Refactoring, moving plugin config options into config field.
[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 $show_navigation}
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 $show_client}
28         <tr>
29           <td align="right">{$i18n.label.client}{if $user->isOptionEnabled('client_required')} (*){/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 $show_project}
45         <tr>
46           <td align="right">{$i18n.label.project} (*):</td>
47           <td>{$forms.timeRecordForm.project.control}</td>
48         </tr>
49 {/if}
50 {if $show_task}
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 $show_start}
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 {/if}
62 {if $show_finish}
63         <tr>
64           <td align="right">{$i18n.label.finish}:</td>
65           <td>{$forms.timeRecordForm.finish.control}&nbsp;<input onclick="setNow('finish');" type="button" tabindex="-1" value="{$i18n.button.now}"></td>
66         </tr>
67 {/if}
68 {if $show_duration}
69         <tr>
70           <td align="right">{$i18n.label.duration}:</td>
71           <td>{$forms.timeRecordForm.duration.control}&nbsp;{if $user->getDecimalMark() == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}</td>
72         </tr>
73 {/if}
74 {if $show_files}
75         <tr>
76           <td align="right">{$i18n.label.file}:</td>
77           <td>{$forms.timeRecordForm.newfile.control}</td>
78         </tr>
79 {/if}
80 {if $template_dropdown}
81         <tr>
82           <td align="right">{$i18n.label.template}:</td>
83           <td>{$forms.timeRecordForm.template.control}</td>
84         </tr>
85 {/if}
86       </table>
87     </td>
88     <td valign="top">
89       <table>
90         <tr><td>{$forms.timeRecordForm.date.control}</td></tr>
91       </table>
92     </td>
93   </tr>
94 </table>
95
96 <table>
97   <tr>
98     <td align="right">{$i18n.label.note}:</td>
99     <td align="left">{$forms.timeRecordForm.note.control}</td>
100   </tr>
101   <tr>
102     <td align="center" colspan="2">{$forms.timeRecordForm.btn_submit.control}</td>
103   </tr>
104 </table>
105
106 <table width="720">
107 <tr>
108   <td valign="top">
109 {if $time_records}
110       <table border="0" cellpadding="3" cellspacing="1" width="100%">
111       <tr>
112   {if $show_client}
113         <td class="tableHeader">{$i18n.label.client}</td>
114   {/if}
115   {if $show_cf_1}
116         <td class="tableHeader">{$custom_fields->fields[0]['label']|escape}</td>
117   {/if}
118   {if $show_project}
119         <td class="tableHeader">{$i18n.label.project}</td>
120   {/if}
121   {if $show_task}
122         <td class="tableHeader">{$i18n.label.task}</td>
123   {/if}
124   {if $show_start}
125         <td width="5%" class="tableHeader" align="right">{$i18n.label.start}</td>
126   {/if}
127   {if $show_finish}
128         <td width="5%" class="tableHeader" align="right">{$i18n.label.finish}</td>
129   {/if}
130         <td width="5%" class="tableHeader">{$i18n.label.duration}</td>
131   {if $show_note_column}
132         <td class="tableHeader">{$i18n.label.note}</td>
133   {/if}
134   {if $show_files}
135         <td></td>
136   {/if}
137         <td></td>
138         <td></td>
139       </tr>
140   {foreach $time_records as $record}
141       <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}" {if !$record.billable} class="not_billable" {/if}>
142     {if $show_client}
143         <td valign="top">{$record.client|escape}</td>
144     {/if}
145     {if $show_cf_1}
146         <td valign="top">{$record.cf_1|escape}</td>
147     {/if}
148     {if $show_project}
149         <td valign="top">{$record.project|escape}</td>
150     {/if}
151     {if $show_task}
152         <td valign="top">{$record.task|escape}</td>
153     {/if}
154     {if $show_start}
155         <td nowrap align="right" valign="top">{if $record.start}{$record.start}{else}&nbsp;{/if}</td>
156     {/if}
157     {if $show_finish}
158         <td nowrap align="right" valign="top">{if $record.finish}{$record.finish}{else}&nbsp;{/if}</td>
159     {/if}
160         <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>
161     {if $show_note_column}
162         <td valign="top">{if $record.comment}{$record.comment|escape}{else}&nbsp;{/if}</td>
163     {/if}
164     {if $show_files}
165       {if $record.has_files}
166         <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>
167       {else}
168         <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>
169       {/if}
170     {/if}
171         <td valign="top" align="center">
172     {if $record.approved || $record.timesheet_id || $record.invoice_id}
173           &nbsp;
174     {else}
175           <a href="time_edit.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.edit}" src="images/icon_edit.png"></a>
176       {if ($record.duration == '0:00' && $record.start <> '')}
177           <input type="hidden" name="record_id" value="{$record.id}">
178           <input type="hidden" name="browser_date" value="">
179           <input type="hidden" name="browser_time" value="">
180           <input type="submit" id="btn_stop" name="btn_stop" onclick="browser_date.value=get_date();browser_time.value=get_time()" value="{$i18n.button.stop}">
181       {/if}
182     {/if}
183         </td>
184         <td valign="top" align="center">
185     {if $record.approved || $record.timesheet_id || $record.invoice_id}
186           &nbsp;
187     {else}
188           <a href="time_delete.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.delete}" src="images/icon_delete.png"></a>
189     {/if}
190         </td>
191       </tr>
192     {if $show_note_row && $record.comment}
193       <tr>
194         <td align="right" valign="top">{$i18n.label.note}:</td>
195         <td colspan="{$colspan}" align="left" valign="top">{$record.comment|escape}</td>
196       </tr>
197     {/if}
198   {/foreach}
199     </table>
200 {/if}
201   </td>
202 </tr>
203 </table>
204
205 <table cellpadding="3" cellspacing="1" width="720">
206   <tr>
207     <td align="left">{$i18n.label.week_total}: {$week_total}</td>
208     <td align="right">{$i18n.label.day_total}: {$day_total}</td>
209   </tr>
210   {if $user->isPluginEnabled('mq')}
211   <tr>
212     <td align="left">{$i18n.label.month_total}: {$month_total}</td>
213     {if $over_balance}
214     <td align="right">{$i18n.form.time.over_balance}: <span style="color: green;">{$balance_remaining}</span></td>
215     {else}
216     <td align="right">{$i18n.form.time.remaining_balance}: <span style="color: red;">{$balance_remaining}</span></td>
217     {/if}
218   </tr>
219   <tr>
220     <td align="left">{$i18n.label.quota}: {$month_quota}</td>
221     {if $over_quota}
222     <td align="right">{$i18n.form.time.over_quota}: <span style="color: green;">{$quota_remaining}</span></td>
223     {else}
224     <td align="right">{$i18n.form.time.remaining_quota}: <span style="color: red;">{$quota_remaining}</span></td>
225     {/if}
226   </tr>
227   {/if}
228 </table>
229
230 {$forms.timeRecordForm.close}