LP#1167541: Use Patron home org for pickup lib instead of staff's user/miker/lp1167541_staff-hold-patron-pickuplib
authorMike Rylander <mrylander@gmail.com>
Thu, 9 Mar 2017 20:26:44 +0000 (15:26 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 9 Mar 2017 20:26:44 +0000 (15:26 -0500)
When staff are placing a hold for a patron, we should use the patron's
preferred pickup location, and failing that, their home library rather
than the staff's home library.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/opac/staff.js
Open-ILS/web/js/ui/default/staff/services/eframe.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js

index fff3aea..37d9a3c 100644 (file)
@@ -110,6 +110,7 @@ function staff_hold_usr_barcode_changed2(
     }
     cur_hold_barcode = load_info.barcode;
     if(!only_settings || (isload && isload !== true)) document.getElementById('hold_usr_input').value = load_info.barcode; // Safe at this point as we already set cur_hold_barcode
+    if(!only_settings || (isload && isload !== true) && load_info.pickup_lib) document.getElementById('pickup_lib').value = load_info.pickup_lib; // Safe at this point as we already set cur_hold_barcode
     if(load_info.settings['opac.default_pickup_location'])
         document.getElementById('pickup_lib').value = load_info.settings['opac.default_pickup_location'];
     if(!load_info.settings['opac.default_phone']) load_info.settings['opac.default_phone'] = '';
index b9b4dd7..3beaa7c 100644 (file)
@@ -256,6 +256,7 @@ angular.module('egCoreMod')
 
                             deferred.resolve({
                                 "barcode": barcode, 
+                                "pickup_lib": user.home_ou(), 
                                 "settings" : settings, 
                                 "user_email" : user.email(), 
                                 "patron_name" : patron_name
index 1a6680a..26034ba 100644 (file)
@@ -2836,7 +2836,7 @@ commands:
             user.first_given_name() + ' ' +
             ( user.second_given_name() ? user.second_given_name() + ' ' : '' ) +
             ( user.suffix() ? user.suffix() : '');
-        return {"barcode": barcode, "settings" : settings, "user_email" : user.email(), "patron_name" : patron_name};
+        return {"barcode": barcode, "pickup_lib" : user.home_ou(), "settings" : settings, "user_email" : user.email(), "patron_name" : patron_name};
     },
 
     'sort_menu' : function(menu, recurse) {