--- /dev/null
+package SL::Controller::RequirementSpecAcceptanceStatus;
+
+use strict;
+
+use parent qw(SL::Controller::Base);
+
+use SL::DB::RequirementSpecAcceptanceStatus;
+use SL::DB::Language;
+use SL::Helper::Flash;
+use SL::Locale::String;
+
+use Rose::Object::MakeMethods::Generic
+(
+ scalar => [ qw(requirement_spec_acceptance_status valid_names) ],
+);
+
+__PACKAGE__->run_before('check_auth');
+__PACKAGE__->run_before('load_requirement_spec_acceptance_status', only => [ qw(edit update destroy) ]);
+__PACKAGE__->run_before(sub { $_[0]->valid_names(\@SL::DB::RequirementSpecAcceptanceStatus::valid_names) });
+
+#
+# actions
+#
+
+sub action_list {
+ my ($self) = @_;
+
+ $self->render('requirement_spec_acceptance_status/list',
+ title => t8('Acceptance Statuses'),
+ REQUIREMENT_SPEC_ACCEPTANCE_STATUSES => SL::DB::Manager::RequirementSpecAcceptanceStatus->get_all_sorted);
+}
+
+sub action_new {
+ my ($self) = @_;
+
+ $self->{requirement_spec_acceptance_status} = SL::DB::RequirementSpecAcceptanceStatus->new;
+ $self->render('requirement_spec_acceptance_status/form', title => t8('Create a new acceptance status'));
+}
+
+sub action_edit {
+ my ($self) = @_;
+ $self->render('requirement_spec_acceptance_status/form', title => t8('Edit acceptance status'));
+}
+
+sub action_create {
+ my ($self) = @_;
+
+ $self->{requirement_spec_acceptance_status} = SL::DB::RequirementSpecAcceptanceStatus->new;
+ $self->create_or_update;
+}
+
+sub action_update {
+ my ($self) = @_;
+ $self->create_or_update;
+}
+
+sub action_destroy {
+ my ($self) = @_;
+
+ if (eval { $self->{requirement_spec_acceptance_status}->delete; 1; }) {
+ flash_later('info', t8('The acceptance status has been deleted.'));
+ } else {
+ flash_later('error', t8('The acceptance status is in use and cannot be deleted.'));
+ }
+
+ $self->redirect_to(action => 'list');
+}
+
+sub action_reorder {
+ my ($self) = @_;
+
+ SL::DB::RequirementSpecAcceptanceStatus->reorder_list(@{ $::form->{requirement_spec_acceptance_status_id} || [] });
+
+ $self->render(\'', { status => 'json' });
+}
+
+#
+# filters
+#
+
+sub check_auth {
+ $::auth->assert('config');
+}
+
+#
+# helpers
+#
+
+sub create_or_update {
+ my $self = shift;
+ my $is_new = !$self->{requirement_spec_acceptance_status}->id;
+ my $params = delete($::form->{requirement_spec_acceptance_status}) || { };
+ my $title = $is_new ? t8('Create a new acceptance status') : t8('Edit acceptance status');
+
+ $self->{requirement_spec_acceptance_status}->assign_attributes(%{ $params });
+
+ my @errors = $self->{requirement_spec_acceptance_status}->validate;
+
+ if (@errors) {
+ flash('error', @errors);
+ $self->render('requirement_spec_acceptance_status/form', title => $title);
+ return;
+ }
+
+ $self->{requirement_spec_acceptance_status}->save;
+
+ flash_later('info', $is_new ? t8('The acceptance status has been created.') : t8('The acceptance status has been saved.'));
+ $self->redirect_to(action => 'list');
+}
+
+sub load_requirement_spec_acceptance_status {
+ my ($self) = @_;
+ $self->{requirement_spec_acceptance_status} = SL::DB::RequirementSpecAcceptanceStatus->new(id => $::form->{id})->load;
+}
+
+1;
'Abteilung' => 'Abteilung',
'Access rights' => 'Zugriffsrechte',
'Access to clients' => 'Zugriff auf Mandanten',
+ 'Acceptance Statuses' => 'Abnahmestatus',
'Acceptance Types' => 'Abnahmetypen',
'Account' => 'Konto',
'Account Category A' => 'Aktiva/Mittelverwendung',
'Create Chart of Accounts' => 'Zu verwendender Kontenplan',
'Create Dataset' => 'Neue Datenbank anlegen',
'Create Date' => 'Erstelldatum',
+ 'Create a new acceptance status' => 'Einen neuen Abnahmestatus anlegen',
'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen',
'Create a new business' => 'Einen neuen Kunden-/Lieferantentyp erfassen',
'Create a new client' => 'Einen neuen Mandanten anlegen',
'Edit Vendor' => 'Lieferant editieren',
'Edit Vendor Invoice' => 'Einkaufsrechnung bearbeiten',
'Edit Warehouse' => 'Lager bearbeiten',
+ 'Edit acceptance status' => 'Abnahmestatus bearbeiten',
'Edit background job' => 'Hintergrund-Job bearbeiten',
'Edit bank account' => 'Bankkonto bearbeiten',
'Edit business' => 'Kunden-/Lieferantentyp bearbeiten',
'No Company Name given' => 'Kein Firmenname hinterlegt!',
'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden',
'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Händler gefunden',
+ 'No acceptance statuses has been created yet.' => 'Es wurde noch kein Abnahmestatus angelegt.',
'No action defined.' => 'Keine Aktion definiert.',
'No background job has been created yet.' => 'Es wurden noch keine Hintergrund-Jobs angelegt.',
'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' => 'Für diesen Kunden wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, können Sie keine Überweisungen für den Lieferanten anlegen.',
'The SEPA export has been created.' => 'Der SEPA-Export wurde erstellt',
'The SEPA strings have been saved.' => 'Die bei SEPA-Überweisungen verwendeten Begriffe wurden gespeichert.',
'The WebDAV feature has been used.' => 'Das WebDAV-Feature wurde benutzt.',
+ 'The acceptance status has been created.' => 'Der Abnahmestatus wurde angelegt.',
+ 'The acceptance status has been deleted.' => 'Der Abnahmestatus wurde gelöscht.',
+ 'The acceptance status has been saved.' => 'Der Abnahmestatus wurde gespeichert.',
+ 'The acceptance status is in use and cannot be deleted.' => 'Der Abnahmestatus wird verwendet und kann nicht gelöscht werden.',
'The access rights a user has within a client instance is still governed by his group membership.' => 'Welche Zugriffsrechte ein Benutzer innerhalb eines Mandanten hat, wird weiterhin über Gruppenmitgliedschaften geregelt.',
'The access rights have been saved.' => 'Die Zugriffsrechte wurden gespeichert.',
'The account 3804 already exists, the update will be skipped.' => 'Das Konto 3804 existiert schon, das Update wird übersprungen.',
module=controller.pl
action=RequirementSpecRisk/list
-[System--Requirement specs--Acceptance Types]
+[System--Requirement specs--Acceptance Statuses]
module=controller.pl
-action=RequirementSpecAcceptanceType/list
+action=RequirementSpecAcceptanceStatus/list
[System--Languages and translations]
module=menu.pl
--- /dev/null
+[% USE HTML %][% USE L %][% USE LxERP %]
+
+ <form method="post" action="controller.pl">
+ <div class="listtop">[% FORM.title %]</div>
+
+[%- INCLUDE 'common/flash.html' %]
+
+ <table>
+ <tr>
+ <td>[% LxERP.t8('Name') %]</td>
+ <td>[% L.select_tag("requirement_spec_acceptance_status.name", SELF.valid_names, default = SELF.requirement_spec_acceptance_status.name) %]</td>
+ </tr>
+
+ <tr>
+ <td>[% LxERP.t8('Description') %]</td>
+ <td>[% L.input_tag("requirement_spec_acceptance_status.description", SELF.requirement_spec_acceptance_status.description) %]</td>
+ </tr>
+ </table>
+
+ <p>
+ [% L.hidden_tag("id", SELF.requirement_spec_acceptance_status.id) %]
+ [% L.hidden_tag("action", "RequirementSpecAcceptanceStatus/dispatch") %]
+ [% L.submit_tag("action_" _ (SELF.requirement_spec_acceptance_status.id ? "update" : "create"), LxERP.t8('Save')) %]
+ [%- IF SELF.requirement_spec_acceptance_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 %]
+
+ <div class="listtop">[% FORM.title %]</div>
+
+[%- INCLUDE 'common/flash.html' %]
+
+ <form method="post" action="controller.pl">
+ [% IF !REQUIREMENT_SPEC_ACCEPTANCE_STATUSES.size %]
+ <p>
+ [%- LxERP.t8('No acceptance statuses has been created yet.') %]
+ </p>
+
+ [%- ELSE %]
+ <table id="requirement_spec_acceptance_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_acceptance_status = REQUIREMENT_SPEC_ACCEPTANCE_STATUSES %]
+ <tr class="listrow[% loop.count % 2 %]" id="requirement_spec_acceptance_status_id_[% requirement_spec_acceptance_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_acceptance_status.id) %]">
+ [%- HTML.escape(requirement_spec_acceptance_status.name) %]
+ </a>
+ </td>
+
+ <td>[%- HTML.escape(requirement_spec_acceptance_status.description) %]</td>
+ </tr>
+ [%- END %]
+ </tbody>
+ </table>
+ [%- END %]
+
+ <p>
+ <a href="[% SELF.url_for(action => 'new') %]">[%- LxERP.t8('Create a new acceptance status') %]</a>
+ </p>
+ </form>
+
+ [% L.sortable_element('#requirement_spec_acceptance_status_list tbody', url => 'controller.pl?action=RequirementSpecAcceptanceStatus/reorder', with => 'requirement_spec_acceptance_status_id') %]