From: Moritz Bunkus Date: Wed, 1 Feb 2017 14:31:03 +0000 (+0100) Subject: SimpleSystemSetting: Umstellung von »Pflichtenhefte« → »Pflichtenhefttypen« X-Git-Tag: release-3.5.4~1553 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d98b10d9bf580996729826c720e986ac9d57bf53;p=kivitendo-erp.git SimpleSystemSetting: Umstellung von »Pflichtenhefte« → »Pflichtenhefttypen« --- diff --git a/SL/Controller/RequirementSpecType.pm b/SL/Controller/RequirementSpecType.pm deleted file mode 100644 index e9bdb7b82..000000000 --- a/SL/Controller/RequirementSpecType.pm +++ /dev/null @@ -1,114 +0,0 @@ -package SL::Controller::RequirementSpecType; - -use strict; - -use parent qw(SL::Controller::Base); - -use SL::DB::RequirementSpecType; -use SL::Helper::Flash; -use SL::Locale::String; - -use Rose::Object::MakeMethods::Generic -( - scalar => [ qw(requirement_spec_type) ], -); - -__PACKAGE__->run_before('check_auth'); -__PACKAGE__->run_before('load_requirement_spec_type', only => [ qw(edit update destroy) ]); - -# -# actions -# - -sub action_list { - my ($self) = @_; - - $self->render('requirement_spec_type/list', - title => t8('Requirement Spec Types'), - REQUIREMENT_SPEC_TYPES => SL::DB::Manager::RequirementSpecType->get_all_sorted); -} - -sub action_new { - my ($self) = @_; - - $self->{requirement_spec_type} = SL::DB::RequirementSpecType->new(template_file_name => 'requirement_spec'); - $self->render('requirement_spec_type/form', title => t8('Create a new requirement spec type')); -} - -sub action_edit { - my ($self) = @_; - $self->render('requirement_spec_type/form', title => t8('Edit requirement spec type')); -} - -sub action_create { - my ($self) = @_; - - $self->{requirement_spec_type} = SL::DB::RequirementSpecType->new; - $self->create_or_update; -} - -sub action_update { - my ($self) = @_; - $self->create_or_update; -} - -sub action_destroy { - my ($self) = @_; - - if (eval { $self->{requirement_spec_type}->delete; 1; }) { - flash_later('info', t8('The requirement spec type has been deleted.')); - } else { - flash_later('error', t8('The requirement spec type is in use and cannot be deleted.')); - } - - $self->redirect_to(action => 'list'); -} - -sub action_reorder { - my ($self) = @_; - - SL::DB::RequirementSpecType->reorder_list(@{ $::form->{requirement_spec_type_id} || [] }); - - $self->render(\'', { type => 'json' }); -} - -# -# filters -# - -sub check_auth { - $::auth->assert('config'); -} - -# -# helpers -# - -sub create_or_update { - my $self = shift; - my $is_new = !$self->{requirement_spec_type}->id; - my $params = delete($::form->{requirement_spec_type}) || { }; - my $title = $is_new ? t8('Create a new requirement spec type') : t8('Edit requirement spec type'); - - $self->{requirement_spec_type}->assign_attributes(%{ $params }); - - my @errors = $self->{requirement_spec_type}->validate; - - if (@errors) { - flash('error', @errors); - $self->render('requirement_spec_type/form', title => $title); - return; - } - - $self->{requirement_spec_type}->save; - - flash_later('info', $is_new ? t8('The requirement spec type has been created.') : t8('The requirement spec type has been saved.')); - $self->redirect_to(action => 'list'); -} - -sub load_requirement_spec_type { - my ($self) = @_; - $self->{requirement_spec_type} = SL::DB::RequirementSpecType->new(id => $::form->{id})->load; -} - -1; diff --git a/SL/Controller/SimpleSystemSetting.pm b/SL/Controller/SimpleSystemSetting.pm index 8cc577e3a..6bb1b1fca 100644 --- a/SL/Controller/SimpleSystemSetting.pm +++ b/SL/Controller/SimpleSystemSetting.pm @@ -158,6 +158,21 @@ my %supported_types = ( ], }, + requirement_spec_type => { + # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_type_form") + class => 'RequirementSpecType', + titles => { + list => t8('Requirement Spec Types'), + add => t8('Add requirement spec type'), + edit => t8('Edit requirement spec type'), + }, + list_attributes => [ + { method => 'description', title => t8('Description') }, + { method => 'section_number_format', title => t8('Section number format') }, + { method => 'function_block_number_format', title => t8('Function block number format') }, + ], + }, + ); my @default_list_attributes = ( diff --git a/locale/de/all b/locale/de/all index b8e147657..80e528667 100755 --- a/locale/de/all +++ b/locale/de/all @@ -215,6 +215,7 @@ $self->{texts} = { 'Add pricegroup' => 'Preisgruppe hinzufügen', 'Add project status' => 'Projektstatus hinzufügen', 'Add project type' => 'Projekttypen hinzufügen', + 'Add requirement spec type' => 'Pflichtenhefttypen hinzufügen', 'Add section' => 'Abschnitt hinzufügen', 'Add sub function block' => 'Unterfunktionsblock hinzufügen', 'Add taxzone' => 'Steuerzone hinzufügen', @@ -677,7 +678,6 @@ $self->{texts} = { 'Create a new requirement spec' => 'Ein neues Pflichtenheft anlegen', 'Create a new requirement spec status' => 'Einen neuen Pflichtenheftstatus anlegen', 'Create a new requirement spec template' => 'Eine neue Pflichtenheftvorlage erfassen', - 'Create a new requirement spec type' => 'Einen neuen Pflichtenhefttypen anlegen', 'Create a new risk level' => 'Einen neuen Risikograd anlegen', 'Create a new sales price rule' => 'Neue Verkaufspreisregel anlegen', 'Create a new user' => 'Einen neuen Benutzer anlegen', @@ -1887,7 +1887,6 @@ $self->{texts} = { 'No report with id #1' => 'Es gibt keinen Report mit der Id #1', 'No requirement spec statuses has been created yet.' => 'Es wurden noch keine Pflichtenheftstatus angelegt.', 'No requirement spec templates have been created yet.' => 'Es wurden noch keine Pflichtenheftvorlagen angelegt.', - 'No requirement spec type has been created yet.' => 'Es wurden noch keine Pflichtenhefttypen angelegt.', 'No results.' => 'Keine Artikel', 'No revert available.' => 'Dieser Vorgang kann nicht rückgängig gemacht werden, ggf. falsch erstellte Buchungen müssen einzeln manuell korrigiert werden.', 'No risks level has been created yet.' => 'Es wurden noch keine Risikograde angelegt.', @@ -3094,10 +3093,6 @@ $self->{texts} = { 'The requirement spec status has been saved.' => 'Der Pflichtenheftstatus wurde gespeichert.', 'The requirement spec status is in use and cannot be deleted.' => 'Der Pflichtenheftstatus wird verwendet und kann nicht gelöscht werden.', 'The requirement spec template has been saved.' => 'Die Pflichtenheftvorlage wurde gespeichert.', - 'The requirement spec type has been created.' => 'Der Pflichtenhefttyp wurde angelegt.', - 'The requirement spec type has been deleted.' => 'Der Pflichtenhefttyp wurde gelöscht.', - 'The requirement spec type has been saved.' => 'Der Pflichtenhefttyp wurde gespeichert.', - 'The requirement spec type is in use and cannot be deleted.' => 'Der Pflichtenhefttyp wird verwendet und kann nicht gelöscht werden.', 'The risk level has been created.' => 'Der Risikograd wurde angelegt.', 'The risk level has been deleted.' => 'Der Risikograd wurde gelöscht.', 'The risk level has been saved.' => 'Der Risikograd wurde gespeichert.', diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index 7f06d8ac8..45cb20989 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -1147,7 +1147,8 @@ name: Requirement Spec Types order: 200 params: - action: RequirementSpecType/list + action: SimpleSystemSetting/list + type: requirement_spec_type - parent: system_requirement_specs id: system_requirement_specs_requirement_spec_statuses name: Requirement Spec Statuses diff --git a/templates/webpages/requirement_spec_type/form.html b/templates/webpages/requirement_spec_type/form.html deleted file mode 100755 index a965c868d..000000000 --- a/templates/webpages/requirement_spec_type/form.html +++ /dev/null @@ -1,45 +0,0 @@ -[% USE HTML %][% USE L %][% USE LxERP %] -

