updated logging, when ticket is assigned/unassigned or forwarded, then it will be logged!

This commit is contained in:
Quitta 2013-07-22 20:33:34 +02:00
parent f37483c357
commit d34f9378c5
6 changed files with 23 additions and 6 deletions

View file

@ -147,7 +147,9 @@ class Ticket{
//returns SUCCESS_ASSIGNED, TICKET_NOT_EXISTING or ALREADY_ASSIGNED //returns SUCCESS_ASSIGNED, TICKET_NOT_EXISTING or ALREADY_ASSIGNED
public static function assignTicket($user_id, $ticket_id){ public static function assignTicket($user_id, $ticket_id){
if(self::ticketExists($ticket_id)){ if(self::ticketExists($ticket_id)){
return Assigned::assignTicket($user_id, $ticket_id); $returnvalue = Assigned::assignTicket($user_id, $ticket_id);
Ticket_Log::createLogEntry( $ticket_id, $user_id, 7);
return $returnvalue;
}else{ }else{
return "TICKET_NOT_EXISTING"; return "TICKET_NOT_EXISTING";
} }
@ -156,7 +158,9 @@ class Ticket{
//returns SUCCESS_UNASSIGNED, TICKET_NOT_EXISTING or NOT_ASSIGNED //returns SUCCESS_UNASSIGNED, TICKET_NOT_EXISTING or NOT_ASSIGNED
public static function unAssignTicket($user_id, $ticket_id){ public static function unAssignTicket($user_id, $ticket_id){
if(self::ticketExists($ticket_id)){ if(self::ticketExists($ticket_id)){
return Assigned::unAssignTicket($user_id, $ticket_id); $returnvalue = Assigned::unAssignTicket($user_id, $ticket_id);
Ticket_Log::createLogEntry( $ticket_id, $user_id, 9);
return $returnvalue;
}else{ }else{
return "TICKET_NOT_EXISTING"; return "TICKET_NOT_EXISTING";
} }
@ -165,7 +169,9 @@ class Ticket{
public static function forwardTicket($user_id, $ticket_id, $group_id){ public static function forwardTicket($user_id, $ticket_id, $group_id){
if(self::ticketExists($ticket_id)){ if(self::ticketExists($ticket_id)){
if(isset($group_id) && $group_id != ""){ if(isset($group_id) && $group_id != ""){
return Forwarded::forwardTicket($group_id, $ticket_id); $returnvalue = Forwarded::forwardTicket($group_id, $ticket_id);
Ticket_Log::createLogEntry( $ticket_id, $user_id, 8, $group_id);
return $returnvalue;
}else{ }else{
return "INVALID_SGROUP"; return "INVALID_SGROUP";
} }

View file

@ -16,6 +16,9 @@ class Ticket_Log{
* 4: Added Reply ID: arg to ticket * 4: Added Reply ID: arg to ticket
* 5: Changed status to arg * 5: Changed status to arg
* 6: Changed Priority to arg * 6: Changed Priority to arg
* 7: assigned to the ticket
* 8: Forwarded ticket to support group arg
* 9: unassigned to the ticket
* *
****************************************/ ****************************************/

View file

@ -68,6 +68,9 @@ group_size_error = "The name has to be between 4-20 chars and the tag between 2-
4 = "added reply" 4 = "added reply"
5 = "changed the status to" 5 = "changed the status to"
6 = "changed the priority to" 6 = "changed the priority to"
7 = "assigned to the ticket"
8 = "forwarded the ticket to the support group: "
9 = "unassigned from the ticket"
[error] [error]
title404 = "Not<br/>Found!" title404 = "Not<br/>Found!"

View file

@ -68,6 +68,9 @@ group_size_error = "le nom doit etre 4-20 chars et le tag 2-4!"
4 = "a ajoute le reponse" 4 = "a ajoute le reponse"
5 = "change le status a" 5 = "change le status a"
6 = "change le priorite a" 6 = "change le priorite a"
7 = "assigne ce billet a ce meme"
8 = "a eenvoyee ce ticket a la groupe de support:"
[error] [error]
title404 = "Pas<br/>trouvez!" title404 = "Pas<br/>trouvez!"

View file

@ -28,6 +28,8 @@ function show_ticket_log(){
}else if($log['action'] == 6){ }else if($log['action'] == 6){
$priorityArray = Ticket::getPriorityArray(); $priorityArray = Ticket::getPriorityArray();
$query_backpart = $priorityArray[$log['argument'] ]; $query_backpart = $priorityArray[$log['argument'] ];
}else if($log['action'] == 8){
$query_backpart = "<a href='index.php?page=show_sgroupy&id=" . $log['argument'] . "'>" . Support_Group::getGroup($log['argument'])->getName() . "</a>";
} }
$result['ticket_logs'][$i]['query'] = $author . " " . $log_action_array[$log['action']] . " " . $query_backpart; $result['ticket_logs'][$i]['query'] = $author . " " . $log_action_array[$log['action']] . " " . $query_backpart;
$result['ticket_logs'][$i]['timestamp_elapsed'] = Gui_Elements::time_elapsed_string($log['timestamp']); $result['ticket_logs'][$i]['timestamp_elapsed'] = Gui_Elements::time_elapsed_string($log['timestamp']);

View file

@ -57,13 +57,13 @@
<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"> <td class="center">
<span class="label label-info">
{if $ticket.forwardedGroupName eq "0"} {if $ticket.forwardedGroupName eq "0"}
<i>{$public_sgroup}</i> <i>{$public_sgroup}</i>
{else} {else}
<a href="index.php?page=show_sgroup&id={$ticket.forwardedGroupId}"><font color="white">{$ticket.forwardedGroupName}</font></a> <span class="label label-info"><a href="index.php?page=show_sgroup&id={$ticket.forwardedGroupId}"><font color="white">{$ticket.forwardedGroupName}</font></a></span>
{/if} {/if}
</span>
</td> </td>
<td> <td>
{if $ticket.assigned eq 0} {if $ticket.assigned eq 0}