]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Ansprechpersonen-Drop-Downs in mehreren Masken sortiert anzeigen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 31 Jan 2014 14:41:51 +0000 (15:41 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 31 Jan 2014 14:41:51 +0000 (15:41 +0100)
SL/DB/Contact.pm
SL/DB/Manager/Contact.pm [new file with mode: 0644]
bin/mozilla/do.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl

index 565566a19c57c1369987c92f63ca2e8709d3d674..81b743f8b926e57322b77a9d925c8b61045db450 100644 (file)
@@ -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 (file)
index 0000000..6761eca
--- /dev/null
@@ -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;
index 400df9e50996e901de89e0ba69c90f04e121e710..a804dee7afba352c57b298aea4ceb0b758ca03f1 100644 (file)
@@ -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      => [
index db7b8e1781c528df04d2f909da7543e24838c94c..2666efd342343ee4fa797136ba0a93b28359ccfd 100644 (file)
@@ -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      => [
index aa6a4bebeecaa74554f6ea6e832d0e6fa9189a82..b13de83de9b5775d7c3cb71b0a7af7113ba0e6e5 100644 (file)
@@ -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      => [
index 1bc88d38281ff3166d946d92faf48b82d25fe6f7..71748b36dc81f44424a416c459d6ab8a40f4cad9 100644 (file)
@@ -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      => [