049979cacb5b0114fef632adcbf4e2393401098f
[timetracker.git] / WEB-INF / templates / time.tpl
1 {include file="time_script.tpl"}
2
3 <style>
4 .not_billable td {
5   color: #ff6666;
6 }
7 </style>
8
9 {$forms.timeRecordForm.open}
10 <table cellspacing="4" cellpadding="0" border="0">
11 {if $user->isPluginEnabled('wv')}
12   <tr>
13     <td align="center" colspan=2">
14       <a href="time.php?date={$selected_date->toString()}">{$i18n.label.day_view}</a>&nbsp;/&nbsp;<a href="week.php?date={$selected_date->toString()}">{$i18n.label.week_view}</a>
15     </td>
16   </tr>
17 {/if}
18   <tr>
19     <td valign="top">
20       <table>
21 {if $user_dropdown}
22         <tr>
23           <td align="right">{$i18n.label.user}:</td>
24           <td>{$forms.timeRecordForm.user.control}</td>
25         </tr>
26 {/if}
27 {if $user->isPluginEnabled('cl')}
28         <tr>
29           <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
30           <td>{$forms.timeRecordForm.client.control}</td>
31         </tr>
32 {/if}
33 {if $user->isPluginEnabled('iv')}
34         <tr>
35           <td align="right">&nbsp;</td>
36           <td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td>
37         </tr>
38 {/if}
39 {if ($custom_fields && $custom_fields->fields[0])}
40         <tr>
41           <td align="right">{$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:</td><td>{$forms.timeRecordForm.cf_1.control}</td>
42         </tr>
43 {/if}
44 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
45         <tr>
46           <td align="right">{$i18n.label.project} (*):</td>
47           <td>{$forms.timeRecordForm.project.control}</td>
48         </tr>
49 {/if}
50 {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
51         <tr>
52           <td align="right">{$i18n.label.task}{if $user->task_required} (*){/if}:</td>
53           <td>{$forms.timeRecordForm.task.control}</td>
54         </tr>
55 {/if}
56 {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
57         <tr>
58           <td align="right">{$i18n.label.start}:</td>
59           <td>{$forms.timeRecordForm.start.control}&nbsp;<input onclick="setNow('start');" type="button" tabindex="-1" value="{$i18n.button.now}"></td>
60         </tr>
61         <tr>
62           <td align="right">{$i18n.label.finish}:</td>
63           <td>{$forms.timeRecordForm.finish.control}&nbsp;<input onclick="setNow('finish');" type="button" tabindex="-1" value="{$i18n.button.now}"></td>
64         </tr>
65 {/if}
66 {if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
67         <tr>
68           <td align="right">{$i18n.label.duration}:</td>
69           <td>{$forms.timeRecordForm.duration.control}&nbsp;{if $user->getDecimalMark() == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}</td>
70         </tr>
71 {/if}
72 {if $template_dropdown}
73         <tr>
74           <td align="right">{$i18n.label.template}:</td>
75           <td>{$forms.timeRecordForm.template.control}</td>
76         </tr>
77 {/if}
78       </table>
79     </td>
80     <td valign="top">
81       <table>
82         <tr><td>{$forms.timeRecordForm.date.control}</td></tr>
83       </table>
84     </td>
85   </tr>
86 </table>
87
88 <table>
89   <tr>
90     <td align="right">{$i18n.label.note}:</td>
91     <td align="left">{$forms.timeRecordForm.note.control}</td>
92   </tr>
93   <tr>
94     <td align="center" colspan="2">{$forms.timeRecordForm.btn_submit.control}</td>
95   </tr>
96 </table>
97
98 <table width="720">
99 <tr>
100   <td valign="top">
101 {if $time_records}
102       <table border="0" cellpadding="3" cellspacing="1" width="100%">
103       <tr>
104   {if $user->isPluginEnabled('cl')}
105         <td width="20%" class="tableHeader">{$i18n.label.client}</td>
106   {/if}
107   {if $show_cf_1}
108         <td class="tableHeader">{$custom_fields->fields[0]['label']|escape}</td>
109   {/if}
110   {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
111         <td class="tableHeader">{$i18n.label.project}</td>
112   {/if}
113   {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
114         <td class="tableHeader">{$i18n.label.task}</td>
115   {/if}
116   {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
117         <td width="5%" class="tableHeader" align="right">{$i18n.label.start}</td>
118         <td width="5%" class="tableHeader" align="right">{$i18n.label.finish}</td>
119   {/if}
120         <td width="5%" class="tableHeader">{$i18n.label.duration}</td>
121         <td class="tableHeader">{$i18n.label.note}</td>
122         <td></td>
123         <td></td>
124   {if $show_files}
125         <td></td>
126   {/if}
127       </tr>
128   {foreach $time_records as $record}
129       <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}" {if !$record.billable} class="not_billable" {/if}>
130     {if $user->isPluginEnabled('cl')}
131         <td valign="top">{$record.client|escape}</td>
132     {/if}
133     {if $show_cf_1}
134         <td valign="top">{$record.cf_1|escape}</td>
135     {/if}
136     {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
137         <td valign="top">{$record.project|escape}</td>
138     {/if}
139     {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
140         <td valign="top">{$record.task|escape}</td>
141     {/if}
142     {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
143         <td nowrap align="right" valign="top">{if $record.start}{$record.start}{else}&nbsp;{/if}</td>
144         <td nowrap align="right" valign="top">{if $record.finish}{$record.finish}{else}&nbsp;{/if}</td>
145     {/if}
146         <td align="right" valign="top">{if ($record.duration == '0:00' && $record.start <> '')}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{else}{$record.duration}{/if}</td>
147         <td valign="top">{if $record.comment}{$record.comment|escape}{else}&nbsp;{/if}</td>
148     {if $show_files}
149       {if $record.has_files}
150         <td valign="top" align="center"><a href="time_files.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.files}" src="images/icon_files.png"></a></td>
151       {else}
152         <td valign="top" align="center"><a href="time_files.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.files}" src="images/icon_file.png"></a></td>
153       {/if}
154     {/if}
155         <td valign="top" align="center">
156     {if $record.approved || $record.timesheet_id || $record.invoice_id}
157           &nbsp;
158     {else}
159           <a href="time_edit.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.edit}" src="images/icon_edit.png"></a>
160       {if ($record.duration == '0:00' && $record.start <> '')}
161           <input type="hidden" name="record_id" value="{$record.id}">
162           <input type="hidden" name="browser_date" value="">
163           <input type="hidden" name="browser_time" value="">
164           <input type="submit" id="btn_stop" name="btn_stop" onclick="browser_date.value=get_date();browser_time.value=get_time()" value="{$i18n.button.stop}">
165       {/if}
166     {/if}
167         </td>
168         <td valign="top" align="center">
169     {if $record.approved || $record.timesheet_id || $record.invoice_id}
170           &nbsp;
171     {else}
172           <a href="time_delete.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.delete}" src="images/icon_delete.png"></a>
173     {/if}
174         </td>
175       </tr>
176   {/foreach}
177     </table>
178 {/if}
179   </td>
180 </tr>
181 </table>
182
183 <table cellpadding="3" cellspacing="1" width="720">
184   <tr>
185     <td align="left">{$i18n.label.week_total}: {$week_total}</td>
186     <td align="right">{$i18n.label.day_total}: {$day_total}</td>
187   </tr>
188   {if $user->isPluginEnabled('mq')}
189   <tr>
190     <td align="left">{$i18n.label.month_total}: {$month_total}</td>
191     {if $over_balance}
192     <td align="right">{$i18n.form.time.over_balance}: <span style="color: green;">{$balance_remaining}</span></td>
193     {else}
194     <td align="right">{$i18n.form.time.remaining_balance}: <span style="color: red;">{$balance_remaining}</span></td>
195     {/if}
196   </tr>
197   <tr>
198     <td align="left">{$i18n.label.quota}: {$month_quota}</td>
199     {if $over_quota}
200     <td align="right">{$i18n.form.time.over_quota}: <span style="color: green;">{$quota_remaining}</span></td>
201     {else}
202     <td align="right">{$i18n.form.time.remaining_quota}: <span style="color: red;">{$quota_remaining}</span></td>
203     {/if}
204   </tr>
205   {/if}
206 </table>
207
208 {$forms.timeRecordForm.close}