testing, bug fixing, more to come
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Jul 2006 22:03:05 +0000 (22:03 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Jul 2006 22:03:05 +0000 (22:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4993 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 478efc7..4df442c 100644 (file)
@@ -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.
index 080d448..72ad052 100644 (file)
@@ -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;
index a24f858..a6e959e 100644 (file)
@@ -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');
 
 
index 7fad3ee..531a284 100644 (file)
@@ -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();