Lieferadressen, gelöschte aber ausgewählte weiterhin einblenden.
[kivitendo-erp.git] / templates / webpages / do / form_header.html
index 2410439..000811e 100644 (file)
@@ -1,5 +1,8 @@
 [%- USE T8 %]
-[% USE HTML %][% USE LxERP %]<body onload="on_load()">
+[%- USE HTML %]
+[%- USE LxERP %]
+[%- USE L %]
+<body onload="on_load()">
 
  <script type="text/javascript" src="js/show_form_details.js"></script>
  <script type="text/javascript" src="js/show_history.js"></script>
@@ -50,6 +53,8 @@
 
  <div class="listtop">[% title %]</div>
 
+[%- INCLUDE 'common/flash.html' %]
+
  [%- IF ERRORS && ERRORS.size %]
  <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
  [%- END %]
@@ -62,7 +67,7 @@
   <input type="hidden" name="cc" value="[% HTML.escape(cc) %]">
   <input type="hidden" name="closed" value="[% HTML.escape(closed) %]">
   <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
-  <input type="hidden" name="curr" value="[% HTML.escape(curr) %]">
+  <input type="hidden" name="currency" value="[% HTML.escape(currency) %]">
   <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
   <input type="hidden" name="discount" value="[% HTML.escape(discount) %]">
   <input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
@@ -90,6 +95,7 @@
   <input type="hidden" name="shiptophone" value="[% HTML.escape(shiptophone) %]">
   <input type="hidden" name="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
   <input type="hidden" name="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
+  <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
   <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
   <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
           [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]
           [%- END %]
           [%- ELSE %]
-          <select name="cp_id" class="fixed_width" >
-           <option></option>
-           [%- FOREACH row = ALL_CONTACTS %]
-           <option value="[% HTML.escape(row.cp_id) %]"[% IF cp_id == row.cp_id %] selected[% END %]>
-            [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]
-           </option>
-           [%- END %]
-          </select>
+            [% L.select_tag('cp_id', L.options_for_select(ALL_CONTACTS, default=cp_id, value='cp_id', title='full_name_dep', with_empty=1), style='width: 250px') %]
           [%- END %]
          </td>
         </tr>
           [%- END %]
 
           [%- ELSE %]
-          <select name="shipto_id" class="fixed_width" >
-           <option></option>
-           [%- FOREACH row = ALL_SHIPTO %]
-           <option value="[% HTML.escape(row.shipto_id) %]"[% IF shipto_id == row.shipto_id %] selected[% END %]>
-            [%- HTML.escape(row.shiptoname) -%]
-            [%- IF row.shiptodepartment_1 %]; [% HTML.escape(row.shiptodepartment_1) -%][% END -%]
-            [%- IF row.shiptostreet %]; [% HTML.escape(row.shiptostreet) -%][% END -%]
-            [%- IF row.shiptocity %]; [% HTML.escape(row.shiptocity) -%][% END -%]
-           </option>
-           [%- END %]
-          </select>
+            [% L.select_tag('shipto_id', L.options_for_select(ALL_SHIPTO, default=shipto_id, value='shipto_id', title='displayable_id', with_empty=1), class='fixed_width') %]
           [%- END %]
          </td>
         </tr>
        <tr>
         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
         <td colspan="3">
-         [%- IF delivered %]
-         <input type="hidden" name="department" value="[% HTML.escape(department) %]">
-         [%- FOREACH row = ALL_DEPARTMENTS %]
-         [% IF department == row.value %][% HTML.escape(row.description) %]--[% HTML.escape(row.id) %][% END %]
-         [%- END %]
-         [%- ELSE %]
-         <select name="department" class="fixed_width">
-          <option></option>
-          [%- FOREACH row = ALL_DEPARTMENTS %]
-          <option[% IF department == row.value %] selected[% END %]>[% HTML.escape(row.description) %]--[% HTML.escape(row.id) %]</option>
-          [%- END %]
-         </select>
-         [%- END %]
-        </td>
+         [% L.select_tag('department_id', L.options_for_select(ALL_DEPARTMENTS, default=department_id, title="description", with_empty=1), style='width: 250px', disabled => delivered )%]
+       </td>
        </tr>
        [%- END %]
 
          [% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
          [%- END %]
          [%- ELSE %]
-         <select name="employee_id">
-          [%- FOREACH row = ALL_EMPLOYEES %]
-          <option value="[% HTML.escape(row.id) %]"[% IF row.id == employee_id %] selected[% END %]>
-           [%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %]
-          </option>
-          [%- END %]
-         </select>
+           [% L.select_tag('employee_id', L.options_for_select(ALL_EMPLOYEES, default=employee_id, title='safe_name')) %]
          [%- END %]
         </td>
        </tr>
          [% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
          [%- END %]
          [%- ELSE %]
-         <select name="salesman_id">
-          [%- FOREACH row = ALL_SALESMEN %]
-          <option value="[% HTML.escape(row.id) %]"[% IF row.id == the_salesman_id %] selected[% END %]>
-           [%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %]
-          </option>
-          [%- END %]
-         </select>
+          [% L.select_tag('salesman_id', L.options_for_select(ALL_SALESMEN, default=(salesman_id ? salesman_id : employee_id), title='safe_name')) %]
          [%- END %]
         </td>
        </tr>