Merge branch 'master' of ssh://lx-office/~/lx-office-erp
[kivitendo-erp.git] / templates / webpages / ct / form_header_de.html
index a435449..8d885dc 100644 (file)
@@ -1,4 +1,5 @@
-[% USE HTML %][% USE LxERP %]<body onLoad="fokus()">
+[% USE HTML %][% USE LxERP %]
+<body onLoad="fokus()">
 
  <div class="listtop">[% title %]</div>
 
 
     <table width="100%">
      <tr height="5"></tr>
+     [% IF conf_vertreter %]
+      <tr>
+       <th align="right">[% IF is_customer %]Kundentyp[%- ELSE %]Lieferantentyp[%- END %]</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'business',
+              DATA       = all_business,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      </tr>
+      <tr>
+       <th align="right">Vertreter</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name      = 'salesman_id',
+              DATA      = ALL_SALESMAN_CUSTOMERS,
+              id_key    = 'id',
+              label_key = 'name',
+        -%]
+       </td>
+      </tr>
+     [%- END %]
      <tr>
       [%- IF is_customer %]
       <th align="right" nowrap>Kundennummer</th>
@@ -46,7 +72,7 @@
      </tr>
 
      <tr>
-      <th align="right" nowrap>Firmenname</th>
+      <th align="right" nowrap>[% IF is_customer %]Kundenname[%- ELSE %]Lieferantenname[%- END %]</th>
       <td><input name="name" size="35" maxlength="75" value="[% HTML.escape(name) %]"></td>
      </tr>
 
       <td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
      </tr>
 
+     [%- IF conf_vertreter %]
+      <tr>
+       <th align="right">Benutzername</th>
+       <td><input name="username" maxlength="50" value="[% HTML.escape(username) %]"></td>
+       <th align="right">Passwort</th>
+       <td><input name="user_password" value="[% HTML.escape(user_password) %]"></td>
+      </tr>
+     [%- END %]
+
      <tr>
-      <th align="right">Kunden-/Lieferantentyp</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'business',
-             DATA       = all_business,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
+      [% UNLESS conf_vertreter %]
+       <th align="right">[% IF is_customer %]Kundentyp[% ELSE %]Lieferantentyp[%- END %]</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'business',
+              DATA       = all_business,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      [%- END %]
       <th align="right">Sprache</th>
       <td>
        [%- INCLUDE generic/multibox.html
              label_key  = 'description',
        -%]
       </td>
-      [%- IF is_customer %]
+      [%- IF is_customer && !conf_vertreter %]
       <th align="right">Verkäufer/in</th>
       <td>
        [%- INCLUDE generic/multibox.html
              name       = 'cp_id',
              id         = 'cp_id',
              DATA       = CONTACTS,
-             onChange   = "get_contact(['cp_id__'+this.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])",
+             onChange   = "on_contact_changed()",
              id_key     = 'cp_id',
              label_sub  = 'contacts_label',
        -%]
        <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',
        <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',
 
   </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>
-
-
-