From 353865191d4508cd07946449f80a19d156df2fa7 Mon Sep 17 00:00:00 2001 From: Quitta Date: Mon, 22 Jul 2013 18:22:21 +0200 Subject: [PATCH] showing in the queue to what support_group the ticket is sent to, also made the query bigger and changed the todo query as primary! --- .../ryzom_ams/ams_lib/autoload/ticket_queue.php | 11 ++++++++++- .../server/ryzom_ams/ams_lib/translations/en.ini | 1 + .../server/ryzom_ams/ams_lib/translations/fr.ini | 6 ++++++ .../server/ryzom_ams/www/html/inc/show_queue.php | 2 +- .../ryzom_ams/www/html/templates/layout_admin.tpl | 2 +- .../ryzom_ams/www/html/templates/layout_mod.tpl | 2 +- .../ryzom_ams/www/html/templates/show_queue.tpl | 10 ++++++++++ 7 files changed, 30 insertions(+), 4 deletions(-) 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 @@
  • Settings
  • Users
  • -
  • Queues
  • +
  • Queues
  • Support Groups
  • Syncing
  • diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl index 823b68445..e0a77d99a 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl @@ -6,7 +6,7 @@
  • Settings
  • Users
  • -
  • Queues
  • +
  • Queues
  • Support Groups
  • Logout
  • diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl index 060c4219c..43bd193fb 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl @@ -43,6 +43,7 @@ Timestamp Category Status + SupportGroup Actions @@ -55,6 +56,15 @@ {$ticket.timestamp} {$ticket.category} {if $ticket.status eq 0} {/if} {$ticket.statusText} + + + {if $ticket.forwardedGroupName eq "0"} + {$public_sgroup} + {else} + {$ticket.forwardedGroupName} + {/if} + + {if $ticket.assigned eq 0}