]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Abteilungen bei Ansprechpersonen: SimpleSettings-Controller zum Editieren
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 8 May 2020 15:08:25 +0000 (17:08 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 11 May 2020 15:04:47 +0000 (17:04 +0200)
SL/Controller/SimpleSystemSetting.pm
SL/DB/ContactDepartment.pm
SL/DB/Manager/ContactDepartment.pm
locale/de/all
locale/en/all
menus/user/00-erp.yaml

index 96fe5edb72e035e1a583205469e968b332811bc3..aaca8e9bd531cbbe331f5dcdf9a0d088d3a8d551 100644 (file)
@@ -56,6 +56,16 @@ my %supported_types = (
     ],
   },
 
+  contact_department => {
+    class  => 'ContactDepartment',
+    auth   => 'config',
+    titles => {
+      list => t8('Contact Departments'),
+      add  => t8('Add department'),
+      edit => t8('Edit department'),
+    },
+  },
+
   contact_title => {
     class  => 'ContactTitle',
     auth   => 'config',
index a7645b1fcdbb9b43149d17910666cdccef7216c4..8a6d2bd3becff9a4757e7ac4e0aeaf9b3b376bb5 100644 (file)
@@ -5,9 +5,18 @@ package SL::DB::ContactDepartment;
 
 use strict;
 
+use SL::Util qw(trim);
+
 use SL::DB::MetaSetup::ContactDepartment;
 use SL::DB::Manager::ContactDepartment;
 
 __PACKAGE__->meta->initialize;
 
+__PACKAGE__->before_save('_before_save_trim_content');
+
+sub _before_save_trim_content {
+  $_[0]->description(trim($_[0]->description));
+  return 1;
+}
+
 1;
index f545f650c6848e700587063e7e5c0c75327561c0..ed1b1b4a013f0e40ca4ef32803b47655dfbacc88 100644 (file)
@@ -7,8 +7,17 @@ use strict;
 
 use parent qw(SL::DB::Helper::Manager);
 
+use SL::DB::Helper::Sorted;
+
 sub object_class { 'SL::DB::ContactDepartment' }
 
 __PACKAGE__->make_manager_methods;
 
+sub _sort_spec {
+  return ( default => [ 'description', 1 ],
+           columns => { SIMPLE => 'ALL',
+                        map { ( $_ => "lower(contact_departments.$_)" ) } qw(description)
+                      });
+}
+
 1;
index d7c8e72491dc5b4954d187829f2ed12c665c4a64..ea5f995d33d58a88a42112f24e2b6195b2ac67f6 100755 (executable)
@@ -667,6 +667,7 @@ $self->{texts} = {
   'Confirm!'                    => 'Bestätigen Sie!',
   'Confirmation'                => 'Auftragsbestätigung',
   'Contact'                     => 'Kontakt',
+  'Contact Departments'         => 'Abteilungen von Ansprechpersonen',
   'Contact Person'              => 'Ansprechperson',
   'Contact Person (database ID)' => 'Ansprechperson (Datenbank-ID)',
   'Contact Person (name)'       => 'Ansprechperson (Name)',
index 4ef9a6398870ea60cdbec4bf0e64eff2c52a22e3..a3d1900e1e73ac59a80cd863b9efe7418397067a 100644 (file)
@@ -667,6 +667,7 @@ $self->{texts} = {
   'Confirm!'                    => '',
   'Confirmation'                => '',
   'Contact'                     => '',
+  'Contact Departments'         => '',
   'Contact Person'              => '',
   'Contact Person (database ID)' => '',
   'Contact Person (name)'       => '',
index 068bd698f7069eb0cbe3ce1af37978904a8128c7..b56a7b905245dc5c9127774890b48b446a41f2a7 100644 (file)
   params:
     action: SimpleSystemSetting/list
     type: contact_title
+- parent: system
+  id: system_contact_departments
+  name: Contact Departments
+  order: 1430
+  params:
+    action: SimpleSystemSetting/list
+    type: contact_department
 - parent: system
   id: system_project_types
   name: Project Types