e786ba856ffec41fad7710bb5b01ee182eb6f314
[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 {if $show_navigation}
27   <tr>
28     <td align="center" colspan=2">
29       <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>
30     </td>
31   </tr>
32 {/if}
33   <tr>
34     <td valign="top">
35       <table>
36 {if $on_behalf_control}
37         <tr>
38           <td align="right">{$i18n.label.user}:</td>
39           <td>{$forms.weekTimeForm.onBehalfUser.control}</td>
40         </tr>
41 {/if}
42 {if $show_client}
43         <tr>
44           <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
45           <td>{$forms.weekTimeForm.client.control}</td>
46         </tr>
47 {/if}
48 {if $user->isPluginEnabled('iv')}
49         <tr>
50           <td align="right">&nbsp;</td>
51           <td><label>{$forms.weekTimeForm.billable.control}{$i18n.form.time.billable}</label></td>
52         </tr>
53 {/if}
54 {if ($custom_fields && $custom_fields->fields[0])}
55         <tr>
56           <td align="right">{$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:</td><td>{$forms.weekTimeForm.cf_1.control}</td>
57         </tr>
58 {/if}
59 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
60         <tr>
61           <td align="right">{$i18n.label.project} (*):</td>
62           <td>{$forms.weekTimeForm.project.control}</td>
63         </tr>
64 {/if}
65 {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
66         <tr>
67           <td align="right">{$i18n.label.task}:</td>
68           <td>{$forms.weekTimeForm.task.control}</td>
69         </tr>
70 {/if}
71 {if $user->isPluginEnabled('wvn')}
72         <tr>
73           <td align="right">{$i18n.label.week_note}:</td>
74           <td>{$forms.weekTimeForm.note.control}</td>
75         </tr>
76 {/if}
77       </table>
78     </td>
79     <td valign="top">
80       <table>
81         <tr><td>{$forms.weekTimeForm.date.control}</td></tr>
82       </table>
83     </td>
84   </tr>
85 </table>
86 <table width="720">
87   <tr valign="top">
88     <td>{$forms.weekTimeForm.week_durations.control}</td>
89   </tr>
90 </table>
91
92 <table>
93   <tr>
94     <td align="center" colspan="2">{$forms.weekTimeForm.btn_submit.control}</td>
95   </tr>
96   <tr><td>&nbsp;</td></tr>
97 </table>
98
99 {if $user->isPluginEnabled('wvl')}
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         <td width="5%" class="tableHeader">{$i18n.label.date}</td>
107   {if $user->isPluginEnabled('cl')}
108         <td width="20%" class="tableHeader">{$i18n.label.client}</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   {if $show_files}
123         <td></td>
124   {/if}
125         <td></td>
126         <td></td>
127       </tr>
128   {foreach $time_records as $record}
129       <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}" {if !$record.billable} class="not_billable" {/if}>
130         <td valign="top">{$record.date}</td>
131     {if $user->isPluginEnabled('cl')}
132         <td valign="top">{$record.client|escape}</td>
133     {/if}
134     {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
135         <td valign="top">{$record.project|escape}</td>
136     {/if}
137     {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
138         <td valign="top">{$record.task|escape}</td>
139     {/if}
140     {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
141         <td nowrap align="right" valign="top">{if $record.start}{$record.start}{else}&nbsp;{/if}</td>
142         <td nowrap align="right" valign="top">{if $record.finish}{$record.finish}{else}&nbsp;{/if}</td>
143     {/if}
144         <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>
145         <td valign="top">{if $record.comment}{$record.comment|escape}{else}&nbsp;{/if}</td>
146     {if $show_files}
147       {if $record.has_files}
148         <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>
149       {else}
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_file.png"></a></td>
151       {/if}
152     {/if}
153         <td valign="top" align="center">
154     {if $record.approved || $record.timesheet_id || $record.invoice_id}
155           &nbsp;
156     {else}
157           <a href="time_edit.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.edit}" src="images/icon_edit.png"></a>
158       {if ($record.duration == '0:00' && $record.start <> '')}
159           <input type="hidden" name="record_id" value="{$record.id}">
160           <input type="hidden" name="browser_date" value="">
161           <input type="hidden" name="browser_time" value="">
162           <input type="submit" id="btn_stop" name="btn_stop" onclick="browser_date.value=get_date();browser_time.value=get_time()" value="{$i18n.button.stop}">
163       {/if}
164     {/if}
165         </td>
166         <td valign="top" align="center">
167     {if $record.approved || $record.timesheet_id || $record.invoice_id}
168           &nbsp;
169     {else}
170           <a href="time_delete.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.delete}" src="images/icon_delete.png"></a>
171     {/if}
172         </td>
173       </tr>
174   {/foreach}
175     </table>
176 {/if}
177   </td>
178 </tr>
179 </table>
180 {/if}
181
182 {if $time_records}
183 <table cellpadding="3" cellspacing="1" width="720">
184   {if $user->isPluginEnabled('wvl')}
185   <tr>
186     <td align="left">{$i18n.label.week_total}: {$week_total}</td>
187     <td></td>
188   </tr>
189   {/if}
190   {if $user->isPluginEnabled('mq')}
191   <tr>
192     <td align="left">{$i18n.label.month_total}: {$month_total}</td>
193     {if $over_quota}
194     <td align="right">{$i18n.form.time.over_quota}: <span style="color: green;">{$quota_remaining}</span></td>
195     {else}
196     <td align="right">{$i18n.form.time.remaining_quota}: <span style="color: red;">{$quota_remaining}</span></td>
197     {/if}
198   </tr>
199   {/if}
200 </table>
201 {/if}
202 {$forms.weekTimeForm.close}