Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d139dd31

Von Moritz Bunkus vor fast 11 Jahren hinzugefügt

  • ID d139dd31791627953f82749d02702bcb8308ebea
  • Vorgänger 579920a7
  • Nachfolger 3816bb51

Verkäufer-/Bearbeiter-Drop-Downs in mehreren Masken sortiert anzeigen

Unterschiede anzeigen:

SL/DB/Manager/Employee.pm
3 3
use strict;
4 4

  
5 5
use SL::DB::Helper::Manager;
6
use SL::DB::Helper::Sorted;
6 7
use base qw(SL::DB::Helper::Manager);
7 8

  
8 9
sub object_class { 'SL::DB::Employee' }
9 10

  
10 11
__PACKAGE__->make_manager_methods;
11 12

  
13
sub _sort_spec {
14
  (
15
    default  => [ 'name', 1 ],
16
    columns  => {
17
      SIMPLE => 'ALL',
18
      map { +($_ => "lower(employee.$_)") } qw(deleted_email deleted_fax deleted_signature deleted_tel login name)
19
    },
20
  );
21
}
22

  
12 23
sub current {
13 24
  return undef unless $::form && $::form->{login};
14 25
  return shift->find_by(login => $::form->{login});
bin/mozilla/ar.pl
847 847
                   "departments"    => "ALL_DEPARTMENTS",
848 848
                   "customers"      => "ALL_VC",
849 849
                   "business_types" => "ALL_BUSINESS_TYPES");
850
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
850
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
851 851
  $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
852 852

  
853 853
  # constants and subs for template
bin/mozilla/dn.pl
298 298

  
299 299
  $form->get_lists("customers"   => "ALL_CUSTOMERS",
300 300
                   "departments" => "ALL_DEPARTMENTS");
301
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
301
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
302 302

  
303 303
  DN->get_config(\%myconfig, \%$form);
304 304

  
bin/mozilla/do.pl
271 271
                   "business_types" => "ALL_BUSINESS_TYPES",
272 272
    );
273 273

  
274
  $::form->{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
275
  $::form->{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
274
  $::form->{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
275
  $::form->{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
276 276
  $::form->{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
277 277
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
278 278
  ]);
......
466 466
                                       "all" => 1 },
467 467
                   "departments"  => "ALL_DEPARTMENTS",
468 468
                   "$form->{vc}s" => "ALL_VC");
469
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
469
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
470 470

  
471 471
  $form->{SHOW_VC_DROP_DOWN} =  $myconfig{vclimit} > scalar @{ $form->{ALL_VC} };
472 472
  $form->{title}             = $locale->text('Delivery Orders');
bin/mozilla/fu.pl
403 403

  
404 404
  my $access = FU->retrieve_access_rights();
405 405

  
406
  $form->{EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
406
  $form->{EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
407 407

  
408 408
  map { $_->{access} = $access->{$_->{id}} } @{ $form->{EMPLOYEES} };
409 409

  
bin/mozilla/gl.pl
218 218
  $::form->get_lists(
219 219
    projects  => { key => "ALL_PROJECTS", all => 1 },
220 220
  );
221
  $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
221
  $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
222 222

  
223 223
  $::form->header;
224 224
  print $::form->parse_html_template('gl/search', {
bin/mozilla/ir.pl
269 269
                   "departments"   => "all_departments",
270 270
                   "price_factors" => "ALL_PRICE_FACTORS");
271 271

  
272
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
272
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
273 273
  $TMPL_VAR{ALL_CONTACTS}          = SL::DB::Manager::Contact->get_all(query => [
274 274
    or => [
275 275
      cp_cv_id => $::form->{"$::form->{vc}_id"} * 1,
bin/mozilla/is.pl
317 317
                   "departments"   => "all_departments",
318 318
                   "price_factors" => "ALL_PRICE_FACTORS");
319 319

  
320
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
321
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
320
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
321
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
322 322
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
323 323
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
324 324
  ]);
bin/mozilla/oe.pl
343 343

  
344 344
  # label subs
345 345
  my $employee_list_query_gen      = sub { $::form->{$_[0]} ? [ or => [ id => $::form->{$_[0]}, deleted => 0 ] ] : [ deleted => 0 ] };
346
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all(query => $employee_list_query_gen->('employee_id'));
347
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all(query => $employee_list_query_gen->('salesman_id'));
346
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => $employee_list_query_gen->('employee_id'));
347
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => $employee_list_query_gen->('salesman_id'));
348 348
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
349 349
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
350 350
  ]);
......
728 728
                   "$form->{vc}s" => "ALL_VC",
729 729
                   "taxzones"     => "ALL_TAXZONES",
730 730
                   "business_types" => "ALL_BUSINESS_TYPES",);
731
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
731
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
732 732

  
733 733
  # constants and subs for template
734 734
  $form->{vc_keys}         = sub { "$_[0]->{name}--$_[0]->{id}" };

Auch abrufbar als: Unified diff