From: Moritz Bunkus Date: Fri, 11 Nov 2016 14:03:54 +0000 (+0100) Subject: ActionBar: Verwendung in MassInvoiceCreatePrint-Controller (nur Rechnungsliste) X-Git-Tag: release-3.5.4~1349 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fdbdd0b1dbcae7c3b86a9ab532cb3377a4fcfd90;p=kivitendo-erp.git ActionBar: Verwendung in MassInvoiceCreatePrint-Controller (nur Rechnungsliste) --- diff --git a/SL/Controller/MassInvoiceCreatePrint.pm b/SL/Controller/MassInvoiceCreatePrint.pm index ef5bfaf74..e5308d06b 100644 --- a/SL/Controller/MassInvoiceCreatePrint.pm +++ b/SL/Controller/MassInvoiceCreatePrint.pm @@ -95,6 +95,8 @@ sub action_list_invoices { $::form->{printer_id} ||= $self->default_printer_id; + $self->setup_list_invoices_action_bar(num_rows => scalar(@{ $self->invoice_models->get })); + $self->render('mass_invoice_create_print_from_do/list_invoices', title => $::locale->text('Open invoice'), noshow => $show, @@ -332,6 +334,30 @@ sub make_filter_summary { $self->{filter_summary} = join ', ', @filter_strings; } + +sub setup_list_invoices_action_bar { + my ($self, %params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Search'), + submit => [ '#search_form', { action => 'MassInvoiceCreatePrint/list_invoices' } ], + accesskey => 'enter', + ], + action => [ + t8('Reset'), + call => [ 'kivi.Project.reset_search_form' ], + ], + action => [ + $::locale->text('Print'), + call => [ 'kivi.MassInvoiceCreatePrint.showMassPrintOptionsOrDownloadDirectly' ], + disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef, + ], + ); + } +} + 1; __END__ diff --git a/js/kivi.MassInvoiceCreatePrint.js b/js/kivi.MassInvoiceCreatePrint.js index d00e56ab9..0c188dcb2 100644 --- a/js/kivi.MassInvoiceCreatePrint.js +++ b/js/kivi.MassInvoiceCreatePrint.js @@ -115,6 +115,10 @@ namespace('kivi.MassInvoiceCreatePrint', function(ns) { return true; }; + + this.resetSearchForm = function() { + $("#filter_table input").val(""); + }; }); $(kivi.MassInvoiceCreatePrint.setup); diff --git a/templates/webpages/mass_invoice_create_print_from_do/_filter.html b/templates/webpages/mass_invoice_create_print_from_do/_filter.html index 1d906e138..a7b5d9364 100644 --- a/templates/webpages/mass_invoice_create_print_from_do/_filter.html +++ b/templates/webpages/mass_invoice_create_print_from_do/_filter.html @@ -1,6 +1,6 @@ [%- USE L %][%- USE LxERP %][%- USE HTML %]
-
+
[% LxERP.t8('Show Filter') %] [% SELF.filter_summary %] @@ -22,14 +22,10 @@ - [% L.hidden_tag('action', 'MassInvoiceCreatePrint/dispatch') %] + [% L.hidden_tag('action', 'MassInvoiceCreatePrint/' _ LIST_ACTION, id='filter_action') %] [% L.hidden_tag('sort_by', FORM.sort_by) %] [% L.hidden_tag('sort_dir', FORM.sort_dir) %] [% L.hidden_tag('page', FORM.page) %] - [% L.submit_tag(LIST_ACTION, LxERP.t8('Continue'))%] - - [% LxERP.t8('Reset') %] -
diff --git a/templates/webpages/mass_invoice_create_print_from_do/list_invoices.html b/templates/webpages/mass_invoice_create_print_from_do/list_invoices.html index 8bec62a02..bc8896340 100644 --- a/templates/webpages/mass_invoice_create_print_from_do/list_invoices.html +++ b/templates/webpages/mass_invoice_create_print_from_do/list_invoices.html @@ -4,8 +4,8 @@ [%- INCLUDE "common/flash.html" %] -[% LIST_ACTION = 'action_list_invoices' %] -[%- PROCESS 'mass_invoice_create_print_from_do/_filter.html' filter=SELF.filter %] +[% LIST_ACTION = 'list_invoices' %] +[%- PROCESS 'mass_invoice_create_print_from_do/_filter.html' filter=SELF.invoice_models.filtered.laundered %] [% IF noshow == 1 %] [% invoices = SELF.invoice_models.get; @@ -16,7 +16,7 @@

[%- ELSE %] -
+ @@ -57,21 +57,23 @@ [% L.paginate_controls %] [% END %] -
+ [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %] + [% L.hidden_tag("printer_id") %] + - [% IF SELF.printers.size %] + [% IF SELF.printers.size %] + + [% END %] [%- END %] [%- END %] diff --git a/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html b/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html index 7d2ac038b..61bcd5fcf 100644 --- a/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html +++ b/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html @@ -5,7 +5,7 @@ [%- INCLUDE "common/flash.html" %] -[% LIST_ACTION = 'action_list_sales_delivery_orders' %] +[% LIST_ACTION = 'list_sales_delivery_orders' %] [% SET MODELS = SELF.sales_delivery_order_models; dummy = MODELS.finalize %]