diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php index 865b230e2..e0bffade7 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php @@ -45,8 +45,7 @@ class Gui_Elements{ } public static function time_elapsed_string($ptime){ - - $ptime = strtotime($ptime); + $ptime = DateTime::createFromFormat('m-d-Y H:i:s', $ptime)->getTimestamp(); $etime = time() - $ptime; diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php index 619833e2d..24882e8b9 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php @@ -3,6 +3,13 @@ class Ticket_Queue{ 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(){ $dbl = new DBLayer("lib"); $statement = $dbl->executeWithoutParams("SELECT * FROM ticket INNER JOIN ticket_user ON ticket.Author = ticket_user.TUserId and ticket.Status!=3"); diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_csr.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_csr.php deleted file mode 100644 index 7d30d77d8..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_csr.php +++ /dev/null @@ -1,11 +0,0 @@ -executeWithoutParams("SELECT ticket . * FROM ticket LEFT JOIN assigned ON ticket.TId = assigned.Ticket WHERE assigned.Ticket IS NULL"); - $rows = $statement->fetchAll(); - $this->setQueue($rows); - } - -} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php index 0b704d1e2..6103d9731 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php @@ -2,16 +2,10 @@ class Ticket_Queue_Handler{ - public static function getTickets($input,$permission){ - switch($permission){ - case 2: - $queue = new Ticket_Queue_Csr(); - break; - - case 3: - // $queue = new Ticket_Queue_Dev(); - break; - } + public static function getTickets($input){ + + $queue = new Ticket_Queue(); + switch ($input){ case "all_open": @@ -20,6 +14,9 @@ class Ticket_Queue_Handler{ case "archive": $queue->loadAllClosedTickets(); break; + case "not_assigned": + $queue->loadAllNotAssignedTickets(); + break; default: return "ERROR"; } diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php index 7b8f041d1..4ab1ca878 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php @@ -7,7 +7,7 @@ function show_queue(){ if( Ticket_User::isMod($_SESSION['ticket_user'])){ $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"){ $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")); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl index ea07383fc..c47d113db 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl @@ -55,6 +55,7 @@