[% FORM.title %]

- -
- -[%- INCLUDE 'common/flash.html' %] - - - - - - - - - - - - - - - - - - - - - -
[% LxERP.t8('Description') %][% L.input_tag("requirement_spec_type.description", SELF.requirement_spec_type.description) %]
[% LxERP.t8('Print template base file name') %](1)[% L.input_tag("requirement_spec_type.template_file_name", SELF.requirement_spec_type.template_file_name) %]
[% LxERP.t8('Section number format') %](2)[% L.input_tag("requirement_spec_type.section_number_format", SELF.requirement_spec_type.section_number_format, size="15") %]
[% LxERP.t8('Function block number format') %](2)[% L.input_tag("requirement_spec_type.function_block_number_format", SELF.requirement_spec_type.function_block_number_format, size="15") %]
- -

- [% L.hidden_tag("id", SELF.requirement_spec_type.id) %] - [% L.hidden_tag("action", "RequirementSpecType/dispatch") %] - [% L.submit_tag("action_" _ (SELF.requirement_spec_type.id ? "update" : "create"), LxERP.t8('Save')) %] - [%- IF SELF.requirement_spec_type.id %] - [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) %] - [%- END %] - [%- LxERP.t8('Abort') %] -

- -

- (1): [% LxERP.t8("The base file name without a path or an extension to be used for printing for this type of requirement spec.") %] -
- (2): [% LxERP.t8('The numbering will start at 1 with each requirement spec.') %] -

