Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b1d38913

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID b1d38913571c810a6e09fa2f756e8dd17b35a25a
  • Vorgänger 5aaa3c62
  • Nachfolger a65c8e99

Lieferadressentab mit jQuery & AJAX neu laden lassen, nicht via CGI::AJAX

Unterschiede anzeigen:

bin/mozilla/ct.pl
293 293
  $main::lxdebug->leave_sub();
294 294
}
295 295

  
296
sub _shipto_label {
297
  my $s = shift(@_);
298
  join('; ', grep { $_ } map { $s->{"shipto$_"} } qw(name department_1 street city)) || ' '
299
}
300

  
296 301
sub form_header {
297 302
  $main::lxdebug->enter_sub();
298 303

  
......
313 318
  $form->{is_admin}       = $myconfig{role} eq 'admin';
314 319
  $form->{is_customer}    = $form->{db}     eq 'customer';
315 320
  $form->{salesman_label} = sub { $_[0]->{name} ne "" ? $_[0]->{name} : $_[0]->{login} };
316
  $form->{shipto_label}   = sub { my $s = shift(@_); join('; ', grep { $_ } map { $s->{"shipto$_"} } qw(name department_1 street city)) || ' ' };
321
  $form->{shipto_label}   = \&_shipto_label;
317 322
  $form->{contacts_label} = sub { join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname} };
318 323
  $form->{taxzone_id}     = 0                                                               if !$form->{id};
319 324
  $form->{jsscript}       = 1;
320 325
  $form->{fokus}          = "ct.greeting";
321
  $form->{AJAX}           = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(shipto contact delivery) ) ];
326
  $form->{AJAX}           = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(contact delivery) ) ];
327
  $form->{SHIPTO_ALL}     = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ];
322 328

  
323
  unshift @{ $form->{SHIPTO} },   +{ shipto_id => '0', shiptoname => '' }, +{ shipto_id => '0', shiptoname => 'Alle' };
324 329
  unshift @{ $form->{CONTACTS} }, +{ cp_id     => '0', cp_name => $locale->text('New contact') };
325 330

  
326 331
  $form->{title} = $form->{title_save}
......
661 666

  
662 667
  $main::auth->assert('customer_vendor_edit');
663 668

  
664
  my $form     = $main::form;
665
  my %myconfig = %main::myconfig;
669
  CT->populate_drop_down_boxes(\%::myconfig, $::form);
670
  CT->get_shipto(\%::myconfig, $::form) if $::form->{shipto_id};
666 671

  
667
  CT->get_shipto(\%myconfig, \%$form);
668
  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)));
669
  $main::lxdebug->leave_sub();
672
  $::form->{shipto_label} = \&_shipto_label;
670 673

  
674
  print $::form->ajax_response_header(), $::form->parse_html_template('ct/_shipto');
675

  
676
  $main::lxdebug->leave_sub();
671 677
}
672 678

  
673 679
sub get_delivery {

Auch abrufbar als: Unified diff