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!

This commit is contained in:
Quitta 2013-07-22 18:22:21 +02:00
parent 95806fa9f4
commit f37483c357
7 changed files with 30 additions and 4 deletions

View file

@ -27,7 +27,16 @@ class Ticket_Queue{
public function loadToDoTickets($user_id){ public function loadToDoTickets($user_id){
$dbl = new DBLayer("lib"); $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); $values = array('user_id' => $user_id);
$statement = $dbl->execute($query,$values); $statement = $dbl->execute($query,$values);
$rows = $statement->fetchAll(); $rows = $statement->fetchAll();

View file

@ -40,6 +40,7 @@ success_unassigned = "The ticket was successfully unassigned!"
ticket_not_existing = "That ticket doesn't exist!" ticket_not_existing = "That ticket doesn't exist!"
ticket_already_assigned = "That ticket is already assigned to someone!" ticket_already_assigned = "That ticket is already assigned to someone!"
ticket_not_assigned = "That ticket isn't assigned to you!" ticket_not_assigned = "That ticket isn't assigned to you!"
public_sgroup = "Public"
[show_sgroup] [show_sgroup]
add_to_group_success = "The user has been added to the group!" add_to_group_success = "The user has been added to the group!"

View file

@ -35,6 +35,12 @@ public_sgroup = "Publique"
[show_queue] [show_queue]
not_assigned = "Libre" 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] [show_sgroup]
add_to_group_success = "ce user est ajoute sur la groupe!" add_to_group_success = "ce user est ajoute sur la groupe!"

View file

@ -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; $i = 0;
foreach( $result['tickets'] as $ticket){ foreach( $result['tickets'] as $ticket){
$result['tickets'][$i]['author'] = WebUsers::getUsername($ticket['authorExtern']); $result['tickets'][$i]['author'] = WebUsers::getUsername($ticket['authorExtern']);

View file

@ -6,7 +6,7 @@
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=settings"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=settings"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li>
<li class="nav-header hidden-tablet">Admin</li> <li class="nav-header hidden-tablet">Admin</li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=userlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Users</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=userlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Users</span></a></li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_queue&get=all_open"><i class="icon-th-list"></i><span class="hidden-tablet"> Queues</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_queue&get=todo"><i class="icon-th-list"></i><span class="hidden-tablet"> Queues</span></a></li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=sgroup_list"><i class="icon-briefcase"></i><span class="hidden-tablet"> Support Groups</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=sgroup_list"><i class="icon-briefcase"></i><span class="hidden-tablet"> Support Groups</span></a></li>
<li class="nav-header hidden-tablet">Actions</li> <li class="nav-header hidden-tablet">Actions</li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=libuserlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Syncing</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=libuserlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Syncing</span></a></li>

View file

@ -6,7 +6,7 @@
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=settings"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=settings"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li>
<li class="nav-header hidden-tablet">Admin</li> <li class="nav-header hidden-tablet">Admin</li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=userlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Users</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=userlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Users</span></a></li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_queue&get=all_open"><i class="icon-th-list"></i><span class="hidden-tablet"> Queues</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_queue&get=todo"><i class="icon-th-list"></i><span class="hidden-tablet"> Queues</span></a></li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=sgroup_list"><i class="icon-briefcase"></i><span class="hidden-tablet"> Support Groups</span></a></li> <li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=sgroup_list"><i class="icon-briefcase"></i><span class="hidden-tablet"> Support Groups</span></a></li>
<li class="nav-header hidden-tablet">Actions</li> <li class="nav-header hidden-tablet">Actions</li>
<li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li> <li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li>

View file

@ -43,6 +43,7 @@
<th>Timestamp</th> <th>Timestamp</th>
<th>Category</th> <th>Category</th>
<th>Status</th> <th>Status</th>
<th>SupportGroup</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@ -55,6 +56,15 @@
<td class="center"><span title="{$ticket.timestamp_elapsed}" data-rel="tooltip" data-placement="right">{$ticket.timestamp}</span></td> <td class="center"><span title="{$ticket.timestamp_elapsed}" data-rel="tooltip" data-placement="right">{$ticket.timestamp}</span></td>
<td class="center">{$ticket.category}</td> <td class="center">{$ticket.category}</td>
<td class="center"><span class="label {if $ticket.status eq 0}label-success{else if $ticket.status eq 1}label-warning{else if $ticket.status eq 2}label-important{/if}">{if $ticket.status eq 0} <i class="icon-exclamation-sign icon-white"></i>{/if} {$ticket.statusText}</span></td> <td class="center"><span class="label {if $ticket.status eq 0}label-success{else if $ticket.status eq 1}label-warning{else if $ticket.status eq 2}label-important{/if}">{if $ticket.status eq 0} <i class="icon-exclamation-sign icon-white"></i>{/if} {$ticket.statusText}</span></td>
<td class="center">
<span class="label label-info">
{if $ticket.forwardedGroupName eq "0"}
<i>{$public_sgroup}</i>
{else}
<a href="index.php?page=show_sgroup&id={$ticket.forwardedGroupId}"><font color="white">{$ticket.forwardedGroupName}</font></a>
{/if}
</span>
</td>
<td> <td>
{if $ticket.assigned eq 0} {if $ticket.assigned eq 0}
<form id="assign_ticket" class="form-vertical" method="post" action="" style="margin:0px 0px 0px;"> <form id="assign_ticket" class="form-vertical" method="post" action="" style="margin:0px 0px 0px;">