LP 1167541 - Use Workstation OU for default hold pickup lib for staff. user/stompro/lp1167541_use_ws_ou_default_hold_pickup
authorJosh Stompro <stomproj@larl.org>
Thu, 16 Jun 2016 13:28:39 +0000 (08:28 -0500)
committerJosh Stompro <stomproj@larl.org>
Thu, 16 Jun 2016 13:28:39 +0000 (08:28 -0500)
This is part of the solution for LP1167541.  When using
the staff client, use the workstation OU for the initial
hold pickup location when placing holds, instead of the
staff users home_ou.

This solves the issue for sites that use unique staff logins
for staff that move between locations that mainly deal with
customers at the physical site they are at.

Signed-off-by: Josh Stompro <stomproj@larl.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

index 945c9f2..bd4f735 100644 (file)
@@ -987,7 +987,13 @@ sub load_place_hold {
     my @parts = $cgi->param('part');
 
     $ctx->{hold_type} = $cgi->param('hold_type');
-    $ctx->{default_pickup_lib} = $e->requestor->home_ou; # unless changed below
+    #If staff - set default_pickup_lib to workstation ou.
+    if ($ctx->{is_staff}) {
+      $ctx->{default_pickup_lib} = $e->requestor->ws_ou;
+    }
+    else { #if not staff, use home_ou of requestor.
+      $ctx->{default_pickup_lib} = $e->requestor->home_ou; # unless changed below
+    }
     $ctx->{email_notify} = $cgi->param('email_notify');
     if ($cgi->param('phone_notify_checkbox')) {
         $ctx->{phone_notify} = $cgi->param('phone_notify');