Some refactoring and cleanup in ttRegistrator class.
[timetracker.git] / WEB-INF / templates / users.tpl
1 <script>
2   function chLocation(newLocation) { document.location = newLocation; }
3 </script>
4
5 <table cellspacing="0" cellpadding="7" border="0" width="720">
6   <tr>
7     <td valign="top">
8 {if $user->can('manage_users')}
9       <table cellspacing="1" cellpadding="3" border="0" width="100%">
10   {if $inactive_users}
11         <tr><td class="sectionHeaderNoBorder">{$i18n.form.users.active_users}</td></tr>
12   {/if}
13         <tr>
14           <td width="30%" class="tableHeader">{$i18n.label.person_name}</td>
15           <td width="30%" class="tableHeader">{$i18n.label.login}</td>
16           <td width="20%" class="tableHeader">{$i18n.form.users.role}</td>
17           <td width="10%" class="tableHeader">{$i18n.label.edit}</td>
18           <td width="10%" class="tableHeader">{$i18n.label.delete}</td>
19         </tr>
20   {if $active_users}
21     {foreach $active_users as $u}
22         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
23           <td>
24           {if $user->uncompleted_indicators}
25             <span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
26           {/if}
27             {$u.name|escape}
28           </td>
29           <td>{$u.login|escape}</td>
30           <td>{$u.role_name|escape}</td>
31       {if $u.rank < $user->rank || ($u.rank == $user->rank && $u.id == $user->id)}
32           <td><a href="user_edit.php?id={$u.id}">{$i18n.label.edit}</a></td>
33          {if $u.id != $user->id}<td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>{else}<td></td>{/if}
34       {else}
35           <td></td>
36           <td></td>
37       {/if}
38         </tr>
39     {/foreach}
40   {/if}
41       </table>
42
43       <table width="100%">
44         <tr>
45           <td align="center"><br>
46             <form><input type="button" onclick="chLocation('user_add.php');" value="{$i18n.button.add}"></form>
47           </td>
48         </tr>
49       </table>
50
51   {if $inactive_users}
52       <table cellspacing="1" cellpadding="3" border="0" width="100%">
53         <tr><td class="sectionHeaderNoBorder">{$i18n.form.users.inactive_users}</td></tr>
54         <tr>
55           <td width="30%" class="tableHeader">{$i18n.label.person_name}</td>
56           <td width="30%" class="tableHeader">{$i18n.label.login}</td>
57           <td width="20%" class="tableHeader">{$i18n.form.users.role}</td>
58           <td width="10%" class="tableHeader">{$i18n.label.edit}</td>
59           <td width="10%" class="tableHeader">{$i18n.label.delete}</td>
60         </tr>
61     {foreach $inactive_users as $u}
62         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
63           <td>{$u.name|escape}</td>
64           <td>{$u.login|escape}</td>
65           <td>{$u.role_name|escape}</td>
66       {if $u.rank < $user->rank}
67           <td><a href="user_edit.php?id={$u.id}">{$i18n.label.edit}</a></td>
68           <td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>
69       {else}
70           <td></td>
71           <td></td>
72       {/if}
73         </tr>
74     {/foreach}
75
76       </table>
77
78       <table width="100%">
79         <tr>
80           <td align="center" height="50">
81             <form><input type="button" onclick="chLocation('user_add.php');" value="{$i18n.button.add}"></form>
82           </td>
83         </tr>
84       </table>
85   {/if}
86 {else}
87       <table cellspacing="1" cellpadding="3" border="0" width="100%">
88         <tr>
89           <td width="35%" class="tableHeader">{$i18n.label.person_name}</td>
90           <td width="35%" class="tableHeader">{$i18n.label.login}</td>
91           <td class="tableHeader">{$i18n.form.users.role}</td>
92         </tr>
93   {foreach $active_users as $u}
94         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
95           <td>{$u.name|escape}</td>
96           <td>{$u.login|escape}</td>
97           <td>{$u.role_name|escape}</td>
98         </tr>
99   {/foreach}
100       </table>
101 {/if}
102     </td>
103   </tr>
104 </table>