Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d66df20d

Von Sven Schöling vor fast 17 Jahren hinzugefügt

  • ID d66df20dae09592c6326d8376be0816caa30542d
  • Vorgänger f2860992
  • Nachfolger fcc318eb

Kleine Code Kosmetik.
Ausserdem Aufruf von CGI::Ajax so geaendert, dass die Ajax Javascript Routinen nur einmal generiert werden.

Unterschiede anzeigen:

bin/mozilla/ct.pl
36 36
# $locale->text('Vendors')
37 37
# $locale->text('Add Customer')
38 38
# $locale->text('Add Vendor')
39
# $locale->text('Edit Customer')
40
# $locale->text('Edit Vendor')
41
# $locale->text('Customer saved!')
42
# $locale->text('Vendor saved!')
43
# $locale->text('Customer deleted!')
44
# $locale->text('Cannot delete customer!')
45
# $locale->text('Vendor deleted!')
46
# $locale->text('Cannot delete vendor!')
39 47

  
40 48
use CGI::Ajax;
41 49
use POSIX qw(strftime);
......
232 240
  $form->{javascript} = qq|<script type=text/javascript src=js/show_history.js></script>|;
233 241
  #/show hhistory button
234 242
  
235
  # $locale->text('Edit Customer')
236
  # $locale->text('Edit Vendor')
237

  
238 243
  CT->get_tuple(\%myconfig, \%$form);
239 244
  CT->populate_drop_down_boxes(\%myconfig, \%$form);
240 245

  
......
271 276
  $form->{taxzone_id}     = 0                                                               if !$form->{id};
272 277
  $form->{jsscript}       = 1;
273 278
  $form->{fokus}          = "ct.greeting";
279
  $form->{AJAX}           = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(shipto contact delivery) ) ];
274 280

  
275 281
  unshift @{ $form->{SHIPTO} },   +{ shipto_id => '0', shiptoname => '' }, +{ shipto_id => '0', shiptoname => 'Alle' };
276 282
  unshift @{ $form->{CONTACTS} }, +{ cp_id     => '0', cp_name => $locale->text('New contact') };
277 283

  
278
  push @{ $form->{AJAX} }, map { 
279
    new CGI::Ajax( "get_$_" => "$form->{script}?action=get_$_" ) 
280
  } qw(shipto contact delivery);
281

  
282 284
  $form->{title} = $form->{title_save} 
283 285
                || $locale->text("$form->{title} " . ucfirst $form->{db}) . ($form->{title} eq "Edit" ? " $form->{name}" : '');
284 286

  
285
## LINET: Create a drop-down box with all prior titles and greetings.
286 287
  CT->query_titles_and_greetings(\%myconfig, \%$form);
287 288
  map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(TITLES GREETINGS COMPANY_GREETINGS DEPARTMENT);
288
## /LINET
289 289

  
290 290
  $form->{NOTES} ||= [ ];
291 291

  
......
454 454

  
455 455
  $auth->assert('customer_vendor_edit');
456 456

  
457
  # $locale->text('Customer saved!')
458
  # $locale->text('Vendor saved!')
459

  
460 457
  $msg = ucfirst $form->{db};
461 458
  $imsg .= " saved!";
462 459

  
......
486 483

  
487 484
  $auth->assert('customer_vendor_edit');
488 485

  
489
  # $locale->text('Customer saved!')
490
  # $locale->text('Vendor saved!')
491

  
492 486
  $msg = ucfirst $form->{db};
493 487
  $imsg .= " saved!";
494 488

  
......
525 519

  
526 520
  $auth->assert('customer_vendor_edit');
527 521

  
528
  # $locale->text('Customer deleted!')
529
  # $locale->text('Cannot delete customer!')
530
  # $locale->text('Vendor deleted!')
531
  # $locale->text('Cannot delete vendor!')
532

  
533 522
  CT->delete(\%myconfig, \%$form);
534 523

  
535 524
  $msg = ucfirst $form->{db};
......
575 564
  $auth->assert('customer_vendor_edit');
576 565

  
577 566
  CT->get_contact(\%myconfig, \%$form);
578

  
579 567
  print $cgi->header(), join '__pjx__', map $form->{"cp_$_"}, 
580 568
    qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday);
581 569
  $lxdebug->leave_sub();
......
588 576
  $auth->assert('customer_vendor_edit');
589 577

  
590 578
  CT->get_shipto(\%myconfig, \%$form);
591

  
592 579
  print $cgi->header(),  join '__pjx__', map $form->{"shipto$_"},
593 580
    qw(name department_1 department_2 street zipcode city country contact phone fax email);
594 581
  $lxdebug->leave_sub();

Auch abrufbar als: Unified diff