From: Bernd Bleßmann <bernd@kivitendo-premium.de>
Date: Fri, 8 May 2020 14:47:13 +0000 (+0200)
Subject: Titel von Ansprechpersonen: SimpleSettings-Controller zum Editieren
X-Git-Tag: release-3.5.6.1~204
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b8c7ffdf1b2b7fdfb246083ee145527fc17d966a;p=kivitendo-erp.git

Titel von Ansprechpersonen: SimpleSettings-Controller zum Editieren
---

diff --git a/SL/Controller/SimpleSystemSetting.pm b/SL/Controller/SimpleSystemSetting.pm
index f0590a165..96fe5edb7 100644
--- a/SL/Controller/SimpleSystemSetting.pm
+++ b/SL/Controller/SimpleSystemSetting.pm
@@ -56,6 +56,16 @@ my %supported_types = (
     ],
   },
 
+  contact_title => {
+    class  => 'ContactTitle',
+    auth   => 'config',
+    titles => {
+      list => t8('Contact Titles'),
+      add  => t8('Add title'),
+      edit => t8('Edit title'),
+    },
+  },
+
   department => {
     class  => 'Department',
     titles => {
diff --git a/SL/DB/Manager/ContactTitle.pm b/SL/DB/Manager/ContactTitle.pm
index f4119a8d1..dea095d38 100644
--- a/SL/DB/Manager/ContactTitle.pm
+++ b/SL/DB/Manager/ContactTitle.pm
@@ -7,8 +7,17 @@ use strict;
 
 use parent qw(SL::DB::Helper::Manager);
 
+use SL::DB::Helper::Sorted;
+
 sub object_class { 'SL::DB::ContactTitle' }
 
 __PACKAGE__->make_manager_methods;
 
+sub _sort_spec {
+  return ( default => [ 'description', 1 ],
+           columns => { SIMPLE => 'ALL',
+                        map { ( $_ => "lower(contact_titles.$_)" ) } qw(description)
+                      });
+}
+
 1;
diff --git a/locale/de/all b/locale/de/all
index 5f05135d2..3c5ec2ad9 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -236,6 +236,7 @@ $self->{texts} = {
   'Add sub function block'      => 'Unterfunktionsblock hinzufügen',
   'Add taxzone'                 => 'Steuerzone hinzufügen',
   'Add text block'              => 'Textblock erfassen',
+  'Add title'                   => 'Titel hinzufügen',
   'Add unit'                    => 'Einheit hinzufügen',
   'Added sections and function blocks: #1' => 'Hinzugefügte Abschnitte und Funktionsblöcke: #1',
   'Added text blocks: #1'       => 'Hinzugefügte Textblöcke: #1',
@@ -669,6 +670,7 @@ $self->{texts} = {
   'Contact Person'              => 'Ansprechperson',
   'Contact Person (database ID)' => 'Ansprechperson (Datenbank-ID)',
   'Contact Person (name)'       => 'Ansprechperson (Name)',
+  'Contact Titles'              => 'Titel von Ansprechpersonen',
   'Contact deleted.'            => 'Ansprechperson gelöscht.',
   'Contact is in use and was flagged invalid.' => 'Die Ansprechperson ist noch in Verwendung und wurde deshalb nur als ungültig markiert.',
   'Contact person (surname)'    => 'Ansprechperson (Nachname)',
@@ -1244,6 +1246,7 @@ $self->{texts} = {
   'Edit the request_quotation'  => 'Bearbeiten der Preisanfrage',
   'Edit the sales_order'        => 'Bearbeiten des Auftrags',
   'Edit the sales_quotation'    => 'Bearbeiten des Angebots',
+  'Edit title'                  => 'Titiel bearbeiten',
   'Edit units'                  => 'Einheiten bearbeiten',
   'Edit user signature'         => 'Benutzersignatur bearbeiten',
   'Editable'                    => 'Bearbeitbar',
diff --git a/locale/en/all b/locale/en/all
index 55084c8f9..56561d538 100644
--- a/locale/en/all
+++ b/locale/en/all
@@ -236,6 +236,7 @@ $self->{texts} = {
   'Add sub function block'      => '',
   'Add taxzone'                 => '',
   'Add text block'              => '',
+  'Add title'                   => '',
   'Add unit'                    => '',
   'Added sections and function blocks: #1' => '',
   'Added text blocks: #1'       => '',
@@ -669,6 +670,7 @@ $self->{texts} = {
   'Contact Person'              => '',
   'Contact Person (database ID)' => '',
   'Contact Person (name)'       => '',
+  'Contact Titles'              => '',
   'Contact deleted.'            => '',
   'Contact is in use and was flagged invalid.' => '',
   'Contact person (surname)'    => '',
@@ -1244,6 +1246,7 @@ $self->{texts} = {
   'Edit the request_quotation'  => '',
   'Edit the sales_order'        => '',
   'Edit the sales_quotation'    => '',
+  'Edit title'                  => '',
   'Edit units'                  => '',
   'Edit user signature'         => '',
   'Editable'                    => '',
diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml
index a9a828db6..068bd698f 100644
--- a/menus/user/00-erp.yaml
+++ b/menus/user/00-erp.yaml
@@ -1182,6 +1182,13 @@
   params:
     action: SimpleSystemSetting/list
     type: business
+- parent: system
+  id: system_contact_titles
+  name: Contact Titles
+  order: 1420
+  params:
+    action: SimpleSystemSetting/list
+    type: contact_title
 - parent: system
   id: system_project_types
   name: Project Types