Bug 8287: Improve "show checked out items" filter on the overdues report
The "Show any items currently checked out" was confusing, especially if the "From" and "To" due date filters were passed. This patch moves the checkbox close to the 2 other filters and show/hide the due date filters when needed. Test plan: 0. Have some overdue 1. Search for overdues 2. Confirm that the filters are shown/hidden depending on the status of the checkbox 3. Fill "To" with a date, tick the checkbox, submit the form => Confirm that the date was not taken into account Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
a63748e241
commit
35994c1da5
1 changed files with 39 additions and 17 deletions
|
@ -114,16 +114,27 @@
|
||||||
<form method="post" action="/cgi-bin/koha/circ/overdue.pl">
|
<form method="post" action="/cgi-bin/koha/circ/overdue.pl">
|
||||||
<fieldset class="brief">
|
<fieldset class="brief">
|
||||||
<h4>Filter on:</h4>
|
<h4>Filter on:</h4>
|
||||||
<fieldset><legend>Date due:</legend>
|
<fieldset><legend>Date due:</legend>
|
||||||
<ol>
|
<ol>
|
||||||
<li><label for="from">From:</label>
|
<li class="radio">
|
||||||
<input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="datepickerfrom" />
|
<label for="showall">Show any items currently checked out:</label>
|
||||||
</li>
|
[% IF ( showall ) %]
|
||||||
<li>
|
<input type="checkbox" id="showall" name="showall" value="show" checked="checked" />
|
||||||
<label for="to">To:</label>
|
[% ELSE %]
|
||||||
<input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="datepickerto" />
|
<input type="checkbox" id="showall" name="showall" value="show" />
|
||||||
</li>
|
[% END %]
|
||||||
</ol></fieldset>
|
</li>
|
||||||
|
|
||||||
|
<li class="date_due_filter">
|
||||||
|
<label for="from">From:</label>
|
||||||
|
<input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="datepickerfrom" />
|
||||||
|
</li>
|
||||||
|
<li class="date_due_filter">
|
||||||
|
<label for="to">To:</label>
|
||||||
|
<input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="datepickerto" />
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</fieldset>
|
||||||
<ol>
|
<ol>
|
||||||
<li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% filters.borname | html %]" /></li>
|
<li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% filters.borname | html %]" /></li>
|
||||||
<li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
|
<li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
|
||||||
|
@ -132,6 +143,7 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><label>Patron flags:</label>
|
<li><label>Patron flags:</label>
|
||||||
<select name="borflag" size="1" id="borflag">
|
<select name="borflag" size="1" id="borflag">
|
||||||
<option value="">None</option>
|
<option value="">None</option>
|
||||||
|
@ -202,13 +214,6 @@
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="radio"><label for="showall">Show any items currently checked out:</label>
|
|
||||||
[% IF ( showall ) %]
|
|
||||||
<input type="checkbox" id="showall" name="showall" value="show" checked="checked" />
|
|
||||||
[% ELSE %]
|
|
||||||
<input type="checkbox" id="showall" name="showall" value="show" />
|
|
||||||
[% END %]
|
|
||||||
</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
<fieldset class="action">
|
<fieldset class="action">
|
||||||
<input type="submit" value="Apply filter" class="submit" />
|
<input type="submit" value="Apply filter" class="submit" />
|
||||||
|
@ -277,6 +282,18 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_date_due_filters_visibility(){
|
||||||
|
if( $("#showall").is(":checked")) {
|
||||||
|
$(".date_due_filter").hide();
|
||||||
|
$("#from").prop("disabled", true);
|
||||||
|
$("#to").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
$(".date_due_filter").show();
|
||||||
|
$("#from").prop("disabled", false);
|
||||||
|
$("#to").prop("disabled", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var columns_settings = [% TablesSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
|
var columns_settings = [% TablesSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
|
||||||
KohaTable("overduest", {
|
KohaTable("overduest", {
|
||||||
|
@ -285,6 +302,11 @@
|
||||||
"autoWidth": false,
|
"autoWidth": false,
|
||||||
"stateSave": true
|
"stateSave": true
|
||||||
}, columns_settings);
|
}, columns_settings);
|
||||||
|
|
||||||
|
$("#showall").on("change", function(){
|
||||||
|
update_date_due_filters_visibility();
|
||||||
|
});
|
||||||
|
update_date_due_filters_visibility();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
Loading…
Reference in a new issue