more cleanup
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Apr 2007 13:32:05 +0000 (13:32 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Apr 2007 13:32:05 +0000 (13:32 +0000)
fixed some syntax errors

git-svn-id: svn://svn.open-ils.org/ILS/trunk@7161 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/javascript/backend/circ/circ_duration.js
Open-ILS/src/javascript/backend/circ/circ_item_config.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_patron.js

index b4f129f..55468ab 100644 (file)
@@ -28,7 +28,7 @@ if( config ) {
        log_debug("circ_duration found a config for the copy");
        result.durationRule                     = config.durationRule;
        result.recurringFinesRule       = config.recurringFinesRule;
-       result.maxFine                                  = config.maxFine;
+       result.maxFine                      = config.maxFine;
 
 } else {
 
index 27a0e0c..cc07951 100644 (file)
@@ -26,8 +26,8 @@ var MARC_ITEM_TYPE_MAP = {
        a : { /* Language material [Books] */
                SIPMediaType                    : '001',
                magneticMedia                   : 'f',
-               durationRule                    : 'default'
-               recurringFinesRule          : 'default'
+               durationRule                    : 'default',
+               recurringFinesRule          : 'default',
                maxFine                                 : 'default'
        },
     /* add more MARC item type configs as needed... */
@@ -41,8 +41,8 @@ var CIRC_MOD_MAP = {
        'bestseller'                            : {
                SIPMediaType                    : '001',
                magneticMedia                   : 'f',
-               durationRule                    : 'default'
-               recurringFinesRule          : 'default'
+               durationRule                    : 'default',
+               recurringFinesRule          : 'default',
                maxFine                                 : 'default'
        },
 }
index e7de3de..acf80aa 100644 (file)
@@ -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,12 @@ 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]);
+}
 
 
 /**
@@ -226,6 +233,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;
index 8de1cd0..2474a5e 100644 (file)
@@ -4,6 +4,7 @@ load_lib('circ/circ_lib.js');
 log_vars('circ_permit_hold');
 
 
+
 if( isTrue(patron.barred) ) 
        result.events.push('PATRON_BARRED');
 
@@ -14,6 +15,20 @@ if( !isTrue(copy.circulate) )
        result.events.push('ITEM_NOT_HOLDABLE');
 
 
+var config = findGroupConfig(patronProfile);
+
+if( config ) {
+
+    /* see if they have too many items out */
+    var limit = config.maxHolds;
+    var count = userHoldCount(patron.id);
+    if( limit >= 0 && count >= limit ) {
+        log_info("patron has " + count + " open holds");
+        result.events.push('MAX_HOLDS');
+    }
+}
+
+
 } go();
 
 
index 3ea5ddb..da6f719 100644 (file)
@@ -9,7 +9,22 @@ if( isTrue(patron.barred) )
        result.events.push('PATRON_BARRED');
 
 var config = findGroupConfig(patronProfile);
-/* inspect the config too see if this patron should be allowed */
+
+if( config ) {
+
+    var limit = config.maxItemsOut;
+    if( limit >= 0 ) {
+        log_info('patron items out = ' + patronItemsOut +' limit = ' + limit);
+        if( !isTrue(isRenewal) && patronItemsOut >= limit ) {
+            result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
+        }
+    }
+    
+} else {
+
+    log_warn("** profile has no configured information: " + patronProfile);
+}
+
 
 
 } go();