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