+++ /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(\'', { type => '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;
},
},
+ requirement_spec_acceptance_status => {
+ # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_acceptance_status_form")
+ class => 'RequirementSpecAcceptanceStatus',
+ titles => {
+ list => t8('Acceptance Statuses'),
+ add => t8('Add acceptance status'),
+ edit => t8('Edit acceptance status'),
+ },
+ list_attributes => [
+ { method => 'name', title => t8('Name') },
+ { method => 'description', title => t8('Description') },
+ ],
+ },
+
requirement_spec_predefined_text => {
# Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_predefined_text_form")
class => 'RequirementSpecPredefinedText',
# type-specific helper functions
#
+sub setup_requirement_spec_acceptance_status {
+ my ($self) = @_;
+
+ no warnings 'once';
+ $self->{valid_names} = \@SL::DB::RequirementSpecAcceptanceStatus::valid_names;
+}
+
sub setup_requirement_spec_status {
my ($self) = @_;
'Add Vendor' => 'Lieferant erfassen',
'Add Vendor Invoice' => 'Einkaufsrechnung erfassen',
'Add Warehouse' => 'Lager erfassen',
+ 'Add acceptance status' => 'Abnahmestatus hinzufügen',
'Add and edit units' => 'Einheiten erfassen und bearbeiten',
'Add bank account' => 'Bankkonto erfassen',
'Add booking group' => 'Buchungsgruppe erfassen',
'Create Date' => 'Erstelldatum',
'Create HTML' => 'HTML erzeugen',
'Create PDF' => 'PDF erzeugen',
- 'Create a new acceptance status' => 'Einen neuen Abnahmestatus anlegen',
'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen',
'Create a new client' => 'Einen neuen Mandanten anlegen',
'Create a new complexity' => 'Einen Komplexitätsgrad anlegen',
'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden',
'No Journal' => 'Kein Journal',
'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 articles have been added yet.' => 'Es wurden noch keine Artikel hinzugefügt.',
'No background job has been created yet.' => 'Es wurden noch keine Hintergrund-Jobs angelegt.',
'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 abbreviation is missing.' => 'Abkürzung fehlt',
- '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 #1 is already being used by bank account #2.' => 'Das Konto #1 wird schon von Bankkonto #2 benutzt.',
name: Acceptance Statuses
order: 600
params:
- action: RequirementSpecAcceptanceStatus/list
+ action: SimpleSystemSetting/list
+ type: requirement_spec_acceptance_status
- parent: system
id: system_languages_and_translations
name: Languages and translations
+++ /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_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 %]
-<h1>[% FORM.title %]</h1>
-
-[%- 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') %]
--- /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>