From: erickson Date: Thu, 29 Mar 2007 16:28:04 +0000 (+0000) Subject: updating scripts to pull in requestor information X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ffe2240285637f830319ca52c827f3146d017569;p=Evergreen.git updating scripts to pull in requestor information git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7122 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/javascript/backend/circ/circ_lib.js b/Open-ILS/src/javascript/backend/circ/circ_lib.js index 8024f5aaa7..ce42fe074d 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_lib.js +++ b/Open-ILS/src/javascript/backend/circ/circ_lib.js @@ -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; diff --git a/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js b/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js index 41e3374a72..094440f862 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js +++ b/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js @@ -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) )