Refactoring, moving plugin config options into config field.
[timetracker.git] / WEB-INF / templates / time_edit.tpl
1 {include file="time_script.tpl"}
2
3 {* Conditional include of confirmSave handler. *}
4 {if $confirm_save}
5 <script>
6 var original_date = "{$entry_date}";
7
8 function confirmSave() {
9   var date_on_save = document.getElementById("date").value;
10   if (original_date != date_on_save) {
11     return confirm("{$i18n.warn.confirm_save}");
12   }
13 }
14 </script>
15 {/if}
16
17 {$forms.timeRecordForm.open}
18 <table cellspacing="4" cellpadding="7" border="0">
19 <tr>
20   <td>
21   <table width = "100%">
22   <tr>
23     <td valign="top">
24     <table border="0">
25 {if $user->isPluginEnabled('cl')}
26     <tr>
27       <td align="right">{$i18n.label.client}{if $user->isOptionEnabled('client_required')} (*){/if}:</td>
28       <td>{$forms.timeRecordForm.client.control}</td>
29     </tr>
30 {/if}
31 {if $user->isPluginEnabled('iv')}
32     <tr>
33       <td align="right">&nbsp;</td>
34       <td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td>
35     </tr>
36 {/if}
37 {if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))}
38     <tr>
39       <td align="right">&nbsp;</td>
40       <td><label>{$forms.timeRecordForm.paid.control}{$i18n.label.paid}</label></td>
41     </tr>
42 {/if}
43 {if ($custom_fields && $custom_fields->fields[0])} 
44     <tr>
45       <td align="right">{$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:</td><td>{$forms.timeRecordForm.cf_1.control}</td>
46     </tr>
47 {/if}
48 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
49     <tr>
50       <td align="right">{$i18n.label.project} (*):</td>
51       <td>{$forms.timeRecordForm.project.control}</td>
52     </tr>
53 {/if}
54 {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
55     <tr>
56       <td align="right">{$i18n.label.task}{if $user->task_required} (*){/if}:</td>
57       <td>{$forms.timeRecordForm.task.control}</td>
58     </tr>
59 {/if}
60 {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
61     <tr>
62       <td align="right">{$i18n.label.start}:</td>
63       <td>{$forms.timeRecordForm.start.control}&nbsp;<input onclick="setNow('start');" type="button" tabindex="-1" value="{$i18n.button.now}"></td>
64     </tr>
65     <tr>
66       <td align="right">{$i18n.label.finish}:</td>
67       <td>{$forms.timeRecordForm.finish.control}&nbsp;<input onclick="setNow('finish');" type="button" tabindex="-1" value="{$i18n.button.now}"></td>
68     </tr>
69 {/if}
70 {if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
71     <tr>
72       <td align="right">{$i18n.label.duration}:</td>
73       <td>{$forms.timeRecordForm.duration.control}&nbsp;{if $user->decimal_mark == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}</td>
74     </tr>
75 {/if}
76     <tr>
77       <td align="right">{$i18n.label.date}:</td>
78       <td>{$forms.timeRecordForm.date.control}</td>
79     </tr>
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     <tr>
87       <td align="right">{$i18n.label.note}:</td>
88       <td>{$forms.timeRecordForm.note.control}</td>
89     </tr>
90     <tr>
91       <td colspan="2">&nbsp;</td>
92     </tr>
93     <tr>
94       <td></td>
95       <td align="left">{$forms.timeRecordForm.btn_save.control} {$forms.timeRecordForm.btn_copy.control} {$forms.timeRecordForm.btn_delete.control}</td>
96     </tr>
97     </table>
98     </td>
99     </tr>
100   </table>
101   </td>
102   </tr>
103 </table>
104 {$forms.timeRecordForm.close}