Bug fix to recognize user's default pickup library for holds when they are logged in.
authorTerran McCanna <tmccanna@georgialibraries.org>
Fri, 20 Dec 2013 17:58:50 +0000 (12:58 -0500)
committerTerran McCanna <tmccanna@georgialibraries.org>
Fri, 20 Dec 2013 17:58:50 +0000 (12:58 -0500)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm

index 77a7eae..c50e1dd 100644 (file)
@@ -79,6 +79,8 @@ sub load_getit {
     return $self->save_item_to_bookbag($rec_id, $bbag_id) if $action eq 'save';
     return $self->login_and_place_hold($rec_id) if $action eq 'hold';
 
+
+
     # if the user is logged in, fetch his bookbags
     if ($ctx->{user}) {
         $ctx->{bookbags} = $self->editor->search_container_biblio_record_entry_bucket([
@@ -91,6 +93,15 @@ sub load_getit {
         ]);
     }
 
+    # If user is logged in and has a default pickup location, grab it
+    if ($ctx->{user}) {
+        my $set_map = $self->ctx->{user_setting_map};
+        if ($$set_map{'opac.default_pickup_location'}) {
+            $ctx->{default_pickup_lib} = $$set_map{'opac.default_pickup_location'};
+        }
+    }
+
+
     $self->ctx->{page} = 'getit'; # repair the page
     return Apache2::Const::OK;
 }