changed hold creation to make request_lib the ws_ou of the requestor - also added...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 Sep 2006 21:20:16 +0000 (21:20 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 Sep 2006 21:20:16 +0000 (21:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6085 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Open-ILS/web/opac/skin/default/js/holds.js

index 21cb016..5113d6d 100644 (file)
@@ -139,6 +139,7 @@ sub create_hold {
                }
 
                $hold->requestor($e->requestor->id); 
+               $hold->request_lib($e->requestor->ws_ou);
                $hold->selection_ou($recipient->home_ou) unless $hold->selection_ou;
                $hold = $e->create_action_hold_request($hold) or return $e->event;
                push( @copyholds, $hold ) if $hold->hold_type eq OILS_HOLD_TYPE_COPY;
index e0f5ce0..b7b6cc6 100644 (file)
@@ -25,10 +25,18 @@ function _holdsHandleStaffMe() {
 function _holdsHandleStaff() {
        var barcode = $('xul_recipient_barcode').value;
        var user = grabUserByBarcode( G.user.session, barcode );
-       if(!user) {
-               alert('fixme: invalid user barcode: ['+barcode+']');
+
+       var evt;
+       if(evt = checkILSEvent(user)) {
+               alertILSEvent(user);
+               return;
+       }
+
+       if(!barcode || !user) {
+               alertId('holds_invalid_recipient', barcode);
                return
        }
+
        holdArgs.recipient = user;
        holdsDrawEditor();
 }
@@ -615,7 +623,7 @@ function holdsBuildHoldFromWindow() {
 
 
        hold.pickup_lib(org); 
-       hold.request_lib(org); 
+       //hold.request_lib(org); 
        hold.requestor(holdArgs.requestor.id());
        hold.usr(holdArgs.recipient.id());
        hold.target(target);
@@ -707,7 +715,6 @@ function holdCreateHold( recurse, hold ) {
 
 
 function holdProcessResult( hold, res, recurse ) {
-
        if( res == '1' ) {
                alert($('holds_success').innerHTML);