From a162fdd5f1d7ca1fe1911da762c74e36f4d18a37 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Dec 2020 15:28:50 +0100 Subject: [PATCH] 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 --- .../intranet-tmpl/prog/en/modules/circ/overdue.tt | 56 +++++++++++++++------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt index f5a32f2d1c..d4c90e5700 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt @@ -114,16 +114,27 @@

Filter on:

-
Date due: -
    -
  1. - -
  2. -
  3. - - -
  4. -
+
Date due: +
    +
  1. + + [% IF ( showall ) %] + + [% ELSE %] + + [% END %] +
  2. + +
  3. + + +
  4. +
  5. + + +
  6. +
+
  1. +
  2. -
  3. - [% IF ( showall ) %] - - [% ELSE %] - - [% END %] -
@@ -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(){ var columns_settings = [% TablesSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %]; KohaTable("overduest", { @@ -285,6 +302,11 @@ "autoWidth": false, "stateSave": true }, columns_settings); + + $("#showall").on("change", function(){ + update_date_due_filters_visibility(); + }); + update_date_due_filters_visibility(); }); [% END %] -- 2.11.0