Ansprechpartner löschen im contact partial rendern.
[kivitendo-erp.git] / templates / webpages / ct / form_header.html
index e8183f2..814ccb0 100644 (file)
@@ -1,8 +1,11 @@
 [%- USE T8 %]
 [% USE HTML %][% USE LxERP %]
+[% USE L %]
 <body>
 
- <div class="listtop">[% title %]</div>
+ <h1>[% title %]</h1>
+
+ [% PROCESS 'common/flash.html' %]
 
  <form method="post" name="ct" action="ct.pl" >
 
@@ -10,7 +13,9 @@
    <li class="selected"><a href="#" rel="billing">[% 'Billing Address' | $T8 %]</a></li>
    <li><a href="#" rel="shipto">[% 'Shipping Address' | $T8 %]</a></li>
    <li><a href="#" rel="contacts">[% 'Contacts' | $T8 %]</a></li>
+[%- IF id %]
    <li><a href="#" rel="deliveries">[% 'Supplies' | $T8 %]</a></li>
+[%- END %]
    <li><a href="#" rel="vcnotes">[% 'Notes' | $T8 %]</a></li>
    [%- IF CUSTOM_VARIABLES.size %]
    <li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
       <td><input name="taxnumber" size="20" value="[% HTML.escape(taxnumber) %]"></td>
       <!-- Anm.: R&B 15.11.2008     VAT Reg No ist Ust-ID in GB, aber generell sollte es laut Richardson die sales tax id sein -->
       <th align="right">[% 'sales tax identification number' | $T8 %]</th>
-      <td><input name="ustid" maxlength="14" size="20" value="[% HTML.escape(ustid) %]"></td>
+      <td><input name="ustid" id="ustid" maxlength="14" size="20" value="[% HTML.escape(ustid) %]"></td>
       [%- IF is_customer %]
       <th align="right">[% 'our vendor number at customer' | $T8 %]</th>
       <td><input name="c_vendor_id" size="10" value="[% HTML.escape(c_vendor_id) %]"></td>
       <td><input name="iban" size="10" maxlength="100" value="[% HTML.escape(iban) %]"></td>
       <th align="right">[% 'BIC' | $T8 %]</th>
       <td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
+      [%- IF ALL_CURRENCIES.size %]
+        <th align="right">[% 'Currency' | $T8 %]</th>
+        <td>[% L.select_tag('currency', L.options_for_select(ALL_CURRENCIES, default=currency, with_empty=1)) %]</td>
+      [%- END %]
      </tr>
 
      <tr>
       <td>
        [%- INCLUDE generic/multibox.html
              name       = 'language_id',
+             default    = default_language_id,
              DATA       = languages,
              show_empty = 1,
              id_key     = 'id',
       <td>
        [%- INCLUDE generic/multibox.html
              name       = 'taxzone_id',
+             id         = 'taxzone_id',
              DATA       = ALL_TAXZONES,
-             show_empty = 1,
+             show_empty = 0,
              id_key     = 'id',
              label_key  = 'description',
        -%]
       </td>
       [%- IF is_customer && !conf_vertreter %]
       <th align="right">[% 'Salesman' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'salesman_id',
-             DATA       = ALL_SALESMEN,
-             show_empty = 1,
-             id_key     = 'id',
-             label_sub  = 'salesman_label',
-       -%]
-      </td>
+      <td>[% L.select_tag('salesman_id', L.options_for_select(ALL_SALESMEN, default=salesman_id, show_empty=1, title='safe_name')) %]</td>
       [%- END %]
      </tr>
     </table>
    </div>
 
    <div id="shipto" class="tabcontent">
-
-    <table width="100%">
-     <tr>
-      <th align="right">[% 'Shipping Address' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'shipto_id',
-             id         = 'shipto_id',
-             DATA       = SHIPTO,
-             onChange   = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto,set_gender])",
-             id_key     = 'shipto_id',
-             label_sub  = 'shipto_label',
-             label_key  = 'shipto_label',
-       -%]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Company Name' | $T8 %]</th>
-      <td><input id="shiptoname" name="shiptoname" size="35" maxlength="75" value="[% HTML.escape(shiptoname) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Abteilung' | $T8 %]</th>
-      <td>
-       <input id="shiptodepartment_1" name="shiptodepartment_1" size="16" maxlength="75" value="[% HTML.escape(shiptodepartment_1) %]">
-       <input id="shiptodepartment_2" name="shiptodepartment_2" size="16" maxlength="75" value="[% HTML.escape(shiptodepartment_2) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Street' | $T8 %]</th>
-      <td><input id="shiptostreet" name="shiptostreet" size="35" maxlength="75" value="[% HTML.escape(shiptostreet) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
-      <td>
-       <input id="shiptozipcode" name="shiptozipcode" size="5" maxlength="75" value="[% HTML.escape(shiptozipcode) %]">
-       <input id="shiptocity" name="shiptocity" size="30" maxlength="75" value="[% HTML.escape(shiptocity) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Country' | $T8 %]</th>
-      <td><input id="shiptocountry" name="shiptocountry" size="35" maxlength="75" value="[% HTML.escape(shiptocountry) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
-      <td><input id="shiptocontact" name="shiptocontact" size="30" maxlength="75" value="[% HTML.escape(shiptocontact) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
-      <td><input id="shiptophone" name="shiptophone" size="30" maxlength="30" value="[% HTML.escape(shiptophone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
-      <td><input id="shiptofax" name="shiptofax" size="30" maxlength="30" value="[% HTML.escape(shiptofax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
-      <td><input id="shiptoemail" name="shiptoemail" size="45" value="[% HTML.escape(shiptoemail) %]"></td>
-     </tr>
-
-     <tr>
-      <td>&nbsp;</td>
-     </tr>
-     <tr>
-      <td>&nbsp;</td>
-     </tr>
-    </table>
-
-    <input type="submit" id="delete_shipto" name="action" value="[% 'Delete Shipto' | $T8 %]" disabled>
-    <br style="clear: left" />
+    [% INCLUDE 'ct/_shipto.html' %]
    </div>
 
    <div id="contacts" class="tabcontent">
