From: Moritz Bunkus Date: Fri, 31 Jan 2014 14:41:51 +0000 (+0100) Subject: Ansprechpersonen-Drop-Downs in mehreren Masken sortiert anzeigen X-Git-Tag: release-3.1.0rc1~36 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3816bb5160e9ccc0652082434f2d3f07b9ea7cb1;p=kivitendo-erp.git Ansprechpersonen-Drop-Downs in mehreren Masken sortiert anzeigen --- diff --git a/SL/DB/Contact.pm b/SL/DB/Contact.pm index 565566a19..81b743f8b 100644 --- a/SL/DB/Contact.pm +++ b/SL/DB/Contact.pm @@ -1,19 +1,14 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - package SL::DB::Contact; use strict; use SL::DB::MetaSetup::Contact; +use SL::DB::Manager::Contact; use SL::DB::Helper::CustomVariables ( module => 'Contacts', cvars_alias => 1, ); -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - __PACKAGE__->meta->initialize; sub used { diff --git a/SL/DB/Manager/Contact.pm b/SL/DB/Manager/Contact.pm new file mode 100644 index 000000000..6761eca2b --- /dev/null +++ b/SL/DB/Manager/Contact.pm @@ -0,0 +1,24 @@ +package SL::DB::Manager::Contact; + +use strict; + +use SL::DB::Helper::Manager; +use base qw(SL::DB::Helper::Manager); + +use SL::DB::Helper::Sorted; + +sub object_class { 'SL::DB::Contact' } + +__PACKAGE__->make_manager_methods; + +sub _sort_spec { + return ( + default => [ 'full_name', 1 ], + columns => { + SIMPLE => 'ALL', + full_name => [ 'lower(contacts.cp_name)', 'lower(contacts.cp_givenname)', ], + map { ( $_ => "lower(contacts.cp_$_)" ) } qw(abteilung city email fax givenname mobile1 mobile2 name phone1 phone2 position privatemail privatphone project satfax satphone street title zipcode) + }); +} + +1; diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 400df9e50..a804dee7a 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -276,7 +276,7 @@ sub form_header { $::form->{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [ or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ] ]); - $::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + $::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(query => [ or => [ cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, and => [ diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index db7b8e178..2666efd34 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -270,7 +270,7 @@ sub form_header { "price_factors" => "ALL_PRICE_FACTORS"); $TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]); - $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(query => [ or => [ cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, and => [ diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index aa6a4bebe..b13de83de 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -322,7 +322,7 @@ sub form_header { $TMPL_VAR{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [ or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ] ]); - $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(query => [ or => [ cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, and => [ diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 1bc88d382..71748b36d 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -348,7 +348,7 @@ sub form_header { $TMPL_VAR{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [ or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ] ]); - $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(query => [ or => [ cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, and => [