6fc08b8a9bda2d69d584db89ce01802b94aa9113
[timetracker.git] / WEB-INF / templates / week.tpl
1 {include file="time_script.tpl"}
2
3 <script>
4 // This is here because fillDropdowns() in time_script.tpl uses a different form name.
5 // Perhaps a better fix would be to provide form name as paramater to fillDropdowns()?
6 // TODO: try to fix it properly.
7 //
8 // The fillDropdowns function populates the "project" and "task" dropdown controls
9 // with relevant values.
10 function fillDropdowns() {
11   if(document.body.contains(document.weekTimeForm.client))
12     fillProjectDropdown(document.weekTimeForm.client.value);
13
14   fillTaskDropdown(document.weekTimeForm.project.value);
15 }
16 </script>
17
18 <style>
19 .not_billable td {
20   color: #ff6666;
21 }
22 </style>
23
24 {$forms.weekTimeForm.open}
25 <table cellspacing="4" cellpadding="0" border="0">
26   <tr>
27     <td align="center" colspan=2">
28       <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>
29     </td>
30   </tr>
31   <tr>
32     <td valign="top">
33       <table>
34 {if $on_behalf_control}
35         <tr>
36           <td align="right">{$i18n.label.user}:</td>
37           <td>{$forms.weekTimeForm.onBehalfUser.control}</td>
38         </tr>
39 {/if}
40 {if $user->isPluginEnabled('cl')}
41         <tr>
42           <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
43           <td>{$forms.weekTimeForm.client.control}</td>
44         </tr>
45 {/if}
46 {if $user->isPluginEnabled('iv')}
47         <tr>
48           <td align="right">&nbsp;</td>
49           <td><label>{$forms.weekTimeForm.billable.control}{$i18n.form.time.billable}</label></td>
50         </tr>
51 {/if}
52 {if ($custom_fields && $custom_fields->fields[0])}
53         <tr>
54           <td align="right">{$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:</td><td>{$forms.weekTimeForm.cf_1.control}</td>
55         </tr>
56 {/if}
57 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
58         <tr>
59           <td align="right">{$i18n.label.project} (*):</td>
60           <td>{$forms.weekTimeForm.project.control}</td>
61         </tr>
62 {/if}
63 {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
64         <tr>
65           <td align="right">{$i18n.label.task}:</td>
66           <td>{$forms.weekTimeForm.task.control}</td>
67         </tr>
68 {/if}
69 {if $user->isPluginEnabled('wvn')}
70         <tr>
71           <td align="right">{$i18n.label.week_note}:</td>
72           <td>{$forms.weekTimeForm.note.control}</td>
73         </tr>
74 {/if}
75       </table>
76     </td>
77     <td valign="top">
78       <table>
79         <tr><td>{$forms.weekTimeForm.date.control}</td></tr>
80       </table>
81     </td>
82   </tr>
83 </table>
84 <table width="720">
85   <tr valign="top">
86     <td>{$forms.weekTimeForm.week_durations.control}</td>
87   </tr>
88 </table>
89
90 <table>
91   <tr>
92     <td align="center" colspan="2">{$forms.weekTimeForm.btn_submit.control}</td>
93   </tr>
94   <tr><td>&nbsp;</td></tr>
95 </table>
96
97 {if $user->isPluginEnabled('wvl')}
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         <td width="5%" class="tableHeader">{$i18n.label.date}</td>
105   {if $user->isPluginEnabled('cl')}
106         <td width="20%" class="tableHeader">{$i18n.label.client}</td>
107   {/if}
108   {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
109         <td class="tableHeader">{$i18n.label.project}</td>
110   {/if}
111   {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
112         <td class="tableHeader">{$i18n.label.task}</td>
113   {/if}
114   {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
115         <td width="5%" class="tableHeader" align="right">{$i18n.label.start}</td>
116         <td width="5%" class="tableHeader" align="right">{$i18n.label.finish}</td>
117   {/if}
118         <td width="5%" class="tableHeader">{$i18n.label.duration}</td>
119         <td class="tableHeader">{$i18n.label.note}</td>
120         <td></td>
121         <td></td>
122       </tr>
123   {foreach $time_records as $record}
124       <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}" {if !$record.billable} class="not_billable" {/if}>
125         <td valign="top">{$record.date}</td>
126     {if $user->isPluginEnabled('cl')}
127         <td valign="top">{$record.client|escape}</td>
128     {/if}
129     {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
130         <td valign="top">{$record.project|escape}</td>
131     {/if}
132     {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
133         <td valign="top">{$record.task|escape}</td>
134     {/if}
135     {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
136         <td nowrap align="right" valign="top">{if $record.start}{$record.start}{else}&nbsp;{/if}</td>
137         <td nowrap align="right" valign="top">{if $record.finish}{$record.finish}{else}&nbsp;{/if}</td>
138     {/if}
139         <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>
140         <td valign="top">{if $record.comment}{$record.comment|escape}{else}&nbsp;{/if}</td>
141         <td valign="top" align="center">
142     {if $record.approved || $record.timesheet_id || $record.invoice_id}
143           &nbsp;
144     {else}
145           <a href="time_edit.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.edit}" src="images/icon_edit.png"></a>
146       {if ($record.duration == '0:00' && $record.start <> '')}
147           <input type="hidden" name="record_id" value="{$record.id}">
148           <input type="hidden" name="browser_date" value="">
149           <input type="hidden" name="browser_time" value="">
150           <input type="submit" id="btn_stop" name="btn_stop" onclick="browser_date.value=get_date();browser_time.value=get_time()" value="{$i18n.button.stop}">
151       {/if}
152     {/if}
153         </td>
154         <td valign="top" align="center">
155     {if $record.approved || $record.timesheet_id || $record.invoice_id}
156           &nbsp;
157     {else}
158           <a href="time_delete.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.delete}" src="images/icon_delete.png"></a>
159     {/if}
160         </td>
161       </tr>
162   {/foreach}
163     </table>
164 {/if}
165   </td>
166 </tr>
167 </table>
168 {/if}
169
170 {if $time_records}
171 <table cellpadding="3" cellspacing="1" width="720">
172   {if $user->isPluginEnabled('wvl')}
173   <tr>
174     <td align="left">{$i18n.label.week_total}: {$week_total}</td>
175     <td></td>
176   </tr>
177   {/if}
178   {if $user->isPluginEnabled('mq')}
179   <tr>
180     <td align="left">{$i18n.label.month_total}: {$month_total}</td>
181     {if $over_quota}
182     <td align="right">{$i18n.form.time.over_quota}: <span style="color: green;">{$quota_remaining}</span></td>
183     {else}
184     <td align="right">{$i18n.form.time.remaining_quota}: <span style="color: red;">{$quota_remaining}</span></td>
185     {/if}
186   </tr>
187   {/if}
188 </table>
189 {/if}
190 {$forms.weekTimeForm.close}