Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1521c33d

Von Sven Schöling vor mehr als 14 Jahren hinzugefügt

  • ID 1521c33d91f45cfaecfda6258f66a4efff4cfc71
  • Vorgänger 53d06080
  • Nachfolger 3cc77e53

check_name erweitert um ein no_select flag. siehe perldoc bin/mozilla/arap.pl

Conflicts:

bin/mozilla/arap.pl

Unterschiede anzeigen:

bin/mozilla/arap.pl
59 59
                'request_quotation_edit       | sales_quotation_edit      | purchase_order_edit | cash         |' .
60 60
                'purchase_delivery_order_edit | sales_delivery_order_edit');
61 61

  
62
  my ($name) = @_;
62
  my ($name, %params) = @_;
63 63

  
64 64
  $name = $name eq "customer" ? "customer" : "vendor";
65 65

  
......
99 99
      $form->{calctax}      = 1;
100 100

  
101 101
      # return one name or a list of names in $form->{name_list}
102
      if (($i = $form->get_name(\%myconfig, $name)) > 1) {
103
        &select_name($name);
104
        exit;
102
      $i = $form->get_name(\%myconfig, $name);
103

  
104
      if ($i > 1) {
105
        if ($params{no_select}) {
106
          # $locale->text('Customer')
107
          # $locale->text('Vendor')
108
          $form->error($locale->text("More than one #1 found matching, please be more specific.", $locale->text(ucfirst $name)));
109
        } else {
110
          &select_name($name);
111
          exit;
112
        }
105 113
      }
106 114

  
107 115
      if ($i == 1) {
......
486 494

  
487 495
sub continue       { call_sub($main::form->{"nextsub"}); }
488 496

  
489

  
490 497
1;
491 498

  
492 499
__END__
493 500

  
494 501
=head1 NAME
495 502

  
503
<<<<<<< HEAD:bin/mozilla/arap.pl
496 504
bin/mozilla/arap.pl - helper routines for invoiceing frontend.
497 505

  
498 506
=head1 SYNOPSIS
......
502 510
=head1 DESCRIPTION
503 511

  
504 512
nothing yet
513
=======
514
arap.pl - helper functions or customer/vendor retrieval
515

  
516
=head1 SYNOPSIS
517

  
518
 check_name('vendor')
519
 check_project();
520

  
521
=head1 DESCRIPTION
522

  
523
Don't use anyting in this file without extreme care, and even then be prepared for massive headaches.
524

  
525
It's a collection of helper routines that wrap the customer/vendor dropdown/textfield duality into something even complexer.
526
>>>>>>> 88f5a78... check_name erweitert um ein no_select flag. siehe perldoc bin/mozilla/arap.pl:bin/mozilla/arap.pl
505 527

  
506 528
=head1 FUNCTIONS
507 529

  
508 530
=head2 check_name customer|vendor
509 531

  
532
<<<<<<< HEAD:bin/mozilla/arap.pl
510 533
check_name was originally meant to update the selected customer or vendor. The
511 534
way it does that has generted more hate than almost any other part of this
512 535
software.
......
593 616

  
594 617
Since get_customer and get_vendor clobber a lot of fields, make sure what
595 618
changes exactly.
619
=======
620
This function will take the contents of $form->{vendor} or $form->{customer}, try to guess if there was a selectbox or not, and search for matching customer/vendors.
621

  
622
This mostly works great, except for the case when there is more than one match.
623
In that case check_name will display a select form, that will redirect to the
624
original C<nextsub>. Unfortunately any hidden vars or input fields will be lost
625
in the process unless saved before in a callback.
626

  
627
If you still want to use it, you can disable this feature, like this:
628

  
629
  check_name('customer', no_select => 1)
630

  
631
In that case multiple matches will trigger an error.
632

  
633
=head1 BUGS
634

  
635
=head1 AUTHOR
636
>>>>>>> 88f5a78... check_name erweitert um ein no_select flag. siehe perldoc bin/mozilla/arap.pl:bin/mozilla/arap.pl
596 637

  
597 638
=cut

Auch abrufbar als: Unified diff