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 <partner_code> 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 <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
06f7cc332c
commit
bbe77b10d8
2 changed files with 12 additions and 8 deletions
|
@ -290,9 +290,11 @@
|
||||||
<label for="partners" class="required">Select partner libraries:</label>
|
<label for="partners" class="required">Select partner libraries:</label>
|
||||||
<select size="5" multiple="true" id="partners" name="partners" required="required">
|
<select size="5" multiple="true" id="partners" name="partners" required="required">
|
||||||
[% FOREACH partner IN whole.value.partners %]
|
[% FOREACH partner IN whole.value.partners %]
|
||||||
<option value=[% partner.email | html %]>
|
[% IF partner.email && partner.email.length > 0 %]
|
||||||
[% partner.branchcode _ " - " _ partner.surname %]
|
<option value="[% partner.email | html %]">
|
||||||
</option>
|
[% partner.branchcode _ " - " _ partner.surname %]
|
||||||
|
</option>
|
||||||
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -323,20 +323,22 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Filter partner list
|
// Filter partner list
|
||||||
|
// Record the list of all options
|
||||||
|
var ill_partner_options = $('#partners > option');
|
||||||
$('#partner_filter').keyup(function() {
|
$('#partner_filter').keyup(function() {
|
||||||
var needle = $('#partner_filter').val();
|
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 (
|
if (
|
||||||
needle.length == 0 ||
|
needle.length == 0 ||
|
||||||
$(this).is(':selected') ||
|
$(this).is(':selected') ||
|
||||||
$(this).text().match(regex)
|
$(this).text().match(regex)
|
||||||
) {
|
) {
|
||||||
$(this).show();
|
filtered.push($(this));
|
||||||
} else {
|
|
||||||
$(this).hide();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('#partners').empty().append(filtered);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Display the modal containing request supplier metadata
|
// Display the modal containing request supplier metadata
|
||||||
|
|
Loading…
Reference in a new issue