@@ -, +, @@
(open/closed)
---
acqui/invoice.pl | 10 +++-
acqui/invoices.pl | 11 ++++
.../lib/jquery/plugins/dataTables.fnFilterAll.js | 39 +++++++++++++
.../prog/en/modules/acqui/invoices.tt | 64 ++++++++++++++++++++--
4 files changed, 116 insertions(+), 8 deletions(-)
create mode 100644 koha-tmpl/intranet-tmpl/lib/jquery/plugins/dataTables.fnFilterAll.js
--- a/acqui/invoice.pl
+++ a/acqui/invoice.pl
@@ -62,7 +62,10 @@ if ( C4::Context->preference('AcqEnableFiles') ) {
}
if ( $op && $op eq 'close' ) {
- CloseInvoice($invoiceid);
+ my @invoiceid = $input->multi_param('invoiceid');
+ foreach my $invoiceid ( @invoiceid ) {
+ CloseInvoice($invoiceid);
+ }
my $referer = $input->param('referer');
if ($referer) {
print $input->redirect($referer);
@@ -70,7 +73,10 @@ if ( $op && $op eq 'close' ) {
}
}
elsif ( $op && $op eq 'reopen' ) {
- ReopenInvoice($invoiceid);
+ my @invoiceid = $input->multi_param('invoiceid');
+ foreach my $invoiceid ( @invoiceid ) {
+ ReopenInvoice($invoiceid);
+ }
my $referer = $input->param('referer');
if ($referer) {
print $input->redirect($referer);
--- a/acqui/invoices.pl
+++ a/acqui/invoices.pl
@@ -112,9 +112,20 @@ foreach my $budget (@$budgets) {
push @budgets_loop, $budget if CanUserUseBudget( $loggedinuser, $budget, $flags );
}
+my (@openedinvoices, @closedinvoices);
+for my $sub ( @{$invoices} ) {
+ unless ( $sub->{closedate} ) {
+ push @openedinvoices, $sub
+ } else {
+ push @closedinvoices, $sub
+ }
+}
+
$template->{'VARS'}->{'budgets_loop'} = \@budgets_loop;
$template->param(
+ openedinvoices => \@openedinvoices,
+ closedinvoices => \@closedinvoices,
do_search => ( $op and $op eq 'do_search' ) ? 1 : 0,
invoices => $invoices,
invoicenumber => $invoicenumber,
--- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/dataTables.fnFilterAll.js
+++ a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/dataTables.fnFilterAll.js
@@ -0,0 +1,39 @@
+/**
+ * Apply the same filter to all DataTable instances on a particular page. The
+ * function call exactly matches that used by `fnFilter()` so regular expression
+ * and individual column sorting can be used.
+ *
+ * DataTables 1.10+ provides this ability through its new API, which is able to
+ * to control multiple tables at a time.
+ * `$('.dataTable').DataTable().search( ... )` for example will apply the same
+ * filter to all tables on the page. The new API should be used in preference
+ * to this older method if at all possible.
+ *
+ * @name fnFilterAll
+ * @summary Apply a common filter to all DataTables on a page
+ * @author [Kristoffer Karlström](http://www.kmmtiming.se/)
+ * @deprecated
+ *
+ * @param {string} sInput Filtering input
+ * @param {integer} [iColumn=null] Column to apply the filter to
+ * @param {boolean} [bRegex] Regular expression flag
+ * @param {boolean} [bSmart] Smart filtering flag
+ *
+ * @example
+ * $(document).ready(function() {
+ * var table = $(".dataTable").dataTable();
+ *
+ * $("#search").keyup( function () {
+ * // Filter on the column (the index) of this element
+ * table.fnFilterAll(this.value);
+ * } );
+ * });
+ */
+
+jQuery.fn.dataTableExt.oApi.fnFilterAll = function(oSettings, sInput, iColumn, bRegex, bSmart) {
+ var settings = $.fn.dataTableSettings;
+
+ for ( var i=0 ; i
@@ -95,7 +101,40 @@ [% END %] |
---|