-
diff --git a/templates/webpages/requirement_spec_type/list.html b/templates/webpages/requirement_spec_type/list.html deleted file mode 100644 index b215d9287..000000000 --- a/templates/webpages/requirement_spec_type/list.html +++ /dev/null @@ -1,46 +0,0 @@ -[% USE HTML %][% USE L %][% USE LxERP %] -

[% FORM.title %]

- -[%- INCLUDE 'common/flash.html' %] - -
- [% IF !REQUIREMENT_SPEC_TYPES.size %] -

- [%- LxERP.t8('No requirement spec type has been created yet.') %] -

- - [%- ELSE %] - - - - - - - - - - - - [%- FOREACH requirement_spec_type = REQUIREMENT_SPEC_TYPES %] - - - - - - - - [%- END %] - -
[%- LxERP.t8('reorder item') %][%- LxERP.t8('Description') %][%- LxERP.t8('Section number format') %][%- LxERP.t8('Function block number format') %]
[%- LxERP.t8('reorder item') %] - - [%- HTML.escape(requirement_spec_type.description) %] - - [% HTML.escape(requirement_spec_type.section_number_format) %][% HTML.escape(requirement_spec_type.function_block_number_format) %]
- [%- END %] - -

- [%- LxERP.t8('Create a new requirement spec type') %] -

-
- - [% L.sortable_element('#requirement_spec_type_list tbody', url => 'controller.pl?action=RequirementSpecType/reorder', with => 'requirement_spec_type_id') %] diff --git a/templates/webpages/simple_system_setting/_requirement_spec_type_form.html b/templates/webpages/simple_system_setting/_requirement_spec_type_form.html new file mode 100644 index 000000000..96fdfb4cc --- /dev/null +++ b/templates/webpages/simple_system_setting/_requirement_spec_type_form.html @@ -0,0 +1,28 @@ +[% USE HTML %][% USE L %][% USE LxERP %] + + + + + + + + + + + + + + + + + + + + +
[% LxERP.t8("Description") %][% L.input_tag("object.description", SELF.object.description, "data-validate"="required", "data-title"=LxERP.t8("Description")) %]
[% LxERP.t8("Print template base file name") %](1)[% L.input_tag("object.template_file_name", SELF.object.template_file_name, "data-validate"="required", "data-title"=LxERP.t8("Print template base file name")) %]
[% LxERP.t8("Section number format") %](2)[% L.input_tag("object.section_number_format", SELF.object.section_number_format, size="15", "data-validate"="required", "data-title"=LxERP.t8("Section number format")) %]
[% LxERP.t8("Function block number format") %](2)[% L.input_tag("object.function_block_number_format", SELF.object.function_block_number_format, size="15", "data-validate"="required", "data-title"=LxERP.t8("Function block number format")) %]
+ +

+ (1): [% LxERP.t8("The base file name without a path or an extension to be used for printing for this type of requirement spec.") %] +
+ (2): [% LxERP.t8("The numbering will start at 1 with each requirement spec.") %] +