From f30f50be6ea874caaf854263612f1c17e85bc5bc Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Mon, 27 Jan 2020 12:00:47 +0000 Subject: [PATCH] Bug 24518: Fix IE11 partner filtering This patch adopts the approach detailed in comment #1. It also fixes a couple of additional minor bugs relating to the ILL partner list: - Exclude partners with no email address, we cannot use them - Quote the "value" attribute to avoid warnings displayed by IE, they should be quoted anyway! Test plan: USE IE11 - Apply the patch - Define 3 ILL partner patrons (patrons in the category that has a code that matches the value in the ILL config). One patron should have no email address, the other two should have an email address - Navigate to "Place request with partners" for an ILL request - TEST: Observe that the patron with no email address is not displayed - Try filtering the list - TEST: Observe that the list filters correctly Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart Did not test on I11, but regression tested ok --- .../prog/en/modules/ill/ill-requests.tt | 8 +++++--- koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 12 +++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index b5ccab44b8..dc921283e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -290,9 +290,11 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index 1365174674..877d5f1220 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -323,20 +323,22 @@ $(document).ready(function() { }); // Filter partner list + // Record the list of all options + var ill_partner_options = $('#partners > option'); $('#partner_filter').keyup(function() { var needle = $('#partner_filter').val(); - $('#partners > option').each(function() { - var regex = new RegExp(needle, 'i'); + var regex = new RegExp(needle, 'i'); + var filtered = []; + ill_partner_options.each(function() { if ( needle.length == 0 || $(this).is(':selected') || $(this).text().match(regex) ) { - $(this).show(); - } else { - $(this).hide(); + filtered.push($(this)); } }); + $('#partners').empty().append(filtered); }); // Display the modal containing request supplier metadata -- 2.20.1