Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a65c8e99

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID a65c8e991906fc1ad47af84decc066672348ce1b
  • Vorgänger b1d38913
  • Nachfolger 59486b32

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

Unterschiede anzeigen:

bin/mozilla/ct.pl
join('; ', grep { $_ } map { $s->{"shipto$_"} } qw(name department_1 street city)) || ' '
}
sub _contacts_label {
join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname};
}
sub form_header {
$main::lxdebug->enter_sub();
......
$form->{is_customer} = $form->{db} eq 'customer';
$form->{salesman_label} = sub { $_[0]->{name} ne "" ? $_[0]->{name} : $_[0]->{login} };
$form->{shipto_label} = \&_shipto_label;
$form->{contacts_label} = sub { join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname} };
$form->{contacts_label} = \&_contacts_label;
$form->{taxzone_id} = 0 if !$form->{id};
$form->{jsscript} = 1;
$form->{fokus} = "ct.greeting";
$form->{AJAX} = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(contact delivery) ) ];
$form->{AJAX} = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(delivery) ) ];
$form->{SHIPTO_ALL} = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ];
unshift @{ $form->{CONTACTS} }, +{ cp_id => '0', cp_name => $locale->text('New contact') };
$form->{title} = $form->{title_save}
|| $locale->text("$form->{title} " . ucfirst $form->{db}) . ($form->{title} eq "Edit" ? " $form->{name}" : '');
CT->query_titles_and_greetings(\%myconfig, \%$form);
map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(TITLES GREETINGS COMPANY_GREETINGS DEPARTMENT);
map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(COMPANY_GREETINGS);
$form->{NOTES} ||= [ ];
......
$main::auth->assert('customer_vendor_edit');
my $form = $main::form;
my %myconfig = %main::myconfig;
CT->populate_drop_down_boxes(\%::myconfig, $::form);
CT->query_titles_and_greetings(\%::myconfig, $::form);
CT->get_contact(\%::myconfig, $::form) if $::form->{cp_id};
CT->get_contact(\%myconfig, \%$form);
print $form->ajax_response_header(), join '__pjx__', map $form->{"cp_$_"},
qw(name title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday used gender);
$main::lxdebug->leave_sub();
$::form->{contacts_label} = \&_contacts_label;
print $::form->ajax_response_header(), $::form->parse_html_template('ct/_contact');
$main::lxdebug->leave_sub();
}
sub get_shipto {

Auch abrufbar als: Unified diff