updating scripts to pull in requestor information
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Mar 2007 16:28:04 +0000 (16:28 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Mar 2007 16:28:04 +0000 (16:28 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7122 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/javascript/backend/circ/circ_lib.js
Open-ILS/src/javascript/backend/circ/circ_permit_hold.js

index 8024f5a..ce42fe0 100644 (file)
@@ -41,6 +41,7 @@ var isPrecat                  = environment.isPrecat;
 var currentLocation    = environment.location;
 var holdRequestLib     = environment.requestLib;
 var holdPickupLib       = environment.pickupLib; /* hold pickup lib */
+var requestor = environment.requestor || patron;
 
 
 
@@ -145,6 +146,13 @@ function isGroupDescendant( parent, child ) {
                groupList[child]);
 }
 
+function isGroupDescendantId( parentName, childId ) {
+       log_debug("checking descendant ID p="+parentName + " c=" + childId);
+       return __isGroupDescendant(
+               groupList[parentName],
+               groupIDList[childId]);
+}
+
 
 
 /**
@@ -236,6 +244,9 @@ function log_vars( prefix ) {
                } catch(e) {}
        }
 
+    if(requestor.id != patron.id) 
+        str+= ' Requestor='+requestor.usrname;
+
        if(copy)        {
                str += ', Copy=' + copy.id;
                str += ', Copy_Barcode=' + copy.barcode;
index 41e3374..094440f 100644 (file)
@@ -5,7 +5,8 @@ log_vars('circ_permit_hold');
 
 
 /* is a staff member placing this hold? */
-var isStaffHold = isGroupDescendant('Staff', patronProfile);
+//var isStaffHold = isGroupDescendant('Staff', patronProfile);
+var isStaffHold = isGroupDescendantId('Staff', requestor.profile);
 
 
 /* non-staff members are allowed 50 open holds at most */
@@ -14,7 +15,9 @@ if( ! isStaffHold ) {
    log_info("patron has " + count + " open holds");
    if( count >= 50 ) 
       result.events.push('MAX_HOLDS');
-} 
+} else {
+    log_info("This is a staff-placed hold");
+}
 
 
 if( isTrue(patron.barred) )