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.

--HG--
branch : quitta-gsoc-2013
This commit is contained in:
Quitta 2013-07-19 16:30:58 +02:00
parent 19e26b93a9
commit f922b14e30
6 changed files with 38 additions and 7 deletions

View file

@ -105,7 +105,11 @@ class Helpers{
} }
return parse_ini_file( $AMS_TRANS . '/' . $language . '.ini', true ); 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));
} }
} }

View file

@ -192,7 +192,7 @@ class Ticket{
} }
public function getTimestamp(){ public function getTimestamp(){
return $this->timestamp; return Helpers::outputTime($this->timestamp);
} }
public function getTitle(){ public function getTitle(){

View file

@ -117,7 +117,7 @@ class Ticket_Log{
} }
public function getTimestamp(){ public function getTimestamp(){
return $this->timestamp; return Helpers::outputTime($this->timestamp);
} }
public function getQuery(){ public function getQuery(){

View file

@ -125,7 +125,7 @@ class Ticket_Reply{
} }
public function getTimestamp(){ public function getTimestamp(){
return $this->timestamp; return Helpers::outputTime($this->timestamp);
} }

View file

@ -12,6 +12,9 @@ function userlist(){
$pageResult['userlist'][$i]['email'] = $row['Email']; $pageResult['userlist'][$i]['email'] = $row['Email'];
$i++; $i++;
} }
if (Ticket_User::isAdmin($_SESSION['ticket_user'])){
$pageResult['isAdmin'] = "TRUE";
}
return $pageResult; return $pageResult;
}else{ }else{
//ERROR: No access! //ERROR: No access!

View file

@ -30,8 +30,32 @@
{if $element.permission eq 2}<td class="center"><span class="label label-warning">Moderator</span></td>{/if} {if $element.permission eq 2}<td class="center"><span class="label label-warning">Moderator</span></td>{/if}
{if $element.permission eq 3}<td class="center"><span class="label label-important">Admin</span></td>{/if} {if $element.permission eq 3}<td class="center"><span class="label label-important">Admin</span></td>{/if}
<td class="center"> <td class="center">
<a class="btn btn-primary" href="index.php?page=show_user&id={$element.id}"><i class=" icon-pencil icon-white"></i>Show User</a> <div class="btn-group" style="display: inline-block;">
<a class="btn btn-info" href="index.php?page=settings&id={$element.id}"><i class=" icon-pencil icon-white"></i>Edit User</a> <a class="btn btn-primary" href="index.php?page=show_user&id={$element.id}"><i class=" icon-eye-open icon-white"></i> Show User</a>
</div>
<div class="btn-group" style="display: inline-block;">
<a class="btn btn-info" href="index.php?page=settings&id={$element.id}"><i class=" icon-pencil icon-white"></i> Edit User</a>
</div>
{if isset($isAdmin) and $isAdmin eq 'TRUE' and $element.id neq 1}
<div class="btn-group" style="display: inline-block;">
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown"><i class=" icon-star icon-white"></i> Change Role<span class="caret"></span></button>
<ul class="dropdown-menu">
<li class="divider"></li>
{if $element.permission eq 1}
<li><a href="index.php?page=change_permission&user_id={$element.id}&value=2">Make Moderator</a></li>
<li><a href="index.php?page=change_permission&user_id={$element.id}&value=3">Make Admin</a></li>
{else if $element.permission eq 2 }
<li><a href="index.php?page=change_permission&user_id={$element.id}&value=1">Demote to User</a></li>
<li><a href="index.php?page=change_permission&user_id={$element.id}&value=3">Make Admin</a></li>
{else if $element.permission eq 3 }
<li><a href="index.php?page=change_permission&user_id={$element.id}&value=1">Demote to User</a></li>
<li><a href="index.php?page=change_permission&user_id={$element.id}&value=2">Demote to Moderator</a></li>
{/if}
<li class="divider"></li>
</ul>
</div>
{/if}
</td> </td>
</tr> </tr>