From 10cc131bad6c9d9e59157e79a7a0b3cc8b29ea7f Mon Sep 17 00:00:00 2001 From: Quitta Date: Tue, 23 Jul 2013 03:16:19 +0200 Subject: [PATCH] Added another row of info to the show_ticket where the user to whom the ticket is assigned to and also cleaned up the right side, so user can also assign & unassign while browsing a ticket :) --- .../ryzom_ams/ams_lib/translations/en.ini | 1 + .../ryzom_ams/ams_lib/translations/fr.ini | 1 + .../ryzom_ams/www/html/inc/show_ticket.php | 15 +++++- .../www/html/templates/show_ticket.tpl | 53 +++++++++++++++++-- 4 files changed, 63 insertions(+), 7 deletions(-) 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 f8f32b5e2..ddda98203 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 @@ -30,6 +30,7 @@ invalid_sgroup = "Invalid support group!" ticket_not_existing = "That's an invalid ticket" success_forwarded = "The ticket was forwarded successfully!" public_sgroup = "Public" +not_assigned = "None" [show_user] 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 87d47245a..b8f145abe 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 @@ -30,6 +30,7 @@ invalid_sgroup = "Invalide support group!" ticket_not_existing = "c'est un billet invalide" success_forwarded = "ce billet est renvoyee bien!" public_sgroup = "Publique" +not_assigned = "Ne rien" [show_user] diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php index 03a7036e7..dee370655 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php @@ -4,6 +4,7 @@ function show_ticket(){ //if logged in if(WebUsers::isLoggedIn() && isset($_GET['id'])){ + $result['user_id'] = $_SESSION['ticket_user']->getTUserId(); $result['ticket_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT); $target_ticket = new Ticket(); $target_ticket->load_With_TId($result['ticket_id']); @@ -14,13 +15,21 @@ function show_ticket(){ case "forward": $ticket_id = filter_var($_POST['ticket_id'], FILTER_SANITIZE_NUMBER_INT); $group_id = filter_var($_POST['group'], FILTER_SANITIZE_NUMBER_INT); - $result['ACTION_RESULT'] = Ticket::forwardTicket($_SESSION['ticket_user']->getTUserId(), $ticket_id, $group_id); + $result['ACTION_RESULT'] = Ticket::forwardTicket($result['user_id'], $ticket_id, $group_id); break; + case "assignTicket": + $ticket_id = filter_var($_POST['ticket_id'], FILTER_SANITIZE_NUMBER_INT); + $result['ACTION_RESULT'] = Ticket::assignTicket($result['user_id'] , $ticket_id); + break; + case "unAssignTicket": + $ticket_id = filter_var($_POST['ticket_id'], FILTER_SANITIZE_NUMBER_INT); + $result['ACTION_RESULT'] = Ticket::unAssignTicket($result['user_id'], $ticket_id); + break; + } } } - if(($target_ticket->getAuthor() == $_SESSION['ticket_user']->getTUserId()) || Ticket_User::isMod($_SESSION['ticket_user'] )){ $show_as_admin = false; @@ -41,6 +50,8 @@ function show_ticket(){ $result['ticket_statustext'] = $entire_ticket['ticket_obj']->getStatusText(); $result['ticket_lastupdate'] = Gui_Elements::time_elapsed_string(Ticket::getLatestReply($result['ticket_id'])->getTimestamp()); $result['ticket_category'] = $entire_ticket['ticket_obj']->getCategoryName(); + $result['ticket_assignedToText'] = WebUsers::getUsername(Assigned::getUserAssignedToTicket($result['ticket_tId'])); + $result['ticket_assignedTo'] = Assigned::getUserAssignedToTicket($result['ticket_tId']); $result['ticket_replies'] = Gui_Elements::make_table($entire_ticket['reply_array'], Array("getTReplyId","getContent()->getContent","getTimestamp","getAuthor()->getExternId","getAuthor()->getPermission","getHidden"), Array("tReplyId","replyContent","timestamp","authorExtern","permission","hidden")); $i = 0; foreach( $result['ticket_replies'] as $reply){ diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl index b1cdc78ad..b09f6fd4d 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl @@ -32,7 +32,12 @@ {/if} - + + + Assigned To: {if $ticket_assignedTo neq ""} {$ticket_assignedToText} {else} {$not_assigned} {/if} + + + @@ -139,11 +144,49 @@
{if isset($isMod) and $isMod eq "TRUE"} -
- Forward to Group + + Ticket Assigning + {if $ticket_assignedTo eq 0} + + + + +
+ {else if $ticket_assignedTo eq $user_id} +
+ + + +
+ {/if} + + {if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_ASSIGNED"} +
+ {$success_assigned} +
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_UNASSIGNED"} +
+ {$success_unassigned} +
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "TICKET_NOT_EXISTING"} +
+ {$ticket_not_existing} +
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "ALREADY_ASSIGNED"} +
+ {$ticket_already_assigned} +
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "NOT_ASSIGNED"} +
+ {$ticket_not_assigned} +
+ {/if} + + Forward to Group +
-
+