fixed error in time elapsed function and removed the queue structure, one queue class would suffice I guess

--HG--
branch : quitta-gsoc-2013
hg/feature/sse2
Quitta 11 years ago
parent f922b14e30
commit 9d90043a76

@ -45,8 +45,7 @@ class Gui_Elements{
} }
public static function time_elapsed_string($ptime){ public static function time_elapsed_string($ptime){
$ptime = DateTime::createFromFormat('m-d-Y H:i:s', $ptime)->getTimestamp();
$ptime = strtotime($ptime);
$etime = time() - $ptime; $etime = time() - $ptime;

@ -3,6 +3,13 @@ class Ticket_Queue{
protected $queueElements; protected $queueElements;
public function loadAllNotAssignedTickets(){
$dbl = new DBLayer("lib");
$statement = $dbl->executeWithoutParams("SELECT ticket . * FROM ticket LEFT JOIN assigned ON ticket.TId = assigned.Ticket WHERE assigned.Ticket IS NULL");
$rows = $statement->fetchAll();
$this->setQueue($rows);
}
public function loadAllOpenTickets(){ public function loadAllOpenTickets(){
$dbl = new DBLayer("lib"); $dbl = new DBLayer("lib");
$statement = $dbl->executeWithoutParams("SELECT * FROM ticket INNER JOIN ticket_user ON ticket.Author = ticket_user.TUserId and ticket.Status!=3"); $statement = $dbl->executeWithoutParams("SELECT * FROM ticket INNER JOIN ticket_user ON ticket.Author = ticket_user.TUserId and ticket.Status!=3");

@ -1,11 +0,0 @@
<?php
class Ticket_Queue_csr extends Ticket_Queue{
public function loadAllNewCsrTickets(){
$dbl = new DBLayer("lib");
$statement = $dbl->executeWithoutParams("SELECT ticket . * FROM ticket LEFT JOIN assigned ON ticket.TId = assigned.Ticket WHERE assigned.Ticket IS NULL");
$rows = $statement->fetchAll();
$this->setQueue($rows);
}
}

@ -2,16 +2,10 @@
class Ticket_Queue_Handler{ class Ticket_Queue_Handler{
public static function getTickets($input,$permission){ public static function getTickets($input){
switch($permission){
case 2: $queue = new Ticket_Queue();
$queue = new Ticket_Queue_Csr();
break;
case 3:
// $queue = new Ticket_Queue_Dev();
break;
}
switch ($input){ switch ($input){
case "all_open": case "all_open":
@ -20,6 +14,9 @@ class Ticket_Queue_Handler{
case "archive": case "archive":
$queue->loadAllClosedTickets(); $queue->loadAllClosedTickets();
break; break;
case "not_assigned":
$queue->loadAllNotAssignedTickets();
break;
default: default:
return "ERROR"; return "ERROR";
} }

@ -7,7 +7,7 @@ function show_queue(){
if( Ticket_User::isMod($_SESSION['ticket_user'])){ if( Ticket_User::isMod($_SESSION['ticket_user'])){
$result['queue_action'] = filter_var($_GET['get'], FILTER_SANITIZE_STRING); $result['queue_action'] = filter_var($_GET['get'], FILTER_SANITIZE_STRING);
$queueArray = Ticket_Queue_Handler::getTickets($result['queue_action'],2); $queueArray = Ticket_Queue_Handler::getTickets($result['queue_action']);
if ($queueArray != "ERROR"){ if ($queueArray != "ERROR"){
$result['tickets'] = Gui_Elements::make_table($queueArray, Array("getTId","getTitle","getTimestamp","getAuthor()->getExternId","getTicket_Category()->getName","getStatus","getStatusText"), Array("tId","title","timestamp","authorExtern","category","status","statusText")); $result['tickets'] = Gui_Elements::make_table($queueArray, Array("getTId","getTitle","getTimestamp","getAuthor()->getExternId","getTicket_Category()->getName","getStatus","getStatusText"), Array("tId","title","timestamp","authorExtern","category","status","statusText"));

@ -55,6 +55,7 @@
<li class="divider"></li> <li class="divider"></li>
<li><a href="index.php?page=show_queue&get=all_open">All open tickets</a></li> <li><a href="index.php?page=show_queue&get=all_open">All open tickets</a></li>
<li><a href="index.php?page=show_queue&get=archive">Ticket Archive</a></li> <li><a href="index.php?page=show_queue&get=archive">Ticket Archive</a></li>
<li><a href="index.php?page=show_queue&get=not_assigned">Not Assigned Tickets</a></li>
<li class="divider"></li> <li class="divider"></li>
</ul> </ul>
</div> </div>

Loading…
Cancel
Save