From: Dan Briem Date: Tue, 25 Aug 2020 19:47:15 +0000 (-0400) Subject: LP#1361270 Self-registration doesn't retain org unit on refresh X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e9bac1c7e19bdf0f55f086e4f9ba99e122ce95c5;p=evergreen%2Fmasslnc.git LP#1361270 Self-registration doesn't retain org unit on refresh This sets the self-registration form's org unit selector to the the current org unit request parameter if it's set and self- registration is allowed for that org unit. This will preopulate the org selector on refresh or error instead of resetting to the default context. To test: 1. Administration->Local Administration->Library Settings Editor set Allow Patron Self-Registration to True (top context) 2. go to OPAC->Request Library Card (stock link is on bottom) 3. select a Home Library and click Submit Registration 4. note the Home Library select doesn't retain your selection 5. apply this fix and repeat steps 6. note the Home Library is retained Signed-off-by: Dan Briem Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/src/templates/opac/register.tt2 b/Open-ILS/src/templates/opac/register.tt2 index d1086511cf..206ca5a60f 100644 --- a/Open-ILS/src/templates/opac/register.tt2 +++ b/Open-ILS/src/templates/opac/register.tt2 @@ -99,6 +99,14 @@ END; ) | html %] [% END %] + [% + #prepopulate org selector on refresh or error + cgi_org = CGI.param('stgu.home_ou') | html; + IF cgi_org && ctx.register.valid_orgs.grep("^$cgi_org$").size; + prepopulate_org = cgi_org; + END + %] +
@@ -107,7 +115,7 @@ END;
[% INCLUDE build_org_selector name='stgu.home_ou' - value=value || ctx_org + value=value || prepopulate_org || ctx_org can_have_users_only=1 valid_org_list=ctx.register.valid_orgs %]