+++ /dev/null
-package SL::Controller::RequirementSpecStatus;
-
-use strict;
-
-use parent qw(SL::Controller::Base);
-
-use SL::DB::RequirementSpecStatus;
-use SL::Helper::Flash;
-use SL::Locale::String;
-
-use Rose::Object::MakeMethods::Generic
-(
- scalar => [ qw(requirement_spec_status valid_names) ],
-);
-
-__PACKAGE__->run_before('check_auth');
-__PACKAGE__->run_before('load_requirement_spec_status', only => [ qw(edit update destroy) ]);
-__PACKAGE__->run_before(sub { $_[0]->valid_names(\@SL::DB::RequirementSpecStatus::valid_names) });
-
-#
-# actions
-#
-
-sub action_list {
- my ($self) = @_;
-
- $self->render('requirement_spec_status/list',
- title => t8('Requirement Spec Statuses'),
- REQUIREMENT_SPEC_STATUSES => SL::DB::Manager::RequirementSpecStatus->get_all_sorted);
-}
-
-sub action_new {
- my ($self) = @_;
-
- $self->{requirement_spec_status} = SL::DB::RequirementSpecStatus->new;
- $self->render('requirement_spec_status/form', title => t8('Create a new requirement spec status'));
-}
-
-sub action_edit {
- my ($self) = @_;
- $self->render('requirement_spec_status/form', title => t8('Edit requirement spec status'));
-}
-
-sub action_create {
- my ($self) = @_;
-
- $self->{requirement_spec_status} = SL::DB::RequirementSpecStatus->new;
- $self->create_or_update;
-}
-
-sub action_update {
- my ($self) = @_;
- $self->create_or_update;
-}
-
-sub action_destroy {
- my ($self) = @_;
-
- if (eval { $self->{requirement_spec_status}->delete; 1; }) {
- flash_later('info', t8('The requirement spec status has been deleted.'));
- } else {
- flash_later('error', t8('The requirement spec status is in use and cannot be deleted.'));
- }
-
- $self->redirect_to(action => 'list');
-}
-
-sub action_reorder {
- my ($self) = @_;
-
- SL::DB::RequirementSpecStatus->reorder_list(@{ $::form->{requirement_spec_status_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_status}->id;
- my $params = delete($::form->{requirement_spec_status}) || { };
- my $title = $is_new ? t8('Create a new requirement spec status') : t8('Edit requirement spec status');
-
- $self->{requirement_spec_status}->assign_attributes(%{ $params });
-
- my @errors = $self->{requirement_spec_status}->validate;
-
- if (@errors) {
- flash('error', @errors);
- $self->render('requirement_spec_status/form', title => $title);
- return;
- }
-
- $self->{requirement_spec_status}->save;
-
- flash_later('info', $is_new ? t8('The requirement spec status has been created.') : t8('The requirement spec status has been saved.'));
- $self->redirect_to(action => 'list');
-}
-
-sub load_requirement_spec_status {
- my ($self) = @_;
- $self->{requirement_spec_status} = SL::DB::RequirementSpecStatus->new(id => $::form->{id})->load;
-}
-
-1;
],
},
+ requirement_spec_status => {
+ # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_status_form")
+ class => 'RequirementSpecStatus',
+ titles => {
+ list => t8('Requirement Spec Statuses'),
+ add => t8('Add requirement spec status'),
+ edit => t8('Edit requirement spec status'),
+ },
+ list_attributes => [
+ { method => 'name', title => t8('Name') },
+ { method => 'description', title => t8('Description') },
+ ],
+ },
+
requirement_spec_type => {
# Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_type_form")
class => 'RequirementSpecType',
# type-specific helper functions
#
+sub setup_requirement_spec_status {
+ my ($self) = @_;
+
+ no warnings 'once';
+ $self->{valid_names} = \@SL::DB::RequirementSpecStatus::valid_names;
+}
+
1;
__END__
'Add pricegroup' => 'Preisgruppe hinzufügen',
'Add project status' => 'Projektstatus hinzufügen',
'Add project type' => 'Projekttypen hinzufügen',
+ 'Add requirement spec status' => 'Pflichtenheftstatus hinzufügen',
'Add requirement spec type' => 'Pflichtenhefttypen hinzufügen',
'Add section' => 'Abschnitt hinzufügen',
'Add sub function block' => 'Unterfunktionsblock hinzufügen',
'Create a new project and link to it.' => 'Neues Projekt anlegen und damit verknüpfen.',
'Create a new purchase price rule' => 'Neue Einkaufspreisregel anlegen',
'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 risk level' => 'Einen neuen Risikograd anlegen',
'Create a new sales price rule' => 'Neue Verkaufspreisregel anlegen',
'No problems were recognized.' => 'Es wurden keine Probleme gefunden.',
'No quotations or orders have been created yet.' => 'Es wurden noch keine Angebote oder Aufträge angelegt.',
'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 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.',
'The requirement spec has been reverted to version #1.' => 'Das Pflichtenheft wurde auf Version #1 zurückgesetzt.',
'The requirement spec has been saved.' => 'Das Pflichtenheft wurde gespeichert.',
'The requirement spec is in use and cannot be deleted.' => 'Das Pflichtenheft wird verwendet und kann nicht gelöscht werden.',
- 'The requirement spec status has been created.' => 'Der Pflichtenheftstatus wurde angelegt.',
- 'The requirement spec status has been deleted.' => 'Der Pflichtenheftstatus wurde gelöscht.',
- '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 risk level has been created.' => 'Der Risikograd wurde angelegt.',
'The risk level has been deleted.' => 'Der Risikograd wurde gelöscht.',
name: Requirement Spec Statuses
order: 300
params:
- action: RequirementSpecStatus/list
+ action: SimpleSystemSetting/list
+ type: requirement_spec_status
- parent: system_requirement_specs
id: system_requirement_specs_complexities
name: Complexities
+++ /dev/null
-[% USE HTML %][% USE L %][% USE LxERP %]
-<h1>[% FORM.title %]</h1>
-
- <form method="post" action="controller.pl">
-
-[%- INCLUDE 'common/flash.html' %]
-
- <table>
- <tr>
- <td>[% LxERP.t8('Name') %]</td>
- <td>[% L.select_tag("requirement_spec_status.name", SELF.valid_names, default = SELF.requirement_spec_status.name) %]</td>
- </tr>
-
- <tr>
- <td>[% LxERP.t8('Description') %]</td>
- <td>[% L.input_tag("requirement_spec_status.description", SELF.requirement_spec_status.description) %]</td>
- </tr>
- </table>
-
- <p>
- [% L.hidden_tag("id", SELF.requirement_spec_status.id) %]
- [% L.hidden_tag("action", "RequirementSpecStatus/dispatch") %]
- [% L.submit_tag("action_" _ (SELF.requirement_spec_status.id ? "update" : "create"), LxERP.t8('Save')) %]
- [%- IF SELF.requirement_spec_status.id %]
- [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) %]
- [%- END %]
- <a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a>
- </p>
- </form>
+++ /dev/null
-[% USE HTML %][% USE L %][% USE LxERP %]
-<h1>[% FORM.title %]</h1>
-
-[%- INCLUDE 'common/flash.html' %]
-
- <form method="post" action="controller.pl">
- [% IF !REQUIREMENT_SPEC_STATUSES.size %]
- <p>
- [%- LxERP.t8('No requirement spec statuses has been created yet.') %]
- </p>
-
- [%- ELSE %]
- <table id="requirement_spec_status_list">
- <thead>
- <tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
- <th>[%- LxERP.t8('Name') %]</th>
- <th>[%- LxERP.t8('Description') %]</th>
- </tr>
- </thead>
-
- <tbody>
- [%- FOREACH requirement_spec_status = REQUIREMENT_SPEC_STATUSES %]
- <tr class="listrow[% loop.count % 2 %]" id="requirement_spec_status_id_[% requirement_spec_status.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
- <td>
- <a href="[% SELF.url_for(action => 'edit', id => requirement_spec_status.id) %]">
- [%- HTML.escape(requirement_spec_status.name) %]
- </a>
- </td>
-
- <td>[%- HTML.escape(requirement_spec_status.description) %]</td>
- </tr>
- [%- END %]
- </tbody>
- </table>
- [%- END %]
-
- <p>
- <a href="[% SELF.url_for(action => 'new') %]">[%- LxERP.t8('Create a new requirement spec status') %]</a>
- </p>
- </form>
-
- [% L.sortable_element('#requirement_spec_status_list tbody', url => 'controller.pl?action=RequirementSpecStatus/reorder', with => 'requirement_spec_status_id') %]
--- /dev/null
+[%- USE LxERP -%][%- USE L -%]
+[% SET style="width: 250px" %]
+<table>
+ <tr>
+ <td>[% LxERP.t8("Name") %]</td>
+ <td>[% L.select_tag("object.name", SELF.valid_names, default=SELF.object.name, style=style) %]</td>
+ </tr>
+
+ <tr>
+ <td>[% LxERP.t8("Description") %]</td>
+ <td>[% L.input_tag("object.description", SELF.object.description, style=style, "data-validate"="required", "data-title"=LxERP.t8("Description")) %]</td>
+ </tr>
+</table>