From 9205a42e2d316266a7d77d1eac6f913c7ae0dd07 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 26 Jan 2017 14:04:20 +0100 Subject: [PATCH] ActionBar: Verwendung beim Massendruck --- bin/mozilla/bp.pl | 39 ++++++++++++++++++++++++++- templates/webpages/bp/list_spool.html | 15 ++++------- templates/webpages/bp/search.html | 8 +----- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index f40708b80..439709ebc 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -33,6 +33,7 @@ #====================================================================== use SL::BP; +use SL::Locale::String qw(t8); use Data::Dumper; use List::Util qw(first); @@ -83,6 +84,8 @@ sub search { my $bp_accounts = $::form->{type} =~ /check|receipt/ && BP->payment_accounts(\%::myconfig, $::form); + setup_bp_search_action_bar(); + $::form->header; print $::form->parse_html_template('bp/search', { label => \%label, @@ -183,6 +186,8 @@ sub list_spool { $::form->get_lists(printers => "ALL_PRINTERS"); + setup_bp_list_spool_action_bar(); + $::form->header; print $::form->parse_html_template('bp/list_spool', { href => build_std_url('bp.pl', @href_options), @@ -195,4 +200,36 @@ sub list_spool { $::lxdebug->leave_sub; } -sub continue { call_sub($::form->{"nextsub"}); } +sub setup_bp_search_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Show'), + submit => [ '#form', { action => "list_spool" } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_bp_list_spool_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Remove'), + submit => [ '#form', { action => "remove" } ], + checks => [ [ 'kivi.check_if_entries_selected', '.check_all' ] ], + confirm => t8('Are you sure you want to remove the marked entries from the queue?'), + ], + action => [ + t8('Print'), + submit => [ '#form', { action => "print" } ], + checks => [ [ 'kivi.check_if_entries_selected', '.check_all' ] ], + ], + ); + } +} diff --git a/templates/webpages/bp/list_spool.html b/templates/webpages/bp/list_spool.html index ce5aff8d2..51e7382bc 100644 --- a/templates/webpages/bp/list_spool.html +++ b/templates/webpages/bp/list_spool.html @@ -7,7 +7,11 @@

[% title | html %]

-
+ + +

+ [% LxERP.t8("Printer") %]: [% L.select_tag('printer', ALL_PRINTERS, title_key = 'printer_description') %] +

[% FOREACH option IN options %] @@ -54,9 +58,6 @@ -


-
- [% L.hidden_tag('callback', callback) %] [% L.hidden_tag('title', title) %] [% L.hidden_tag('vc', vc) %] @@ -71,10 +72,4 @@ [% L.hidden_tag('quonumber', quonumber) %] [% L.hidden_tag('customer', customer) %] [% L.hidden_tag('vendor', vendor) %] - -[% L.submit_tag('action', LxERP.t8('Remove'), confirm=LxERP.t8('Are you sure you want to remove the marked entries from the queue?')) %] -[% L.submit_tag('action', LxERP.t8('Print')) %] - -[% L.select_tag('printer', ALL_PRINTERS, title_key = 'printer_description') %] -
diff --git a/templates/webpages/bp/search.html b/templates/webpages/bp/search.html index 6baf32765..c211aef71 100644 --- a/templates/webpages/bp/search.html +++ b/templates/webpages/bp/search.html @@ -2,7 +2,7 @@ [%- USE T8 %] [%- USE LxERP %] [%- USE HTML %] -
+

[% 'Print' | $T8 %] [% label.$type.title %]

[% L.hidden_tag('title', LxERP.t8('Print') _ ' ' _ label.$type.title) %] @@ -55,14 +55,8 @@ -
-
[% L.hidden_tag('sort', 'transdate') %] [% L.hidden_tag('vc', vc) %] [% L.hidden_tag('type', type) %] -[% L.hidden_tag('nextsub', 'list_spool') %] - -[% L.submit_tag('action', LxERP.t8('Continue')) %] -
-- 2.20.1