Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5b8e9fcb

Von Moritz Bunkus vor fast 11 Jahren hinzugefügt

  • ID 5b8e9fcb2f9c94d69519c927b8aa59184d93cea3
  • Vorgänger 3816bb51
  • Nachfolger 65f528cb

Lieferadressen-Drop-Downs in mehreren Masken sortiert anzeigen

Unterschiede anzeigen:

SL/DB/Manager/Shipto.pm
1
package SL::DB::Manager::Shipto;
2

  
3
use strict;
4

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

  
8
use SL::DB::Helper::Sorted;
9

  
10
sub object_class { 'SL::DB::Shipto' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
sub _sort_spec {
15
  return (
16
    default        => [ 'full_address', 1 ],
17
    columns        => {
18
      SIMPLE       => 'ALL',
19
      full_address => '( lower(shipto.shiptoname) || lower(shipto.shiptostreet) || lower(shipto.shiptocity) )',
20
      map { ( $_ => "lower(shipto.shipto$_)" ) } qw(city contact country department_1 department_2 email fax name phone street zipcode)
21
    });
22
}
23

  
24
1;
SL/DB/Shipto.pm
3 3
use strict;
4 4

  
5 5
use SL::DB::MetaSetup::Shipto;
6
use SL::DB::Manager::Shipto;
6 7
use Rose::DB::Object::Helpers qw(clone_and_reset clone);
7 8

  
8 9
our @SHIPTO_VARIABLES = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact
......
10 11

  
11 12
__PACKAGE__->meta->initialize;
12 13

  
13
__PACKAGE__->meta->make_manager_class;
14

  
15 14
sub displayable_id {
16 15
  my $self = shift;
17 16
  my $text = join('; ', grep { $_ } (map({ $self->$_ } qw(shiptoname shiptostreet)),
bin/mozilla/do.pl
273 273

  
274 274
  $::form->{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
275 275
  $::form->{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
276
  $::form->{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
276
  $::form->{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all_sorted(query => [
277 277
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
278 278
  ]);
279 279
  $::form->{ALL_CONTACTS}          = SL::DB::Manager::Contact->get_all_sorted(query => [
bin/mozilla/is.pl
319 319

  
320 320
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
321 321
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
322
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
322
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all_sorted(query => [
323 323
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
324 324
  ]);
325 325
  $TMPL_VAR{ALL_CONTACTS}          = SL::DB::Manager::Contact->get_all_sorted(query => [
bin/mozilla/oe.pl
345 345
  my $employee_list_query_gen      = sub { $::form->{$_[0]} ? [ or => [ id => $::form->{$_[0]}, deleted => 0 ] ] : [ deleted => 0 ] };
346 346
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => $employee_list_query_gen->('employee_id'));
347 347
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => $employee_list_query_gen->('salesman_id'));
348
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all(query => [
348
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all_sorted(query => [
349 349
    or => [ trans_id  => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
350 350
  ]);
351 351
  $TMPL_VAR{ALL_CONTACTS}          = SL::DB::Manager::Contact->get_all_sorted(query => [

Auch abrufbar als: Unified diff