From c0ade1ec06d2b6d31cc9dacacecef05bf2787d7b Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 13 Jul 2006 22:03:05 +0000 Subject: [PATCH] testing, bug fixing, more to come git-svn-id: svn://svn.open-ils.org/ILS/trunk@4993 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/javascript/backend/circ/circ_duration.js | 12 ++++-------- Open-ILS/src/javascript/backend/circ/circ_lib.js | 3 ++- .../src/javascript/backend/circ/circ_permit_hold.js | 4 ++-- .../src/javascript/backend/circ/circ_permit_renew.js | 2 ++ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Open-ILS/src/javascript/backend/circ/circ_duration.js b/Open-ILS/src/javascript/backend/circ/circ_duration.js index 478efc7dc7..4df442ccbb 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_duration.js +++ b/Open-ILS/src/javascript/backend/circ/circ_duration.js @@ -14,7 +14,6 @@ log_vars('circ_duration'); - var MARC_ITEM_TYPE_MAP = { a : { /* Language material [Books] */ @@ -250,8 +249,6 @@ var CIRC_MOD_MAP = { - - /* Get the load duration level directly from the copy */ result.durationLevel = copy.loan_duration; @@ -261,9 +258,10 @@ result.durationLevel = copy.loan_duration; provided circ_modifier, use that config. Otherwise fall back on the MARC item type ----------------------------------------------------------------------------- */ -var marcType = getMARCItemType(); -var circMod = copy.circ_modifier; -var itemForm = extractFixedField(marcXMLDoc,'Form'); +var marcType = getMARCItemType(); +var circMod = copy.circ_modifier; +var itemForm = (marcXMLDoc) ? extractFixedField(marcXMLDoc,'Form') : ""; + var config = ( circMod && CIRC_MOD_MAP[circMod] ) ? @@ -281,8 +279,6 @@ if( MARC_ITEM_TYPE_MAP[marcType] ) log_debug("Copy circ modifier = " + circMod + " and item type = " + marcType ); - - /* ----------------------------------------------------------------------------- Now set the rule values based on the config. If there is no configured info on this copy, fall back on defaults. diff --git a/Open-ILS/src/javascript/backend/circ/circ_lib.js b/Open-ILS/src/javascript/backend/circ/circ_lib.js index 080d4484f6..72ad052ae3 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_lib.js +++ b/Open-ILS/src/javascript/backend/circ/circ_lib.js @@ -154,7 +154,7 @@ function getMARCItemType() { copy.circ_as_type != 'undef' ) return copy.circ_as_type; - return extractFixedField(marcXMLDoc, 'Type'); + return (marcXMLDoc) ? extractFixedField(marcXMLDoc, 'Type') : ""; } @@ -198,6 +198,7 @@ function log_vars( prefix ) { str += ', Copy Barcode=' + copy.barcode; str += ', Copy status=' + copyStatus; str += ', Copy location=' + copy.location.name; + str += ', Circ Lib=' + copy.circ_lib.shortname; } if(volume) str += ', Volume=' + volume.id; 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 a24f8584bc..a6e959ef7c 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js +++ b/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js @@ -7,8 +7,8 @@ log_vars('circ_permit_hold'); /* projected medium */ -if( getMARCItemType() == 'g' - && copy.circ_lib != patron.home_ou.id ) +if( getMARCItemType() == 'g' && + !isOrgDescendent(copy.circ_lib.shortname, patron.home_ou.id) ) result.events.push('CIRC_EXCEEDS_COPY_RANGE'); diff --git a/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js b/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js index 7fad3ee169..531a2843bb 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js +++ b/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js @@ -12,11 +12,13 @@ var patronItemsOut = environment.patronItemsOut; var patronFines = environment.patronFines; var isRenewal = environment.isRenewal; +/* XXX get me working again var holds = copy.fetchHolds(); for( var i in holds ) { var hold = holds[i]; if( hold && hold.usr != patron.id ) return result.events.push('COPY_NEEDED_FOR_HOLD'); } +*/ } go(); -- 2.43.2