-# 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 {
--- /dev/null
+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;
$::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 => [
"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 => [
$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 => [
$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 => [