From: Moritz Bunkus
Date: Tue, 17 Jan 2017 12:35:30 +0000 (+0100)
Subject: ActionBar: Verwendung bei allen anderen Lager-Funktionen
X-Git-Tag: release-3.5.4~1300
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3c005fa1ac7b96ed002ecf7dc84852e79b4a2638;p=kivitendo-erp.git
ActionBar: Verwendung bei allen anderen Lager-Funktionen
Lager → …
• Erzeugnis fertigen
• Umlagern
• Entnahme
Lager → Berichte → …
• Lagerbestand
• Lagerbuchungen
---
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 @@
-->
-
-
-
-
-
-
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 %]
-
-
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 @@
-->
-
-
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 @@
-->
-
-
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 @@
-->
-
-
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 @@
-->
-