Adjusted charts.php for subgroups.
[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   {if $group_dropdown}
10 {$forms.usersForm.open} {* usersForm consists only of one dropdown group control *}
11       <table width="100%">
12         <tr>
13           <td align="center">{$i18n.label.group}: {$forms.usersForm.group.control}</td>
14         </tr>
15       </table>
16 {$forms.usersForm.close}
17   {/if}
18
19       <table cellspacing="1" cellpadding="3" border="0" width="100%">
20   {if $inactive_users}
21         <tr><td class="sectionHeaderNoBorder">{$i18n.form.users.active_users}</td></tr>
22   {/if}
23         <tr>
24           <td width="30%" class="tableHeader">{$i18n.label.person_name}</td>
25           <td width="30%" class="tableHeader">{$i18n.label.login}</td>
26           <td width="20%" class="tableHeader">{$i18n.form.users.role}</td>
27           <td width="10%" class="tableHeader">{$i18n.label.edit}</td>
28           <td width="10%" class="tableHeader">{$i18n.label.delete}</td>
29         </tr>
30   {if $active_users}
31     {foreach $active_users as $u}
32         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
33           <td>
34           {if $uncompleted_indicators}
35             <span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
36           {/if}
37             {$u.name|escape}
38           </td>
39           <td>{$u.login|escape}</td>
40           <td>{$u.role_name|escape}</td>
41       {if $u.group_id != $user->group_id || $u.rank < $user->rank || ($u.rank == $user->rank && $u.id == $user->id)}
42           <td><a href="user_edit.php?id={$u.id}">{$i18n.label.edit}</a></td>
43          {if $u.id != $user->id}<td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>{else}<td></td>{/if}
44       {else}
45           <td></td>
46           <td></td>
47       {/if}
48         </tr>
49     {/foreach}
50   {/if}
51       </table>
52
53       <table width="100%">
54         <tr>
55           <td align="center"><br>
56             <form><input type="button" onclick="chLocation('user_add.php');" value="{$i18n.button.add}"></form>
57           </td>
58         </tr>
59       </table>
60
61   {if $inactive_users}
62       <table cellspacing="1" cellpadding="3" border="0" width="100%">
63         <tr><td class="sectionHeaderNoBorder">{$i18n.form.users.inactive_users}</td></tr>
64         <tr>
65           <td width="30%" class="tableHeader">{$i18n.label.person_name}</td>
66           <td width="30%" class="tableHeader">{$i18n.label.login}</td>
67           <td width="20%" class="tableHeader">{$i18n.form.users.role}</td>
68           <td width="10%" class="tableHeader">{$i18n.label.edit}</td>
69           <td width="10%" class="tableHeader">{$i18n.label.delete}</td>
70         </tr>
71     {foreach $inactive_users as $u}
72         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
73           <td>{$u.name|escape}</td>
74           <td>{$u.login|escape}</td>
75           <td>{$u.role_name|escape}</td>
76       {if $u.group_id != $user->group_id || $u.rank < $user->rank}
77           <td><a href="user_edit.php?id={$u.id}">{$i18n.label.edit}</a></td>
78           <td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>
79       {else}
80           <td></td>
81           <td></td>
82       {/if}
83         </tr>
84     {/foreach}
85
86       </table>
87
88       <table width="100%">
89         <tr>
90           <td align="center" height="50">
91             <form><input type="button" onclick="chLocation('user_add.php');" value="{$i18n.button.add}"></form>
92           </td>
93         </tr>
94       </table>
95   {/if}
96 {else}
97       <table cellspacing="1" cellpadding="3" border="0" width="100%">
98         <tr>
99           <td width="35%" class="tableHeader">{$i18n.label.person_name}</td>
100           <td width="35%" class="tableHeader">{$i18n.label.login}</td>
101           <td class="tableHeader">{$i18n.form.users.role}</td>
102         </tr>
103   {foreach $active_users as $u}
104         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
105           <td>{$u.name|escape}</td>
106           <td>{$u.login|escape}</td>
107           <td>{$u.role_name|escape}</td>
108         </tr>
109   {/foreach}
110       </table>
111 {/if}
112     </td>
113   </tr>
114 </table>