From 3e2d76bbfaec296179dc9563bdc6024ef2d210a6 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 Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 58590b9ac722685b5a050da367be2e76145e48c7) Signed-off-by: Lucas Gass --- .../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 88ee777a09..1ba9b93f3a 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 @@ -137,9 +137,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.39.5