forgot to add the files <,<
This commit is contained in:
parent
5ab7000c5f
commit
8dc95d2604
2 changed files with 76 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
function show_ticket(){
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn()){
|
||||
|
||||
//if( !isset($_GET['id']) || WebUsers::isAdmin() || $_GET['id'] == $_SESSION['id'] ){
|
||||
|
||||
if(isset($_GET['id'])){
|
||||
$result['target_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
|
||||
}else{
|
||||
$result['target_id'] = $_SESSION['id'];
|
||||
}
|
||||
global $cfg;
|
||||
$entire_ticket = Ticket::getEntireTicket( $result['target_id'], $cfg['db']['lib']);
|
||||
$result['ticket_title'] = $entire_ticket['ticket_obj']->getTitle();
|
||||
$result['ticket_replies'] = Gui_Elements::make_table($entire_ticket['reply_array'], Array("getTReplyId","getContent()->getContent","getTimestamp"), Array("tReplyId","replyContent","timestamp"));
|
||||
//$result['ticket_replies'][0]['replyContent'] = nl2br($result['ticket_replies'][0]['replyContent']);
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
{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-user"></i>Ticket</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>Title: {$ticket_title} </legend>
|
||||
<table class="table table-striped" >
|
||||
<tbody>
|
||||
{foreach from=$ticket_replies item=reply}
|
||||
<tr>
|
||||
<td>
|
||||
<p><span class="label label-info">[ID{$reply.tReplyId}] {$reply.timestamp}</span></p>
|
||||
<p><strong>{$username}</strong>{$reply.replyContent}</p>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td>
|
||||
<legend>Reply on the ticket:</legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Description</label>
|
||||
<div class="controls">
|
||||
<div class="input-prepend">
|
||||
<textarea rows="8" class="span12" id="Content" name="Content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
{/block}
|
||||
|
Loading…
Reference in a new issue