
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, rel_3_15 has been updated via 99c30adb72a1c9755d5f74f9e2383d2b77a4bfff (commit) from 6ba23044461d431c4e867858202d660cace6dbef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 99c30adb72a1c9755d5f74f9e2383d2b77a4bfff Author: Jason Stephenson <jason@sigio.com> Date: Fri Aug 14 12:42:24 2020 -0400 LP 1890629: Make Self-Registration Opt-in Settings Lookup Tree Aware Patron self-registration in the OPAC only shows the opt-in settings if the events are owned specifically at one of the locations where patron self-registration is also allowed. The event could be owned higher up the org. tree from the libraries that allow self-registration, particularly in a consortium where not all members do self-registration. This patch changes the search for opt-in events to include the ancestor org. units of those that allow self-registration. Release-note: Makes patron self-registration aware of org unit tree. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Llewellyn Marshall <llewellyn.marshall@dncr.nc.gov> Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org> diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm index c3530334ea..2cb875e217 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm @@ -6,6 +6,7 @@ use OpenILS::Utils::Fieldmapper; use OpenILS::Application::AppUtils; use OpenILS::Utils::CStoreEditor qw/:funcs/; use OpenILS::Event; +use List::MoreUtils qw/uniq/; use Data::Dumper; $Data::Dumper::Indent = 0; my $U = 'OpenILS::Application::AppUtils'; @@ -142,13 +143,20 @@ sub collect_opt_in_settings { my $self = shift; my $e = $self->editor; + # Get the valid_orgs and their ancestors, because the event def + # may be owned higher up the tree. + my @opt_orgs = (); + for my $orgs (map { $U->get_org_ancestors($_) } @{ $self->ctx->{register}{valid_orgs} }) { + push(@opt_orgs, @{$orgs}); + } + my $types = $e->json_query({ select => {cust => ['name']}, from => {atevdef => 'cust'}, transform => 'distinct', where => { '+atevdef' => { - owner => [ map { $_ } @{ $self->ctx->{register}{valid_orgs} } ], + owner => [ uniq @opt_orgs ], active => 't' } } ----------------------------------------------------------------------- Summary of changes: Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- Evergreen ILS