-    <table>
-     <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
-     <tr>
-      <th align="left">[% 'Contacts' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'cp_id',
-             id         = 'cp_id',
-             DATA       = CONTACTS,
-             onChange   = "on_contact_changed()",
-             id_key     = 'cp_id',
-             label_sub  = 'contacts_label',
-       -%]
-      </td>
-     </tr>
-
-    <tr>
-     <th align="left" nowrap>[% 'Gender' | $T8 %]</th>
-     <td>
-      <select id="cp_gender" name="cp_gender">
-       <option value="m"[% IF cp_gender == 'm' %] selected[% END %]>[% 'male' | $T8 %]</option>
-       <option value="f"[% IF cp_gender == 'f' %] selected[% END %]>[% 'female' | $T8 %]</option>
-      </select>
-     </td>
-    </tr>
-    <tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Title' | $T8 %]</th>
-      <td>
-       <input id="cp_title" name="cp_title" size="40" maxlength="75" value="[% HTML.escape(cp_title) %]">&nbsp;
-       [%- INCLUDE generic/multibox.html
-             name       = 'selected_cp_title',
-             id         = 'selected_cp_title',
-             DATA       = MB_TITLES,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Department' | $T8 %]</th>
-      <td>
-       <input id="cp_abteilung" name="cp_abteilung" size="40" value="[% HTML.escape(cp_abteilung) %]">&nbsp;
-       [%- INCLUDE generic/multibox.html
-             name       = 'selected_cp_abteilung',
-             id         = 'selected_cp_abteilung',
-             DATA       = MB_DEPARTMENT,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Given Name' | $T8 %]</th>
-      <td><input id="cp_givenname" name="cp_givenname" size="40" maxlength="75" value="[% HTML.escape(cp_givenname) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Name' | $T8 %]</th>
-      <td><input id="cp_name" name="cp_name" size="40" maxlength="75" value="[% HTML.escape(cp_name) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Phone1' | $T8 %]</th>
-      <td><input id="cp_phone1" name="cp_phone1" size="40" maxlength="75" value="[% HTML.escape(cp_phone1) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Phone2' | $T8 %]</th>
-      <td><input id="cp_phone2" name="cp_phone2" size="40" maxlength="75" value="[% HTML.escape(cp_phone2) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Fax' | $T8 %]</th>
-      <td><input id="cp_fax" name="cp_fax" size="40" value="[% HTML.escape(cp_fax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Mobile1' | $T8 %]</th>
-      <td><input id="cp_mobile1" name="cp_mobile1" size="40" value="[% HTML.escape(cp_mobile1) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Mobile2' | $T8 %]</th>
-      <td><input id="cp_mobile2" name="cp_mobile2" size="40" value="[% HTML.escape(cp_mobile2) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Sat. Phone' | $T8 %]</th>
-      <td><input id="cp_satphone" name="cp_satphone" size="40" value="[% HTML.escape(cp_satphone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Sat. Fax' | $T8 %]</th>
-      <td><input id="cp_satfax" name="cp_satfax" size="40" value="[% HTML.escape(cp_satfax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Project' | $T8 %]</th>
-      <td><input id="cp_project" name="cp_project" size="40" value="[% HTML.escape(cp_project) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'E-mail' | $T8 %]</th>
-      <td><input id="cp_email" name="cp_email" size="40" value="[% HTML.escape(cp_email) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Private Phone' | $T8 %]</th>
-      <td><input id="cp_privatphone" name="cp_privatphone" size="40" value="[% HTML.escape(cp_privatphone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Private E-mail' | $T8 %]</th>
-      <td><input id="cp_privatemail" name="cp_privatemail" size="40" value="[% HTML.escape(cp_privatemail) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Birthday' | $T8 %]</th>
-      <td><input id="cp_birthday" name="cp_birthday" size="40" value="[% HTML.escape(cp_birthday) %]"></td>
-     </tr>
-
-     <tr>
-      <td colspan="2"><hr></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Bcc' | $T8 %]</th>
-      <td><input name="bcc" size="40" value="[% HTML.escape(bcc) %]"></td>
-     </tr>
-    </table>
-
-    <input type="submit" id="delete_contact" name="action" value="[% 'Delete Contact' | $T8 %]" disabled>
-    <br style="clear: left" />
+    [% INCLUDE 'ct/_contact.html' %]
    </div>
 
    <div id="deliveries" class="tabcontent">
     <table>
      <tr>
       <th align="right">[% 'Shipping Address' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'delivery_id',
-             id         = 'delivery_id',
-             DATA       = SHIPTO,
-             onChange   = "get_delivery(['shipto_id__' + this.value, 'from__' + from.value, 'to__' + to.value, 'id__' + cvid.value, 'db__' + db.value], ['delivery'])",
-             id_key     = 'shipto_id',
-             label_sub  = 'shipto_label',
-       -%]
+      <td colspan="3">
+       [% L.select_tag('delivery_id', L.options_for_select(SHIPTO_ALL, title_sub => \shipto_label, with_empty => 1),
+                       onchange => "\$('#delivery').load('ct.pl?action=get_delivery&id=' + \$('#cvid').attr('value') + '&db=' + \$('#db').attr('value') + '&shipto_id=' + this.value)") %]
       </td>
      </tr>
 
         <input name="FU_date" id="FU_date" value="[% HTML.escape(FU_date) %]" size="12">
         <input type="button" name="FU_date_button" id="FU_date_trigger" value="?">
         [% 'for' | $T8 %]
-        <select name="FU_created_for_user">
-         [%- FOREACH row = ALL_EMPLOYEES %]
-         <option value="[% HTML.escape(row.id) %]"[% IF (NOTE_id && (row.id == FU_created_for_user)) || (row.login == login) %] selected[% END %]>
-          [%- IF row.name %][%- HTML.escape(row.name) %] ([% HTML.escape(row.login) %])[% ELSE %][% HTML.escape(row.login) %][% END %]
-         </option>
-         [%- END %]
-        </select>
+        [% L.select_tag('FU_created_for_user', L.options_for_select(ALL_EMPLOYEES, default=(FU_created_for_user ? FU_created_for_user : USER.id), title='safe_name')) %]
        </td>
       </tr>
 
 
   </div>
 
-  <script type="text/javascript" src="js/jquery.js"></script>
   <script type="text/javascript">
    <!--
    function set_gender(gender) {
        s.selectedIndex = (gender == 'f') ? 1 : 0;
      }
    }
-
-   function on_contact_changed() {
-     get_contact(['cp_id__' + $('#cp_id').attr('value')],
-                 ['cp_name','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2',
-                  'cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact,set_gender]);
-     $('#selected_cp_title').attr('selectedIndex', 0);
-     $('#selected_cp_abteilung').attr('selectedIndex', 0);
-   }
   -->
 
   </script>