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 :)

This commit is contained in:
Quitta 2013-07-23 03:16:19 +02:00
parent d8458b2ddd
commit 79a6c99b09
4 changed files with 63 additions and 7 deletions

View file

@ -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]

View file

@ -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]

View file

@ -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){

View file

@ -33,6 +33,11 @@
</span>
</td>
</tr>
<tr>
<td><strong>Assigned To: </strong>{if $ticket_assignedTo neq ""} <a href="index.php?page=show_user&id={$ticket_assignedTo}">{$ticket_assignedToText} {else}<i> {$not_assigned}</i> {/if}</td>
<td></td>
<td></td>
</tr>
</table>
@ -139,11 +144,49 @@
<div class="row-fluid">
{if isset($isMod) and $isMod eq "TRUE"}
<form id="forward" class="form-vertical" method="post" action="">
<legend>Forward to Group</legend>
<legend style="margin-bottom:9px;">Ticket Assigning</legend>
{if $ticket_assignedTo eq 0}
<form id="assign_ticket" class="form-vertical" method="post" action="" style="margin:0px 0px 0px;">
<input type="hidden" name="ticket_id" value="{$ticket_tId}">
<input type="hidden" name="action" value="assignTicket">
<button type="submit" class="btn btn-primary" style="margin-bottom:9px;><i class="icon-flag icon-white"></i> Assign Ticket</button>
</form>
{else if $ticket_assignedTo eq $user_id}
<form id="assign_ticket" class="form-vertical" method="post" action="" style="margin:0px 0px 0px;">
<input type="hidden" name="ticket_id" value="{$ticket_tId}">
<input type="hidden" name="action" value="unAssignTicket">
<button type="submit" class="btn btn-warning" style="margin-bottom:9px;><i class="icon-remove icon-white"></i> Remove Assign</button>
</form>
{/if}
{if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_ASSIGNED"}
<div class="alert alert-success">
{$success_assigned}
</div>
{else if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_UNASSIGNED"}
<div class="alert alert-success">
{$success_unassigned}
</div>
{else if isset($ACTION_RESULT) and $ACTION_RESULT eq "TICKET_NOT_EXISTING"}
<div class="alert alert-error">
{$ticket_not_existing}
</div>
{else if isset($ACTION_RESULT) and $ACTION_RESULT eq "ALREADY_ASSIGNED"}
<div class="alert alert-error">
{$ticket_already_assigned}
</div>
{else if isset($ACTION_RESULT) and $ACTION_RESULT eq "NOT_ASSIGNED"}
<div class="alert alert-error">
{$ticket_not_assigned}
</div>
{/if}
<legend style="margin-bottom:9px;">Forward to Group</legend>
<form id="forward" class="form-vertical" method="post" action="" style="margin-bottom:9px;" >
<div class="control-group">
<div class="controls">
<div class="controls" >
<select name="group">
<option></option>
{foreach from=$sGroups key=k item=v}
@ -174,7 +217,7 @@
</div>
{/if}
{/if}
<legend>Actions</legend>
<legend style="margin-bottom:9px;">Other actions</legend>
<div class="btn-group">
<button class="btn btn-primary btn-large dropdown-toggle" data-toggle="dropdown">Actions<span class="caret"></span></button>
<ul class="dropdown-menu">