Some refactoring and cleanup in ttRegistrator class.
[timetracker.git] / WEB-INF / templates / clients.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_clients')}
9       <table cellspacing="1" cellpadding="3" border="0" width="100%">
10   {if $inactive_clients}
11         <tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.active_clients}</td></tr>
12   {/if}
13         <tr>
14           <td width="40%" class="tableHeader">{$i18n.label.person_name}</td>
15           <td width="40%" class="tableHeader">{$i18n.label.address}</td>
16           <td class="tableHeader">{$i18n.label.edit}</td>
17           <td class="tableHeader">{$i18n.label.delete}</td>
18         </tr>
19   {foreach $active_clients as $client}
20         <tr valign="top" bgcolor="{cycle values="#f5f5f5,#ffffff"}">
21           <td>{$client.name|escape}</td>
22           <td>{$client.address|escape}</td>
23           <td><a href="client_edit.php?id={$client.id}">{$i18n.label.edit}</a></td>
24           <td><a href="client_delete.php?id={$client.id}">{$i18n.label.delete}</a></td>
25         </tr>
26   {/foreach}
27       </table>
28
29       <table width="100%">
30         <tr><td align="center"><br><form><input type="button" onclick="chLocation('client_add.php');" value="{$i18n.button.add}"></form></td></tr>
31       </table>
32
33   {if $inactive_clients}
34       <table cellspacing="1" cellpadding="3" border="0" width="100%">
35         <tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.inactive_clients}</td></tr>
36         <tr>
37           <td width="40%" class="tableHeader">{$i18n.label.person_name}</td>
38           <td width="40%" class="tableHeader">{$i18n.label.address}</td>
39           <td class="tableHeader">{$i18n.label.edit}</td>
40           <td class="tableHeader">{$i18n.label.delete}</td>
41         </tr>
42     {foreach $inactive_clients as $client}
43         <tr valign="top" bgcolor="{cycle values="#f5f5f5,#ffffff"}">
44           <td>{$client.name|escape}</td>
45           <td>{$client.address|escape}</td>
46           <td><a href="client_edit.php?id={$client.id}">{$i18n.label.edit}</a></td>
47           <td><a href="client_delete.php?id={$client.id}">{$i18n.label.delete}</a></td>
48         </tr>
49     {/foreach}
50       </table>
51
52       <table width="100%">
53         <tr><td align="center"><br><form><input type="button" onclick="chLocation('client_add.php');" value="{$i18n.button.add}"></form></td></tr>
54       </table>
55   {/if}
56 {else}
57       <table cellspacing="1" cellpadding="3" border="0" width="100%">
58         <tr>
59           <td class="tableHeader">{$i18n.label.thing_name}</td>
60           <td class="tableHeader">{$i18n.label.address}</td>
61         </tr>
62   {if $active_clients}
63     {foreach $active_clients as $client}
64         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
65           <td>{$client.name|escape}</td>
66           <td>{$client.address|escape}</td>
67         </tr>
68     {/foreach}
69   {/if}
70       </table>
71 {/if}
72     </td>
73   </tr>
74 </table>