show ticket log works + fixed timestamp issue
This commit is contained in:
parent
bfeb583c46
commit
4e36f5575d
7 changed files with 89 additions and 4 deletions
|
@ -49,7 +49,7 @@ $cfg['mail']['host'] = "ryzomcore.com";
|
|||
|
||||
//Defines mailing related stuff
|
||||
$SUPPORT_GROUP_IMAP_CRYPTKEY = "azerty";
|
||||
$TICKET_MAILING_SUPPORT = true;
|
||||
$TICKET_MAILING_SUPPORT = false;
|
||||
|
||||
//You have to create this dir at first!
|
||||
$MAIL_DIR = "/tmp/mail";
|
||||
|
|
|
@ -19,7 +19,7 @@ function create_ticket(){
|
|||
$author= Ticket_User::constr_ExternId($_POST['target_id'])->getTUserId();
|
||||
}
|
||||
$ticket_id = Ticket::create_Ticket($title, $content, $category, $author, unserialize($_SESSION['ticket_user'])->getTUserId(),0, $_POST);
|
||||
header("Location: index.php?page=show_ticket&id=".$ticket_id);
|
||||
header("Location: ams?page=show_ticket&id=".$ticket_id);
|
||||
exit;
|
||||
|
||||
}catch (PDOException $e) {
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
function show_ticket_log(){
|
||||
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn() && isset($_GET['id'])){
|
||||
//only allow admins to browse the log!
|
||||
if(Ticket_User::isMod(unserialize($_SESSION['ticket_user'])) ){
|
||||
$result['ticket_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
|
||||
$target_ticket = new Ticket();
|
||||
$target_ticket->load_With_TId($result['ticket_id']);
|
||||
$result['ticket_title'] = $target_ticket->getTitle();
|
||||
$ticket_logs = Ticket_Log::getLogsOfTicket( $result['ticket_id']);
|
||||
$log_action_array = Ticket_Log::getActionTextArray();
|
||||
$result['ticket_logs'] = Gui_Elements::make_table($ticket_logs, Array("getTLogId","getTimestamp","getAuthor()->getExternId","getAction","getArgument()"), Array("tLogId","timestamp","authorExtern","action","argument"));
|
||||
$i = 0;
|
||||
foreach( $result['ticket_logs'] as $log){
|
||||
$webUser = new WebUsers($log['authorExtern']);
|
||||
$author = $webUser->getUsername();
|
||||
$result['ticket_logs'][$i]['author'] = $author;
|
||||
$query_backpart = "";
|
||||
if($log['action'] == 2){
|
||||
$webUser2 = new WebUsers($log['argument']);
|
||||
$query_backpart = $webUser2->getUsername();
|
||||
}else if($log['action'] == 4){
|
||||
$query_backpart = "<a href='ams?page=show_reply&id=" . $log['argument'] . "'>ID#" . $log['argument'] . "</a>";
|
||||
}else if($log['action'] == 5){
|
||||
$statusArray = Ticket::getStatusArray();
|
||||
$query_backpart = $statusArray[$log['argument'] ];
|
||||
}else if($log['action'] == 6){
|
||||
$priorityArray = Ticket::getPriorityArray();
|
||||
$query_backpart = $priorityArray[$log['argument'] ];
|
||||
}else if($log['action'] == 8){
|
||||
$query_backpart = "<a href='ams?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]['timestamp_elapsed'] = Gui_Elements::time_elapsed_string($log['timestamp']);
|
||||
$i++;
|
||||
}
|
||||
if(Ticket_User::isMod(unserialize($_SESSION['ticket_user']))){
|
||||
$result['isMod'] = "TRUE";
|
||||
}
|
||||
return $result;
|
||||
|
||||
}else{
|
||||
//ERROR: No access!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
//ERROR: not logged in!
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
}
|
|
@ -19,6 +19,9 @@ global $SITEBASE;
|
|||
global $AMS_TRANS;
|
||||
global $DEFAULT_LANGUAGE;
|
||||
global $cfg;
|
||||
global $TICKET_LOGGING;
|
||||
global $TIME_FORMAT;
|
||||
global $TICKET_MAILING_SUPPORT;
|
||||
|
||||
require 'ams_lib/libinclude.php';
|
||||
spl_autoload_register('__autoload');
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<tr>
|
||||
<td width=33%><strong>Original Submitted: </strong>{$ticket_timestamp}</td>
|
||||
<td width=33%><strong>Last Updated: </strong>{$ticket_lastupdate}</td>
|
||||
<td width=33%><strong>Status: </strong>{if $ticket_status neq 3}<font color="green">Open</font>{/if} <font color="{if $ticket_status eq 0}orange{else if $ticket_status eq 1}green{else if $ticket_status eq 3}red{/if}"><strong>{$ticket_statustext}</strong></font></td>
|
||||
<td width=33%><strong>Status: </strong>{if $ticket_status neq 3}<font color="green">Open</font>{/if} <font color="{if $ticket_status eq 0}green{else if $ticket_status eq 1}orange{else if $ticket_status eq 3}red{/if}"><strong>{$ticket_statustext}</strong></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=33%><strong>Category: </strong>{$ticket_category}</td>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
{block name=content}
|
||||
|
||||
<h2><i class="icon-tag"></i> Log of Ticket #{$ticket_id}</h2>
|
||||
<legend>Title: <a href="ams?page=show_ticket&id={$ticket_id}">{$ticket_title}</a></legend>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Query</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$ticket_logs item=log}
|
||||
<tr>
|
||||
<td>{$log.tLogId}</td>
|
||||
<td>{$log.timestamp}</td>
|
||||
<td>{$log.query}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/block}
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<td class="center"><i>{$ticket.timestamp}</i></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"><font color=" {if $ticket.status eq 0}green{else if $ticket.status eq 1}orange{else if $ticket.status eq 3}red{/if}">{$ticket.statusText}</span></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
|
|
Loading…
Reference in a new issue