started working on the show_ticket_log and encapsulated the createReply of ticket_reply into a ticket class function
This commit is contained in:
parent
5dc0266e15
commit
2a85eb6367
6 changed files with 71 additions and 5 deletions
|
@ -106,7 +106,7 @@ class Ticket{
|
|||
|
||||
}
|
||||
|
||||
//return constructed element based on TCategoryId
|
||||
//return the latest reply.
|
||||
public static function getLatestReply( $ticket_id) {
|
||||
$dbl = new DBLayer("lib");
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_reply WHERE Ticket =:id ORDER BY TReplyId DESC LIMIT 1 ", array('id' => $ticket_id));
|
||||
|
@ -115,6 +115,21 @@ class Ticket{
|
|||
return $reply;
|
||||
}
|
||||
|
||||
public static function createReply($content, $author, $ticket_id){
|
||||
if($content != ""){
|
||||
$ticket = new Ticket();
|
||||
$ticket->load_With_TId($ticket_id);
|
||||
//if status is not closed
|
||||
if($ticket->getStatus() != 3){
|
||||
Ticket_Reply::createReply($content, $author, $ticket_id);
|
||||
}else{
|
||||
//TODO: Show error message that ticket is closed
|
||||
}
|
||||
}else{
|
||||
//TODO: Show error content is empty
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
public function __construct() {
|
||||
|
|
|
@ -31,6 +31,8 @@ t_send = "Send reply"
|
|||
|
||||
[createticket]
|
||||
|
||||
[show_ticket_log]
|
||||
|
||||
[error]
|
||||
title404 = "Not<br/>Found!"
|
||||
title403 = "Forbidden!"
|
||||
|
|
|
@ -31,6 +31,7 @@ t_send = "Envoyer la reponse"
|
|||
|
||||
[createticket]
|
||||
|
||||
[show_ticket_log]
|
||||
|
||||
[error]
|
||||
title404 = "Pas<br/>trouvez!"
|
||||
|
|
|
@ -13,10 +13,9 @@ function reply_on_ticket(){
|
|||
|
||||
try{
|
||||
$author = $_SESSION['ticket_user']->getTUserId();
|
||||
if(isset($_POST['ChangeStatus']) && $_POST['Content'] != ""){
|
||||
$content = filter_var($_POST['Content'], FILTER_SANITIZE_STRING);
|
||||
Ticket_Reply::createReply($content, $author, $ticket_id);
|
||||
}
|
||||
Ticket::createReply($content, $author, $ticket_id);
|
||||
|
||||
if(isset($_POST['ChangeStatus']) && isset($_POST['ChangePriority']) && WebUsers::isAdmin()){
|
||||
$newStatus = filter_var($_POST['ChangeStatus'], FILTER_SANITIZE_NUMBER_INT);
|
||||
$newPriority = filter_var($_POST['ChangePriority'], FILTER_SANITIZE_NUMBER_INT);
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
function show_ticket_log(){
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
{block name=content}
|
||||
<div class="row-fluid sortable ui-sortable">
|
||||
<div class="box span12">
|
||||
<div class="box-header well" data-original-title="">
|
||||
<h2><i class="icon-tag"></i> Tickets of {$target_name}</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<div class="row-fluid">
|
||||
<legend>Tickets</legend>
|
||||
<table class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Category</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$ticketlist item=ticket}
|
||||
<tr>
|
||||
<td>{$ticket.tId}</td>
|
||||
<td><a href ="index.php?page=show_ticket&id={$ticket.tId}">{$ticket.title}</a></td>
|
||||
<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>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
{/block}
|
||||
|
Loading…
Reference in a new issue