Page 1 of 1
changing category - no mail (2nd try)
Posted: Fri Sep 24, 2010 12:15 pm
by stevencools
Script URL: (located on internal server)
Version of script: 2.2
Hosting company: (local server)
URL of phpinfo.php: (\wwwroot\hesk\extra)
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
i posted this questions a while ago, but got stuck there...
viewtopic.php?f=13&t=3214
now i did a complete fresh install (of easyphp and hesk) but am faced with the same issue.
so i took your debug tip again and this time it gives me
Array ( [0] =>
hesk-admin@ilvo.vlaanderen.be )
(logged in as user_C, and changed a ticket from category A to B)
as far as i see, this array should also have at least one more user (user_B) no?
could you take another look at this?
thanx!
regards,
S.
Re: changing category - no mail (2nd try)
Posted: Sat Sep 25, 2010 9:47 am
by Klemen
Could you make one more test please? Try replacing this code in the admin/move_category.php
Code: Select all
while ($myuser=hesk_dbFetchAssoc($result))
{
/* Is this an administrator? */
if ($myuser['isadmin']) {$admins[]=$myuser['email']; continue;}
/* Not admin, is he allowed this category? */
$cat=substr($myuser['categories'], 0, -1);
$myuser['categories']=explode(',',$cat);
if (in_array($category,$myuser['categories']))
{
$admins[]=$myuser['email']; continue;
}
}
with
Code: Select all
while ($myuser=hesk_dbFetchAssoc($result))
{
print_r($myuser);
echo "<br />\n";
}
exit();
Post the results here (you can of course modify the e-mail addresses) so I can further debug this.
Re: changing category - no mail (2nd try)
Posted: Mon Sep 27, 2010 7:41 am
by stevencools
Array ( [email] => user_A [isadmin] => 0 [categories] => 1,3 )
Array ( [email] => user_B [isadmin] => 0 [categories] => 1,2 )
Array ( [email] => user_C [isadmin] => 0 [categories] => 1,3,2 )
Re: changing category - no mail (2nd try)
Posted: Mon Sep 27, 2010 10:29 am
by Klemen
Based on this setup it should work like this (none of the users is an administrator):
1. you are logged in as user C
2. if you change category from Default (ID 1) to category with ID 2 only user B will receive e-mail
3. if you change category from Default (ID 1) to category with ID 3 only user A will receive e-mail
4. if you change from category ID 2 or 3 to category ID 1 (Default category) both A and B will receive e-mail
Re: changing category - no mail (2nd try)
Posted: Mon Sep 27, 2010 10:50 am
by stevencools
i understand that it should work like this, and i was hoping that it would, but as i said, it doesn't!
only my admin user gets a notification of the category-move, but neither user_A,_B nor _C get a notification.
something else i can check or have to change then?
Re: changing category - no mail (2nd try)
Posted: Mon Sep 27, 2010 2:37 pm
by Klemen
Sorry, I can be a real fool sometimes. This should fix it for you, remove this code from the original file:
Code: Select all
$cat=substr($myuser['categories'], 0, -1);
and change it with
I assume it works then?
Re: changing category - no mail (2nd try)
Posted: Tue Sep 28, 2010 7:18 am
by stevencools
yes yes yes!
it works now!
thanks for the help... and don't worry about being a fool, we all are sometimes
i just wonder now why this is not in your default code? maybe something to include in the next version? or is there a reason why you only had admin users get a move_category notification?
cheers!
S.
Re: changing category - no mail (2nd try)
Posted: Tue Sep 28, 2010 1:42 pm
by Klemen
It will be, it's a bug in 2.2 (the 2.1 code doesn't work properly in all cases in 2.2).