From acf373c8b2ae728945b99f84aa51cce1ba174388 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 24 May 2011 17:22:36 -0400 Subject: [PATCH] Prevent renewal of an item which has a hold placed on it Per http://biblio.laurentian.ca/tickets/conifer/wiki/devHolds, we had this functional in 1.6 but must not have had the updated script checked into SVN (now git) for the purposes of our upgrade, as the functionality is not present after our upgrade. Adding this to the repo so that we can test and hopefully get rid of the regression. Signed-off-by: Dan Scott --- circ/circ_permit_renew.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 circ/circ_permit_renew.js diff --git a/circ/circ_permit_renew.js b/circ/circ_permit_renew.js new file mode 100644 index 0000000000..d86094e29d --- /dev/null +++ b/circ/circ_permit_renew.js @@ -0,0 +1,17 @@ +function go() { + +/* load the lib script */ +load_lib('circ/circ_lib.js'); +load_lib('JSON_v1.js'); +log_vars('circ_permit_renew'); + +//from Jason Etheridge's suggestion on OPEN-ILS-GENERAL, Dec. 23, 2009 +log_info("permit_renew searching for potential holds for copy " + copy.barcode) +var hold = copy.fetchBestHold(); +if( hold ) { + log_info("hold found for renewal item, checking hold->usr.."); + if( hold && hold.usr != patron.id ) + return result.events.push('COPY_NEEDED_FOR_HOLD'); +} + +} go(); -- 2.11.0