Bei Wechsel Ansprechpartner Drop-Down-Boxen für Titel/Abteilung zurücksetzen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 5 Mar 2010 10:08:15 +0000 (11:08 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 5 Mar 2010 10:08:15 +0000 (11:08 +0100)
Fix für Bug 1311.

bin/mozilla/ct.pl
templates/webpages/ct/form_header_de.html
templates/webpages/ct/form_header_master.html

index 7fe6afa..9488ec8 100644 (file)
@@ -654,8 +654,7 @@ sub get_shipto {
   my %myconfig = %main::myconfig;
 
   CT->get_shipto(\%myconfig, \%$form);
-  print $form->ajax_response_header(),  join '__pjx__', map $form->{"shipto$_"},
-    qw(name department_1 department_2 street zipcode city country contact phone fax email used);
+  print $form->ajax_response_header(), join('__pjx__', map($form->{"shipto$_"}, qw(name department_1 department_2 street zipcode city country contact phone fax email used)));
   $main::lxdebug->leave_sub();
 
 }
index 2cf95ad..42b36e5 100644 (file)
              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>
-
-
-
index 4c2db99..1908225 100644 (file)
              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>
-
-
-