Revision a65c8e99
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
bin/mozilla/ct.pl | ||
---|---|---|
298 | 298 |
join('; ', grep { $_ } map { $s->{"shipto$_"} } qw(name department_1 street city)) || ' ' |
299 | 299 |
} |
300 | 300 |
|
301 |
sub _contacts_label { |
|
302 |
join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname}; |
|
303 |
} |
|
304 |
|
|
301 | 305 |
sub form_header { |
302 | 306 |
$main::lxdebug->enter_sub(); |
303 | 307 |
|
... | ... | |
319 | 323 |
$form->{is_customer} = $form->{db} eq 'customer'; |
320 | 324 |
$form->{salesman_label} = sub { $_[0]->{name} ne "" ? $_[0]->{name} : $_[0]->{login} }; |
321 | 325 |
$form->{shipto_label} = \&_shipto_label; |
322 |
$form->{contacts_label} = sub { join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname} };
|
|
326 |
$form->{contacts_label} = \&_contacts_label;
|
|
323 | 327 |
$form->{taxzone_id} = 0 if !$form->{id}; |
324 | 328 |
$form->{jsscript} = 1; |
325 | 329 |
$form->{fokus} = "ct.greeting"; |
326 |
$form->{AJAX} = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(contact delivery) ) ];
|
|
330 |
$form->{AJAX} = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(delivery) ) ]; |
|
327 | 331 |
$form->{SHIPTO_ALL} = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ]; |
328 | 332 |
|
329 |
unshift @{ $form->{CONTACTS} }, +{ cp_id => '0', cp_name => $locale->text('New contact') }; |
|
330 |
|
|
331 | 333 |
$form->{title} = $form->{title_save} |
332 | 334 |
|| $locale->text("$form->{title} " . ucfirst $form->{db}) . ($form->{title} eq "Edit" ? " $form->{name}" : ''); |
333 | 335 |
|
334 | 336 |
CT->query_titles_and_greetings(\%myconfig, \%$form); |
335 |
map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(TITLES GREETINGS COMPANY_GREETINGS DEPARTMENT);
|
|
337 |
map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(COMPANY_GREETINGS);
|
|
336 | 338 |
|
337 | 339 |
$form->{NOTES} ||= [ ]; |
338 | 340 |
|
... | ... | |
651 | 653 |
|
652 | 654 |
$main::auth->assert('customer_vendor_edit'); |
653 | 655 |
|
654 |
my $form = $main::form; |
|
655 |
my %myconfig = %main::myconfig; |
|
656 |
CT->populate_drop_down_boxes(\%::myconfig, $::form); |
|
657 |
CT->query_titles_and_greetings(\%::myconfig, $::form); |
|
658 |
CT->get_contact(\%::myconfig, $::form) if $::form->{cp_id}; |
|
656 | 659 |
|
657 |
CT->get_contact(\%myconfig, \%$form); |
|
658 |
print $form->ajax_response_header(), join '__pjx__', map $form->{"cp_$_"}, |
|
659 |
qw(name title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday used gender); |
|
660 |
$main::lxdebug->leave_sub(); |
|
660 |
$::form->{contacts_label} = \&_contacts_label; |
|
661 | 661 |
|
662 |
print $::form->ajax_response_header(), $::form->parse_html_template('ct/_contact'); |
|
663 |
|
|
664 |
$main::lxdebug->leave_sub(); |
|
662 | 665 |
} |
663 | 666 |
|
664 | 667 |
sub get_shipto { |
Auch abrufbar als: Unified diff
Ansprechpersonentab mit jQuery & AJAX neu laden lassen, nicht via CGI::AJAX