+++ /dev/null
-package SL::Controller::Department;
-
-use strict;
-
-use parent qw(SL::Controller::Base);
-
-use SL::DB::Department;
-use SL::Helper::Flash;
-
-use Rose::Object::MakeMethods::Generic
-(
- scalar => [ qw(department) ],
-);
-
-__PACKAGE__->run_before('check_auth');
-__PACKAGE__->run_before('load_department', only => [ qw(edit update destroy) ]);
-
-#
-# actions
-#
-
-sub action_list {
- my ($self) = @_;
-
- $self->render('department/list',
- title => $::locale->text('Departments'),
- DEPARTMENTS => SL::DB::Manager::Department->get_all_sorted);
-}
-
-sub action_new {
- my ($self) = @_;
-
- $self->render('department/form', title => $::locale->text('Create a new department'));
-}
-
-sub action_edit {
- my ($self) = @_;
- $self->render('department/form', title => $::locale->text('Edit department'));
-}
-
-sub action_create {
- my ($self) = @_;
-
- $self->{department} = SL::DB::Department->new;
- $self->create_or_update;
-}
-
-sub action_update {
- my ($self) = @_;
- $self->create_or_update;
-}
-
-sub action_destroy {
- my ($self) = @_;
-
- if (eval { $self->{department}->delete; 1; }) {
- flash_later('info', $::locale->text('The department has been deleted.'));
- } else {
- flash_later('error', $::locale->text('The department is in use and cannot be deleted.'));
- }
-
- $self->redirect_to(action => 'list');
-}
-
-#
-# filters
-#
-
-sub check_auth {
- $::auth->assert('config');
-}
-
-#
-# helpers
-#
-
-sub create_or_update {
- my $self = shift;
- my $is_new = !$self->{department}->id;
- my $params = delete($::form->{department}) || { };
-
- $self->{department}->assign_attributes(%{ $params });
-
- my @errors = $self->{department}->validate;
-
- if (@errors) {
- flash('error', @errors);
- $self->render('department/form', title => $is_new ? $::locale->text('Create a new department') : $::locale->text('Edit department'));
- return;
- }
- $self->{department}->save;
-
- flash_later('info', $is_new ? $::locale->text('The department has been created.') : $::locale->text('The department has been saved.'));
- $self->redirect_to(action => 'list');
-}
-
-sub load_department {
- my ($self) = @_;
- $self->{department} = SL::DB::Department->new(id => $::form->{id})->load;
-}
-
-1;
'Add bank account' => 'Bankkonto erfassen',
'Add booking group' => 'Buchungsgruppe erfassen',
'Add custom variable' => 'Benutzerdefinierte Variable erfassen',
+ 'Add department' => 'Abteilung hinzufügen',
'Add empty line (csv_import)' => 'Leere Zeile einfügen',
'Add function block' => 'Funktionsblock hinzufügen',
'Add headers from last uploaded file (csv_import)' => 'Spalten aus der hochgeladenen Datei einfügen',
'Are you sure you want to delete this background job?' => 'Sind Sie sicher, dass Sie diesen Hintergrund-Job löschen möchten?',
'Are you sure you want to delete this business?' => 'Sind Sie sicher, dass Sie diesen Kunden-/Lieferantentyp löschen wollen?',
'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?',
- 'Are you sure you want to delete this department?' => 'Sind Sie sicher, dass Sie diese Abteilung löschen wollen?',
'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?',
'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
'Are you sure you want to remove the marked entries from the queue?' => 'Sind Sie sicher, dass die markierten Einträge von der Warteschlange gelöscht werden sollen?',
'Create a new client' => 'Einen neuen Mandanten anlegen',
'Create a new complexity' => 'Einen Komplexitätsgrad anlegen',
'Create a new delivery term' => 'Neue Lieferbedingungen anlegen',
- 'Create a new department' => 'Eine neue Abteilung erfassen',
'Create a new group' => 'Neue Benutzergruppe erfassen',
'Create a new payment term' => 'Neue Zahlungsbedingungen anlegen',
'Create a new predefined text' => 'Einen neuen vordefinierten Textblock anlegen',
'Create new business' => 'Kunden-/Lieferantentyp erfassen',
'Create new client #1' => 'Neuen Mandanten #1 anlegen',
'Create new delivery term' => 'Neue Lieferbedingungen anlegen',
- 'Create new department' => 'Neue Abteilung erfassen',
'Create new payment term' => 'Neue Zahlungsbedingung anlegen',
'Create new project type' => 'Neuen Projekttypen anlegen',
'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen',
'No delievery orders selected, please set one checkbox!' => 'Kein Lieferschein selektiert, bitte eine Box anklicken!',
'No delivery orders have been selected.' => 'Es wurden keine Lieferscheine ausgewählt.',
'No delivery term has been created yet.' => 'Es wurden noch keine Lieferbedingungen angelegt',
- 'No department has been created yet.' => 'Es wurde noch keine Abteilung erfasst.',
'No document' => 'Kein Datei mitschicken (ggf. Anhänge)',
'No draft was found.' => 'Kein Entwurf gefunden.',
'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.',
'The delivery term has been deleted.' => 'Die Lieferbedingungen wurden gelöscht.',
'The delivery term has been saved.' => 'Die Lieferbedingungen wurden gespeichert.',
'The delivery term is in use and cannot be deleted.' => 'Die Lieferbedingungen werden bereits verwendet und können nicht gelöscht werden.',
- 'The department has been created.' => 'Die Abteilung wurde angelegt.',
- 'The department has been deleted.' => 'Die Abteilung wurde gelöscht.',
- 'The department has been saved.' => 'Die Abteilung wurde gespeichert.',
- 'The department is in use and cannot be deleted.' => 'Die Abteilung wird benutzt und kann nicht gelöscht werden.',
'The description is missing.' => 'Die Beschreibung fehlt.',
'The description is not unique.' => 'Die Beschreibung ist nicht eindeutig.',
'The description is shown on the form. Chose something short and descriptive.' => 'Die Beschreibung wird in der jeweiligen Maske angezeigt. Sie sollte kurz und prägnant sein.',
+++ /dev/null
-[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
-[% SET is_used = SELF.department.is_used %]
-<h1>[% FORM.title %]</h1>
-
- <form method="post" action="controller.pl">
-
-[%- INCLUDE 'common/flash.html' %]
-
- <table>
- <tr>
- <td>[%- 'Description' | $T8 %]</td>
- <td>[% L.input_tag("department.description", SELF.department.description) %]</td>
- </tr>
- </table>
-
- <p>
- [% L.hidden_tag("id", SELF.department.id) %]
- [% L.hidden_tag("action", "Department/dispatch") %]
- [% L.submit_tag("action_" _ (SELF.department.id ? "update" : "create"), LxERP.t8('Save')) %]
- [%- IF SELF.department.id && !is_used %]
- [% L.submit_tag("action_destroy", LxERP.t8("Delete"), "confirm", LxERP.t8("Are you sure you want to delete this department?")) %]
- [%- END %]
- <a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a>
- </p>
- </form>
+++ /dev/null
-[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
-<h1>[% FORM.title %]</h1>
-
-[%- INCLUDE 'common/flash.html' %]
-
- <form method="post" action="controller.pl">
- [% IF !DEPARTMENTS.size %]
- <p>
- [%- 'No department has been created yet.' | $T8 %]
- </p>
-
- [%- ELSE %]
- <table id="department_list" width="100%">
- <thead>
- <tr class="listheading">
- <th width="100%">[%- 'Description' | $T8 %]</th>
- </tr>
- </thead>
-
- <tbody>
- [%- FOREACH department = DEPARTMENTS %]
- <tr class="listrow[% loop.count % 2 %]" id="department_id_[% department.id %]">
- <td>
- <a href="[% SELF.url_for(action => 'edit', id => department.id) %]">
- [%- HTML.escape(department.description) %]
- </a>
- </td>
- </tr>
- [%- END %]
- </tbody>
- </table>
- [%- END %]
-
- <hr size="3" noshade>
-
- <p>
- <a href="[% SELF.url_for(action => 'new') %]">[%- 'Create new department' | $T8 %]</a>
- </p>
- </form>