Bug 29952: Replace obsolete DataTable column filter function

The "Filter paid transactions" link on the Accounting -> Transactions
page is broken because it uses an obsolete DataTables function for
filtering. This patch updates it to use the current syntax, available in
DataTables since version 1.10.

To test, apply the patch and locate a patron in the staff interface who
has multiple fines, some paid.

- View the patron's "Accounting" page and click the "Transactions" tab.
- Click the "Filter paid transactions" link. The table should be
  filtered so that only transactions with an outstanding amount > zero
  are shown.
- The filter link should change to read "Show all transactions."
- Clicking "Show all transactions" should clear the filter.
- Test with one or more columns hidden using the "Columns" control.
  Filtering should still work correctly with columns hidden.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a8dea1e702)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2022-01-27 11:50:28 +00:00 committed by Andrew Fuerste-Henry
parent bbb22c061a
commit b23a0f8a5f
1 changed files with 1 additions and 1 deletions

View File

@ -349,7 +349,7 @@
var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
$(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
}
table_account_fines.fnFilter(filteredValue, 10, true, false);
table_account_fines.DataTable().columns( 13 ).search( filteredValue, true, false ).draw();
$(this).toggleClass('filtered');
});