global copy location groups collab/berick/global-copy-location-groups
authorBill Erickson <berick@esilibrary.com>
Fri, 12 Apr 2013 21:58:07 +0000 (17:58 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 12 Apr 2013 22:43:02 +0000 (18:43 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm

index 93cc3e1..fe69d4d 100644 (file)
@@ -460,6 +460,14 @@ sub load_copy_location_groups {
     push(@ctx_orgs, $ctx->{physical_loc}) if $ctx->{physical_loc};
     push(@ctx_orgs, $ctx->{user}->home_ou) if $ctx->{user};
 
+    # if the global copy loc group setting is enabled, 
+    # load all copy location groups, regardless of context
+    my $global = $ctx->{get_org_setting}->(
+        $ctx->{physical_loc} || $ctx_orgs[0],
+        'opac.global_copy_location_groups');
+
+    @ctx_orgs = ($ctx->{aou_tree}->()->id) if $U->is_true($global);
+
     my $grps = $self->editor->search_asset_copy_location_group([
         {
             opac_visible => 't',