changing category - no mail (2nd try)

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
stevencools
Posts: 9
Joined: Mon Jul 05, 2010 2:10 pm

changing category - no mail (2nd try)

Post 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.
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Re: changing category - no mail (2nd try)

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
stevencools
Posts: 9
Joined: Mon Jul 05, 2010 2:10 pm

Re: changing category - no mail (2nd try)

Post 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 )
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Re: changing category - no mail (2nd try)

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
stevencools
Posts: 9
Joined: Mon Jul 05, 2010 2:10 pm

Re: changing category - no mail (2nd try)

Post 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?
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Re: changing category - no mail (2nd try)

Post 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

Code: Select all

$cat=$myuser['categories'];
I assume it works then?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
stevencools
Posts: 9
Joined: Mon Jul 05, 2010 2:10 pm

Re: changing category - no mail (2nd try)

Post 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.
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Re: changing category - no mail (2nd try)

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply