Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / customer_vendor / tabs / contacts.html
index 630a607..90793f4 100644 (file)
@@ -6,7 +6,7 @@
 <div id="contacts">
   <table>
     <tr>
-      <th align="left">[% 'Contacts' | $T8 %]</th>
+      <th align="right">[% 'Contacts' | $T8 %]</th>
 
       <td>
         [%
             empty_title = LxERP.t8('New contact'),
             value_key = 'cp_id',
             title_key = 'full_name',
-            onchange = "kivi.CustomerVendor.selectContact({onFormSet: function(){ contactsMapWidget.testInputs(); local_reinit_widgets(); }});",
+            onchange = "kivi.CustomerVendor.selectContact({onFormSet: function(){ contactsMapWidget.testInputs(); kivi.reinit_widgets(); }});",
           )
         %]
       </td>
     </tr>
-
     <tr>
-      <th align="left" nowrap>[% 'Gender' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Main Contact Person' | $T8 %]</th>
+      <td>[% L.yes_no_tag('contact.cp_main', SELF.contact.cp_main) %]</td>
+    </tr>
+    <tr>
+      <th align="right" nowrap>[% 'Gender' | $T8 %]</th>
 
       <td>
         [%
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Title' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Title' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('contact.cp_title', SELF.contact.cp_title, size = 40) %]
-        [% L.select_tag('contact_cp_title_select', SELF.all_titles, with_empty = 1, onchange = '$("#contact_cp_title").val(this.value);') %]
+        [%- IF INSTANCE_CONF.get_contact_titles_use_textfield -%]
+          [% L.input_tag('contact.cp_title', SELF.contact.cp_title, size = 40) %]
+          [% L.select_tag('contact_cp_title_select', SELF.all_contact_titles, default = SELF.contact.cp_title, value_key = 'description', title_key = 'description', with_empty = 1, onchange = '$("#contact_cp_title").val(this.value);') %]
+        [%- ELSE -%]
+          [% L.select_tag('contact.cp_title', SELF.all_contact_titles, default = SELF.contact.cp_title, value_key = 'description', title_key = 'description', with_empty = 1) %]
+        [%- END -%]
       </td>
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Department' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Department' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('contact.cp_abteilung', SELF.contact.cp_abteilung, size = 40) %]
-        [% L.select_tag('contact_cp_abteilung_select', SELF.all_departments, default = SELF.contact.cp_abteilung,  with_empty = 1, onchange = '$("#contact_cp_abteilung").val(this.value);') %]
+        [%- IF INSTANCE_CONF.get_contact_departments_use_textfield -%]
+          [% L.input_tag('contact.cp_abteilung', SELF.contact.cp_abteilung, size = 40) %]
+          [% L.select_tag('contact_cp_abteilung_select', SELF.all_contact_departments, default = SELF.contact.cp_abteilung, value_key = 'description', title_key = 'description', with_empty = 1, onchange = '$("#contact_cp_abteilung").val(this.value);') %]
+        [%- ELSE -%]
+          [% L.select_tag('contact.cp_abteilung', SELF.all_contact_departments, default = SELF.contact.cp_abteilung, value_key = 'description', title_key = 'description', with_empty = 1) %]
+        [%- END -%]
       </td>
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Function/position' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Function/position' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_position', SELF.contact.cp_position, size = 40) %]
@@ -65,7 +76,7 @@
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Given Name' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Given Name' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_givenname', SELF.contact.cp_givenname, size = 40) %]
@@ -73,7 +84,7 @@
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Name' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Surname' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_name', SELF.contact.cp_name, size = 40) %]
@@ -81,7 +92,7 @@
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'E-mail' | $T8 %]</th>
+      <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_email', SELF.contact.cp_email, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Phone1' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Phone1' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_phone1', SELF.contact.cp_phone1, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Phone2' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Phone2' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_phone2', SELF.contact.cp_phone2, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Fax' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_fax', SELF.contact.cp_fax, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Mobile1' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Mobile1' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_mobile1', SELF.contact.cp_mobile1, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Mobile2' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Mobile2' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_mobile2', SELF.contact.cp_mobile2, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Sat. Phone' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Sat. Phone' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_satphone', SELF.contact.cp_satphone, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Sat. Fax' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Sat. Fax' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_satfax', SELF.contact.cp_satfax, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Project' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Project' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_project', SELF.contact.cp_project, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Street' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Street' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_street', SELF.contact.cp_street, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Zip, City' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Zip, City' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_zipcode', SELF.contact.cp_zipcode, size = 5) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Private Phone' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Private Phone' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_privatphone', SELF.contact.cp_privatphone, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Private E-mail' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Private E-mail' | $T8 %]</th>
 
       <td>
         [% L.input_tag('contact.cp_privatemail', SELF.contact.cp_privatemail, size = 40) %]
     </tr>
 
     <tr>
-      <th align="left" nowrap>[% 'Birthday' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Birthday' | $T8 %]</th>
 
       <td>
         [% L.date_tag('contact.cp_birthday', SELF.contact.cp_birthday) %]
 
       [% FOREACH var = contact_cvars %]
         <tr>
-          <th align="left" valign="top" nowrap>[% var.config.description | html %]</th>
+          <th align="right" valign="top" nowrap>[% var.config.description | html %]</th>
 
           <td valign="top">
             [% INCLUDE 'common/render_cvar_input.html'
 
   </table>
 
-  [% L.button_tag('submitInputButton(this);', LxERP.t8('Delete Contact'), name = 'action_delete_contact', class = 'submit') %]
+  [% L.button_tag('submitInputButton("delete_contact");', LxERP.t8('Delete Contact'), id = 'action_delete_contact', class = 'submit') %]
   [% IF ( !SELF.contact.cp_id ) %]
     <script type="text/javascript">
       $('#action_delete_contact').hide();