From 3c005fa1ac7b96ed002ecf7dc84852e79b4a2638 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 17 Jan 2017 13:35:30 +0100 Subject: [PATCH] ActionBar: Verwendung bei allen anderen Lager-Funktionen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Lager → … • Erzeugnis fertigen • Umlagern • Entnahme Lager → Berichte → … • Lagerbestand • Lagerbuchungen --- bin/mozilla/wh.pl | 118 +++++++++++++++++- locale/de/all | 3 +- templates/webpages/wh/journal_filter.html | 9 +- .../webpages/wh/removal_parts_selection.html | 8 +- templates/webpages/wh/report_filter.html | 7 +- .../webpages/wh/transfer_parts_selection.html | 10 +- .../webpages/wh/warehouse_selection.html | 9 +- .../wh/warehouse_selection_assembly.html | 12 +- 8 files changed, 120 insertions(+), 56 deletions(-) diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index ceb367ae1..214a26a64 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -43,6 +43,7 @@ use SL::CT; use SL::IC; use SL::WH; use SL::OE; +use SL::Locale::String qw(t8); use SL::ReportGenerator; use SL::DB::Part; @@ -108,16 +109,17 @@ sub transfer_warehouse_selection { my $content; if ($form->{trans_type} eq 'removal') { - $form->{nextsub} = "removal_parts_selection"; + setup_wh_transfer_warehouse_selection_action_bar("removal_parts_selection"); $form->{title} = $locale->text('Removal from Warehouse'); $content = $form->parse_html_template('wh/warehouse_selection'); } elsif (!$form->{trans_type} || ($form->{trans_type} eq 'transfer')) { - $form->{nextsub} = "transfer_parts_selection"; + setup_wh_transfer_warehouse_selection_action_bar("transfer_parts_selection"); $form->{title} = $locale->text('Transfer'); $content = $form->parse_html_template('wh/warehouse_selection'); } elsif ($form->{trans_type} eq 'assembly') { + setup_wh_transfer_warehouse_selection_assembly_action_bar(); $form->{title} = $locale->text('Produce Assembly'); $content = $form->parse_html_template('wh/warehouse_selection_assembly'); } @@ -139,6 +141,8 @@ sub transfer_parts_selection { transfer_or_removal_prepare_contents('direction' => 'transfer'); + setup_wh_transfer_parts_action_bar(); + $form->{title} = $locale->text('Transfer'); $form->header(); print $form->parse_html_template("wh/transfer_parts_selection"); @@ -442,6 +446,8 @@ sub removal_parts_selection { transfer_or_removal_prepare_contents('direction' => 'out'); + setup_wh_removal_parts_selection_action_bar(); + $form->{title} = $locale->text('Removal'); $form->header(); print $form->parse_html_template("wh/removal_parts_selection"); @@ -557,6 +563,8 @@ sub journal { show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} }); + setup_wh_journal_action_bar(); + $form->header(); print $form->parse_html_template("wh/journal_filter", { "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) }); @@ -732,7 +740,7 @@ sub generate_journal { $report->set_options('raw_bottom_info_text' => $form->parse_html_template('common/paginate', { 'pages' => $pages , 'base_url' => $href.'&sort='.$form->{sort}.'&order='.$form->{order}}) ); } - $report->generate_with_headers(); + $report->generate_with_headers(action_bar => 1); $main::lxdebug->leave_sub(); } @@ -757,10 +765,11 @@ sub report { $form->{title} = $locale->text("Report about warehouse contents"); + setup_wh_report_action_bar(); + $form->header(); print $form->parse_html_template("wh/report_filter", - { "nextsub" => "generate_report", - "WAREHOUSES" => $form->{WAREHOUSES}, + { "WAREHOUSES" => $form->{WAREHOUSES}, "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) }); $main::lxdebug->leave_sub(); @@ -964,7 +973,7 @@ sub generate_report { {'pages' => $pages , 'base_url' => $href}) ); } - $report->generate_with_headers(); + $report->generate_with_headers(action_bar => 1); $main::lxdebug->leave_sub(); } @@ -1061,6 +1070,103 @@ sub stock { call_sub($form->{stock_nextsub} || $form->{nextsub}); } +sub setup_wh_transfer_warehouse_selection_action_bar { + my ($action) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Update'), + submit => [ '#form', { action => $action } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_wh_transfer_warehouse_selection_assembly_action_bar { + my ($action) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Update'), + submit => [ '#form', { action => 'transfer_assembly_update_part' } ], + accesskey => 'enter', + ], + action => [ + t8('Produce'), + submit => [ '#form', { action => 'create_assembly' } ], + disabled => $::form->{parts_id} ? undef : $::locale->text('No assembly has been selected yet.'), + ], + ); + } +} + +sub setup_wh_transfer_parts_action_bar { + my ($action) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Transfer'), + submit => [ '#form', { action => 'transfer_parts' } ], + accesskey => 'enter', + ], + action => [ + t8('Back'), + call => [ 'kivi.history_back' ], + ], + ); + } +} + +sub setup_wh_removal_parts_selection_action_bar { + my ($action) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Transfer out'), + submit => [ '#form', { action => 'remove_parts' } ], + accesskey => 'enter', + ], + action => [ + t8('Back'), + call => [ 'kivi.history_back' ], + ], + ); + } +} + +sub setup_wh_report_action_bar { + my ($action) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Show'), + submit => [ '#form', { action => 'generate_report' } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_wh_journal_action_bar { + my ($action) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Show'), + submit => [ '#form', { action => 'generate_journal' } ], + accesskey => 'enter', + ], + ); + } +} + 1; __END__ diff --git a/locale/de/all b/locale/de/all index 9ba028bd0..fb92910b0 100755 --- a/locale/de/all +++ b/locale/de/all @@ -665,7 +665,6 @@ $self->{texts} = { 'Could not update prices!' => 'Preise konnten nicht aktualisiert werden!', 'Country' => 'Land', 'Create' => 'Anlegen', - 'Create Assembly' => 'Erzeugnis fertigen', 'Create Chart of Accounts' => 'Zu verwendender Kontenplan', 'Create Dataset' => 'Neue Datenbank anlegen', 'Create Date' => 'Erstelldatum', @@ -1841,6 +1840,7 @@ $self->{texts} = { 'No action defined.' => 'Keine Aktion definiert.', 'No article has been selected yet.' => 'Es wurde noch kein Artikel ausgewählt.', 'No articles have been added yet.' => 'Es wurden noch keine Artikel hinzugefügt.', + 'No assembly has been selected yet.' => 'Es wurde noch kein Erzeugnis ausgewahlt.', 'No background job has been created yet.' => 'Es wurden noch keine Hintergrund-Jobs angelegt.', 'No bank account chosen!' => 'Kein Bankkonto ausgewählt!', '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.', @@ -2231,6 +2231,7 @@ $self->{texts} = { 'Private E-mail' => 'Private E-Mail', 'Private Phone' => 'Privates Tel.', 'Problem' => 'Problem', + 'Produce' => 'Fertigen', 'Produce Assembly' => 'Erzeugnis fertigen', 'Production' => 'Produktion', 'Production (typeabbreviation)' => 'P', diff --git a/templates/webpages/wh/journal_filter.html b/templates/webpages/wh/journal_filter.html index 8b342d7c2..1101d1fa5 100644 --- a/templates/webpages/wh/journal_filter.html +++ b/templates/webpages/wh/journal_filter.html @@ -66,9 +66,7 @@ --> -
- - +

@@ -207,9 +205,4 @@

- -

- -

- diff --git a/templates/webpages/wh/removal_parts_selection.html b/templates/webpages/wh/removal_parts_selection.html index 5bc1e30a9..edc45d369 100644 --- a/templates/webpages/wh/removal_parts_selection.html +++ b/templates/webpages/wh/removal_parts_selection.html @@ -2,9 +2,8 @@ [%- USE HTML %][%- USE JavaScript %]

[% title %]

-
+ -

[% 'Removal from warehouse' | $T8 %]: [% warehouse_description %]

@@ -78,9 +77,4 @@

- -

- -

- diff --git a/templates/webpages/wh/report_filter.html b/templates/webpages/wh/report_filter.html index 810743efa..b41e905ae 100644 --- a/templates/webpages/wh/report_filter.html +++ b/templates/webpages/wh/report_filter.html @@ -66,7 +66,7 @@ --> -
+ @@ -194,9 +194,4 @@

- -

- -

- diff --git a/templates/webpages/wh/transfer_parts_selection.html b/templates/webpages/wh/transfer_parts_selection.html index 0f5d2f50a..245da8b05 100644 --- a/templates/webpages/wh/transfer_parts_selection.html +++ b/templates/webpages/wh/transfer_parts_selection.html @@ -34,9 +34,8 @@ --> -
+ -

[% 'Transfer from warehouse' | $T8 %]: [% warehouse_description %]

@@ -120,11 +119,4 @@

- -
- -

- -

- diff --git a/templates/webpages/wh/warehouse_selection.html b/templates/webpages/wh/warehouse_selection.html index 6c20594e7..756e95676 100644 --- a/templates/webpages/wh/warehouse_selection.html +++ b/templates/webpages/wh/warehouse_selection.html @@ -60,9 +60,7 @@ --> -
- - + [% IF saved_message %]

[% saved_message %]

@@ -122,9 +120,4 @@

- -

- -

- diff --git a/templates/webpages/wh/warehouse_selection_assembly.html b/templates/webpages/wh/warehouse_selection_assembly.html index 43746dbd3..2bbd77323 100644 --- a/templates/webpages/wh/warehouse_selection_assembly.html +++ b/templates/webpages/wh/warehouse_selection_assembly.html @@ -55,10 +55,7 @@ --> -
- - - + [% IF saved_message %]

[% saved_message %]

@@ -120,13 +117,6 @@

- -

- - [%- IF parts_id %] - - [%- END %] -