From cded3d3b31801ce01a075d6c56ea3c48552562a6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 11 Jan 2017 16:39:04 +0100 Subject: [PATCH] ActionBar: Verwendung bei Angebots-/Auftragssuche --- bin/mozilla/oe.pl | 20 +++++++++++++++++++- locale/de/all | 2 +- templates/webpages/oe/orders_bottom.html | 5 ----- templates/webpages/oe/orders_top.html | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index f24612112..2d89a05d7 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -435,6 +435,23 @@ sub setup_oe_search_action_bar { } } +sub setup_oe_orders_action_bar { + my %params = @_; + + return unless $::form->{type} eq 'sales_order'; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('New sales order'), + submit => [ '#form', { action => 'edit' } ], + checks => [ [ 'kivi.check_if_entries_selected', '[name^=multi_id_]' ] ], + accesskey => 'enter', + ], + ); + } +} + sub form_header { $main::lxdebug->enter_sub(); my @custom_hiddens; @@ -1158,7 +1175,7 @@ sub orders { $report->set_options('top_info_text' => join("\n", @options), 'raw_top_info_text' => $form->parse_html_template('oe/orders_top'), - 'raw_bottom_info_text' => $form->parse_html_template('oe/orders_bottom', { 'SHOW_CONTINUE_BUTTON' => $allow_multiple_orders }), + 'raw_bottom_info_text' => $form->parse_html_template('oe/orders_bottom'), 'output_format' => 'HTML', 'title' => $form->{title}, 'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time), @@ -1239,6 +1256,7 @@ sub orders { $report->add_separator(); $report->add_data(create_subtotal_row(\%totals, \@columns, \%column_alignment, \@subtotal_columns, 'listtotal')); + setup_oe_orders_action_bar(); $report->generate_with_headers(action_bar => 1); $main::lxdebug->leave_sub(); diff --git a/locale/de/all b/locale/de/all index b8d20864a..cf5552bb2 100755 --- a/locale/de/all +++ b/locale/de/all @@ -3568,7 +3568,7 @@ $self->{texts} = { 'You have not added bank accounts yet.' => 'Sie haben noch keine Bankkonten angelegt.', 'You have not selected any delivery order.' => 'Sie haben keinen Lieferschein ausgewählt.', 'You have not selected any export.' => 'Sie haben keinen Export ausgewählt.', - 'You have not selected any item.' => 'Sie haben keine noch nicht gebuchten Einträge ausgewählt.', + 'You have not selected any item.' => 'Sie haben keine Einträge ausgewählt.', 'You have selected none of the invoices.' => 'Sie haben keine der Rechnungen ausgewählt.', 'You have to define a unit as a multiple of a smaller unit.' => 'Sie müssen Einheiten als ein Vielfaches einer kleineren Einheit eingeben.', 'You have to enter a company name in the client configuration.' => 'Sie müssen in der Mandantenkonfiguration einen Firmennamen angeben.', diff --git a/templates/webpages/oe/orders_bottom.html b/templates/webpages/oe/orders_bottom.html index 5ceb69c47..704374fc7 100644 --- a/templates/webpages/oe/orders_bottom.html +++ b/templates/webpages/oe/orders_bottom.html @@ -1,10 +1,5 @@ [%- USE T8 %] [% USE HTML %] - [%- IF SHOW_CONTINUE_BUTTON %] - [% 'New sales order' | $T8 %]
- - [%- END %] - diff --git a/templates/webpages/oe/orders_top.html b/templates/webpages/oe/orders_top.html index f6bc1de7b..b94d6f55c 100644 --- a/templates/webpages/oe/orders_top.html +++ b/templates/webpages/oe/orders_top.html @@ -1 +1 @@ -
+ -- 2.20.1