Zeiterfassung: Artikel beim Erfassen wählen können und mit auflisten
[kivitendo-erp.git] / templates / webpages / time_recording / form.html
index 119de5c..32207b5 100644 (file)
@@ -2,6 +2,7 @@
 [% USE P %]
 [% USE T8 %]
 [% USE LxERP %]
+[% USE HTML %]
 
 <h1>[% title %]</h1>
 
 
   <table>
     <thead class="listheading">
-      <th>[% 'Start' | $T8 %]</th>
-      <th>[% 'End' | $T8 %]</th>
-      <th>[% 'Customer' | $T8 %]</th>
-      <th>[% 'Type' | $T8 %]</th>
-      <th>[% 'Project' | $T8 %]</th>
-      <th>[% 'Description' | $T8 %]</th>
+      <tr>
+        <th>[% 'Start' | $T8 %]</th>
+        <th>[% 'End' | $T8 %]</th>
+        <th>[% 'Customer' | $T8 %]</th>
+        <th>[% 'Article' | $T8 %]</th>
+        <th>[% 'Project' | $T8 %]</th>
+        <th>[% 'Description' | $T8 %]</th>
+        <th>[% 'Mitarbeiter' | $T8 %]</th>
+      </tr>
     </thead>
     <tbody valign="top">
-      <td>
-        [% P.date_tag('start_date',  SELF.start_date, "data-validate"="required", "data-title"=LxERP.t8('Start date'), onchange='kivi.TimeRecording.set_end_date()') %]<br>
-        [% P.input_tag('start_time', SELF.start_time, type="time", "data-validate"="required", "data-title"=LxERP.t8('Start time')) %]
-        [% P.button_tag('kivi.TimeRecording.set_current_date_time("start")', LxERP.t8('now')) %]
-      </td>
-      <td>
-        [% P.date_tag('end_date',  SELF.end_date) %]<br>
-        [% P.input_tag('end_time', SELF.end_time, type="time") %]
-        [% P.button_tag('kivi.TimeRecording.set_current_date_time("end")', LxERP.t8('now')) %]
-      </td>
-      <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>
-      <td>[% P.select_tag('time_recording.type_id', SELF.all_time_recording_types, default=SELF.time_recording.type.id, with_empty=1, title_key='abbreviation') %]</td>
-      <td>[% P.project.picker('time_recording.project_id', SELF.time_recording.project_id, style='width: 300px') %]</td>
-      <td>[% L.textarea_tag('time_recording.description', SELF.time_recording.description, wrap="soft", style="width: 350px; height: 150px", class="texteditor", "data-validate"="required", "data-title"=LxERP.t8('Description')) %]</td>
+      <tr>
+        <td>
+          [% P.date_tag('start_date',  SELF.start_date, "data-validate"="required", "data-title"=LxERP.t8('Start date'), onchange='kivi.TimeRecording.set_end_date()') %]<br>
+          [% P.input_tag('start_time', SELF.start_time, type="time", "data-validate"="required", "data-title"=LxERP.t8('Start time')) %]
+          [% P.button_tag('kivi.TimeRecording.set_current_date_time("start")', LxERP.t8('now')) %]
+        </td>
+        <td>
+          [% P.date_tag('end_date',  SELF.end_date) %]<br>
+          [% P.input_tag('end_time', SELF.end_time, type="time") %]
+          [% P.button_tag('kivi.TimeRecording.set_current_date_time("end")', LxERP.t8('now')) %]
+        </td>
+        <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>
+        <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') %]</td>
+        <td>[% P.project.picker('time_recording.project_id', SELF.time_recording.project_id, style='width: 300px') %]</td>
+        <td>[% L.textarea_tag('time_recording.description', SELF.time_recording.description, wrap="soft", style="width: 350px; height: 150px", class="texteditor", "data-validate"="required", "data-title"=LxERP.t8('Description')) %]</td>
+        <td>
+          [%- IF SELF.can_edit_all -%]
+            [% L.select_tag('time_recording.staff_member_id', SELF.all_employees,
+                             default    => SELF.time_recording.staff_member_id,
+                             title_key  => 'safe_name',
+                             value_key  => 'id',
+                             style      => 'width: 200px') %]
+          [%- ELSE -%]
+            [% SELF.time_recording.staff_member.safe_name | html %]
+          [%- END -%]
+        </td>
+      </tr>
     </tbody>
   </table>