Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / time_recording / form.html
1 [% USE L %]
2 [% USE P %]
3 [% USE T8 %]
4 [% USE LxERP %]
5 [% USE HTML %]
6
7 <h1>[% title %]</h1>
8
9 [%- INCLUDE 'common/flash.html' %]
10
11 <form method="post" action="controller.pl" id="form">
12   [% P.hidden_tag('id',       SELF.time_recording.id) %]
13   [% L.hidden_tag('callback', FORM.callback) %]
14
15   <table>
16    [%- IF SELF.use_duration %]
17     <tr>
18       <th align="right">[% 'Date' | $T8 %]</th>
19       <td>
20         [% P.date_tag('time_recording.date_as_date', SELF.time_recording.date_as_date, "data-validate"="required", "data-title"=LxERP.t8('Date')) %]<br>
21       </td>
22     </tr>
23     <tr>
24       <th align="right">[% 'Duration' | $T8 %]</th>
25       <td>
26         [% P.input_tag('duration_h', SELF.time_recording.duration_as_hours   || '', size=4, class='numeric',
27            "data-validate"="number", "data-title"=LxERP.t8('h'),   "placeholder"=LxERP.format_amount(0.00, 2)) %] [% 'h'   | $T8 %]<sup>(1)</sup>
28         [% P.input_tag('duration_m', SELF.time_recording.duration_as_minutes || '', size=4, class='numeric',
29            "data-validate"="number", "data-title"=LxERP.t8('min'), "placeholder"="0"                         ) %] [% 'min' | $T8 %]
30       </td>
31     </tr>
32    [%- ELSE %]
33     <tr>
34       <th align="right">[% 'Start' | $T8 %]</th>
35       <td>
36         [% P.date_tag('start_date',  SELF.start_date, "data-validate"="required", "data-title"=LxERP.t8('Start date'), onchange='kivi.TimeRecording.set_end_date()') %]
37         [% P.input_tag('start_time', SELF.start_time, type="time", "data-validate"="required", "data-title"=LxERP.t8('Start time')) %]
38         [% P.button_tag('kivi.TimeRecording.set_current_date_time("start")', LxERP.t8('now')) %]
39       </td>
40     </tr>
41     <tr>
42       <th align="right">[% 'End' | $T8 %]</th>
43       <td>
44         [% P.date_tag('end_date',  SELF.end_date) %]
45         [% P.input_tag('end_time', SELF.end_time, type="time") %]
46         [% P.button_tag('kivi.TimeRecording.set_current_date_time("end")', LxERP.t8('now')) %]
47       </td>
48     </tr>
49    [%- END %]
50     <tr></tr><tr></tr>
51     <tr>
52       <th align="right">[% 'Sales Order' | $T8 %]</th>
53       <td>[% P.select_tag('time_recording.order_id', SELF.all_orders, default=SELF.time_recording.order_id, with_empty=1, style='width: 300px', onchange='kivi.TimeRecording.order_changed(this.value)') %]</td>
54     </tr>
55     <tr>
56       <th align="right">[% 'Customer' | $T8 %]</th>
57       <td>[% P.customer_vendor.picker('time_recording.customer_id', SELF.time_recording.customer_id, type='customer', style='width: 300px', "data-validate"="required", "data-title"=LxERP.t8('Customer')) %]</td>
58     </tr>
59     <tr>
60       <th align="right">[% 'Project' | $T8 %]</th>
61       <td>[% P.project.picker('time_recording.project_id', SELF.time_recording.project_id, description_style='both', style='width: 300px') %]</td>
62     </tr>
63     <tr></tr><tr></tr>
64     <tr>
65       <th align="right">[% 'Article' | $T8 %]</th>
66       <td>[% P.select_tag('time_recording.part_id', SELF.all_time_recording_articles, default=SELF.time_recording.part_id, with_empty=1, value_key='id', title_key='description', style='width: 300px') %]</td>
67     </tr>
68     <tr>
69       <th align="right">[% 'Description' | $T8 %]</th>
70       <td>[% L.textarea_tag('time_recording.description', SELF.time_recording.description, wrap="soft", style="width: 300px; height: 150px", class="texteditor", "data-validate"="required", "data-title"=LxERP.t8('Description')) %]</td>
71     </tr>
72     <tr>
73       <th align="right">[% 'Mitarbeiter' | $T8 %]</th>
74       <td>
75        [%- IF SELF.can_edit_all -%]
76         [% L.select_tag('time_recording.staff_member_id', SELF.all_employees,
77                         default    => SELF.time_recording.staff_member_id,
78                         title_key  => 'safe_name',
79                         value_key  => 'id',
80                         style      => 'width: 300px') %]
81        [%- ELSE -%]
82         [% SELF.time_recording.staff_member.safe_name | html %]
83        [%- END -%]
84       </td>
85     </tr>
86   </table>
87
88   [%- IF SELF.use_duration %]
89   <p>
90     <sup>(1)</sup>
91     [% 'Valid are integer values and floating point numbers, e.g. 4.75h = 4 hours and 45 minutes.' | $T8 %]
92   </p>
93   [%- END %]
94
95 </form>
96
97 <script type="text/javascript">
98 <!--
99   [% FOREACH i = inputs_to_disable %]
100     kivi.TimeRecording.inputs_to_disable.push("[% i %]");
101   [% END %]
102 -->
103 </script>