233eb706abc4f719b8526dc1040af2df36bc2e44
[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') %] [% 'h' | $T8 %]<sup>(1)</sup>
27         [% P.input_tag('duration_m', SELF.time_recording.duration_as_minutes, size=4, class='numeric') %] [% 'min' | $T8%]
28       </td>
29     </tr>
30    [%- ELSE %]
31     <tr>
32       <th align="right">[% 'Start' | $T8 %]</th>
33       <td>
34         [% P.date_tag('start_date',  SELF.start_date, "data-validate"="required", "data-title"=LxERP.t8('Start date'), onchange='kivi.TimeRecording.set_end_date()') %]
35         [% P.input_tag('start_time', SELF.start_time, type="time", "data-validate"="required", "data-title"=LxERP.t8('Start time')) %]
36         [% P.button_tag('kivi.TimeRecording.set_current_date_time("start")', LxERP.t8('now')) %]
37       </td>
38     </tr>
39     <tr>
40       <th align="right">[% 'End' | $T8 %]</th>
41       <td>
42         [% P.date_tag('end_date',  SELF.end_date) %]
43         [% P.input_tag('end_time', SELF.end_time, type="time") %]
44         [% P.button_tag('kivi.TimeRecording.set_current_date_time("end")', LxERP.t8('now')) %]
45       </td>
46     </tr>
47    [%- END %]
48     <tr></tr><tr></tr>
49     <tr>
50       <th align="right">[% 'Sales Order' | $T8 %]</th>
51       <td>[% P.select_tag('time_recording.order_id', SELF.all_orders, default=SELF.time_recording.order_id, title_key='digest', with_empty=1, style='width: 300px', onchange='kivi.TimeRecording.order_changed(this.value)') %]</td>
52     </tr>
53     <tr>
54       <th align="right">[% 'Customer' | $T8 %]</th>
55       <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>
56     </tr>
57     <tr>
58       <th align="right">[% 'Project' | $T8 %]</th>
59       <td>[% P.project.picker('time_recording.project_id', SELF.time_recording.project_id, style='width: 300px') %]</td>
60     </tr>
61     <tr></tr><tr></tr>
62     <tr>
63       <th align="right">[% 'Article' | $T8 %]</th>
64       <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>
65     </tr>
66     <tr>
67       <th align="right">[% 'Description' | $T8 %]</th>
68       <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>
69     </tr>
70     <tr>
71       <th align="right">[% 'Mitarbeiter' | $T8 %]</th>
72       <td>
73        [%- IF SELF.can_edit_all -%]
74         [% L.select_tag('time_recording.staff_member_id', SELF.all_employees,
75                         default    => SELF.time_recording.staff_member_id,
76                         title_key  => 'safe_name',
77                         value_key  => 'id',
78                         style      => 'width: 300px') %]
79        [%- ELSE -%]
80         [% SELF.time_recording.staff_member.safe_name | html %]
81        [%- END -%]
82       </td>
83     </tr>
84   </table>
85
86   [%- IF SELF.use_duration %]
87   <p>
88     <sup>(1)</sup>
89     [% 'Valid are integer values and floating point numbers, e.g. 4.75h = 4 hours and 45 minutes.' | $T8 %]
90   </p>
91   [%- END %]
92
93 </form>