Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8af39a65

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID 8af39a65f18765dc26b93a8b25bfdd21dad5812c
  • Vorgänger 8dd087bf
  • Nachfolger 8516ea3a

Datenbankabfrage mit leerem Feld für employee_id vermeiden

Fixt #2055.

Unterschiede anzeigen:

bin/mozilla/oe.pl
341 341
                   "price_factors" => "ALL_PRICE_FACTORS");
342 342

  
343 343
  # label subs
344
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
345
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
344
  my $employee_list_query_gen      = sub { $::form->{$_[0]} ? [ or => [ id => $::form->{$_[0]}, deleted => 0 ] ] : [ deleted => 0 ] };
345
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all(query => $employee_list_query_gen->('employee_id'));
346
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all(query => $employee_list_query_gen->('salesman_id'));
346 347
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
347 348
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
348 349
  ]);

Auch abrufbar als: Unified diff