From 7be4e0e12291c463b5c5a73978096e9e83e82006 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 19 Jan 2006 16:34:24 +0000 Subject: [PATCH] moved to OpenILS/src/javascript/backend/circ git-svn-id: svn://svn.open-ils.org/ILS/trunk@2754 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/circ_rules/circ_permit.js | 47 ----------------------------- Evergreen/circ_rules/script_libs.js | 22 -------------- 2 files changed, 69 deletions(-) delete mode 100644 Evergreen/circ_rules/circ_permit.js delete mode 100644 Evergreen/circ_rules/script_libs.js diff --git a/Evergreen/circ_rules/circ_permit.js b/Evergreen/circ_rules/circ_permit.js deleted file mode 100644 index 507f3a548b..0000000000 --- a/Evergreen/circ_rules/circ_permit.js +++ /dev/null @@ -1,47 +0,0 @@ -function go() { - -log_debug('Checking permit circ on ' + - ' Copy: ' + copy.id + - ' Patron:' + patron.id + - ' Patron Profile: ' + patron.profile + - ' Patron Standing: ' + patron.standing + - ' Patron copies: ' + patron_info.items_out + - ' Patron fines: ' + patron_info.fines + - ' Copy status: ' + copy.status + - ' Copy location: ' + copy.location.name + - ''); - - - -/* Patron checks --------------------------------------------- */ -if( ! patron.standing.match(/good/i) ) - return result.event = 'PATRON_BAD_STANDING'; - -if( patron.profile.match(/patrons/i) && patron_info.items_out > 10 ) - return result.event = 'PATRON_EXCEEDS_CHECKOUT_COUNT'; - -if( patron.profile.match(/staff/i) && patron_info.items_out > 30 ) - return result.event = 'PATRON_EXCEEDS_CHECKOUT_COUNT'; - - - -/* Copy checks ------------------------------------------------ */ -if( is_false( copy.circulate ) ) - return result.event = 'COPY_CIRC_NOT_ALLOWED'; - -if( is_true( copy.ref ) ) - return result.event = 'COPY_IS_REFERENCE'; - -if( !copy.status.match(/available/i) && !copy.status.match(/on holds shelf/i) ) - return result.event = 'COPY_NOT_AVAILABLE'; - - -/* check for holds -------------------------------------------- */ -fetch_hold_by_copy( copy.id ); -if( hold && hold.usr != patron.id ) - return result.event = 'COPY_NEEDED_FOR_HOLD'; - - -} go(); - - diff --git a/Evergreen/circ_rules/script_libs.js b/Evergreen/circ_rules/script_libs.js deleted file mode 100644 index d76a3c2f16..0000000000 --- a/Evergreen/circ_rules/script_libs.js +++ /dev/null @@ -1,22 +0,0 @@ -/* pre-define all global circ vars. This way, any vars not fetched and - defined by the circ code won't throw exceptions when accessed */ - -var hold = null; /* most recently retrieve hold object */ -var copy = null; /* the current copy object */ -var title = null; /* the current title (biblio record entry) object */ -var patron = null; /* the current patron object */ -var patron_info = null; /* additional info on the current patron */ - - - - -/* Utility function ----------------------------------------------------- */ - -function is_true(item) { return !is_false(item); } - -function is_false(item) { - if( ! item ) return true; - if( item.match(/0/) ) return true; - return false; -} - -- 2.43.2