diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php index 2a0d236cd..b1d467c10 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php @@ -27,7 +27,16 @@ class Ticket_Queue{ public function loadToDoTickets($user_id){ $dbl = new DBLayer("lib"); - $query = "SELECT t . * FROM `ticket` t LEFT JOIN `assigned` a ON t.TId = a.Ticket LEFT JOIN `ticket_user` tu ON tu.TUserId = a.User WHERE (tu.ExternId = :user_id AND t.Status = 1) OR (a.Ticket IS NULL) OR (tu.ExternId != :user_id AND t.Status = 1 AND (SELECT ticket_reply.Timestamp FROM `ticket_reply` WHERE Ticket =t.TId ORDER BY TReplyId DESC LIMIT 1) < NOW() - INTERVAL 1 DAY )"; + //first: find the tickets assigned to the user with status = waiting on support + //second find all not assigned tickets that aren't forwarded yet. + //find all tickets assigned to someone else witht status waiting on support, with timestamp of last reply > 1 day + //find all non-assigned tickets forwarded to the support groups to which that user belongs + $query = "SELECT * FROM `ticket` t LEFT JOIN `assigned` a ON t.TId = a.Ticket LEFT JOIN `ticket_user` tu ON tu.TUserId = a.User LEFT JOIN `forwarded` f ON t.TId = f.Ticket + WHERE (tu.ExternId = :user_id AND t.Status = 1) + OR (a.Ticket IS NULL AND f.Group IS NULL) + OR (tu.ExternId != :user_id AND t.Status = 1 AND (SELECT ticket_reply.Timestamp FROM `ticket_reply` WHERE Ticket =t.TId ORDER BY TReplyId DESC LIMIT 1) < NOW() - INTERVAL 1 DAY ) + OR (a.Ticket IS NULL AND EXISTS (SELECT * FROM `in_support_group` isg JOIN `ticket_user` tu2 ON isg.User = tu2.TUserId WHERE isg.Group = f.Group)) + "; $values = array('user_id' => $user_id); $statement = $dbl->execute($query,$values); $rows = $statement->fetchAll(); diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini index 57cce4170..3d610875a 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini @@ -40,6 +40,7 @@ success_unassigned = "The ticket was successfully unassigned!" ticket_not_existing = "That ticket doesn't exist!" ticket_already_assigned = "That ticket is already assigned to someone!" ticket_not_assigned = "That ticket isn't assigned to you!" +public_sgroup = "Public" [show_sgroup] add_to_group_success = "The user has been added to the group!" diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini index 8cd3b01a3..a7aeb36cf 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini @@ -35,6 +35,12 @@ public_sgroup = "Publique" [show_queue] not_assigned = "Libre" +success_assigned = "Ce billet est succesfull assignee!" +success_unassigned = "Ce billet est succesful unassignee!" +ticket_not_existing = "ce billet n'existe pas!" +ticket_already_assigned = "Ce billet est deja assigne a quelqu'un autre" +ticket_not_assigned = "Ce billet n'est assigne pas" +public_sgroup = "Publique" [show_sgroup] add_to_group_success = "ce user est ajoute sur la groupe!" diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php index 6654dc161..9482214f8 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php @@ -30,7 +30,7 @@ function show_queue(){ } } - $result['tickets'] = Gui_Elements::make_table($queueArray, Array("getTId","getTitle","getTimestamp","getAuthor()->getExternId","getTicket_Category()->getName","getStatus","getStatusText","getAssigned"), Array("tId","title","timestamp","authorExtern","category","status","statusText","assigned")); + $result['tickets'] = Gui_Elements::make_table($queueArray, Array("getTId","getTitle","getTimestamp","getAuthor()->getExternId","getTicket_Category()->getName","getStatus","getStatusText","getAssigned","getForwardedGroupName","getForwardedGroupId"), Array("tId","title","timestamp","authorExtern","category","status","statusText","assigned","forwardedGroupName","forwardedGroupId")); $i = 0; foreach( $result['tickets'] as $ticket){ $result['tickets'][$i]['author'] = WebUsers::getUsername($ticket['authorExtern']); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl index 114f65dc5..bdda0a892 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl @@ -6,7 +6,7 @@