From 16fa7aa7dc3d401e9e311a3d50584f09197ac571 Mon Sep 17 00:00:00 2001 From: Quitta Date: Fri, 19 Jul 2013 16:30:58 +0200 Subject: [PATCH] Outputted time is handled by using the Helpers::outputTime function, this makes changees to the time format easy. Also made it possible for admins to edit roles directly in the userlist. --- .../ryzom_ams/ams_lib/autoload/helpers.php | 8 ++++-- .../ryzom_ams/ams_lib/autoload/ticket.php | 2 +- .../ryzom_ams/ams_lib/autoload/ticket_log.php | 2 +- .../ams_lib/autoload/ticket_reply.php | 2 +- .../ryzom_ams/www/html/inc/userlist.php | 3 ++ .../ryzom_ams/www/html/templates/userlist.tpl | 28 +++++++++++++++++-- 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php index d677cb936..e72a1e216 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php @@ -105,7 +105,11 @@ class Helpers{ } return parse_ini_file( $AMS_TRANS . '/' . $language . '.ini', true ); - - + } + + + //Time output function for handling the time display function. + static public function outputTime($time){ + return date("m-d-Y H:i:s",strtotime($time)); } } diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php index cb25794ae..6e97d93d8 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php @@ -192,7 +192,7 @@ class Ticket{ } public function getTimestamp(){ - return $this->timestamp; + return Helpers::outputTime($this->timestamp); } public function getTitle(){ diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php index 89bd9763c..5e6f4018a 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php @@ -117,7 +117,7 @@ class Ticket_Log{ } public function getTimestamp(){ - return $this->timestamp; + return Helpers::outputTime($this->timestamp); } public function getQuery(){ diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php index 9726531dc..e2af13ba4 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php @@ -125,7 +125,7 @@ class Ticket_Reply{ } public function getTimestamp(){ - return $this->timestamp; + return Helpers::outputTime($this->timestamp); } diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php index 032a61835..de7414bc7 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php @@ -12,6 +12,9 @@ function userlist(){ $pageResult['userlist'][$i]['email'] = $row['Email']; $i++; } + if (Ticket_User::isAdmin($_SESSION['ticket_user'])){ + $pageResult['isAdmin'] = "TRUE"; + } return $pageResult; }else{ //ERROR: No access! diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl index 069f69316..0cc586841 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl @@ -30,8 +30,32 @@ {if $element.permission eq 2}Moderator{/if} {if $element.permission eq 3}Admin{/if} - Show User - Edit User +
+ Show User +
+
+ Edit User +
+ {if isset($isAdmin) and $isAdmin eq 'TRUE' and $element.id neq 1} +
+ + + +
+ {/if}