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