From fecb9a11fc44f9d1c8bb9be37ad532c7b2ad710a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 4 Feb 2021 12:20:27 +0000 Subject: [PATCH] Bug 27618: Don't show dropdown if PatronSelfRegistrationLibraryList only has one library This patch modifies the patron entry form in the OPAC so that if there is only one library to choose from, the input is hidden and the single library displays as text. To test, apply the patch and enable PatronSelfRegistration. - Modify the PatronSelfRegistrationLibraryList system preference to include only one library. - Go to the self-registratoin page in the OPAC. - Under "Home library," you should see the library name. If you inspect the source you should see the library branchcode in a hidden form. - Confirm that the form submission includes the correct library information. Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../bootstrap/en/modules/opac-memberentry.tt | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index d9ee294706..fc46fedda5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -239,21 +239,29 @@ [% UNLESS hidden.defined('branchcode') %]
  • - [% IF mandatory.defined('branchcode') %] - - [% ELSE %] - - [% END %] + [% IF ( libraries.size > 1 ) %] + [% IF mandatory.defined('branchcode') %] + + [% ELSE %] + + [% END %] - + [% FOREACH l IN libraries %] + [% IF l.branchcode == borrower.branchcode %] + + [% ELSE %] + + [% END %] [% END %] + + [% ELSE %] + Home library: + [% FOREACH l IN libraries %] + [% l.branchname | html %] + [% END %] - + [% END %]
  • [% END %] -- 2.39.5