Translation files work.
[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 width="5%" class="tableHeader">{$i18n.label.edit}</td>
121       </tr>
122   {foreach $time_records as $record}
123       <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}" {if !$record.billable} class="not_billable" {/if}>
124         <td valign="top">{$record.date}</td>
125     {if $user->isPluginEnabled('cl')}
126         <td valign="top">{$record.client|escape}</td>
127     {/if}
128     {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
129         <td valign="top">{$record.project|escape}</td>
130     {/if}
131     {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
132         <td valign="top">{$record.task|escape}</td>
133     {/if}
134     {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
135         <td nowrap align="right" valign="top">{if $record.start}{$record.start}{else}&nbsp;{/if}</td>
136         <td nowrap align="right" valign="top">{if $record.finish}{$record.finish}{else}&nbsp;{/if}</td>
137     {/if}
138         <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>
139         <td valign="top">{if $record.comment}{$record.comment|escape}{else}&nbsp;{/if}</td>
140         <td valign="top" align="center">
141     {if $record.invoice_id}
142           &nbsp;
143     {else}
144           <a href="time_edit.php?id={$record.id}">{$i18n.label.edit}</a>
145       {if ($record.duration == '0:00' && $record.start <> '')}
146           <input type="hidden" name="record_id" value="{$record.id}">
147           <input type="hidden" name="browser_date" value="">
148           <input type="hidden" name="browser_time" value="">
149           <input type="submit" id="btn_stop" name="btn_stop" onclick="browser_date.value=get_date();browser_time.value=get_time()" value="{$i18n.button.stop}">
150       {/if}
151     {/if}
152         </td>
153       </tr>
154   {/foreach}
155     </table>
156 {/if}
157   </td>
158 </tr>
159 </table>
160 {/if}
161
162 {if $time_records}
163 <table cellpadding="3" cellspacing="1" width="720">
164   {if $user->isPluginEnabled('wvl')}
165   <tr>
166     <td align="left">{$i18n.label.week_total}: {$week_total}</td>
167     <td></td>
168   </tr>
169   {/if}
170   {if $user->isPluginEnabled('mq')}
171   <tr>
172     <td align="left">{$i18n.label.month_total}: {$month_total}</td>
173     {if $over_quota}
174     <td align="right">{$i18n.form.time.over_quota}: <span style="color: green;">{$quota_remaining}</span></td>
175     {else}
176     <td align="right">{$i18n.form.time.remaining_quota}: <span style="color: red;">{$quota_remaining}</span></td>
177     {/if}
178   </tr>
179   {/if}
180 </table>
181 {/if}
182 {$forms.weekTimeForm.close}