Browse Source

Bug 25614: Move ILL request keyword filter to sidebar

On the ILL request list page there are two filters for the table: One in
the sidebar and one configured automatically by the DataTables plugin. I
think these two systems are conflicting somehow to prevent the "clear
filter" button in the table toolbar from working correctly.

This patch doesn't fix the bug but avoids it: Since the filter field in
the table toolbar is duplicating the functionality of the form in the
sidebar, we could hide it and rely on the sidebar filter instead.

To test, apply the patch and go to the ILL requests page in the staff
interface.

 - The table of requests should display without a search form or "clear
   filter" button at the top.
 - The left-hand sidebar form should now have a "keyword" filter option
   which searches any column in the table.
 - Other filter fields should work as before.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Owen Leonard 2 years ago
committed by Jonathan Druart
parent
commit
6c5ad42edd
  1. 4
      koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
  2. 21
      koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js

4
koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt

@ -37,6 +37,10 @@
<fieldset class="brief">
<h3>Filters</h3>
<ol>
<li>
<label for="illfilter_keyword">Keyword:</label>
<input type="text" name="illfilter_keyword" id="illfilter_keyword" />
</li>
<li>
<label for="illfilter_status">Status:</label>
<select name="illfilter_status" id="illfilter_status">

21
koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js

@ -116,6 +116,26 @@ $(document).ready(function() {
$('#illfilter_patron').val('');
}
},
keyword: {
listener: function () {
var me = 'keyword';
$('#illfilter_keyword').change(function () {
var val = $('#illfilter_keyword').val();
if (val && val.length > 0) {
activeFilters[me] = function () {
table.api().search(val);
}
} else {
if (activeFilters.hasOwnProperty(me)) {
delete activeFilters[me];
}
}
});
},
clear: function () {
$('#illfilter_keyword').val('');
}
},
dateModified: {
clear: function() {
$('#illfilter_datemodified_start, #illfilter_datemodified_end').val('');
@ -455,6 +475,7 @@ $(document).ready(function() {
'sPaginationType': "full_numbers", // Pagination display
'deferRender': true, // Improve performance on big datasets
'data': dataCopy,
"dom": '<"top pager"<"table_entries"ilp><"table_controls"B>>tr<"bottom pager"ip>',
'columns': colData,
'originalData': data, // Enable render functions to access
// our original data

Loading…
Cancel
Save