From c2e4989097c6a6817e6c4d7bbabf70e43f14253d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 24 Apr 2020 14:56:32 +0200 Subject: [PATCH] Anreden: SimpleSettings-Controller zum Editieren --- SL/Controller/SimpleSystemSetting.pm | 10 ++++++++++ SL/DB/Manager/Greeting.pm | 9 +++++++++ locale/de/all | 2 ++ locale/en/all | 2 ++ menus/user/00-erp.yaml | 7 +++++++ 5 files changed, 30 insertions(+) diff --git a/SL/Controller/SimpleSystemSetting.pm b/SL/Controller/SimpleSystemSetting.pm index 4fec19a9f..f0590a165 100644 --- a/SL/Controller/SimpleSystemSetting.pm +++ b/SL/Controller/SimpleSystemSetting.pm @@ -65,6 +65,16 @@ my %supported_types = ( }, }, + greeting => { + class => 'Greeting', + auth => 'config', + titles => { + list => t8('Greetings'), + add => t8('Add greeting'), + edit => t8('Edit greeting'), + }, + }, + language => { # Make locales.pl happy: $self->render("simple_system_setting/_language_form") class => 'Language', diff --git a/SL/DB/Manager/Greeting.pm b/SL/DB/Manager/Greeting.pm index dfe80db1d..0a8de8319 100644 --- a/SL/DB/Manager/Greeting.pm +++ b/SL/DB/Manager/Greeting.pm @@ -7,8 +7,17 @@ use strict; use parent qw(SL::DB::Helper::Manager); +use SL::DB::Helper::Sorted; + sub object_class { 'SL::DB::Greeting' } __PACKAGE__->make_manager_methods; +sub _sort_spec { + return ( default => [ 'description', 1 ], + columns => { SIMPLE => 'ALL', + map { ( $_ => "lower(greetings.$_)" ) } qw(description) + }); +} + 1; diff --git a/locale/de/all b/locale/de/all index 26e1c6512..51f5989f5 100755 --- a/locale/de/all +++ b/locale/de/all @@ -205,6 +205,7 @@ $self->{texts} = { 'Add department' => 'Abteilung hinzufügen', 'Add empty line (csv_import)' => 'Leere Zeile einfügen', 'Add function block' => 'Funktionsblock hinzufügen', + 'Add greeting' => 'Anrede hinzufügen', 'Add headers from last uploaded file (csv_import)' => 'Spalten aus der hochgeladenen Datei einfügen', 'Add invoices' => 'Rechnungen hinzufügen', 'Add language' => 'Sprache hinzufügen', @@ -1203,6 +1204,7 @@ $self->{texts} = { 'Edit department' => 'Abteilung bearbeiten', 'Edit file' => 'Datei bearbeiten', 'Edit general settings' => 'Grundeinstellungen bearbeiten', + 'Edit greeting' => 'Anrede bearbeiten', 'Edit greetings' => 'Anreden bearbeiten', 'Edit language' => 'Sprache bearbeiten', 'Edit note' => 'Notiz bearbeiten', diff --git a/locale/en/all b/locale/en/all index c16c93ad9..49abaf3d1 100644 --- a/locale/en/all +++ b/locale/en/all @@ -205,6 +205,7 @@ $self->{texts} = { 'Add department' => '', 'Add empty line (csv_import)' => '', 'Add function block' => '', + 'Add greeting' => '', 'Add headers from last uploaded file (csv_import)' => '', 'Add invoices' => '', 'Add language' => '', @@ -1203,6 +1204,7 @@ $self->{texts} = { 'Edit department' => '', 'Edit file' => '', 'Edit general settings' => '', + 'Edit greeting' => '', 'Edit greetings' => '', 'Edit language' => '', 'Edit note' => '', diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index 3486fa668..a9a828db6 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -1161,6 +1161,13 @@ params: action: SimpleSystemSetting/list type: price_factor +- parent: system + id: system_greetings + name: Greetings + order: 1250 + params: + action: SimpleSystemSetting/list + type: greeting - parent: system id: system_departments name: Departments -- 2.20.1