projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
371ab59
)
Abteilungen bei Ansprechpersonen: SimpleSettings-Controller zum Editieren
author
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Fri, 8 May 2020 15:08:25 +0000
(17:08 +0200)
committer
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Mon, 11 May 2020 15:04:47 +0000
(17:04 +0200)
SL/Controller/SimpleSystemSetting.pm
patch
|
blob
|
history
SL/DB/ContactDepartment.pm
patch
|
blob
|
history
SL/DB/Manager/ContactDepartment.pm
patch
|
blob
|
history
locale/de/all
patch
|
blob
|
history
locale/en/all
patch
|
blob
|
history
menus/user/00-erp.yaml
patch
|
blob
|
history
diff --git
a/SL/Controller/SimpleSystemSetting.pm
b/SL/Controller/SimpleSystemSetting.pm
index
96fe5ed
..
aaca8e9
100644
(file)
--- a/
SL/Controller/SimpleSystemSetting.pm
+++ b/
SL/Controller/SimpleSystemSetting.pm
@@
-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',
contact_title => {
class => 'ContactTitle',
auth => 'config',
diff --git
a/SL/DB/ContactDepartment.pm
b/SL/DB/ContactDepartment.pm
index
a7645b1
..
8a6d2bd
100644
(file)
--- a/
SL/DB/ContactDepartment.pm
+++ b/
SL/DB/ContactDepartment.pm
@@
-5,9
+5,18
@@
package SL::DB::ContactDepartment;
use strict;
use strict;
+use SL::Util qw(trim);
+
use SL::DB::MetaSetup::ContactDepartment;
use SL::DB::Manager::ContactDepartment;
__PACKAGE__->meta->initialize;
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;
1;
diff --git
a/SL/DB/Manager/ContactDepartment.pm
b/SL/DB/Manager/ContactDepartment.pm
index
f545f65
..
ed1b1b4
100644
(file)
--- a/
SL/DB/Manager/ContactDepartment.pm
+++ b/
SL/DB/Manager/ContactDepartment.pm
@@
-7,8
+7,17
@@
use strict;
use parent qw(SL::DB::Helper::Manager);
use parent qw(SL::DB::Helper::Manager);
+use SL::DB::Helper::Sorted;
+
sub object_class { 'SL::DB::ContactDepartment' }
__PACKAGE__->make_manager_methods;
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;
1;
diff --git
a/locale/de/all
b/locale/de/all
index
d7c8e72
..
ea5f995
100755
(executable)
--- a/
locale/de/all
+++ b/
locale/de/all
@@
-667,6
+667,7
@@
$self->{texts} = {
'Confirm!' => 'Bestätigen Sie!',
'Confirmation' => 'Auftragsbestätigung',
'Contact' => 'Kontakt',
'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)',
'Contact Person' => 'Ansprechperson',
'Contact Person (database ID)' => 'Ansprechperson (Datenbank-ID)',
'Contact Person (name)' => 'Ansprechperson (Name)',
diff --git
a/locale/en/all
b/locale/en/all
index
4ef9a63
..
a3d1900
100644
(file)
--- a/
locale/en/all
+++ b/
locale/en/all
@@
-667,6
+667,7
@@
$self->{texts} = {
'Confirm!' => '',
'Confirmation' => '',
'Contact' => '',
'Confirm!' => '',
'Confirmation' => '',
'Contact' => '',
+ 'Contact Departments' => '',
'Contact Person' => '',
'Contact Person (database ID)' => '',
'Contact Person (name)' => '',
'Contact Person' => '',
'Contact Person (database ID)' => '',
'Contact Person (name)' => '',
diff --git
a/menus/user/00-erp.yaml
b/menus/user/00-erp.yaml
index
068bd69
..
b56a7b9
100644
(file)
--- a/
menus/user/00-erp.yaml
+++ b/
menus/user/00-erp.yaml
@@
-1189,6
+1189,13
@@
params:
action: SimpleSystemSetting/list
type: contact_title
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
- parent: system
id: system_project_types
name: Project Types