Bug 33829: Fix add patron to patron list if PatronAutoComplete is off

When adding patrons to a patron list we get a JS error about undefined
variables. We can easily fix this problem by defining them even if the
pref is not set.

We are enabling the auto complete even if PatronAutoComplete if off.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-05-25 15:07:25 +02:00 committed by Tomas Cohen Arazi
parent a69551e32e
commit 493819b92b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -69,12 +69,14 @@
</script>
[% END %]
[% IF ( PatronAutoComplete ) %]
<script>
// PatronAutoComplete
<script>
var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]";
var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
var singleBranchMode = '[% singleBranchMode | html %]';
</script>
[% IF ( PatronAutoComplete ) %]
<script>
// PatronAutoComplete
var loggedInClass = "";
$(document).ready(function(){
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]