small layout update, before trying to refactor the DBLayer, I want to make sure that I can revert to this point :D

This commit is contained in:
Quitta 2013-07-10 10:10:02 +02:00
parent 4ab2c46091
commit 0da0cf9da8
2 changed files with 21 additions and 15 deletions

View file

@ -2,28 +2,27 @@
function show_ticket(){ function show_ticket(){
//if logged in //if logged in
if(WebUsers::isLoggedIn()){ if(WebUsers::isLoggedIn() && isset($_GET['id'])){
//if( !isset($_GET['id']) || WebUsers::isAdmin() || $_GET['id'] == $_SESSION['id'] ){ global $cfg;
$result['ticket_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
$target_ticket = new Ticket($cfg['db']['lib']);
$target_ticket->load_With_TId($result['ticket_id']);
if(isset($_GET['id'])){ if(($target_ticket->getAuthor() == $_SESSION['ticket_user']->getTUserId()) || WebUsers::isAdmin() ){
$result['target_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
}else{ $entire_ticket = Ticket::getEntireTicket( $result['ticket_id'], $cfg['db']['lib']);
$result['target_id'] = $_SESSION['id']; $result['ticket_tId'] = $entire_ticket['ticket_obj']->getTId();
}
global $cfg;
$entire_ticket = Ticket::getEntireTicket( $result['target_id'], $cfg['db']['lib']);
$result['ticket_title'] = $entire_ticket['ticket_obj']->getTitle(); $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'] = 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; return $result;
/*}else{ }else{
//ERROR: No access! //ERROR: No access!
$_SESSION['error_code'] = "403"; $_SESSION['error_code'] = "403";
header("Location: index.php?page=error"); header("Location: index.php?page=error");
exit; exit;
}*/ }
}else{ }else{
//ERROR: not logged in! //ERROR: not logged in!
header("Location: index.php"); header("Location: index.php");

View file

@ -2,7 +2,7 @@
<div class="row-fluid sortable ui-sortable"> <div class="row-fluid sortable ui-sortable">
<div class="box span12"> <div class="box span12">
<div class="box-header well" data-original-title=""> <div class="box-header well" data-original-title="">
<h2><i class="icon-user"></i>Ticket</h2> <h2><i class="icon-user"></i>Ticket [ID#{$ticket_tId}] </h2>
<div class="box-icon"> <div class="box-icon">
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a> <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> <a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
@ -16,7 +16,7 @@
{foreach from=$ticket_replies item=reply} {foreach from=$ticket_replies item=reply}
<tr> <tr>
<td> <td>
<p><span class="label label-info">[ID{$reply.tReplyId}] {$reply.timestamp}</span> <span class="label label-warning"><strong>{$username}</span></strong></p> <p><span class="label label-info">[ID#{$reply.tReplyId}] {$reply.timestamp}</span> <span class="label label-warning"><strong>{$username}</span></strong></p>
<p><pre>{$reply.replyContent}</pre></p> <p><pre>{$reply.replyContent}</pre></p>
</td> </td>
</tr> </tr>
@ -28,10 +28,17 @@
<label class="control-label">Description</label> <label class="control-label">Description</label>
<div class="controls"> <div class="controls">
<div class="input-prepend"> <div class="input-prepend">
<textarea rows="8" class="span12" id="Content" name="Content"></textarea> <textarea rows="6" class="span12" id="Content" name="Content"></textarea>
</div> </div>
</div> </div>
</div> </div>
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<button type="submit" class="btn btn-primary" >Send Reply</button>
</div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>