cleanup of everything
authorJames <james.fournie@gmail.com>
Sat, 24 Apr 2010 19:31:00 +0000 (15:31 -0400)
committerJames <james.fournie@gmail.com>
Sat, 24 Apr 2010 19:31:00 +0000 (15:31 -0400)
39 files changed:
circ/circ_duration.js
circ/circ_permit_copy.js
circ/circ_permit_hold.js
circ/circ_permit_patron.js
circ/circ_permit_renew.js
circ/config_BABM.js
circ/config_BBUL.js
circ/config_BCD.js
circ/config_BCREK.js
circ/config_BFN.js
circ/config_BGF.js
circ/config_BGI.js
circ/config_BGSI.js
circ/config_BH.js
circ/config_BHA.js
circ/config_BIN.js
circ/config_BKCT.js
circ/config_BLP-BB.js
circ/config_BLP.js
circ/config_BM.js
circ/config_BMB.js
circ/config_BMK.js
circ/config_BNA.js
circ/config_BPE.js
circ/config_BPR.js
circ/config_BPRDP.js
circ/config_BR.js
circ/config_BRHSP.js
circ/config_BS.js
circ/config_BSA.js
circ/config_BSE.js
circ/config_BSP.js
circ/config_BTA.js
circ/config_BTE.js
circ/config_BVALE.js
circ/config_BVDH.js
circ/config_BW.js
circ/config_BWLCR.js
circ/librarymap.js

index 1ff6d9e..501972a 100644 (file)
@@ -1,46 +1,47 @@
-function go(){
-load_lib('JSON_v1.js');
-load_lib('circ/circ_item_config.js');
-log_vars('circ_duration');
+function go() {
+    load_lib('JSON_v1.js');
+    load_lib('circ/circ_item_config.js');
+    log_vars('circ_duration');
 
 
-/** set some defaults */
-result.durationRule                    = 'default'; 
-result.recurringFinesRule      = 'default';
-result.maxFine                     = 'default';
+    /** set some defaults */
+    result.durationRule = 'default';
+    result.recurringFinesRule = 'default';
+    result.maxFine = 'default';
 
-patronProfile = patron.profile.name;
+    patronProfile = patron.profile.name;
 
-/* grab the config from the config script */
+    /* grab the config from the config script */
 
-var location;
-if(isPrecat){
-       location = currentLocation.shortname;   
-} else {
-       location = copy.circ_lib.shortname || currentLocation.shortname; 
-}
-var policy = openPolicyFile(location);
-var config = policy.getGroupConfig();
+    var location;
+    if (isPrecat) {
+        location = currentLocation.shortname;
+    } else {
+        location = copy.circ_lib.shortname || currentLocation.shortname;
+    }
+    var policy = openPolicyFile(location);
+    var config = policy.getGroupConfig();
 
-if(config){
-       result.durationRule                     = policy.getLoanDuration();
-       result.recurringFinesRule       = policy.getRecurringFine();
-       result.maxFine                      = policy.getMaxFine();
-}
+    if (config) {
+        result.durationRule = policy.getLoanDuration();
+        result.recurringFinesRule = policy.getRecurringFine();
+        result.maxFine = policy.getMaxFine();
+    }
 
-if(isGroupDescendant('Staff', patronProfile) ||
-       isGroupDescendant('Library Staff', patronProfile) || 
-       isGroupDescendant('NoFines', patronProfile)) {
-    /* in general, these users do not pay fines */
-    result.recurringFinesRule = 'zero';
-    result.maxFine = 'zero';
-}
+    if (isGroupDescendant('Staff', patronProfile) ||
+    isGroupDescendant('Library Staff', patronProfile) ||
+    isGroupDescendant('NoFines', patronProfile)) {
+        /* in general, these users do not pay fines */
+        result.recurringFinesRule = 'zero';
+        result.maxFine = 'zero';
+    }
 
 
-log_info('final duration results: ' + 
-    result.durationRule + ' : ' + result.recurringFinesRule + ' : ' + result.maxFine );
+    log_info('final duration results: ' +
+    result.durationRule + ' : ' + result.recurringFinesRule + ' : ' + result.maxFine);
 
-} go();
+}
+go();
 
 
 
index 059fd37..dde50ac 100644 (file)
@@ -1,36 +1,37 @@
 function go() {
 
-/* load the lib script */
-load_lib('JSON_v1.js');
-load_lib('circ/circ_lib.js');
-log_vars('circ_permit_copy');
+    /* load the lib script */
+    load_lib('JSON_v1.js');
+    load_lib('circ/circ_lib.js');
+    log_vars('circ_permit_copy');
 
 
-if( ! isTrue(copy.circulate) || !isTrue(copy.location.circulate) ){ 
-    result.events.push('COPY_CIRC_NOT_ALLOWED');
-}
+    if (!isTrue(copy.circulate) || !isTrue(copy.location.circulate)) {
+        result.events.push('COPY_CIRC_NOT_ALLOWED');
+    }
 
-if( isTrue(copy.ref) ){
-    result.events.push('COPY_IS_REFERENCE');
-}
+    if (isTrue(copy.ref)) {
+        result.events.push('COPY_IS_REFERENCE');
+    }
 
-if( ! isTrue(isRenewal) ) {
-       if(copyStatus != 'Available' && 
-               copyStatus != 'On holds shelf' && copyStatus != 'Reshelving' ) {
-                       result.events.push('COPY_NOT_AVAILABLE');
-       }
-    if(!hasCommonAncestor( currentLocation.id, copy.circ_lib.id, 2 )){ 
+    if (!isTrue(isRenewal)) {
+        if (copyStatus != 'Available' &&
+        copyStatus != 'On holds shelf' && copyStatus != 'Reshelving') {
+            result.events.push('COPY_NOT_AVAILABLE');
+        }
+        if (!hasCommonAncestor(currentLocation.id, copy.circ_lib.id, 2)) {
             result.events.push('COPY_REMOTE_CIRC_LIB');
+        }
+
     }
 
-}
+    var location = copy.circ_lib.shortname || currentLocation.shortname;
+    var policy = openPolicyFile(location);
+    if (!policy.isAllowedCirc()) {
+        result.events.push('COPY_CIRC_NOT_ALLOWED');
+    }
 
-var location = copy.circ_lib.shortname || currentLocation.shortname; 
-var policy = openPolicyFile(location);
-if (!policy.isAllowedCirc()){
-    result.events.push('COPY_CIRC_NOT_ALLOWED');
 }
-
-} go();
+go();
 
 
index 6ac0305..0479636 100644 (file)
@@ -1,52 +1,53 @@
 function go() {
-load_lib('JSON_v1.js');
-load_lib('circ/circ_lib.js');
-log_vars('circ_permit_hold');
+    load_lib('JSON_v1.js');
+    load_lib('circ/circ_lib.js');
+    log_vars('circ_permit_hold');
 
 
 
-if( isTrue(patron.barred) ) 
-       result.events.push('PATRON_BARRED');
+    if (isTrue(patron.barred))
+    result.events.push('PATRON_BARRED');
 
-if( isTrue(copy.ref) ) 
-       result.events.push('ITEM_NOT_HOLDABLE');
+    if (isTrue(copy.ref))
+    result.events.push('ITEM_NOT_HOLDABLE');
 
-if( !isTrue(copy.circulate) ) 
-       result.events.push('ITEM_NOT_HOLDABLE');
+    if (!isTrue(copy.circulate))
+    result.events.push('ITEM_NOT_HOLDABLE');
 
-var testAncestor = hasCommonAncestor( copy.circ_lib.id, holdPickupLib, 2);
-if(!isTrue(testAncestor)){
-       result.events.push('ITEM_NOT_HOLDABLE');
-} 
+    var testAncestor = hasCommonAncestor(copy.circ_lib.id, holdPickupLib, 2);
+    if (!isTrue(testAncestor)) {
+        result.events.push('ITEM_NOT_HOLDABLE');
+    }
 
-var location = copy.circ_lib.shortname || currentLocation.shortname;
-var config = findGroupConfig(patronProfile);
-var policy = openPolicyFile(location);
-       config = policy.getGroupConfig() || findGroupConfig(patronProfile);
+    var location = copy.circ_lib.shortname || currentLocation.shortname;
+    var config = findGroupConfig(patronProfile);
+    var policy = openPolicyFile(location);
+    config = policy.getGroupConfig() || findGroupConfig(patronProfile);
 
-if( config ) {
-       var holdAllowed = policy.isAllowedHold();
+    if (config) {
+        var holdAllowed = policy.isAllowedHold();
 
-       if(!isTrue(holdAllowed)){
-                       result.events.push('ITEM_NOT_HOLDABLE');
-       }
+        if (!isTrue(holdAllowed)) {
+            result.events.push('ITEM_NOT_HOLDABLE');
+        }
 
-       if(newHold) {
-           /* see if they have too many items out */
-               var limit = config.maxHolds;
-               var count = userHoldCount(patron.id) || 0;
-               log_info("patron has " + count + " open holds");
-               if( limit >= 0 && count >= limit ) {
-                       result.events.push('MAX_HOLDS');
-               }
+        if (newHold) {
+            /* see if they have too many items out */
+            var limit = config.maxHolds;
+            var count = userHoldCount(patron.id) || 0;
+            log_info("patron has " + count + " open holds");
+            if (limit >= 0 && count >= limit) {
+                result.events.push('MAX_HOLDS');
+            }
 
-    } else {
-               // ignore maxholds on existing hold
-       }
-}
+        } else {
+            // ignore maxholds on existing hold
+            }
+    }
 
 
-} go();
+}
+go();
 
 
 
index deaf3f1..8360ee4 100644 (file)
@@ -1,53 +1,39 @@
 function go() {
 
-/* load the script library */
-load_lib('JSON_v1.js');
-load_lib('circ/circ_lib.js');
-log_vars('circ_permit_patron');
+    /* load the script library */
+    load_lib('JSON_v1.js');
+    load_lib('circ/circ_lib.js');
+    log_vars('circ_permit_patron');
 
 
-if( isTrue(patron.barred) ) 
-       result.events.push('PATRON_BARRED');
+    if (isTrue(patron.barred))
+    result.events.push('PATRON_BARRED');
 
-var config = findGroupConfig(patronProfile);
+    var config = findGroupConfig(patronProfile);
 
-var policy = null;
+    var policy = null;
 
-var location = currentLocation.shortname || patron.home_ou.shortname || copy.circ_lib.shortname; 
-log_debug(location);
-var config = findGroupConfig(patronProfile);
-policy = openPolicyFile(location);
-config = policy.getGroupConfig();
+    var location = currentLocation.shortname || patron.home_ou.shortname || copy.circ_lib.shortname;
+    log_debug(location);
+    var config = findGroupConfig(patronProfile);
+    policy = openPolicyFile(location);
+    config = policy.getGroupConfig();
 
-if( config ) {
+    if (config) {
 
-/*
-    var limit = config.maxItemsOut;
-    if( limit >= 0 ) {
-        log_info('patron items out = ' + patronItemsOut +' limit = ' + limit);
-        if( !isTrue(isRenewal) && patronItemsOut >= limit ) {
+        if (policy && policy.exceedsMaxCheckoutsByCircMod) {
+            if (policy.exceedsMaxCheckoutsByCircMod())
             result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
         }
-    }
-*/
-    if(policy && policy.exceedsMaxCheckoutsByCircMod) {
-        if(policy.exceedsMaxCheckoutsByCircMod())
-            result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
-    }
-  /*  
-    if( config.fineThreshold >= 0 && patronFines >= config.fineThreshold ) 
-               result.events.push('PATRON_EXCEEDS_FINES');
 
-       if( config.overdueThreshold >= 0 && patronOverdueCount >= config.overdueThreshold )
-               result.events.push('PATRON_EXCEEDS_OVERDUE_COUNT');
-*/             
-} else {
+    } else {
 
-    log_warn("** profile has no configured information: " + patronProfile);
-}
+        log_warn("** profile has no configured information: " + patronProfile);
+    }
 
 
 
-} go();
+}
+go();
 
 
index e28ac53..94fe7ec 100644 (file)
@@ -1,18 +1,19 @@
 function go() {
 
-/* load the lib script */
-load_lib('JSON_v1.js');
-load_lib('circ/circ_lib.js');
-log_vars('circ_permit_renew');
+    /* load the lib script */
+    load_lib('JSON_v1.js');
+    load_lib('circ/circ_lib.js');
+    log_vars('circ_permit_renew');
 
-log_info("permit_renew is searching for potential holds for item " + copy.barcode)
+    log_info("permit_renew is searching for potential holds for item " + copy.barcode)
 
-var hold = copy.fetchBestHold();
+    var hold = copy.fetchBestHold();
 
-if(hold) {
-       log_info("hold found for item being renewed, checking hold->usr...")
+    if (hold) {
+        log_info("hold found for item being renewed, checking hold->usr...")
 
-       if(hold && hold.usr != patron.id)
-               return result.events.push('COPY_NEEDED_FOR_HOLD');
+        if (hold && hold.usr != patron.id)
+        return result.events.push('COPY_NEEDED_FOR_HOLD');
+    }
 }
-go();
+go();
index 2b14262..1eca6da 100644 (file)
@@ -9,87 +9,70 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
 
             /* returns config.rule_circ_duration.name */
-               var circMod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-
-               if(patronProfile == 'InterLibraryLoan'){
-                       return '21_2';
+            if (patronProfile == 'InterLibraryLoan') {
+                return '21_2';
             }
 
-           var map = {
-               'compact-discs'         :  '14_1'
-           };  
+            var map = {
+                'compact-discs': '14_1'
+            };
 
-               return map[circMod] ||  '14_2';
+            return map[circMod] || '14_2';
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
             return 'tencents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'twodollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             log_debug("exceedsMaxCheckoutsByCircMod()");
 
-               var maxByCircMod;
-               var circModLimit;
+            var maxByCircMod;
+            var circModLimit;
+
+            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
 
-               var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+            // number of htis circ mod currently checked out
+            var circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
 
-               // number of htis circ mod currently checked out 
-               var circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
+            maxByCircMod = {
+                'compact-discs': 2
+            };
 
-               maxByCircMod = {
-                       'compact-discs' : 2
-               };
-               
-                       circModLimit = maxByCircMod[circMod] || 8;
-       
-               // returns true if we've exceeded the limit
-               return circModCount >= circModLimit;
-       },      
+            circModLimit = maxByCircMod[circMod] || 8;
 
+            // returns true if we've exceeded the limit
+            return circModCount >= circModLimit;
+        },
 
-        isAllowedCirc : function() {
-               return 'true';
+
+        isAllowedCirc: function() {
+            return 'true';
         },
 
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return 'true';
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
             /* returns the combined user config object */
 
-            // override some defaults
-            GROUP_CONFIG.BCOneCard.maxItemsOut = 4;
-            GROUP_CONFIG.InterLibraryLoan.maxItemsOut = 4;
-            
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
-            // these are global settings for BH users
-            config.fineThreshold = 2;
-                   config.maxHolds = 2;
-               config.overdueThreshold = 2;
-               config.maxItemsOut = 8;
-
 
-            // debugging...
-            var str = "BABM getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-            }
-               log_debug(str);
+            // these are global settings for BH users
+            config.maxHolds = 2;
 
             return config;
         }
index 5d23d8a..c97aa4b 100644 (file)
@@ -5,31 +5,31 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BBUL");
 
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
             /* returns config.rule_circ_duration.name */
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-                       
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return '52_2';
             }
 
             var map = {
-                'book'          :   '28_2',
-                'best-seller'   :   '14_1',
-                'media'         :   '14_1',
-                'holiday-special':  '14_0',
-                'magazine'      :   '14_0'
+                'book': '28_2',
+                'best-seller': '14_1',
+                'media': '14_1',
+                'holiday-special': '14_0',
+                'magazine': '14_0'
             };
-                   
-            return map[circMod] || '28_2';         
-                   
+
+            return map[circMod] || '28_2';
+
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-       
+
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return 'zero';
             }
@@ -40,29 +40,28 @@ function getPolicy() {
             return 'twentycent';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-                return false;
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
         },
 
-        isAllowedCirc : function() {
-           return true;
+        isAllowedCirc: function() {
+            return true;
         },
-                
-        isAllowedHold : function() {
-           return true;
+
+        isAllowedHold: function() {
+            return true;
         },
-        getGroupConfig : function() {
+        getGroupConfig: function() {
             /* returns the combined user config object */
 
             // override some defaults
-
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
+
             // these are global settings for BH users
             config.maxHolds = 50;
 
index e86c48b..ace27fa 100644 (file)
@@ -5,137 +5,105 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BCD");
 
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
-            /* returns config.rule_circ_duration.name */
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-            if(patronProfile == 'InterLibraryLoan'){
+            if (patronProfile == 'InterLibraryLoan') {
                 return '42_0';
             }
-
             var map = {
-              '1-day-loan'               : '1day_no_renew',
-              '7-day-loan'               : '7_0',
-              'dvd'                      : '7_2',
-              'inter-library-loan'       : '21_0',
-              'juvenile-holiday-special' : '21_0',
-              'juvenile-serial'          : '21_0',
-              'magazine'                 : '7_0',
-              'videos'                   : '7_2'
+                '1-day-loan': '1day_no_renew',
+                '7-day-loan': '7_0',
+                'dvd': '7_2',
+                'inter-library-loan': '21_0',
+                'juvenile-holiday-special': '21_0',
+                'juvenile-serial': '21_0',
+                'magazine': '7_0',
+                'videos': '7_2'
             };
+            return map[circMod] || '21_2';
+        },
 
-            return map[circMod] || '21_2'; /* 21_2 */
+        getRecurringFine: function() {
+            if ( patronProfile == 'Board' || patronProfile == 'Volunteer') {
+                return 'zero';
+            }
+            var map = {
+                '1-day-loan': 'zero',
+                '7-day-loan': 'twentycent',
+                'audio-cassette': 'twentycent',
+                'audio-cds': 'twentycent',
+                'audio-cds-cnib': 'zero',
+                'book': 'twentycent',
+                'cd-rom': 'twentycent',
+                'dvd': 'twentycent',
+                'inter-library-loan': 'twentycent',
+                'juvenile-collection': 'fivecents',
+                'juvenile-holiday-special': 'fivecents',
+                'kit': 'fivecents',
+                'magazine': 'twentycent',
+                'paperbacks': 'twentycent',
+                'videos': 'twentycent',
+                'juvenile-serial': 'fivecents',
+                'large-print': 'twentycent'
 
-        },
+            };
 
-        getRecurringFine : function() {
-           if (patronProfile == 'Local System Administrator' || patronProfile == 'Catalogers' || patronProfile == 'CircCat' || patronProfile == 'Board' || patronProfile == 'Volunteer') {
-             return 'zero';
-           }
-
-           /* returns config.rule_recuring_fine.name */
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
-           var map = {
-              '1-day-loan'               : 'zero',
-              '7-day-loan'               : 'twentycent',
-              'audio-cassette'           : 'twentycent', 
-              'audio-cds'                : 'twentycent',
-              'audio-cds-cnib'           : 'zero',
-              'book'                     : 'twentycent',
-              'cd-rom'                   : 'twentycent',
-              'dvd'                      : 'twentycent',
-              'inter-library-loan'       : 'twentycent',
-              'juvenile-collection'      : 'fivecents',
-              'juvenile-holiday-special' : 'fivecents',
-              'kit'                      : 'fivecents',
-              'magazine'                 : 'twentycent',
-              'paperbacks'               : 'twentycent',
-              'videos'                   : 'twentycent',
-              'juvenile-serial'          : 'fivecents',
-              'large-print'              : 'twentycent'
-             
-           };
-
-           return map[circMod] || 'twentycent';
+            return map[circMod] || 'twentycent';
         },
 
-          
-        getMaxFine : function() {
-           /* returns config.rule_max_fine.name */
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
-           var map = {
-             'magazine' : 'threedollar',
-             'juvenile-serial' : 'threedollar'
-           };
+        getMaxFine: function() {
+            var map = {
+                'magazine': 'threedollar',
+                'juvenile-serial': 'threedollar'
+            };
 
-           return map[circMod] || 'fivedollar';
+            return map[circMod] || 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
-          return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-        getGroupConfig : function() {
-
-          // set defaults
-          var maxItemsOutValue        =  30;
-          var maxHoldsValue           =  20;
-          var overdueThresholdValue   =  20;
-          var fineThresholdValue      =  10;
-          
-          // set special values for group
-          switch (patronProfile) {
+        getGroupConfig: function() {
+
+            // set defaults
+            var maxHoldsValue = 20;
+
+            // set special values for group
+            switch (patronProfile) {
             case 'Board':
             case 'Homebound':
             case 'InterLibraryLoan':
             case 'Volunteer':
-              fineThresholdValue      =  -1;
-              break;
             case 'JuvenileRes':
-              maxItemsOutValue        =  20;
-              break;
             case 'BCOneCard':
-              maxItemsOutValue        =   5;
-              maxHoldsValue           =   5;
-              overdueThresholdValue   =   5;
-              break;
+                maxHoldsValue = 5;
+                break;
             case 'Staff':
-              maxItemsOutValue        =  -1;
-              maxHoldsValue           =  -1;
-              overdueThresholdValue   =  -1;
-              fineThresholdValue      =  -1;
-              break;
-          }
-
-          // return group config
-          var config = {
-            'maxHolds'          :  maxHoldsValue,
-            'maxItemsOut'       :  maxItemsOutValue,
-            'overdueThreshold'  :  overdueThresholdValue,
-            'fineThreshold'     :  fineThresholdValue
-          };
-
-          // debugging...
-          var str = "BCD getGroupConfig():";
-          for( var i in config ){ 
-            str += i + '=' + config[i] + '  ';
-          }
-          log_debug(str);
-
-          return config;
+                maxHoldsValue = -1;
+                break;
+            }
+
+            // return group config
+            var config = {
+                'maxHolds': maxHoldsValue,
+            };
+
+            return config;
         }
     };
 }
+
index 7a9a10e..aca809e 100644 (file)
 
 function getPolicy() {
 
-  load_lib('circ/circ_lib.js');
-  log_info("Loading policy info for BCREK");
-
-  return {
-
-    getLoanDuration : function() {
-
-      /* returns config.rule_circ_duration.name */
-      var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
-      var map = {
-        'circ-reserve-1-hour'  : '1hr_0',
-        'circ-reserve-2-hour'  : '2hr_0',
-        'circ-reserve-4-hour'  : '4hr_0',
-        'circ-reserve-24-hour' : '24hr_0',
-        'circ-reserve-72-hour' : '72hr_0',
-        '7-day-loan'           : '7_6',
-        'archives'             : '7_0',
-        'book'                 : '21_6',
-        'floppy-disc'          : '3_2',
-        'inter-library-loan'   : '14_0',
-        'ill-media'            : '3_2',
-        'kit'                  : '21_6',
-        'library-equipment'    : '3_2',
-        'magazine'             : '7_6',
-        'maps'                 : '7_6',
-        'media'                : '21_6',
-        'online'               : '21_6',
-        'semester'             : '21_6', /* TODO: do term loan for this */
-        'videos'               : '7_6'
-      };
-
-      return map[circMod] || '21_6';
-
-    },
-
-    getRecurringFine : function() {
-
-      if (isGroupDescendant('Library Staff', patronProfile) || isGroupDescendant('Institution Staff', patronProfile)) {
-       return 'zero';
-}
-      /* returns config.rule_recuring_fine.name */
-      var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-      
-      var map = {
-        'circ-reserve-1-hour'  : 'onedollarperhour',
-        'circ-reserve-2-hour'  : 'onedollarperhour',
-        'circ-reserve-4-hour'  : 'onedollarperhour',
-        'circ-reserve-24-hour' : 'onedollarperhour',
-        'circ-reserve-72-hour' : 'onedollarperhour',
-        'library-equipment'    : 'fivedollarsperhour',
-        'floppy-disc'          : 'zero',
-        'archives'             : 'zero',
-        'online'               : 'zero'
-      };
-      return map[circMod] || 'fiftycents';
-    },
-
-    getMaxFine : function() {
-
-      /* returns config.rule_recuring_fine.name */
-      var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
-      var map = {
-        'library-equipment'  : 'thirtydollar',
-        'floppy-disc'        : 'zero',
-        'archives'           : 'zero',
-        'online'             : 'zero'
-      };
-      return map[circMod] || 'tendollar';
-    },
-
-    exceedsMaxCheckoutsByCircMod : function() {
-      return false;
-    },
-
-    isAllowedCirc : function() {
-      return true;
-    },
-    
-    isAllowedHold : function() {
-      return true;
-    },
-
-    getGroupConfig : function() {
-      /* returns the combined user config object */
-
-      var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-      
-      // set defaults
-      var maxItemsOutValue        =  20;
-      var maxHoldsValue           =   0;
-      var overdueThresholdValue   =  10;
-      var fineThresholdValue      =  30;
-      
-      // set special values for group
-      if (isGroupDescendant('Library Staff', patronProfile)) {
-        maxItemsOutValue        = 1000;
-        maxHoldsValue           = 1000;
-        overdueThresholdValue   = 1000;
-        fineThresholdValue      =   -1;
-      } else if (isGroupDescendant('Institution Staff', patronProfile)) {
-        maxItemsOutValue        =  100;
-        maxHoldsValue           =  100;
-        overdueThresholdValue   =  100;
-        fineThresholdValue      =   -1;
-      } else {
-        switch (patronProfile) {
-          case 'Community Borrowers':
-            maxItemsOutValue        =  20;
-            maxHoldsValue           =   0;
-            overdueThresholdValue   =  10;
-            fineThresholdValue      =  30;
-            break;
-          case 'Students':
-            maxItemsOutValue        = 100;
-            maxHoldsValue           =  50;
-            overdueThresholdValue   =  25;
-            fineThresholdValue      =  30;
-            break;
-          case 'Distance Students':
-            maxItemsOutValue        =  50;
-            maxHoldsValue           =  50;
-            overdueThresholdValue   =  20;
-            fineThresholdValue      =  30;
-            break;
-          case 'InterLibraryLoan':
-            maxItemsOutValue        =  20;
-            maxHoldsValue           =  10;
-            overdueThresholdValue   =  10;
-            fineThresholdValue      =  -1;
-            break;
-          case 'Reciprocal Borrowers':
-            maxItemsOutValue        =  20;
-            maxHoldsValue           =  10;
-            overdueThresholdValue   =  10;
-            fineThresholdValue      =  -1;
-            break;
+    load_lib('circ/circ_lib.js');
+    log_info("Loading policy info for BCREK");
+
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+    return {
+
+        getLoanDuration: function() {
+
+            /* returns config.rule_circ_duration.name */
+
+            var map = {
+                'circ-reserve-1-hour': '1hr_0',
+                'circ-reserve-2-hour': '2hr_0',
+                'circ-reserve-4-hour': '4hr_0',
+                'circ-reserve-24-hour': '24hr_0',
+                'circ-reserve-72-hour': '72hr_0',
+                '7-day-loan': '7_6',
+                'archives': '7_0',
+                'book': '21_6',
+                'floppy-disc': '3_2',
+                'inter-library-loan': '14_0',
+                'ill-media': '3_2',
+                'kit': '21_6',
+                'library-equipment': '3_2',
+                'magazine': '7_6',
+                'maps': '7_6',
+                'media': '21_6',
+                'online': '21_6',
+                'semester': '21_6',
+                /* TODO: do term loan for this */
+                'videos': '7_6'
+            };
+
+            return map[circMod] || '21_6';
+
+        },
+
+        getRecurringFine: function() {
+
+            if (isGroupDescendant('Library Staff', patronProfile) || isGroupDescendant('Institution Staff', patronProfile)) {
+                return 'zero';
+            }
+
+            var map = {
+                'circ-reserve-1-hour': 'onedollarperhour',
+                'circ-reserve-2-hour': 'onedollarperhour',
+                'circ-reserve-4-hour': 'onedollarperhour',
+                'circ-reserve-24-hour': 'onedollarperhour',
+                'circ-reserve-72-hour': 'onedollarperhour',
+                'library-equipment': 'fivedollarsperhour',
+                'floppy-disc': 'zero',
+                'archives': 'zero',
+                'online': 'zero'
+            };
+
+            return map[circMod] || 'fiftycents';
+        },
+
+        getMaxFine: function() {
+            var map = {
+                'library-equipment': 'thirtydollar',
+                'floppy-disc': 'zero',
+                'archives': 'zero',
+                'online': 'zero'
+            };
+
+            return map[circMod] || 'tendollar';
+        },
+
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
+        },
+
+        isAllowedCirc: function() {
+            return true;
+        },
+
+        isAllowedHold: function() {
+            return true;
+        },
+
+        getGroupConfig: function() {
+            /* returns the combined user config object */
+
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+
+            // set defaults
+            var maxHoldsValue = 0;
+
+            // set special values for group
+            if (isGroupDescendant('Library Staff', patronProfile)) {
+                maxHoldsValue = 1000;
+            } else if (isGroupDescendant('Institution Staff', patronProfile)) {
+                maxHoldsValue = 100;
+            } else {
+                switch (patronProfile) {
+                case 'Community Borrowers':
+                    maxHoldsValue = 0;
+                    break;
+                case 'Students':
+                    maxHoldsValue = 50;
+                    break;
+                case 'Distance Students':
+                    maxHoldsValue = 50;
+                    break;
+                case 'InterLibraryLoan':
+                    maxHoldsValue = 10;
+                    break;
+                case 'Reciprocal Borrowers':
+                    maxHoldsValue = 10;
+                    break;
+                }
+            }
+
+            // return group config
+            config = {
+                'maxHolds': maxHoldsValue || 100,
+            };
+
+            return config;
         }
-      }
-
-      // return group config
-      config = {
-        'maxHolds'          :  maxHoldsValue || 100,
-        'maxItemsOut'       :  maxItemsOutValue,
-        'overdueThreshold'  :  overdueThresholdValue,
-        'fineThreshold'     :  fineThresholdValue
-      };
-
-      // debugging...
-      var str = "BCREK getGroupConfig():";
-      for( var i in config ){ 
-        str += i + '=' + config[i] + '  ';
-      }
-      log_debug(str);
-
-      return config;
-    }
-  };
+    };
 }
 
index ad6c81b..69cc808 100644 (file)
@@ -5,81 +5,67 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BFN");
 
+    var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
-            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+        getLoanDuration: function() {
 
-               if(patronProfile == 'Bush People'){
-                       return '28_3';
-               }
+            if (patronProfile == 'Bush People') {
+                return '28_3';
+            }
             var map = {
-                '3-week-videos'     :   '21_3',
-                'juvenile-collection':  '21_3',
-                'videos'            :   '7_3',
-                'video-collection'  :   '7_3',
-                'nfb-videos'        :   '7_3'
-                       };
-                   
+                '3-week-videos': '21_3',
+                'juvenile-collection': '21_3',
+                'videos': '7_3',
+                'video-collection': '7_3',
+                'nfb-videos': '7_3'
+            };
+
             return map[circMod] || '21_3';
-               },
+        },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-                '3-week-videos'     :   'onedollar',
-                'videos'            :   'onedollar',
-                'video-collection'  :   'onedollar',
-                'nfb-videos'        :   'onedollar',
-                'juvenile-collection':  'tencents'
+                '3-week-videos': 'onedollar',
+                'videos': 'onedollar',
+                'video-collection': 'onedollar',
+                'nfb-videos': 'onedollar',
+                'juvenile-collection': 'tencents'
             };
-            
+
             return map[circMod] || 'twentyfivecents';
-               },
-
-       getMaxFine : function() {
-               return 'fivedollar';
-
-       },
-
-       exceedsMaxCheckoutsByCircMod : function() {
-               return false;
-       },
-
-       isAllowedCirc : function() {
-               return true;
-       },
-
-    isAllowedHold : function() {
-        return true;
-    },
-
-       getGroupConfig : function() {
-               /* returns the combined user config object */
-
-               // override some defaults
-               GROUP_CONFIG.Patrons.maxItemsOut = -1;
-               GROUP_CONFIG.JuvenileRes.maxItemsOut = 6;
-           GROUP_CONFIG.Patrons.fineThreshold = 20;
-        
-               var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-               
-               // these are global settings for BFN users
-               config.maxHolds = -1;
-               config.fineThreshold = 20;
-               config.overdueThreshold = -1;
-               
-               // debugging...
-               var str = "BFN getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-               }
-        log_debug(str);
-
-               return config;
-       }
+        },
+
+        getMaxFine: function() {
+            return 'fivedollar';
+
+        },
+
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
+        },
+
+        isAllowedCirc: function() {
+            return true;
+        },
+
+        isAllowedHold: function() {
+            return true;
+        },
+
+        getGroupConfig: function() {
+            /* returns the combined user config object */
+
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+
+            // these are global settings for BFN users
+            config.maxHolds = -1;
+
+            return config;
+        }
     };
 }
 
index 0a62e68..8f19d9b 100644 (file)
@@ -5,96 +5,67 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BGF");
 
+    var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+
 
     return {
-        getLoanDuration : function() {
-           
-          if (patronProfile == 'InterLibraryLoan') {
-            return '42_0';
-          }
-           if (patronProfile == 'Volunteer' || patronProfile == 'NoFines') {
-               return '28_2';
-           }
+        getLoanDuration: function() {
+
+            if (patronProfile == 'InterLibraryLoan') {
+                return '42_0';
+            }
+            if (patronProfile == 'Volunteer' || patronProfile == 'NoFines') {
+                return '28_2';
+            }
 
-           var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-                'talking-books'     :   '365_0',
-                'videos'           :   '7_2'
-                       };
-                   
+                'talking-books': '365_0',
+                'videos': '7_2'
+            };
+
             return map[circMod] || '21_2';
-               },
+        },
 
-        getRecurringFine : function() {
-      
-       if(isGroupDescendant('Staff', patronProfile)) {
-                       return 'staff';
-            }
-       if(patronProfile == 'Volunteer' || patronProfile == 'NoFines' || patronProfile == 'InterLibraryLoan') { 
-                               return 'staff';
+        getRecurringFine: function() {
+
+            if (patronProfile == 'Volunteer' || patronProfile == 'InterLibraryLoan') {
+                return 'staff';
             }
-    
-            return 'tencents';
-               },
 
-       getMaxFine : function() {
-            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+            return 'tencents';
+        },
 
+        getMaxFine: function() {
             var map = {
-                'magazine'     :   'twodollar'
-                       };
+                'magazine': 'twodollar'
+            };
             return map[circMod] || 'fivedollar';
 
-       },
-
-       exceedsMaxCheckoutsByCircMod : function() {
-               return false;
-       },
-
-       isAllowedCirc : function() {
-               return true;
-       },
-
-    isAllowedHold : function() {
-        return true;
-    },
-
-       getGroupConfig : function() {
-               /* returns the combined user config object */
-
-               // override some defaults
-    /*
-               GROUP_CONFIG.Circulators.fineThreshold = -1;
-               GROUP_CONFIG.Catalogers.fineThreshold = -1;
-               GROUP_CONFIG.CircCat.fineThreshold = -1;
-               GROUP_CONFIG.LocalSystemAdministrator.fineThreshold = -1;
-    */
-               GROUP_CONFIG.Staff.fineThreshold = -1;
-
-               GROUP_CONFIG.BCOneCard.maxItemsOut = 5;
-               GROUP_CONFIG.BCOneCard.maxHolds = 0;
-
-               GROUP_CONFIG.Volunteer.fineThreshold = -1;
-        
-               var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-               
-               // these are global settings for BGF users
-               config.maxHolds = -1;
-               config.fineThreshold = 5;
-               config.overdueThreshold = 1;
-               config.maxItemsOut = -1;
-               
-               // debugging...
-               var str = "BFN getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-               }
-        log_debug(str);
-
-               return config;
-       }
+        },
+
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
+        },
+
+        isAllowedCirc: function() {
+            return true;
+        },
+
+        isAllowedHold: function() {
+            return true;
+        },
+
+        getGroupConfig: function() {
+            GROUP_CONFIG.BCOneCard.maxHolds = 0;
+
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+
+            // these are global settings for BGF users
+            config.maxHolds = -1;
+
+            return config;
+        }
     };
 }
 
index d190494..b39bae7 100644 (file)
@@ -8,161 +8,144 @@ function getPolicy() {
     var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
             var map = {
-                'book'                  :   '21_2',
-                'paperbacks'            :   '21_2',
-                'magazine'              :   '7_2',
-                'cassettebook'          :   '21_2',
-                'videos'                :   '7_2',
-                'dvd'                   :   '7_1', // short = 3 days
-                'talking-books'         :   '7_2',
-                'video-games'           :   '7_2',
-                'audio-cds'             :   '7_1',
-                'juvenile-collection'   :   '21_2',
-                'juvenile-video'        :   '7_2',
-                'kit'                   :   '21_1',
-                'new-books'             :   '21_2',
-                'inter-library-loan'    :   '21_0',
-                'best-seller'           :   '7_0', // short - 1 day (dvd)
-                'juvenile-serial'       :   '7_2',
-                'language-learning'     :   '21_2'
+                'book': '21_2',
+                'paperbacks': '21_2',
+                'magazine': '7_2',
+                'cassettebook': '21_2',
+                'videos': '7_2',
+                'dvd': '7_1',
+                // short = 3 days
+                'talking-books': '7_2',
+                'video-games': '7_2',
+                'audio-cds': '7_1',
+                'juvenile-collection': '21_2',
+                'juvenile-video': '7_2',
+                'kit': '21_1',
+                'new-books': '21_2',
+                'inter-library-loan': '21_0',
+                'best-seller': '7_0',
+                // short - 1 day (dvd)
+                'juvenile-serial': '7_2',
+                'language-learning': '21_2'
             };
 
             return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
-            if(patronProfile == 'InterLibraryLoan'){
+        getRecurringFine: function() {
+            if (patronProfile == 'InterLibraryLoan') {
                 return 'zero';
             }
             var map = {
-                'book'                  :   'twentyfivecents',
-                'paperbacks'            :   'twentyfivecents',
-                'magazine'              :   'twentyfivecents',
-                'cassettebook'          :   'twentyfivecents',
-                'videos'                :   'fiftycents',
-                'dvd'                   :   'onedollar',
-                'talking-books'         :   'twentyfivecents',
-                'video-games'           :   'onedollar',
-                'audio-cds'             :   'onedollar',
-                'juvenile-collection'   :   'tencents',
-                'juvenile-video'        :   'fiftycents', // high - $1
-                'kit'                   :   'tencents',
-                'new-books'             :   'twentyfivecents',
-                'inter-library-loan'    :   'onedollar',
-                'best-seller'           :   'onedollar',
-                'juvenile-serial'       :   'tencents',
-                'language-learning'     :   'twentyfivecents'
+                'book': 'twentyfivecents',
+                'paperbacks': 'twentyfivecents',
+                'magazine': 'twentyfivecents',
+                'cassettebook': 'twentyfivecents',
+                'videos': 'fiftycents',
+                'dvd': 'onedollar',
+                'talking-books': 'twentyfivecents',
+                'video-games': 'onedollar',
+                'audio-cds': 'onedollar',
+                'juvenile-collection': 'tencents',
+                'juvenile-video': 'fiftycents',
+                // high - $1
+                'kit': 'tencents',
+                'new-books': 'twentyfivecents',
+                'inter-library-loan': 'onedollar',
+                'best-seller': 'onedollar',
+                'juvenile-serial': 'tencents',
+                'language-learning': 'twentyfivecents'
             };
 
             return map[circMod] || 'twentyfivecents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             var map = {
-                'book'                  :   'fivedollar',
-                'paperbacks'            :   'fivedollar',
-                'magazine'              :   'fivedollar',
-                'cassettebook'          :   'fivedollar',
-                'videos'                :   'fivedollar',
-                'dvd'                   :   'fivedollar',
-                'talking-books'         :   'fivedollar',
-                'video-games'           :   'fivedollar',
-                'audio-cds'             :   'fivedollar',
-                'juvenile-collection'   :   'fivedollar',
-                'juvenile-video'        :   'threedollar', // high - $1
-                'kit'                   :   'fivedollar',
-                'new-books'             :   'fivedollar',
-                'inter-library-loan'    :   'fiftydollar',
-                'best-seller'           :   'fivedollar',
-                'juvenile-serial'       :   'threedollar',
-                'language-learning'     :   'fivedollar'
+                'book': 'fivedollar',
+                'paperbacks': 'fivedollar',
+                'magazine': 'fivedollar',
+                'cassettebook': 'fivedollar',
+                'videos': 'fivedollar',
+                'dvd': 'fivedollar',
+                'talking-books': 'fivedollar',
+                'video-games': 'fivedollar',
+                'audio-cds': 'fivedollar',
+                'juvenile-collection': 'fivedollar',
+                'juvenile-video': 'threedollar',
+                // high - $1
+                'kit': 'fivedollar',
+                'new-books': 'fivedollar',
+                'inter-library-loan': 'fiftydollar',
+                'best-seller': 'fivedollar',
+                'juvenile-serial': 'threedollar',
+                'language-learning': 'fivedollar'
             };
 
 
             return map[circMod] || 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             var maxByCircMod = {
-                       'talking-books' : 4,
-                       'audio-cds' : 3,
-                       'video-games' : 1,
-                       'dvd' : 3,
-                       'playaway' : 1
-               };
-            if(isGroupDescendant('Staff', patronProfile)){
+                'talking-books': 4,
+                'audio-cds': 3,
+                'video-games': 1,
+                'dvd': 3,
+                'playaway': 1
+            };
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
             }
             var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
             var maxCount = maxByCircMod[circMod];
-            if(!maxCount || maxCount === null){ 
+            if (!maxCount || maxCount === null) {
                 return false;
             }
             var outCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
             return outCount >= maxCount;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             var nontransitmap = {
-                'videos'            :'1',
-                'video-game'        :'1',
-                'new-books'         :'1',
-                'best-seller'       :'1',
-                'language-learning' :'1',
-                'dvd'               :'1'
-                };
-             if((copy.circ_lib.id != holdPickupLib) && (nontransitmap[circMod])){
+                'videos''1',
+                'video-game''1',
+                'new-books''1',
+                'best-seller''1',
+                'language-learning''1',
+                'dvd''1'
+            };
+            if ((copy.circ_lib.id != holdPickupLib) && (nontransitmap[circMod])) {
                 return 'false';
             }
-       
-               if (circMod == 'best-seller'){
-                               return false;
-               }
-               return true;
+
+            if (circMod == 'best-seller') {
+                return false;
+            }
+            return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =  -1 ;
-            var maxItemsOutValue        =  40;
-            var overdueThresholdValue   =  5;
-            var fineThresholdValue      =  3;
-            
+            var maxHoldsValue = -1;
+
             // set special values for group
             switch (patronProfile) {
-              case 'Homebound':
-                fineThresholdValue = 12;
-                overdueThresholdValue  = 100;
-                break;
-              case 'NonResident':
+            case 'NonResident':
                 maxHoldsValue = 100;
-                maxItemsOutValue = 100;
-                overdueThresholdValue = 100;
                 break;
-              case 'InterLibraryLoan':
-                maxItemsOutValue = -1;
-                fineThresholdValue = 10;
-                overdueThresholdValue = 100;
-                break;
-              case 'BCOneCard':
-                maxItemsOutValue = 7;
-                overdueThresholdValue = 3;
-                break;
-               }
+            }
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index 2f4d567..d55dbd0 100644 (file)
@@ -4,135 +4,95 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BGSI");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
 
-            if (patronProfile == 'InterLibraryLoan'){
-              return '56_2';
-           }
-
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+            if (patronProfile == 'InterLibraryLoan') {
+                return '56_2';
+            }
 
             var map = {
-                'dvd'                     : '7_1',
-                'cd-rom'                  : '7_1',
-                'juvenile-collection'     : '21_2',
-                'library-equipment'       : '30_0',
-                'magazine'                : '21_0',
-                'mass-market-paperbacks'  : '21_2',
-                'mp-3-audio-disc'         : '21_2',
-                'non-circulating'         : '21_2', 
-                'talking-books'           : '21_2',
-                'videos'                  : '7_1',
-                'compact-discs'           : '21_2'
+                'dvd': '7_1',
+                'cd-rom': '7_1',
+                'juvenile-collection': '21_2',
+                'library-equipment': '30_0',
+                'magazine': '21_0',
+                'mass-market-paperbacks': '21_2',
+                'mp-3-audio-disc': '21_2',
+                'non-circulating': '21_2',
+                'talking-books': '21_2',
+                'videos': '7_1',
+                'compact-discs': '21_2'
             };
 
             return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
-            
-            if (patronProfile == 'InterLibraryLoan'){
-              return 'zero';
+        getRecurringFine: function() {
+
+            if (patronProfile == 'InterLibraryLoan') {
+                return 'zero';
             }
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-                'dvd'                     : 'fiftycents',
-                'cd-rom'                  : 'twentycent',
-                'juvenile-collection'     : 'tencents',
-                'library-equipment'       : 'zero',
-                'magazine'                : 'tencents',
-                'mass-market-paperbacks'  : 'tencents',
-                'mp-3-audio-disc'         : 'twentycent',
-                'non-circulating'         : 'twentycent', 
-                'talking-books'           : 'twentycent',
-                'videos'                  : 'twentycent',
-                'compact-discs'           : 'twentycent'
+                'dvd': 'fiftycents',
+                'cd-rom': 'twentycent',
+                'juvenile-collection': 'tencents',
+                'library-equipment': 'zero',
+                'magazine': 'tencents',
+                'mass-market-paperbacks': 'tencents',
+                'mp-3-audio-disc': 'twentycent',
+                'non-circulating': 'twentycent',
+                'talking-books': 'twentycent',
+                'videos': 'twentycent',
+                'compact-discs': 'twentycent'
             };
 
             return map[circMod] || 'twentycent';
         },
 
-        getMaxFine : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+        getMaxFine: function() {
 
             var map = {
-                'dvd'                     : 'fivedollar',
-                'cd-rom'                  : 'fivedollar',
-                'juvenile-collection'     : 'twodollar',
-                'library-equipment'       : 'fivedollar',
-                'magazine'                : 'onedollar',
-                'mass-market-paperbacks'  : 'twodollar',
-                'mp-3-audio-disc'         : 'fivedollar',
-                'non-circulating'         : 'fullprice', 
-                'talking-books'           : 'fivedollar',
-                'videos'                  : 'fivedollar',
-                'compact-discs'           : 'fivedollar'
+                'dvd': 'fivedollar',
+                'cd-rom': 'fivedollar',
+                'juvenile-collection': 'twodollar',
+                'library-equipment': 'fivedollar',
+                'magazine': 'onedollar',
+                'mass-market-paperbacks': 'twodollar',
+                'mp-3-audio-disc': 'fivedollar',
+                'non-circulating': 'fullprice',
+                'talking-books': 'fivedollar',
+                'videos': 'fivedollar',
+                'compact-discs': 'fivedollar'
             };
 
             return map[circMod] || 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-            log_debug('exceedsMaxCheckoutsByCircMod()');
-
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =  -1;
-            var maxItemsOutValue        =  12;
-            var overdueThresholdValue   =  -1;
-            var fineThresholdValue      =   5;
-            
-            // set special values for group
-            switch (patronProfile) {
-              case 'Board':
-              case 'Homebound':
-              case 'Institution':
-              case 'JuvenileRes':
-              case 'NonResident':
-             case 'InterLibraryLoan':
-               maxItemsOutValue        = -1;
-               break;
-             case 'BCOneCard':
-               maxItemsOutValue        = 5;
-               break;
-             case 'Temporary':
-               maxItemsOutValue        = 5;
-               break;
-             case 'Transient':
-               maxItemsOutValue        = 5;
-               break;
-             case 'NoFines':
-             case 'Volunteer':
-             case 'Staff':
-                maxItemsOutValue       =  -1;
-               fineThresholdValue      = -1;
-                break;
-              default:
-                //do nothing
-            }
+            var maxHoldsValue = -1;
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index 6f8b1b0..3575b3d 100644 (file)
@@ -9,98 +9,79 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-            /* returns config.rule_circ_duration.name */
-            var circMod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-                
-                       if(patronProfile == 'InterLibraryLoan'){
-                               return '28_2';
+        getLoanDuration: function() {
+
+            if (patronProfile == 'InterLibraryLoan') {
+                return '28_2';
             }
 
             var map = {
-                'holiday-special'       :   '14_2',
-                'compact-discs'         :   '7_1',
-                'talking-books'         :   '7_1',
-                'videos'                :   '7_1',
-                'dvd'                   :   '7_1'
+                'holiday-special': '14_2',
+                'compact-discs': '7_1',
+                'talking-books': '7_1',
+                'videos': '7_1',
+                'dvd': '7_1'
             };
 
-            return map[circMod] || '21_2'; 
+            return map[circMod] || '21_2';
 
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-           if(patronProfile == 'InterLibraryLoan' || isGroupDescendant('Staff', patronProfile)){
-                               return 'staff';
+            if (patronProfile == 'InterLibraryLoan' || isGroupDescendant('Staff', patronProfile)) {
+                return 'staff';
             }
-            
+
             var map = {
-                'compact-discs'     :       'fiftycents',
-                'talking-books'     :       'fiftycents',
-                'videos'            :       'fiftycents',
-                'dvd'               :       'fiftycents'
+                'compact-discs': 'fiftycents',
+                'talking-books': 'fiftycents',
+                'videos': 'fiftycents',
+                'dvd': 'fiftycents'
             };
             return map[circMod] || 'tencents';
 
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'threedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             log_debug("exceedsMaxCheckoutsByCircMod()");
-            if(isGroupDescendant('Staff', patronProfile)){
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
             }
             var circMod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-            if (!(circMod == 'compact-discs' || circMod == 'talking-books' || circMod == 'videos' || circMod == 'dvd')) {
+            if (! (circMod == 'compact-discs' || circMod == 'talking-books' || circMod == 'videos' || circMod == 'dvd')) {
                 return false;
-                       }
+            }
             var maxCount = 4;
             var mediaCount = 0;
             mediaCount += parseInt(checkoutsByCircModifier(patron.id)['compact-discs']) || 0;
             mediaCount += parseInt(checkoutsByCircModifier(patron.id)['talking-books']) || 0;
             mediaCount += parseInt(checkoutsByCircModifier(patron.id)['videos']) || 0;
             mediaCount += parseInt(checkoutsByCircModifier(patron.id)['dvd']) || 0;
-            log_debug("found max out by circ mod "+circMod+" and checked out media total count is "+mediaCount);
+            log_debug("found max out by circ mod " + circMod + " and checked out media total count is " + mediaCount);
             return mediaCount >= maxCount;
         },
 
-        isAllowedCirc : function() {
-           if(patronProfile == 'JuvenileRes') {
-                if(circMod == 'compact-discs' || circMod == 'talking-books' || circMod == 'videos' || circMod == 'dvd'){
+        isAllowedCirc: function() {
+            if (patronProfile == 'JuvenileRes') {
+                if (circMod == 'compact-discs' || circMod == 'talking-books' || circMod == 'videos' || circMod == 'dvd') {
                     return false;
                 }
-           }
-           return true;
-        },
-        
-        isAllowedHold : function() {
+            }
             return true;
         },
 
-        getGroupConfig : function() {
-            /* returns the combined user config object */
-
-            // override some defaults
-
+        isAllowedHold: function() {
+            return true;
+        },
+        getGroupConfig: function() {
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
-            // these are global settings for BH users
-            config.fineThreshold = 5;
             config.maxHolds = -1;
-            config.overdueThreshold = 5;
-
-            // debugging...
-            var str = "BH getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-            }
-               log_debug(str);
-
             return config;
         }
     };
index e94ffef..a4368ed 100644 (file)
@@ -5,73 +5,50 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BHA");
 
-    return {
-
-        getLoanDuration : function() {
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+    return {
 
+        getLoanDuration: function() {
             var map = {
-                'dvd'                     : '7_3',
-                'videos'                  : '7_3'
+                'dvd': '7_3',
+                'videos': '7_3'
             };
 
             return map[circMod] || '21_10';
         },
 
-        getRecurringFine : function() {
-            if (patronProfile == 'InterLibraryLoan'){
+        getRecurringFine: function() {
+            if (patronProfile == 'InterLibraryLoan') {
                 return 'zero';
             }
             return 'fivecents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             return 'twofifty';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =  100;
-            var maxItemsOutValue        =  50;
-            var overdueThresholdValue   =  100;
-            var fineThresholdValue      =   10;
-            
-            // set special values for group
-            switch (patronProfile) {
-                   case 'InterLibraryLoan':
-                    maxItemsOutValue   = 1000;
-                    break;
-                case 'BCOneCard':
-                       maxItemsOutValue        = 5;
-                           break;
-                case 'Staff':
-                    maxItemsOutValue       =  1000;
-                           fineThresholdValue  = 100;
-                    break;
-              default:
-                //do nothing
-            }
+            var maxHoldsValue = 100;
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index 9f82532..6fcdc04 100644 (file)
@@ -4,96 +4,87 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BIN");
 
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
     return {
 
-        getLoanDuration : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
-                       var map = {
-                               'audio-cassette'          : '21_10',
-                               'compact-discs'           : '21_10',
-                               'dvd'                     : '21_10',
-                               'videos'                  : '21_10',
-                               'book'                    : '21_10',
-                               'juvenile-collection'     :     '21_10',
-                               'paperbacks'              : '21_10',
-                               'magazine'               :      '7_3'
-                       };
-
-                   return map[circMod] || '21_2';
+        getLoanDuration: function() {
+
+            var map = {
+                'audio-cassette': '21_10',
+                'compact-discs': '21_10',
+                'dvd': '21_10',
+                'videos': '21_10',
+                'book': '21_10',
+                'juvenile-collection': '21_10',
+                'paperbacks': '21_10',
+                'magazine': '7_3'
+            };
+
+            return map[circMod] || '21_2';
         },
 
-               getRecurringFine : function() {
-                       var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
-                       var map = {
-                               'audio-cassette'      : 'twentyfivecents',
-                               'compact-discs'       : 'twentyfivecents',
-                               'dvd'                 : 'twentyfivecents',
-                               'videos'              : 'twentyfivecents',
-                               'book'                : 'twentyfivecents',
-                               'juvenile-collection' : 'tencents',
-                               'paperbacks'          : 'tencents',
-                               'magazine'           : 'twentyfivecents',
-                               'non-circulating'     : 'twentyfivecents'
-                       };
-
-                       return map[circMod] || 'twentyfivecents';
-               },
-
-               getMaxFine : function() {
-                       var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
-                       var map = {
-                               'audio-cassette'       : 'fivedollar',
-                               'compact-discs'        : 'fivedollar',
-                               'dvd'                  : 'fivedollar',
-                               'videos'               : 'fivedollar',
-                               'book'                 : 'fivedollar',
-                               'juvenile-collection'  : 'fivedollar',
-                               'paperbacks'           : 'fivedollar',
-                               'magazine'            : 'twodollar',
-                               'non-circulating'      : 'fivedollar'
-                       };
-
-                       return map[circMod] || 'fivedollar';
-               },
-
-        exceedsMaxCheckoutsByCircMod : function() {
-            return false;
+        getRecurringFine: function() {
+
+            var map = {
+                'audio-cassette': 'twentyfivecents',
+                'compact-discs': 'twentyfivecents',
+                'dvd': 'twentyfivecents',
+                'videos': 'twentyfivecents',
+                'book': 'twentyfivecents',
+                'juvenile-collection': 'tencents',
+                'paperbacks': 'tencents',
+                'magazine': 'twentyfivecents',
+                'non-circulating': 'twentyfivecents'
+            };
+
+            return map[circMod] || 'twentyfivecents';
         },
 
-        isAllowedCirc : function() {
-               return true;
+        getMaxFine: function() {
+
+            var map = {
+                'audio-cassette': 'fivedollar',
+                'compact-discs': 'fivedollar',
+                'dvd': 'fivedollar',
+                'videos': 'fivedollar',
+                'book': 'fivedollar',
+                'juvenile-collection': 'fivedollar',
+                'paperbacks': 'fivedollar',
+                'magazine': 'twodollar',
+                'non-circulating': 'fivedollar'
+            };
+
+            return map[circMod] || 'fivedollar';
         },
-                
-        isAllowedHold : function() {
-               return true;
+
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
         },
 
-               getGroupConfig : function() {
+        isAllowedCirc: function() {
+            return true;
+        },
 
-                       GROUP_CONFIG.Patrons.maxHolds       =  10;
-                       GROUP_CONFIG.JuvenileRes.maxHolds   =  10;
-                       GROUP_CONFIG.NonResident.maxHolds   =  10;
-                       GROUP_CONFIG.BCOneCard.maxHolds     =   3;
-                       GROUP_CONFIG.Temporary.maxHolds     =   3;
-                       GROUP_CONFIG.Transient.maxHolds     =  10;
-                       GROUP_CONFIG.Volunteer.maxHolds     =  10;
-                       GROUP_CONFIG.Staff.maxHolds         =  10;
+        isAllowedHold: function() {
+            return true;
+        },
 
-                       var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+        getGroupConfig: function() {
 
-                       //config.maxHolds                   =  10;
-                       config.maxItemsOut                  = 100;
-                       GROUP_CONFIG.BCOneCard.maxItemsOut      =       5;
-                       GROUP_CONFIG.Temporary.maxItemsOut      =       3;
+            GROUP_CONFIG.Patrons.maxHolds = 10;
+            GROUP_CONFIG.JuvenileRes.maxHolds = 10;
+            GROUP_CONFIG.NonResident.maxHolds = 10;
+            GROUP_CONFIG.BCOneCard.maxHolds = 3;
+            GROUP_CONFIG.Temporary.maxHolds = 3;
+            GROUP_CONFIG.Transient.maxHolds = 10;
+            GROUP_CONFIG.Volunteer.maxHolds = 10;
+            GROUP_CONFIG.Staff.maxHolds = 10;
 
-                       config.overdueThreshold             =  -1;
-                       config.fineThreshold                =  10;
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
 
-                       return config;
-               }
+            return config;
+        }
     };
 }
 
index d99bcd8..2e9143d 100644 (file)
@@ -5,167 +5,165 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_warn("Loading policy info for BKCT");
 
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
 
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-                               'audiobook-impaired'            :       '90_2',
-                               'bookclub'              :       '42_0',
-                               'compact-disc'          :       '14_2',
-                               'dvd'                   :       '14_2',
-                               'highdemand'            :       '14_2',
-                               'inter-library-loan'            :       '14_0',
-                               'magazine'              :       '14_2',
-                               'quickread'             :       '7_0',
-                               '7-day-loan'            :       '7_2',
-                               '1-day-loan'            :       '1_2',
-                               'video' :       '14_2'
+                'audiobook-impaired': '90_2',
+                'bookclub': '42_0',
+                'compact-disc': '14_2',
+                'dvd': '14_2',
+                'highdemand': '14_2',
+                'inter-library-loan': '14_0',
+                'magazine': '14_2',
+                'quickread': '7_0',
+                '7-day-loan': '7_2',
+                '1-day-loan': '1_2',
+                'video': '14_2'
             };
-                       // ALL OTHERS ARE 28_2
+            // ALL OTHERS ARE 28_2
             return map[circMod] || '28_2';
         },
 
-        getRecurringFine : function() {
-               if(isTrue(isPrecat) || isGroupDescendant('Staff', patronProfile) || patronProfile == 
-'NoFines' || patronProfile == 'Homebound' || patronProfile == 'InterLibraryLoan' ){
-                       return 'zero';
-               }
-               var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-               if (isTrue(patron.juvenile)) {
-                       // JUVENILE PATRONS
-                       var juvmap = {
-                               'audiobook-impaired'            : 'zero',
-                               'bookclub'              : 'onedollar',
-                               'dvd'                   : 'twentyfivecents',
-                               'inter-library-loan'    : 'fiftycents',
-                               'mp-3-audio-disc'                       : 'tencents',
-                               'quickread'             : 'onedollar',
-                               '7-day-loan'            : 'tencents',
-                               '1-day-loan'            : 'fiftycents',
-                               'video' : 'twentyfivecents'
-                       };
-                       // all others are 5c/day
-                       return juvmap[circMod] || 'fivecents';
-               } else {
-                       var adultmap = {
-                               'audiobook-impaired'                    : 'zero',
-                               'bookclub'                      : 'onedollar',
-                               'dvd'                   : 'twentyfivecents',
-                               'inter-library-loan'    : 'fiftycents',
-                               'magazine'                      : 'fivecents',
-                               'mp-3-audio-disc'                       : 'tencents',
-                               'paperback'                     : 'fivecents',
-                               'quickread'                     : 'onedollar',
-                               '1-day-loan'                    : 'fiftycents',
-                               'video'                 : 'twentyfivecents'
-                       };
-                       // all ofthers are 10c/day
-                       return adultmap[circMod] || 'tencents';
-               }
+        getRecurringFine: function() {
+            if (isTrue(isPrecat) || patronProfile == 'Homebound' || patronProfile == 'InterLibraryLoan') {
+                return 'zero';
+            }
+            if (isTrue(patron.juvenile)) {
+                // JUVENILE PATRONS
+                var juvmap = {
+                    'audiobook-impaired': 'zero',
+                    'bookclub': 'onedollar',
+                    'dvd': 'twentyfivecents',
+                    'inter-library-loan': 'fiftycents',
+                    'mp-3-audio-disc': 'tencents',
+                    'quickread': 'onedollar',
+                    '7-day-loan': 'tencents',
+                    '1-day-loan': 'fiftycents',
+                    'video': 'twentyfivecents'
+                };
+                // all others are 5c/day
+                return juvmap[circMod] || 'fivecents';
+            } else {
+                var adultmap = {
+                    'audiobook-impaired': 'zero',
+                    'bookclub': 'onedollar',
+                    'dvd': 'twentyfivecents',
+                    'inter-library-loan': 'fiftycents',
+                    'magazine': 'fivecents',
+                    'mp-3-audio-disc': 'tencents',
+                    'paperback': 'fivecents',
+                    'quickread': 'onedollar',
+                    '1-day-loan': 'fiftycents',
+                    'video': 'twentyfivecents'
+                };
+                // all ofthers are 10c/day
+                return adultmap[circMod] || 'tencents';
+            }
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
-                       if(isTrue(patron.juvenile)){            
-                               // JUVENILE PATRONS
-                               var juvmap = {
-                                       'audiobook-impaired'            :       'zero',
-                                       'bookclub'              :       'tendollar',
-                                       'dvd'                   :       'threedollar',
-                                       'inter-library-loan'            :       'fivedollar',
-                                       'mp-3-audio-disc'                       :       'threedollar',
-                                       'quickread'             :       'tendollar',
-                                       '7-day-loan'            :       'threedollar',
-                                       '1-day-loan'            :       'tendollar',
-                                       'video' :       'threedollar'
-                               };
-                               // all others use onedollar
-                               return juvmap[circMod] || 'onedollar';
-                       }  else {
-                               // ADULT PATRONS
-                               var adultmap = {
-                                       'audiobook-impaired'            :       'zero',
-                                       'bookclub'              :       'tendollar',
-                                       'inter-library-loan'            :       'fivedollar',
-                                       'magazine'              :       'onedollar',
-                                       'paperback'             :       'onedollar',
-                                       'quickread'             :       'tendollar',
-                                       '1-day-loan'            :       'tendollar'
-                               };
-                               // all others use three
-                               return adultmap[circMod] || 'threedollar';
-
-                       }            
+            if (isTrue(patron.juvenile)) {
+                // JUVENILE PATRONS
+                var juvmap = {
+                    'audiobook-impaired': 'zero',
+                    'bookclub': 'tendollar',
+                    'dvd': 'threedollar',
+                    'inter-library-loan': 'fivedollar',
+                    'mp-3-audio-disc': 'threedollar',
+                    'quickread': 'tendollar',
+                    '7-day-loan': 'threedollar',
+                    '1-day-loan': 'tendollar',
+                    'video': 'threedollar'
+                };
+                // all others use onedollar
+                return juvmap[circMod] || 'onedollar';
+            } else {
+                // ADULT PATRONS
+                var adultmap = {
+                    'audiobook-impaired': 'zero',
+                    'bookclub': 'tendollar',
+                    'inter-library-loan': 'fivedollar',
+                    'magazine': 'onedollar',
+                    'paperback': 'onedollar',
+                    'quickread': 'tendollar',
+                    '1-day-loan': 'tendollar'
+                };
+                // all others use three
+                return adultmap[circMod] || 'threedollar';
+
+            }
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-                       // returns true if we've exceeded the limit for this circmod
+        exceedsMaxCheckoutsByCircMod: function() {
+            // returns true if we've exceeded the limit for this circmod
             log_debug('exceedsMaxCheckoutsByCircMod()');
 
-                       // if we are staff, bail out and ignore limits
-                       if(isGroupDescendant('Staff', patronProfile)){
+            // if we are staff, bail out and ignore limits
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
             }
 
-                       var maxByCircMod;
+            var maxByCircMod;
             var circModLimit;
 
-                       var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
 
 
-                       // number of this circ mod currently checked out
-                       var circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
+            // number of this circ mod currently checked out
+            var circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
 
-                       if(patronProfile == 'NonResident' || patronProfile == 'Temporary'){
-                           maxByCircMod = {
-                                       'bookclub' : 1
-                           };
-                               circModLimit = maxByCircMod[circMod] || 3;
-                       } 
-                       else {
-                           maxByCircMod = {
-                                       'video' : 15,
-                                       'compact-disc' : 20,
-                                       'leased' :  30,
-                                       'cd-audiobook' : 30,
-                                       'dvd' : 20,
-                                       'mp-3-audio-disc' : 30,
-                                       'quickread' : 3,
-                                       'bookclub' : 1
-                           };
-                               circModLimit = maxByCircMod[circMod] || 50;
-                       }
-                       
-                       // returns true if we've exceeded the limit
-                       return circModCount >= circModLimit;
-               },
-
-               isAllowedCirc : function() {
-                       return true;
-               },
-
-               isAllowedHold : function() {
-                       /* var noHoldAllowed = { 'quickread' : 1 };
+            if (patronProfile == 'NonResident' || patronProfile == 'Temporary') {
+                maxByCircMod = {
+                    'bookclub': 1
+                };
+                circModLimit = maxByCircMod[circMod] || 3;
+            }
+            else {
+                maxByCircMod = {
+                    'video': 15,
+                    'compact-disc': 20,
+                    'leased': 30,
+                    'cd-audiobook': 30,
+                    'dvd': 20,
+                    'mp-3-audio-disc': 30,
+                    'quickread': 3,
+                    'bookclub': 1
+                };
+                circModLimit = maxByCircMod[circMod] || 50;
+            }
+
+            // returns true if we've exceeded the limit
+            return circModCount >= circModLimit;
+        },
+
+        isAllowedCirc: function() {
+            return true;
+        },
+
+        isAllowedHold: function() {
+            /* var noHoldAllowed = { 'quickread' : 1 };
                        if ( noHoldAllowed[circMod] == 1 ) {
                                return false;
                        } 
-                       // patch pending tests
+                       // FIXME
                        */
-                       return true;
-               },
-
-               getGroupConfig : function() {
+            return true;
+        },
 
-                       var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-                       // return group config
-                       config.maxHolds = 100;
+        getGroupConfig: function() {
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+            // return group config
+            config.maxHolds = 100;
 
-                       return config;
-               }
-       };
+            return config;
+        }
+    };
 }
 
index c8cfd0e..889dace 100644 (file)
@@ -4,64 +4,51 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BLP");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
             return '31_1';
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             return 'zero';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             return 'fullprice';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-            log_debug('exceedsMaxCheckoutsByCircMod()');
-
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =   4;
-            var maxItemsOutValue        =  20;
-            var overdueThresholdValue   =  20;
-            var fineThresholdValue      =  -1;
-            
+            var maxHoldsValue = 4;
             // set special values for group
             switch (patronProfile) {
-              case 'Patrons':
-                fineThresholdValue     =  100;
-                break;
-              case 'InterLibraryLoan':
-                maxItemsOutValue            =  150;
-                maxHoldsValue          =    0;
-                overdueThresholdValue  =  150;
+            case 'InterLibraryLoan':
+                maxHoldsValue = 0;
                 break;
-              case 'BCOneCard':
+            case 'BCOneCard':
                 maxHoldsValue = 0;
                 break;
             }
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index 434be75..c231165 100644 (file)
@@ -4,128 +4,116 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BLP");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
 
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return '42_5';
             }
 
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
             var map = {
-                'audio-cassette'            :  '14_2',
-                'audio-cds'                 :  '14_2',
-                'cassette-and-book-in-bag'  :  '14_2',
-                'cassettebook'              :  '14_2',
-                'cd-and-book-in-bag'        :  '14_2',
-                'cd-audiobook'              :  '14_2',
-                'cd-rom'                    :  '14_2',
-                'compact-discs'             :  '14_2',
-                'dvd'                       :  '14_2',
-                'media'                     :  '14_2',
-                'mp-3-audio-disc'           :  '14_2',
-                'talking-books'             :  '14_2',
-                'videos'                    :  '14_2'
+                'audio-cassette': '14_2',
+                'audio-cds': '14_2',
+                'cassette-and-book-in-bag': '14_2',
+                'cassettebook': '14_2',
+                'cd-and-book-in-bag': '14_2',
+                'cd-audiobook': '14_2',
+                'cd-rom': '14_2',
+                'compact-discs': '14_2',
+                'dvd': '14_2',
+                'media': '14_2',
+                'mp-3-audio-disc': '14_2',
+                'talking-books': '14_2',
+                'videos': '14_2'
             };
 
             return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
-            if(patronProfile == 'InterLibraryLoan' || patronProfile == 'Volunteer' || patronProfile == 'Board'){
+        getRecurringFine: function() {
+            if (patronProfile == 'InterLibraryLoan' || patronProfile == 'Volunteer' || patronProfile == 'Board') {
                 return 'zero';
             }
 
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
             var map = {
-                'audio-cassette'            :  'fiftycents',
-                'audio-cds'                 :  'fiftycents',
-                'cassette-and-book-in-bag'  :  'fiftycents',
-                'cassettebook'              :  'fiftycents',
-                'cd-and-book-in-bag'        :  'fiftycents',
-                'cd-audiobook'              :  'fiftycents',
-                'cd-rom'                    :  'fiftycents',
-                'compact-discs'             :  'fiftycents',
-                'dvd'                       :  'fiftycents',
-                'media'                     :  'fiftycents',
-                'mp-3-audio-disc'           :  'fiftycents',
-                'talking-books'             :  'fiftycents',
-                'videos'                    :  'fiftycents',
-
-                'inter-library-loan'  :  'zero',
-                'restricted-access'   :  'zero',
-                'non-circulating'     :  'zero'
+                'audio-cassette': 'fiftycents',
+                'audio-cds': 'fiftycents',
+                'cassette-and-book-in-bag': 'fiftycents',
+                'cassettebook': 'fiftycents',
+                'cd-and-book-in-bag': 'fiftycents',
+                'cd-audiobook': 'fiftycents',
+                'cd-rom': 'fiftycents',
+                'compact-discs': 'fiftycents',
+                'dvd': 'fiftycents',
+                'media': 'fiftycents',
+                'mp-3-audio-disc': 'fiftycents',
+                'talking-books': 'fiftycents',
+                'videos': 'fiftycents',
+                'inter-library-loan': 'zero',
+                'restricted-access': 'zero',
+                'non-circulating': 'zero'
             };
 
             return map[circMod] || 'twentyfivecents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-                'audio-cassette'            :  'fivedollar',
-                'audio-cds'                 :  'fivedollar',
-                'cassette-and-book-in-bag'  :  'fivedollar',
-                'cassettebook'              :  'fivedollar',
-                'cd-and-book-in-bag'        :  'fivedollar',
-                'cd-audiobook'              :  'fivedollar',
-                'cd-rom'                    :  'fivedollar',
-                'compact-discs'             :  'fivedollar',
-                'dvd'                       :  'fivedollar',
-                'media'                     :  'fivedollar',
-                'mp-3-audio-disc'           :  'fivedollar',
-                'talking-books'             :  'fivedollar',
-                'videos'                    :  'fivedollar'
+                'audio-cassette': 'fivedollar',
+                'audio-cds': 'fivedollar',
+                'cassette-and-book-in-bag': 'fivedollar',
+                'cassettebook': 'fivedollar',
+                'cd-and-book-in-bag': 'fivedollar',
+                'cd-audiobook': 'fivedollar',
+                'cd-rom': 'fivedollar',
+                'compact-discs': 'fivedollar',
+                'dvd': 'fivedollar',
+                'media': 'fivedollar',
+                'mp-3-audio-disc': 'fivedollar',
+                'talking-books': 'fivedollar',
+                'videos': 'fivedollar'
             };
 
             return map[circMod] || 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             log_debug('exceedsMaxCheckoutsByCircMod()');
 
             return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =   4;
-            var maxItemsOutValue        =  20;
-            var overdueThresholdValue   =  20;
-            var fineThresholdValue      =  -1;
-            
+            var maxHoldsValue = 4;
+
             // set special values for group
             switch (patronProfile) {
-              case 'InterLibraryLoan':
-                maxItemsOutValue            = 150;
-                maxHoldsValue          =   0;
-                overdueThresholdValue  = 150;
+            case 'InterLibraryLoan':
+                maxHoldsValue = 0;
                 break;
-              case 'BCOneCard':
+            case 'BCOneCard':
                 maxHoldsValue = 0;
                 break;
             }
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index a42f07a..ea6ed5b 100644 (file)
@@ -4,93 +4,77 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BM");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
-            /* returns config.rule_circ_duration.name */
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
+        getLoanDuration: function() {
             var map = {
-                'book'      :   '21_2',
-                'videos'    :   '7_2',
-                'dvd'       :   '7_2',
-                'magazine'  :   '7_2',
-                'video'     :   '7_2'
+                'book': '21_2',
+                'videos': '7_2',
+                'dvd': '7_2',
+                'magazine': '7_2',
+                'video': '7_2'
             };
 
-            return map[circMod] || '21_2'; 
+            return map[circMod] || '21_2';
 
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-               return 'tencents';
+            return 'tencents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'threedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-            log_debug("exceedsMaxCheckoutsByCircMod()");
-
-               if(isGroupDescendant('Staff', patronProfile)) {
+        exceedsMaxCheckoutsByCircMod: function() {
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
-               }
-
-               var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-                       
-               circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
-               var maxByCircMod = {
-                       'videos' : 3,
-                       'video' : 3,
-                       'dvd' : 3
-               };
-               var circModLimit = maxByCircMod[circMod] || 30;
-                       
-               log_debug("go Max for circ_mod:"+circMod+"/patron:"+patronProfile+" is "+circModLimit+ " - you had "+circModCount);
-               return circModCount >= circModLimit;
+            }
+
+            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+
+            circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
+            var maxByCircMod = {
+                'videos': 3,
+                'video': 3,
+                'dvd': 3
+            };
+            var circModLimit = maxByCircMod[circMod] || 30;
+
+            log_debug("go Max for circ_mod:" + circMod + "/patron:" + patronProfile + " is " + circModLimit + " - you had " + circModCount);
+            return circModCount >= circModLimit;
 
         },
 
-        isAllowedCirc : function() {
-        
+        isAllowedCirc: function() {
+
             var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
-            if(patronProfile == 'BCOneCard'){
-                       if (circMod != 'book') {
-                           return 'false';
-                       }
-               }
-               return true;
+            if (patronProfile == 'BCOneCard') {
+                if (circMod != 'book') {
+                    return 'false';
+                }
+            }
+            return true;
         },
 
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-                
-        getGroupConfig : function() {
+
+        getGroupConfig: function() {
             /* returns the combined user config object */
 
             // override some defaults
-
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
+
             // these are global settings for BH users
-            config.fineThreshold = 20;
             config.maxHolds = -1;
-            config.overdueThreshold = 3;
-            config.maxItemsOut = 30;
-
-
-            // debugging...
-            var str = "BM getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-            }
-               log_debug(str);
 
             return config;
         }
index 185a7bf..12ba430 100644 (file)
@@ -8,77 +8,75 @@ function getPolicy() {
     var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
             /* returns config.rule_circ_duration.name */
 
             var map = {
-              'inter-library-loan'              : '21_0'
+                'inter-library-loan': '21_0'
             };
 
             return map[circMod] || '21_2';
 
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
 
-           /* returns config.rule_recuring_fine.name */
-            if(patronProfile == 'Volunteer' || patronProfile == 'Board'){
+            /* returns config.rule_recuring_fine.name */
+            if (patronProfile == 'Volunteer' || patronProfile == 'Board') {
                 return 'zero';
             }
 
 
             var map = {
-              'inter-library-loan'              : 'twentyfivecents'
+                'inter-library-loan': 'twentyfivecents'
             };
 
-           return map[circMod] || 'fivecents';
+            return map[circMod] || 'fivecents';
         },
 
-          
-        getMaxFine : function() {
-           /* returns config.rule_max_fine.name */
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+        getMaxFine: function() {
+            /* returns config.rule_max_fine.name */
+            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-              'inter-library-loan'              : 'fivedollar'
+                'inter-library-loan': 'fivedollar'
             };
-           
-           return map[circMod] || 'threedollar';
+
+            return map[circMod] || 'threedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
 
-        isAllowedCirc : function() {
-               return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
-            if(patronProfile == 'BCOneCard') {  
-                  return false;
+        isAllowedHold: function() {
+            if (patronProfile == 'BCOneCard') {
+                return false;
             }
             return true;
         },
 
-       getGroupConfig : function() {
+        getGroupConfig: function() {
 
-        GROUP_CONFIG.BCOneCard.maxHolds = 0;
-        GROUP_CONFIG.InterLibraryLoan.maxHolds = 0;
-        GROUP_CONFIG.Temporary.maxHolds = 0;
-       
-       var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+            GROUP_CONFIG.BCOneCard.maxHolds = 0;
+            GROUP_CONFIG.InterLibraryLoan.maxHolds = 0;
+            GROUP_CONFIG.Temporary.maxHolds = 0;
 
-    // test
-       // set defaults
-        config.maxHolds           =  -1;
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
 
-       return config;
-       }
+            config.maxHolds = -1;
+
+            return config;
+        }
     };
 
 }
+
index 775c227..ed90108 100644 (file)
@@ -8,86 +8,79 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
-            if(patronProfile == 'InterLibraryLoan'){
+            if (patronProfile == 'InterLibraryLoan') {
                 return '42_0';
             }
 
             var map = {
-              'book'                   : '21_2',
-              'compact-discs'  : '21_2',
-              'cd-roms'                : '21_2',
-                         'kit'                         : '21_2',
-                         'maps'                        : '21_2',
-                         'music-sheets-and-books'      : '21_2',
-                         'talking-books'       : '7_2',
-                         'videos'                      : '7_2',
-                         'holiday-special'     : '7_2',
-                         'audio-cassette'      : '21_2',
-                         'dvd'                         : '7_2',
-                         'magazine'            : '21_2'
-                       };
+                'book': '21_2',
+                'compact-discs': '21_2',
+                'cd-roms': '21_2',
+                'kit': '21_2',
+                'maps': '21_2',
+                'music-sheets-and-books': '21_2',
+                'talking-books': '7_2',
+                'videos': '7_2',
+                'holiday-special': '7_2',
+                'audio-cassette': '21_2',
+                'dvd': '7_2',
+                'magazine': '21_2'
+            };
 
             return map[circMod] || '21_2';
 
         },
 
-        getRecurringFine : function() {
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-           
-           if (circMod == 'dvd' || circMod == 'videos' || circMod == 'holiday-special') {
-                       return 'onedollar';
-               }
-           var map = {
-                       'Local System Administrator'    : 'zero',
-                       'Catalogers'                                    : 'zero',
-                       'CircCat'                                               : 'zero',
-                       'CircCopy'                                              : 'zero',
-                       'Board'                                                 : 'zero',
-                       'NoFines'                                               : 'zero',
-           };
-           
-           return map[patronProfile] || 'twentyfivecents';
-                       
+        getRecurringFine: function() {
+            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+            if (circMod == 'dvd' || circMod == 'videos' || circMod == 'holiday-special') {
+                return 'onedollar';
+            }
+            var map = {
+                'Local System Administrator': 'zero',
+                'Catalogers': 'zero',
+                'CircCat': 'zero',
+                'CircCopy': 'zero',
+                'Board': 'zero',
+                'NoFines': 'zero',
+            };
+
+            return map[patronProfile] || 'twentyfivecents';
+
         },
 
-          
-        getMaxFine : function() {
 
-           return 'fivedollar';
+        getMaxFine: function() {
+
+            return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
-          return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-        getGroupConfig : function() {
-
-          // set defaults
-          var maxItemsOutValue        =  30;
-          var maxHoldsValue           =  20;
-          var overdueThresholdValue   =  20;
-          var fineThresholdValue      =  10;
-   
-          // return group config
-          var config = {
-            'maxHolds'          :  maxHoldsValue,
-            'maxItemsOut'       :  maxItemsOutValue,
-            'overdueThreshold'  :  overdueThresholdValue,
-            'fineThreshold'     :  fineThresholdValue
-          };
-
-          return config;
+        getGroupConfig: function() {
+
+            // set defaults
+            var maxHoldsValue = 20;
+            // return group config
+            var config = {
+                'maxHolds': maxHoldsValue,
+            };
+
+            return config;
         }
     };
 }
+
index e336154..cd89094 100644 (file)
@@ -5,28 +5,27 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info forBNA");
 
-    return {
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
-        getLoanDuration : function() {
-            /* returns config.rule_circ_duration.name */
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+    return {
 
+        getLoanDuration: function() {
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return '28_2';
             }
 
             var map = {
-                'book'      :   '21_2',
-                'videos'    :   '7_2',
-                'dvd'       :   '7_2',
-                'magazine'  :   '7_2'
+                'book': '21_2',
+                'videos': '7_2',
+                'dvd': '7_2',
+                'magazine': '7_2'
             };
 
-               return map[circMod] || '21_2'; 
-                   
+            return map[circMod] || '21_2';
+
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return 'staff';
@@ -34,45 +33,28 @@ function getPolicy() {
             return 'tencents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
-               return 'true';
+        isAllowedCirc: function() {
+            return 'true';
         },
-                
-        isAllowedHold : function() {
-               return 'true';
+
+        isAllowedHold: function() {
+            return 'true';
         },
-        
-        getGroupConfig : function() {
-            /* returns the combined user config object */
-
-            // override some defaults
-           GROUP_CONFIG.Patrons.fineThreshold = 20;
-           GROUP_CONFIG.JuvenileRes.fineThreshold = 10;
-           //GROUP_CONFIG.JuvenileNonRes.fineThreshold = 10;
-           
+
+        getGroupConfig: function() {
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
+
             // these are global settings for BH users
             config.maxHolds = -1;
-            config.overdueThreshold = -1;
-            config.maxItemsOut = 99;
-
-
-            // debugging...
-            var str = "BNA getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-            }
-               log_debug(str);
 
             return config;
         }
index 11875e7..cf65485 100644 (file)
@@ -4,111 +4,99 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BPE");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
             /* returns config.rule_circ_duration.name */
             var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
             var map = {
-                '7-day-loan':           '7_0',
-                'book':                '28_3',
-                'cd-audiobook':        '28_1',
-                'talking-books':       '28_1',
+                '7-day-loan': '7_0',
+                'book': '28_3',
+                'cd-audiobook': '28_1',
+                'talking-books': '28_1',
                 'juvenile-collection': '28_3',
-                'videos':              '7_1',
-                'dvd':                 '7_1',
-                'compact-discs':       '14_1',
-                'magazine':            '14_1',
-                'cd-roms':             '14_1',
-                'pamphlets':           '1day_no_renew',
-                'maps':                '1day_no_renew',
-                'juvenile-7day':       '7_0',
-                'book-7day':           '7_0'
+                'videos': '7_1',
+                'dvd': '7_1',
+                'compact-discs': '14_1',
+                'magazine': '14_1',
+                'cd-roms': '14_1',
+                'pamphlets': '1day_no_renew',
+                'maps': '1day_no_renew',
+                'juvenile-7day': '7_0',
+                'book-7day': '7_0'
             };
             return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-                       return 'zero';
+            return 'zero';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             log_debug("exceedsMaxCheckoutsByCircMod()");
 
-                       if(isGroupDescendant('Staff', patronProfile)){
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
             }
 
-                       var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-                       var circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
-                       var maxByCircMod;
+            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+            var circModCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
+            var maxByCircMod;
             var circModLimit;
 
-                       if(patronProfile == 'JuvenileRes'){
-                           maxByCircMod = {
-                                       'videos' : 10,
-                                       'compact-discs' : 4,
-                                       'cd-audiobook' : 6,
-                                       'pamphlets' : 2,
-                                       'dvd' : 4
-                           };
+            if (patronProfile == 'JuvenileRes') {
+                maxByCircMod = {
+                    'videos': 10,
+                    'compact-discs': 4,
+                    'cd-audiobook': 6,
+                    'pamphlets': 2,
+                    'dvd': 4
+                };
                 circModLimit = maxByCircMod[circMod] || 10;
-                       } 
-                       else {
-                           maxByCircMod = {
-                                       'videos' : 10,
-                                       'compact-discs' : 4,
-                                       'cd-audiobook' : 6,
-                                       'pamphlets' : 2,
-                                       'dvd' : 4
-                           };
-                               circModLimit = maxByCircMod[circMod] || 30;
-                       }
-                       
-//                     var circModLimit = 0;
-               log_debug("go Max for circ_mod:"+circMod+"/patron:"+patronProfile+" is "+circModLimit+ " - you had "+circModCount);
-                       return circModCount >= circModLimit;
+            }
+            else {
+                maxByCircMod = {
+                    'videos': 10,
+                    'compact-discs': 4,
+                    'cd-audiobook': 6,
+                    'pamphlets': 2,
+                    'dvd': 4
+                };
+                circModLimit = maxByCircMod[circMod] || 30;
+            }
+
+            //                 var circModLimit = 0;
+            log_debug("go Max for circ_mod:" + circMod + "/patron:" + patronProfile + " is " + circModLimit + " - you had " + circModCount);
+            return circModCount >= circModLimit;
 
         },
 
 
-        isAllowedCirc : function() {
-           return true;
+        isAllowedCirc: function() {
+            return true;
         },
 
-        isAllowedHold : function() {
-           return true;
+        isAllowedHold: function() {
+            return true;
         },
 
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
             /* returns the combined user config object */
 
             // override some defaults
-
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
+
             // these are global settings for BH users
-            config.fineThreshold = 5;
             config.maxHolds = -1;
-            config.overdueThreshold = 10;
-            config.maxItemsOut = 30;
-                       GROUP_CONFIG.JuvenileRes.maxItemsOut = 10;
-
-
-            // debugging...
-            var str = "BPE getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-            }
-               log_debug(str);
 
             return config;
         }
index 3190af6..7b91a83 100644 (file)
@@ -4,129 +4,112 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BPR");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
-        getLoanDuration : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-//            if (isPrecat || copy.call_number == -1){
-//                return '21_0';
-//            }
-
-                       /* circ duration rules are:
+        getLoanDuration: function() {
+            //            if (isPrecat || copy.call_number == -1){
+            //                return '21_0';
+            //            }
+            /* circ duration rules are:
                        default = 21 days
                        1day = 1 day
                        7 day = 7 days
                        everything is 2 renewals */
-                       
-                       var map = {
-                               '1-day-loan'         : '1_2',
-                               '7-day-loan'         : '7_2',
-                               'digital-disc'       : '7_2',
-                               'library-equipment'  : '1_2',
-                               'pamphlets'          : '1_2',
-                               'videos'             : '7_2',
-                               'videos-educational' : '7_2',
-                               'videos-features'    : '7_2'
-                       };
 
-                       if(patronProfile == 'Lighthouse'){
-                               return '90_2'; // 90 days
+            var map = {
+                '1-day-loan': '1_2',
+                '7-day-loan': '7_2',
+                'digital-disc': '7_2',
+                'library-equipment': '1_2',
+                'pamphlets': '1_2',
+                'videos': '7_2',
+                'videos-educational': '7_2',
+                'videos-features': '7_2'
+            };
+
+            if (patronProfile == 'Lighthouse') {
+                return '90_2';
+                // 90 days
             }
 
-                   return map[circMod] || '21_2'; //21 days
+            return map[circMod] || '21_2';
+            //21 days
         },
-       
-       getRecurringFine : function() {
-                       var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-                       /* recurring fine rules are:
+
+        getRecurringFine: function() {
+            /* recurring fine rules are:
                        video = $1, juvenile = $0.10, equipment = $30, default = $0.25
                        ILL = 0.50, staff = 0.00 */
-                       
-                       var map = {
-                               'videos'                 : 'onedollar',
-                               'video'                  : 'onedollar',
-                               'dvd'                : 'onedollar',
-                               'digital-disc'       : 'onedollar',
-                               'videos-educational' : 'onedollar',
-                               'videos-features'    : 'onedollar',
-                               '1-day-loan'         : 'onedollar',
-                               'juvenile-collection': 'tencents',
-                               'library-equipment'  : 'equipment'
-                       };
-                       if(patronProfile == 'InterLibraryLoan'){
-                               return 'ILL';
-                       }
-            if(patronProfile == 'Staff' || patronProfile == 'Board'){
-                               return 'zero';
+
+            var map = {
+                'videos': 'onedollar',
+                'video': 'onedollar',
+                'dvd': 'onedollar',
+                'digital-disc': 'onedollar',
+                'videos-educational': 'onedollar',
+                'videos-features': 'onedollar',
+                '1-day-loan': 'onedollar',
+                'juvenile-collection': 'tencents',
+                'library-equipment': 'equipment'
+            };
+            if (patronProfile == 'InterLibraryLoan') {
+                return 'ILL';
             }
-                       return map[circMod] || 'twentyfivecents';
-               },
-               
-               getMaxFine : function() {
-                       var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-                       /* max fine rules are:
+            if (patronProfile == 'Staff' || patronProfile == 'Board') {
+                return 'zero';
+            }
+            return map[circMod] || 'twentyfivecents';
+        },
+
+        getMaxFine: function() {
+            /* max fine rules are:
                        'video' = $10, 'default' = $5.  
                        */
-                       var map = {
-                               'videos'                 : 'tendollar',
-                               'video'                  : 'tendollar',
-                               'dvd'                : 'tendollar',
-                               'digital-disc'       : 'tendollar',
-                               'videos-educational' : 'tendollar',
-                               'videos-features'    : 'tendollar',
-                               '1-day-loan'         : 'tendollar'
-                       };
+            var map = {
+                'videos': 'tendollar',
+                'video': 'tendollar',
+                'dvd': 'tendollar',
+                'digital-disc': 'tendollar',
+                'videos-educational': 'tendollar',
+                'videos-features': 'tendollar',
+                '1-day-loan': 'tendollar'
+            };
 
-                       return map[circMod] || 'fivedollar';
-               },
-        exceedsMaxCheckoutsByCircMod : function() {
+            return map[circMod] || 'fivedollar';
+        },
+        exceedsMaxCheckoutsByCircMod: function() {
             var maxByCircMod = {
-                       'compact-discs' : 5,
-                       'digital-disc' : 3,
-                       'talking-books' : 5
-                   };
+                'compact-discs': 5,
+                'digital-disc': 3,
+                'talking-books': 5
+            };
             log_debug("exceedsMaxCheckoutsByCircMod()");
-            if(isGroupDescendant('Staff', patronProfile)){
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
             }
             var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
             var maxCount = maxByCircMod[circMod];
             log_debug("checking circ mod " + circMod);
-            if(!maxCount || maxCount === null){ 
+            if (!maxCount || maxCount === null) {
                 return false;
             }
             var outCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
-            log_info("BPR-1392 - found max out "+maxCount+" for circ mod " +circMod+ " and patron "+patron.id+" checked out count is "+outCount);
+            log_info("BPR-1392 - found max out " + maxCount + " for circ mod " + circMod + " and patron " + patron.id + " checked out count is " + outCount);
             return outCount >= maxCount;
         },
-        
-        isAllowedCirc : function() {
+
+        isAllowedCirc: function() {
             return true;
         },
 
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
 
 
-        getGroupConfig : function() {
-            /* returns the combined user config object */
-
-            // override some defaults
-
+        getGroupConfig: function() {
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
-            // these are global settings for BPR users
-                               config.fineThreshold = 5;
-                       
-            // debugging...
-            var str = "BPR getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-            }
-               log_debug(str);
-
             return config;
         }
     };
index 959684b..6c64d92 100644 (file)
@@ -6,18 +6,18 @@ function getPolicy() {
     log_info("Loading policy info for BPRDP");
 
     var map = {
-        'A' : 'compact-discs',
-        'B' : 'talking-books',
-        'C' : 'audio-cds-cnib',
-        'H' : 'holiday-special',
-        'J' : 'juvenile-collection',
-        'L' : 'periodical',
-        'M' : 'periodical',
-        'N' : 'new-books',
-        'O' : 'inter-library-loan',
-        'P' : 'paperbacks',
-        'S' : 'book',
-        'V' : 'videos'
+        'A': 'compact-discs',
+        'B': 'talking-books',
+        'C': 'audio-cds-cnib',
+        'H': 'holiday-special',
+        'J': 'juvenile-collection',
+        'L': 'periodical',
+        'M': 'periodical',
+        'N': 'new-books',
+        'O': 'inter-library-loan',
+        'P': 'paperbacks',
+        'S': 'book',
+        'V': 'videos'
     };
 
     var oldcircmod = copy.circ_modifier || 'book';
@@ -25,104 +25,103 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-               if (isPrecat || copy.call_number == -1){
-                       return '14_0';
-               }
-               
-               if(patronProfile == 'Homebound'){
-                       return '28_1';
-               }
-
-               if(patronProfile == 'InterLibraryLoan'){
-                       return '30_1';
-               }
-
-               if(patronProfile == 'Institution') {
-                       if(circmod == 'holiday-special') {
-                               return '28_1';
-                       } else {
-                               if(circmod == 'book') {
-                                       return '35_1';
-                               }
-                       }
-               }
-               
-               if(patronProfile == 'BCOneCard') {
-                       if( (circmod == 'juvenile-collection' || circmod == 'paperbacks' || circmod == 'book') ) {
-                                       return '14_1';
-                       }
-               }
-                       
-               if(circmod == 'juvenile-collection' || circmod == 'book' || circmod == 'paperbacks'){
-                       return '28_1';
-               }
-
-               return '14_1';
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
+                return '14_0';
+            }
+
+            if (patronProfile == 'Homebound') {
+                return '28_1';
+            }
+
+            if (patronProfile == 'InterLibraryLoan') {
+                return '30_1';
+            }
+
+            if (patronProfile == 'Institution') {
+                if (circmod == 'holiday-special') {
+                    return '28_1';
+                } else {
+                    if (circmod == 'book') {
+                        return '35_1';
+                    }
+                }
+            }
+
+            if (patronProfile == 'BCOneCard') {
+                if ((circmod == 'juvenile-collection' || circmod == 'paperbacks' || circmod == 'book')) {
+                    return '14_1';
+                }
+            }
+
+            if (circmod == 'juvenile-collection' || circmod == 'book' || circmod == 'paperbacks') {
+                return '28_1';
+            }
+
+            return '14_1';
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-            if(patronProfile == 'Homebound' || patronProfile == 'InterLibrarLoan'){ 
-               return 'staff';
+            if (patronProfile == 'Homebound' || patronProfile == 'InterLibrarLoan') {
+                return 'staff';
             }
-            
+
             var map = {
-                'compact-discs'       : 'fiftycents',
-                'talking-books'       : 'fiftycents',
-                'videos'            : 'fiftycents'
+                'compact-discs': 'fiftycents',
+                'talking-books': 'fiftycents',
+                'videos': 'fiftycents'
             };
-            return map[circmod] || 'twentyfivecents'; 
+            return map[circmod] || 'twentyfivecents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
-            if(patronProfile == 'Homebound' || patronProfile == 'InterLibrarLoan'){ 
-               return 'zero';
+            if (patronProfile == 'Homebound' || patronProfile == 'InterLibrarLoan') {
+                return 'zero';
             }
             var map = {
-                'holiday-special'       : 'twodollar',
-                'juvenile-collection'   : 'twodollar',
-                'periodical'            : 'twodollar',
-                'paperbacks'            : 'twodollar'
+                'holiday-special': 'twodollar',
+                'juvenile-collection': 'twodollar',
+                'periodical': 'twodollar',
+                'paperbacks': 'twodollar'
             };
-            return map[circmod] || 'fivedollar'; 
+            return map[circmod] || 'fivedollar';
         },
 
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-       isAllowedCirc : function() {
-               if(patronProfile == 'BCOneCard') {
-                       if( !(circmod == 'juvenile-collection' || circmod == 'paperbacks' || circmod == 'book') ) {
-                               return false;
-                       }
-               }
-                       
-               if(patronProfile == 'Institution' || patronProfile == 'InterLibraryLoan' || patronProfile == 'Transient') {
-                       if(circmod == 'audio-cds-cnib') {
-                               return false;
-                       }
-               }
-
-               return true;
-       },
-
-        isAllowedHold : function() {
-               return true;
+        isAllowedCirc: function() {
+            if (patronProfile == 'BCOneCard') {
+                if (! (circmod == 'juvenile-collection' || circmod == 'paperbacks' || circmod == 'book')) {
+                    return false;
+                }
+            }
+
+            if (patronProfile == 'Institution' || patronProfile == 'InterLibraryLoan' || patronProfile == 'Transient') {
+                if (circmod == 'audio-cds-cnib') {
+                    return false;
+                }
+            }
+
+            return true;
+        },
+
+        isAllowedHold: function() {
+            return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
             /* returns the combined user config object */
-            
-            // override some defaults
 
+            // override some defaults
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
 
             // these are global settings for BPRDP users
-           config.maxHolds = -1;
+            config.maxHolds = -1;
 
             return config;
         }
index 19976c9..8b761ea 100644 (file)
@@ -4,101 +4,88 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BR");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
+        getLoanDuration: function() {
             var map = {
                 // no reference/big books
-                'book'          : '21_3', // need to create this rule! (copy 'staff')
-                'talking-books' : '21_3',
-                'magazine'      : '21_3',
-                'compact-discs' : '7_0',
-                'videos'        : '7_0',
-                'dvd'           : '7_0'
+                'book': '21_3',
+                // need to create this rule! (copy 'staff')
+                'talking-books': '21_3',
+                'magazine': '21_3',
+                'compact-discs': '7_0',
+                'videos': '7_0',
+                'dvd': '7_0'
             };
 
-            return map[circMod] || '21_3'; 
+            return map[circMod] || '21_3';
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             switch (patronProfile) {
-              case 'Board':
-              case 'InterLibraryLoan':
-              case 'Volunteer':
-              case 'Staff':
+            case 'Board':
+            case 'InterLibraryLoan':
+            case 'Volunteer':
+            case 'Staff':
                 return 'staff';
             }
 
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-
             var map = {
                 // no reference/big books
-                'book'          : 'tencents',
-                'talking-books' : 'tencents',
-                'magazine'      : 'tencents',
-                'compact-discs' : 'video', // $1 per day
-                'videos'        : 'video',
-                'dvd'           : 'video'
+                'book': 'tencents',
+                'talking-books': 'tencents',
+                'magazine': 'tencents',
+                'compact-discs': 'video',
+                // $1 per day
+                'videos': 'video',
+                'dvd': 'video'
             };
 
             return map[circMod] || 'tencents';
         },
 
-        getMaxFine : function() {
-            return 'threedollar'; // all BR items have $3 max fine
+        getMaxFine: function() {
+            return 'threedollar';
+            // all BR items have $3 max fine
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             //log_debug('exceedsMaxCheckoutsByCircMod()');
             return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return 'true';
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             return 'true';
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =   3;
-            var maxItemsOutValue        =  50;
-            var overdueThresholdValue   =  -1;
-            var fineThresholdValue      =  20;
-            
+            var maxHoldsValue = 3;
+
             // set special values for group
             switch (patronProfile) {
-              case 'JuvenileRes':
-                maxItemsOutValue  =  10;
-                break;
-              case 'InterLibraryLoan':
-                maxItemsOutValue  =  500;
-                maxHoldsValue     =    0;
-                break;
-              case 'BCOneCard':
-                maxItemsOutValue   =  5;
-                maxHoldsValue      =  0;
-                fineThresholdValue = -1;
+            case 'JuvenileRes':
+            case 'InterLibraryLoan':
+                maxHoldsValue = 0;
                 break;
-              case 'Temporary':
-                maxItemsOutValue  =  5;
+            case 'BCOneCard':
+                maxHoldsValue = 0;
                 break;
-              default:
+            case 'Temporary':
+            default:
                 //do nothing
             }
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index 6dfeee9..16392f7 100644 (file)
@@ -8,82 +8,82 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
-            if(patronProfile == 'InterLibraryLoan'){
+            if (patronProfile == 'InterLibraryLoan') {
                 return '42_0';
             }
 
             var map = {
-              'new-books' : '21_0',
-                       };
+                'new-books': '21_0',
+            };
 
             return map[circMod] || '21_10';
 
         },
 
-        getRecurringFine : function() {
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-           
-           var map = {
-                       'Local System Administrator'    : 'zero',
-                       'Catalogers'                    : 'zero',
-                       'CircCat'                       : 'zero',
-                       'CircCopy'                      : 'zero',
-                       'Board'                         : 'zero',
-                       'Volunteer'                     : 'zero',
-                       'NoFines'                       : 'zero'
-           };
-           if(circMod == 'new-books'){
-               return 'onedollar';
-          }
-           return map[patronProfile] || 'twentyfivecents';
-                       
+        getRecurringFine: function() {
+
+            var map = {
+                'Local System Administrator': 'zero',
+                'Catalogers': 'zero',
+                'CircCat': 'zero',
+                'CircCopy': 'zero',
+                'Board': 'zero',
+                'Volunteer': 'zero',
+                'NoFines': 'zero'
+            };
+            if (circMod == 'new-books') {
+                return 'onedollar';
+            }
+            return map[patronProfile] || 'twentyfivecents';
+
         },
 
-          
-        getMaxFine : function() {
-           return 'tendollar';
+
+        getMaxFine: function() {
+            return 'tendollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-            if ( isGroupDescendant('Staff', patronProfile) ){
-                return false; // no limit for staff patrons
+        exceedsMaxCheckoutsByCircMod: function() {
+            if (isGroupDescendant('Staff', patronProfile)) {
+                return false;
+                // no limit for staff patrons
             }
-            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-                  'new-books': 1
+                'new-books': 1
             };
             var max = map[circMod] || -1;
             if (max < 0) {
-                return false; // no limit for any other circMod
+                return false;
+                // no limit for any other circMod
             }
             var checkouts = checkoutsByCircModifier(patron.id)[circMod] || 0;
-                        
+
             return checkouts > max;
         },
 
-        isAllowedCirc : function() {
-          return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
-          // set defaults
-          var maxHoldsValue           =  20;
-   
-          // return group config
-          var config = {
-            'maxHolds'          :  maxHoldsValue,
-          };
+            // set defaults
+            var maxHoldsValue = 20;
 
-          return config;
+            // return group config
+            var config = {
+                'maxHolds': maxHoldsValue,
+            };
+
+            return config;
         }
     };
 }
+
index 7bdc287..095f26e 100644 (file)
 
 function getPolicy() {
 
-       load_lib('circ/circ_lib.js');
-       log_info('Loading policy info for BS');
+    load_lib('circ/circ_lib.js');
+    log_info('Loading policy info for BS');
 
     var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-       return {
+    return {
 
-               // returns config.rule_circ_duration.name
-               getLoanDuration: function () {
+        // returns config.rule_circ_duration.name
+        getLoanDuration: function() {
 
-            if (isPrecat || copy.call_number == -1){
-                    return '21_0';
+            if (isPrecat || copy.call_number == -1) {
+                return '21_0';
             }
-                       
-                       var map = {
-                               'book':            '21_2',
-                               'magazine':        '21_2',
-                               'non-circulating': '21_2',
-                               'holiday-special': '21_2',
-                               'kit':             '21_2',
-                               'compact-discs':   '21_2',
-                               'cd-audiobook':    '21_2',
-                               'dvd':             '21_2',
-                           'paperback':        '21_2'
+
+            var map = {
+                'book': '21_2',
+                'magazine': '21_2',
+                'non-circulating': '21_2',
+                'holiday-special': '21_2',
+                'kit': '21_2',
+                'compact-discs': '21_2',
+                'cd-audiobook': '21_2',
+                'dvd': '21_2',
+                'paperback': '21_2'
             };
-                       return map[circMod] || '21_2';
-               },
+            return map[circMod] || '21_2';
+        },
 
-               // returns config.rule_recuring_fine.name
-               getRecurringFine: function () { return 'tencents'; },
+        // returns config.rule_recuring_fine.name
+        getRecurringFine: function() {
+            return 'tencents';
+        },
 
-               // returns config.rule_max_fine.name
-               getMaxFine: function () { 
+        // returns config.rule_max_fine.name
+        getMaxFine: function() {
 
             var map = {
-                'paperback' : 'onedollar',
-                'paperbacks'    : 'onedollar',
-                'magazine'  :   'onedollar' };
+                'paperback': 'onedollar',
+                'paperbacks': 'onedollar',
+                'magazine': 'onedollar'
+            };
 
-            return map[circMod]||'twodollar'; 
+            return map[circMod] || 'twodollar';
         },
 
-               // Is a patron exceeding max checkout limit for a circ modifier?
-               exceedsMaxCheckoutsByCircMod: function () {
-                       log_debug('exceedsMaxCheckoutsByCircMod()');
+        // Is a patron exceeding max checkout limit for a circ modifier?
+        exceedsMaxCheckoutsByCircMod: function() {
+            log_debug('exceedsMaxCheckoutsByCircMod()');
 
-                       if ( isGroupDescendant('Staff', patronProfile) ){
-                               return false; // no limit for staff patrons
+            if (isGroupDescendant('Staff', patronProfile)) {
+                return false;
+                // no limit for staff patrons
+            }
+
+            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+
+            var map = {
+                'cd-audiobook': 3
+            };
+            var max = map[circMod] || -1;
+            if (max < 0) {
+                return false;
+                // no limit for circMod
             }
+            var checkouts = checkoutsByCircModifier(patron.id)[circMod] || 0;
+
+            log_debug("go Max for circ_mod:" + circMod + "/patron:" + patronProfile + " is " + max + " - you had " + checkouts);
+            return checkouts > max;
+        },
 
-                       var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-
-                       var map = {
-                               'cd-audiobook': 3
-                       };
-                       var max = map[circMod] || -1;
-                       if (max < 0) {
-                return false; // no limit for circMod
-               }
-                       var checkouts = checkoutsByCircModifier(patron.id)[circMod] || 0;
-                       
-                       log_debug("go Max for circ_mod:" +circMod+ "/patron:" +patronProfile+ " is " +max+ " - you had " +checkouts);
-                       return checkouts > max;
-               },
-
-               isAllowedCirc: function () {
-                       if (patron.profile.name == 'BCOneCard' && circMod != 'book'){
+        isAllowedCirc: function() {
+            if (patron.profile.name == 'BCOneCard' && circMod != 'book') {
                 return 'true';
             }
             return 'false';
-            
-               },
+
+        },
 
         isAllowedHold: function() {
             return true;
         },
 
-               // returns the combined user config object
-               getGroupConfig: function () {
-
-                       var normal = {
-                               maxHolds:           5,
-                               maxItemsOut:      100,
-                               overdueThreshold:  -1,
-                               fineThreshold:      10
-                       };
-                       var special = {
-                               maxHolds:           5,
-                               maxItemsOut:      100,
-                               overdueThreshold:  -1,
-                               fineThreshold:     10 
-                       };
-                       var onecard = {
-                               maxHolds:           0,
-                               maxItemsOut:        5,
-                               overdueThreshold:  -1,
-                               fineThreshold:     10 
-                       };
-                       var staff = {
-                               maxHolds:          99,
-                               maxItemsOut:      100,
-                               overdueThreshold:  -1,
-                               fineThreshold:     10 
-                       };
-                       var map = {
-                               Patrons:     normal,
-                               NonResident: special,
-                               JuvenileRes: special,
-                               BCOneCard:   onecard,
-                               Institution: special,
-                               Temporary:   special,
-                               Staff:       staff,
-                               Users:       onecard
-                       };
-                       var config = map[patronProfile] || special;
-
-                       // debugging...
-                       //var str = 'BS getGroupConfig():';
-                       //for (var i in config){
-            //    str += i+ '=' +config[i]+ '  ';
-                       //}
-            //log_debug(str);
-
-                       return config;
-               }
-       };
+        // returns the combined user config object
+        getGroupConfig: function() {
+            switch (patronProfile) {
+            case 'Staff':
+                maxHoldsValue = 99;
+                break;
+            case 'BCOneCard':
+                maxHoldsValue = 0;
+                break;
+            default:
+                maxHoldsValue = 5
+            }
+
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+            var config = {
+                'maxHolds': maxHoldsValue,
+            };
+
+            return config;
+        }
+    };
 }
 
index 41443c4..de902e2 100644 (file)
@@ -5,163 +5,149 @@ function getPolicy() {
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BSA");
 
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
     return {
 
-        getLoanDuration : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+        getLoanDuration: function() {
 
             var map = {
-                'juvenile-collection'     :    '21_2',
-                'magazine'                :    '7_1',
-                'hardback'                : '21_2',
-                'mass-market-paperbacks'  : '21_2',
-                'compact-discs'           : '7_1',
-                'cassettebook'            : '7_1',
-                'audio-cds-cnib'          : '42_2', 
-                'book'                    : '21_2',
-                'inter-library-loan'      : '21_2',
-                'dvd'                     : '7_1',
-                'videos'                  : '7_1',
-                'audio-cds'               : '7_1',
-                'cd-and-book-in-bag'      : '7_1',
-                'best-seller'             : '7_0'
+                'juvenile-collection': '21_2',
+                'magazine': '7_1',
+                'hardback': '21_2',
+                'mass-market-paperbacks': '21_2',
+                'compact-discs': '7_1',
+                'cassettebook': '7_1',
+                'audio-cds-cnib': '42_2',
+                'book': '21_2',
+                'inter-library-loan': '21_2',
+                'dvd': '7_1',
+                'videos': '7_1',
+                'audio-cds': '7_1',
+                'cd-and-book-in-bag': '7_1',
+                'best-seller': '7_0'
             };
 
-            return map[circMod] || '21_2'; 
+            return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+        getRecurringFine: function() {
 
             var map = {
-                'juvenile-collection'    : 'twentycent',
-                'magazine'               : 'twentycent',
-                'hardback'               : 'twentycent',
-                'mass-market-paperbacks' : 'twentycent',
-                'compact-discs'          : 'twentycent',
-                'cassettebook'           : 'twentycent',
-                'audio-cds-cnib'         : 'staff',  //TODO: 'zero'?
-                'book'                   : 'twentycent',
-                'non-circulating'        : 'staff',  //TODO: 'zero'?
-                'inter-library-loan'     : 'twentycent',
-                'dvd'                    : 'twentycent',
-                'videos'                 : 'twentycent',
-                'audio-cds'              : 'twentycent',
-                'cd-and-book-in-bag'     : 'twentycent',
-                'best-seller'            : 'twentycent'
+                'juvenile-collection': 'twentycent',
+                'magazine': 'twentycent',
+                'hardback': 'twentycent',
+                'mass-market-paperbacks': 'twentycent',
+                'compact-discs': 'twentycent',
+                'cassettebook': 'twentycent',
+                'audio-cds-cnib': 'staff',
+                //TODO: 'zero'?
+                'book': 'twentycent',
+                'non-circulating': 'staff',
+                //TODO: 'zero'?
+                'inter-library-loan': 'twentycent',
+                'dvd': 'twentycent',
+                'videos': 'twentycent',
+                'audio-cds': 'twentycent',
+                'cd-and-book-in-bag': 'twentycent',
+                'best-seller': 'twentycent'
             };
 
             return map[circMod] || 'twentycent';
         },
 
-        getMaxFine : function() {
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+        getMaxFine: function() {
 
             var map = {
-                'juvenile-collection'    : 'fivedollar',
-                'magazine'               : 'fivedollar',
-                'hardback'               : 'fivedollar',
-                'mass-market-paperbacks' : 'fivedollar',
-                'compact-discs'          : 'fivedollar',
-                'cassettebook'           : 'fivedollar',
-                'audio-cds-cnib'         : 'zero',  //TODO: 'zero'?
-                'book'                   : 'fivedollar',
-                'non-circulating'        : 'zero',  //TODO: 'zero'?
-                'inter-library-loan'     : 'fivedollar',
-                'dvd'                    : 'fivedollar',
-                'videos'                 : 'fivedollar',
-                'audio-cds'              : 'fivedollar',
-                'cd-and-book-in-bag'     : 'fivedollar',
-                'best-seller'            : 'fivedollar'
+                'juvenile-collection': 'fivedollar',
+                'magazine': 'fivedollar',
+                'hardback': 'fivedollar',
+                'mass-market-paperbacks': 'fivedollar',
+                'compact-discs': 'fivedollar',
+                'cassettebook': 'fivedollar',
+                'audio-cds-cnib': 'zero',
+                'book': 'fivedollar',
+                'non-circulating': 'zero',
+                'inter-library-loan': 'fivedollar',
+                'dvd': 'fivedollar',
+                'videos': 'fivedollar',
+                'audio-cds': 'fivedollar',
+                'cd-and-book-in-bag': 'fivedollar',
+                'best-seller': 'fivedollar'
             };
 
             return map[circMod] || 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             log_debug('exceedsMaxCheckoutsByCircMod()');
 
-            if ( isGroupDescendant('Staff', patronProfile) ) {
-              return false; 
+            if (isGroupDescendant('Staff', patronProfile)) {
+                return false;
             }
 
             var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-            
+
             var mediaMax = 0;
             var mediaCount = 0;
 
             if (circMod == 'dvd' || circMod == 'videos') {
-              mediaMax = 3; 
-              mediaCount += parseInt(checkoutsByCircModifier(patron.id)['dvd']) || 0;
-              mediaCount += parseInt(checkoutsByCircModifier(patron.id)['videos']) || 0;
-              log_debug("found max out by circ mod "+circMod+" and checked out media total count is "+mediaCount);
-              return mediaCount >= mediaMax;
+                mediaMax = 3;
+                mediaCount += parseInt(checkoutsByCircModifier(patron.id)['dvd']) || 0;
+                mediaCount += parseInt(checkoutsByCircModifier(patron.id)['videos']) || 0;
+                log_debug("found max out by circ mod " + circMod + " and checked out media total count is " + mediaCount);
+                return mediaCount >= mediaMax;
             } else if (circMod == 'audio-cds' || circMod == 'cassettebook') {
-              mediaMax = 3; 
-              mediaCount += parseInt(checkoutsByCircModifier(patron.id)['audio-cds']) || 0;
-              mediaCount += parseInt(checkoutsByCircModifier(patron.id)['audio-cds-cnib']) || 0;
-              mediaCount += parseInt(checkoutsByCircModifier(patron.id)['cassettebook']) || 0;
-              log_debug("found max out by circ mod "+circMod+" and checked out media total count is "+mediaCount);
-              return mediaCount >= mediaMax;
+                mediaMax = 3;
+                mediaCount += parseInt(checkoutsByCircModifier(patron.id)['audio-cds']) || 0;
+                mediaCount += parseInt(checkoutsByCircModifier(patron.id)['audio-cds-cnib']) || 0;
+                mediaCount += parseInt(checkoutsByCircModifier(patron.id)['cassettebook']) || 0;
+                log_debug("found max out by circ mod " + circMod + " and checked out media total count is " + mediaCount);
+                return mediaCount >= mediaMax;
             } else if (circMod == 'compact-discs') {
-              mediaMax = 3; 
-              mediaCount += parseInt(checkoutsByCircModifier(patron.id)['compact-discs']) || 0;
-              return mediaCount >= mediaMax;
+                mediaMax = 3;
+                mediaCount += parseInt(checkoutsByCircModifier(patron.id)['compact-discs']) || 0;
+                return mediaCount >= mediaMax;
             }
 
             return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
 
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
             // set defaults
-            var maxHoldsValue           =  10;
-            var maxItemsOutValue        =  10;
-            var overdueThresholdValue   =  10;
-            var fineThresholdValue      =   5;
-            
+            var maxHoldsValue = 10;
+
             // set special values for group
             switch (patronProfile) {
-              case 'Board':
-              case 'Homebound':
-              case 'Volunteer':
-                fineThresholdValue = -1;
-                break;
-              case 'JuvenileRes':
-                maxItemsOutValue       =  5;
-                maxHoldsValue          =  5;
-                overdueThresholdValue  =  5;
+            case 'Board':
+            case 'Homebound':
+            case 'Volunteer':
+            case 'JuvenileRes':
+                maxHoldsValue = 5;
                 break;
-              case 'BCOneCard':
-                maxItemsOutValue       =  5;
-                maxHoldsValue          =  0;
-                overdueThresholdValue  =  5;
+            case 'BCOneCard':
+                maxHoldsValue = 0;
                 break;
-              case 'Staff':
-                maxItemsOutValue       =  -1;
-                maxHoldsValue          =  -1;
-                overdueThresholdValue  =  -1;
-                fineThresholdValue     =  -1;
+            case 'Staff':
+                maxHoldsValue = -1;
                 break;
-              default:
+            default:
                 //do nothing
             }
 
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index 0262f5b..4ca9146 100644 (file)
@@ -8,134 +8,116 @@ function getPolicy() {
     var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
     return {
 
-        getLoanDuration : function() {
-            if(patronProfile == 'InterLibraryLoan'){
+        getLoanDuration: function() {
+            if (patronProfile == 'InterLibraryLoan') {
                 return '42_2';
             }
-            
+
             var map = {
-                'book'                 :       '21_2',
-                'juvenile-collection'  :       '21_2',
-                'mass-market-paperbacks':      '21_2',
-                'dvd'                  :       '7_1',
-                'videos'               :       '7_1',
-                'cassettebook'         :       '21_2',
-                'compact-disc'         :       '21_2',
-                'juvenile-video'       :       '7_1',
-                'kit'                  :       '21_2',
-                'magazine'             :       '7_1',
-                'juvenile-serial'      :       '7_1',
-                'new-books'            :       '14_1',
-                'talking-books'                :       '42_2',
-                'inter-library-loan'   :       '21_1',
-                'ill-no-renew'         :       '21_0'
+                'book': '21_2',
+                'juvenile-collection': '21_2',
+                'mass-market-paperbacks': '21_2',
+                'dvd': '7_1',
+                'videos': '7_1',
+                'cassettebook': '21_2',
+                'compact-disc': '21_2',
+                'juvenile-video': '7_1',
+                'kit': '21_2',
+                'magazine': '7_1',
+                'juvenile-serial': '7_1',
+                'new-books': '14_1',
+                'talking-books': '42_2',
+                'inter-library-loan': '21_1',
+                'ill-no-renew': '21_0'
             };
 
             return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
-            if(patronProfile == 'InterLibraryLoan' ||
-                patronProfile == 'Board' ||
-                patronProfile == 'Volunteer'){
+        getRecurringFine: function() {
+            if (patronProfile == 'InterLibraryLoan' ||
+            patronProfile == 'Board' ||
+            patronProfile == 'Volunteer') {
                 return 'zero';
             }
-            
+
             var map = {
-                'book'                 :       'twentyfivecents',
-                'juvenile-collection'  :       'tencents',
-                'mass-market-paperbacks':      'twentyfivecents',
-                'dvd'                  :       'twentyfivecents',
-                'videos'               :       'twentyfivecents',
-                'cassettebooks'                :       'twentyfivecents',
-                'compact-disc'         :       'twentyfivecents',
-                'juvenile-video'       :       'tencents',
-                'kit'                  :       'tencents',
-                'magazine'             :       'twentyfivecents',
-                'juvenile-serial'      :       'tencents',
-                'new-books'            :       'twentyfivecents',
-                'talking-books'                :       'zero',
-                'inter-library-loan'   :       'fiftycents',
-                'ill-no-renew'         :       'fiftycents'
+                'book': 'twentyfivecents',
+                'juvenile-collection': 'tencents',
+                'mass-market-paperbacks': 'twentyfivecents',
+                'dvd': 'twentyfivecents',
+                'videos': 'twentyfivecents',
+                'cassettebooks': 'twentyfivecents',
+                'compact-disc': 'twentyfivecents',
+                'juvenile-video': 'tencents',
+                'kit': 'tencents',
+                'magazine': 'twentyfivecents',
+                'juvenile-serial': 'tencents',
+                'new-books': 'twentyfivecents',
+                'talking-books': 'zero',
+                'inter-library-loan': 'fiftycents',
+                'ill-no-renew': 'fiftycents'
             };
 
             return map[circMod] || 'twentyfivecents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
 
             var map = {
-                'book'                 :       'fivedollar',
-                'juvenile-collection'  :       'threedollar',
-                'mass-market-paperbacks':      'threedollar',
-                'dvd'                  :       'fivedollar',
-                'videos'               :       'fivedollar',
-                'cassettebooks'                :       'fivedollar',
-                'compact-disc'         :       'fivedollar',
-                'juvenile-video'       :       'threedollar',
-                'kit'                  :       'threedollar',
-                'magazine'             :       'threedollar',
-                'juvenile-serial'      :       'threedollar',
-                'new-books'            :       'fivedollar',
-                'talking-books'                :       'zero',
-                'inter-library-loan'   :       'hundreddollar',
-                'ill-no-renew'         :       'hundreddollar'
+                'book': 'fivedollar',
+                'juvenile-collection': 'threedollar',
+                'mass-market-paperbacks': 'threedollar',
+                'dvd': 'fivedollar',
+                'videos': 'fivedollar',
+                'cassettebooks': 'fivedollar',
+                'compact-disc': 'fivedollar',
+                'juvenile-video': 'threedollar',
+                'kit': 'threedollar',
+                'magazine': 'threedollar',
+                'juvenile-serial': 'threedollar',
+                'new-books': 'fivedollar',
+                'talking-books': 'zero',
+                'inter-library-loan': 'hundreddollar',
+                'ill-no-renew': 'hundreddollar'
             };
 
 
             return map[circMod] || 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-                return false;
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
         },
 
-        isAllowedCirc : function() {
+        isAllowedCirc: function() {
             return true;
         },
-                
-        isAllowedHold : function() {
+
+        isAllowedHold: function() {
             var nontransitmap = {
-                'magazine'             :'1',
-                'dvd'                  :'1',
-                'juvenile-video'    :'1',
-                'juvenile-serial'   :'1',
-                'kit'                      :'1',
-                'new-books'                :'1',
-                       'talking-books'         :'1'
-                };
-             if((copy.circ_lib.id != holdPickupLib) && (nontransitmap[circMod])){
+                'magazine''1',
+                'dvd''1',
+                'juvenile-video''1',
+                'juvenile-serial''1',
+                'kit''1',
+                'new-books''1',
+                'talking-books': '1'
+            };
+            if ((copy.circ_lib.id != holdPickupLib) && (nontransitmap[circMod])) {
                 return 'false';
             }
 
             return true;
         },
 
-        getGroupConfig : function() {
-
-            // set defaults
-            var maxHoldsValue           =  99;
-            var maxItemsOutValue        =  40;
-            var overdueThresholdValue   =  10;
-            var fineThresholdValue      =  5;
-            
-            // set special values for group
-            switch (patronProfile) {
-              case 'InterLibraryLoan':
-                fineThresholdValue = -1;
-                overdueThresholdValue  = 100;
-                maxItemsOutValue = 300;
-                break;
-              case 'Volunteer':
-                fineThresholdValue = -1;
-                break;
-             }
+        getGroupConfig: function() {
+
+            var maxHoldsValue = 99;
+
             // return group config
             var config = {
-              'maxHolds'          :  maxHoldsValue,
-              'maxItemsOut'       :  maxItemsOutValue,
-              'overdueThreshold'  :  overdueThresholdValue,
-              'fineThreshold'     :  fineThresholdValue
+                'maxHolds': maxHoldsValue,
             };
 
             return config;
index d6f1b79..0d58d39 100644 (file)
@@ -4,84 +4,70 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BSP");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
             /* returns config.rule_circ_duration.name */
-            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
             var map = {
-              'videos'                 : '7_3',
-              'holiday-special'        : '7_3',
-              'new-books'              : '14_3'
+                'videos': '7_3',
+                'holiday-special': '7_3',
+                'new-books': '14_3'
             };
 
             return map[circMod] || '21_3';
 
         },
 
-        getRecurringFine : function() {
-
-           /* returns config.rule_recuring_fine.name */
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+        getRecurringFine: function() {
 
             var map = {
-              'holiday-special'        : 'default',
-              'new-books'              : 'default'
+                'holiday-special': 'default',
+                'new-books': 'default'
             };
 
-           return map[circMod] || 'tencents';
+            return map[circMod] || 'tencents';
         },
 
-          
-        getMaxFine : function() {
-           /* returns config.rule_max_fine.name */
-           return 'tendollar';
+        getMaxFine: function() {
+            /* returns config.rule_max_fine.name */
+            return 'tendollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-
-        isAllowedCirc : function() {
-          var copyLoc = copy.location.name ;
-          if(  (patronProfile == 'BCOneCard' || patronProfile =='InterLibraryLoan') && (copyLoc.substring(0,3) == 'SSS') ) 
-           {
-               return false;
-          }
-          else
-           {
-               return true;
-           }
+        isAllowedCirc: function() {
+            var copyLoc = copy.location.name;
+            if ((patronProfile == 'BCOneCard' || patronProfile == 'InterLibraryLoan') &&
+            (copyLoc.substring(0, 3) == 'SSS')) {
+                return false;
+            } else {
+                return true;
+            }
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return false;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
 
-          // set defaults
-          var maxItemsOutValue        =  20;
-          var maxHoldsValue           =  0;
-          var overdueThresholdValue   =  3;
-          var fineThresholdValue      =  10;
-          
-          // return group config
-          var config = {
-            'maxHolds'          :  maxHoldsValue,
-            'maxItemsOut'       :  maxItemsOutValue,
-            'overdueThreshold'  :  overdueThresholdValue,
-            'fineThreshold'     :  fineThresholdValue
-          };
+            // set defaults
+            var maxHoldsValue = 0;
+            // return group config
+            var config = {
+                'maxHolds': maxHoldsValue,
+            };
 
 
-          return config;
+            return config;
         }
     };
 }
+
index a934161..d462a9d 100644 (file)
@@ -8,76 +8,75 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
-            if(patronProfile == 'InterLibraryLoan'){
+            if (patronProfile == 'InterLibraryLoan') {
                 return '42_0';
             }
 
             var map = {
-              'book'                   : '21_1',
-              'compact-discs'  : '7_0',
-                         'videos'              : '7_0',
-                         'new-books'   :       '21_0',
-                         'audio-cassette'      : '21_1',
-                         'dvd'                 : '7_0',
-                         'magazine'    : '7_0'
-                       };
+                'book': '21_1',
+                'compact-discs': '7_0',
+                'videos': '7_0',
+                'new-books': '21_0',
+                'audio-cassette': '21_1',
+                'dvd': '7_0',
+                'magazine': '7_0'
+            };
 
             return map[circMod] || '21_1';
 
         },
 
-        getRecurringFine : function() {
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-           
-           if (circMod == 'dvd' || circMod == 'videos'  || circMod == 'audio-cassette'  ||  circMod == 'compact-discs') {
-                       return 'fiftycents';
-               }
-           var map = {
-                       'Local System Administrator'    : 'zero',
-                       'Catalogers'                                    : 'zero',
-                       'CircCat'                                               : 'zero',
-                       'CircCopy'                                              : 'zero',
-                       'Board'                                                 : 'zero',
-                       'NoFines'                                               : 'zero'
-           };
-           
-           return map[patronProfile] || 'fifteencents';
-                       
+        getRecurringFine: function() {
+            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+            if (circMod == 'dvd' || circMod == 'videos' || circMod == 'audio-cassette' || circMod == 'compact-discs') {
+                return 'fiftycents';
+            }
+            var map = {
+                'Local System Administrator': 'zero',
+                'Catalogers': 'zero',
+                'CircCat': 'zero',
+                'CircCopy': 'zero',
+                'Board': 'zero',
+                'NoFines': 'zero'
+            };
+
+            return map[patronProfile] || 'fifteencents';
+
         },
 
-          
-        getMaxFine : function() {
 
-           return 'tendollar';
+        getMaxFine: function() {
+
+            return 'tendollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
-          return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-        getGroupConfig : function() {
-
-          // set defaults
-         
-          var maxHoldsValue           =  5;
-            
-          // return group config
-          var config = {
-            'maxHolds'          :  maxHoldsValue
-                   };
-
-          return config;
+        getGroupConfig: function() {
+
+            // set defaults
+            var maxHoldsValue = 5;
+
+            // return group config
+            var config = {
+                'maxHolds': maxHoldsValue
+            };
+
+            return config;
         }
     };
 }
+
index 063157c..7ebbb06 100644 (file)
@@ -6,113 +6,100 @@ function getPolicy() {
     log_info("Loading policy info for BTE");
 
     var maxByCircMod = {
-        'hardback' : 50,
-        'binder' : 10,
-        'box' : 5,
-        'audio-cassette' : 5,
-        'compact-disc' : 5,
-        'cd-rom' : 5,
-        'dvd' : 3,
-        'folder' : 25,
-        'floppy-disc' : 10,
-        'magazine' : 50,
-        'map' : 50,
-        'pattern' : 5,
-        'paperback' : 50,
-        'photocopy' : 10,
-        'pamphlet' : 50,
-        'record-(lp)' : 5,
-        'spiral-binding' : 50,
-        'stapled' : 5,
-        'video-cassette' : 6,
-        'mass-market-paperbacks' : 50,
-        'cd-and-book-in-bag' : 10,
-        'dvd-rom' : 5,
-        'e-book' : 5,
-        'mp-3-audio-disc' : 5,
-        'literacy-activity-bag' :  2,
-        'ill' : 10
+        'hardback': 50,
+        'binder': 10,
+        'box': 5,
+        'audio-cassette': 5,
+        'compact-disc': 5,
+        'cd-rom': 5,
+        'dvd': 3,
+        'folder': 25,
+        'floppy-disc': 10,
+        'magazine': 50,
+        'map': 50,
+        'pattern': 5,
+        'paperback': 50,
+        'photocopy': 10,
+        'pamphlet': 50,
+        'record-(lp)': 5,
+        'spiral-binding': 50,
+        'stapled': 5,
+        'video-cassette': 6,
+        'mass-market-paperbacks': 50,
+        'cd-and-book-in-bag': 10,
+        'dvd-rom': 5,
+        'e-book': 5,
+        'mp-3-audio-disc': 5,
+        'literacy-activity-bag': 2,
+        'ill': 10
     };
 
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
+        getLoanDuration: function() {
             /* returns config.rule_circ_duration.name */
-            var circMod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-            if(circMod == 'pamphlets'){
+            if (circMod == 'pamphlets') {
                 return '1day';
             }
-            if(circMod.match(/-short/)){
+            if (circMod.match(/-short/)) {
                 return 'terrace_short';
             }
             return 'terrace';
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-            var circMod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-            if(circMod == 'magazine') {
+            if (circMod == 'magazine') {
                 return 'tencents';
             }
             return 'terrace';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
-            if(patronProfile == 'JuvenileRes'){
+            if (patronProfile == 'JuvenileRes') {
                 return 'twodollar';
             }
             return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             log_debug("exceedsMaxCheckoutsByCircMod()");
-            if(isGroupDescendant('Staff', patronProfile)){
+            if (isGroupDescendant('Staff', patronProfile)) {
                 return false;
             }
             var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
             var maxCount = maxByCircMod[circMod];
             log_debug("checking circ mod " + circMod);
-            if(!maxCount || maxCount === null){ 
-                maxCount = maxByCircMod[circMod.replace(/-short$/,'')];
+            if (!maxCount || maxCount === null) {
+                maxCount = maxByCircMod[circMod.replace(/-short$/, '')];
             }
-            if(!maxCount || maxCount === null){
+            if (!maxCount || maxCount === null) {
                 return false;
             }
             var outCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
-            log_debug("found max out by circ mod "+maxCount+" and checked out count is "+outCount);
+            log_debug("found max out by circ mod " + maxCount + " and checked out count is " + outCount);
             return outCount >= maxCount;
         },
-        
-        isAllowedCirc : function() {
+
+        isAllowedCirc: function() {
             return true;
         },
 
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
 
-        getGroupConfig : function() {
+        getGroupConfig: function() {
             /* returns the combined user config object */
 
             // override some defaults
-            GROUP_CONFIG.Patrons.fineThreshold = 25;
-            GROUP_CONFIG.JuvenileRes.fineThreshold = 10;
-
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
+
             // these are global settings for BTE users
             config.maxHolds = 25;
-            config.overdueThreshold = 5;
-
-            // debugging...
-            var str = "BTE getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-               }
-            log_debug(str);
-
             return config;
         }
     };
index 1f78811..aa70dc6 100644 (file)
@@ -4,11 +4,12 @@ function getPolicy() {
 
     load_lib('circ/circ_lib.js');
     log_info("Loading policy info for BVALE");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
-            if (isPrecat || copy.call_number == -1){
+        getLoanDuration: function() {
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
             /* returns config.rule_circ_duration.name */
@@ -18,77 +19,60 @@ function getPolicy() {
                 return '35_1';
             }
             var map = {
-                'dvd'                     : '7_2',
-                'cd-rom'                  : '7_2',
-                'video'                  : '7_2',
-                'magazine'                : '7_2',
-                'compact-discs'           : '7_2'
+                'dvd': '7_2',
+                'cd-rom': '7_2',
+                'video': '7_2',
+                'magazine': '7_2',
+                'compact-discs': '7_2'
             };
 
             return map[circMod] || '21_2';
 
         },
 
-        getRecurringFine : function() {
+        getRecurringFine: function() {
             /* returns config.rule_recuring_fine.name */
-           
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-          
-               if(patronProfile == 'JuvenileRes' && circMod == 'book'){
-                       return 'fivecents';
-               } 
-        if(patronProfile == 'Board' || patronProfile =='InterLibraryLoan'){
-            return 'zero';
-        }
-         var map = {
-               'dvd'   : 'fiftycents',
-               'video' : 'fiftycents',
-               'cd-rom' : 'fiftycents',
-               'compact-discs' : 'fiftycents'
-          };
-           return map[circMod] || 'tencents';
+
+            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+            if (patronProfile == 'JuvenileRes' && circMod == 'book') {
+                return 'fivecents';
+            }
+            if (patronProfile == 'Board' || patronProfile == 'InterLibraryLoan') {
+                return 'zero';
+            }
+            var map = {
+                'dvd': 'fiftycents',
+                'video': 'fiftycents',
+                'cd-rom': 'fiftycents',
+                'compact-discs': 'fiftycents'
+            };
+
+            return map[circMod] || 'tencents';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             /* returns config.rule_max_fine.name */
             return 'tendollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
-          return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-        getGroupConfig : function() {
+        getGroupConfig: function() {
             /* returns the combined user config object */
 
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-            
+
             // these are global settings for BH users
             config.maxHolds = -1;
-            config.overdueThreshold = -1;
-            config.maxItemsOut = 50;
-           config.fineThreshold = 2;
-            
-           // override some defaults
-           GROUP_CONFIG.BCOneCard.maxItemsOut = 5;
-           GROUP_CONFIG.Board.fineThreshold = -1;
-           GROUP_CONFIG.Staff.fineThreshold = -1;
-           GROUP_CONFIG.Volunteer.fineThreshold = -1;
-
-            // debugging...
-            var str = "BVALE getGroupConfig():";
-               for( var i in config ){ 
-                       str += i + '=' + config[i] + '  ';
-               }
-            log_debug(str);
-
             return config;
         }
     };
index bf8b94e..7d938c1 100644 (file)
@@ -2,45 +2,46 @@
 
 function getPolicy() {
 
-  load_lib('circ/circ_lib.js');
-  log_info("Loading policy info for BVDH");
+    load_lib('circ/circ_lib.js');
+    log_info("Loading policy info for BVDH");
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
-  return {
+    return {
 
-    getLoanDuration : function() {
-      return '21_2';
-    },
+        getLoanDuration: function() {
+            return '21_2';
+        },
 
-    getRecurringFine : function() {
-      return 'tencents';
-    },
+        getRecurringFine: function() {
+            return 'tencents';
+        },
 
-    getMaxFine : function() {
-      return 'twodollar';
-    },
+        getMaxFine: function() {
+            return 'twodollar';
+        },
 
-    exceedsMaxCheckoutsByCircMod : function() {
-      return false;
-    },
+        exceedsMaxCheckoutsByCircMod: function() {
+            return false;
+        },
 
-    isAllowedCirc : function() {
-      return true;
-    },
+        isAllowedCirc: function() {
+            return true;
+        },
 
-    isAllowedHold : function() {
-        return true;
-    },
+        isAllowedHold: function() {
+            return true;
+        },
 
-    getGroupConfig : function() {
-      /* returns the combined user config object */
+        getGroupConfig: function() {
+            /* returns the combined user config object */
 
-      var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
-      
-      // these are global settings for BVDH users
-      config.maxHolds          = 10;
+            var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
 
-      return config;
-    }
-  };
+            // these are global settings for BVDH users
+            config.maxHolds = 10;
+
+            return config;
+        }
+    };
 }
 
index 430983c..0f5df05 100644 (file)
@@ -6,94 +6,81 @@ function getPolicy() {
     log_info("Loading policy info for BW");
 
     var maxByCircMod = {
-           'video-games' : 2
+        'video-games': 2
     };
+    var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
 
     return {
 
-        getLoanDuration : function() {
-            /* returns config.rule_circ_duration.name */
-            var circMod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-
-            log_debug("Patron Profile: " + patronProfile);
+        getLoanDuration: function() {
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return '42_0';
             }
-            if (isPrecat || copy.call_number == -1){
+            if (isPrecat || copy.call_number == -1) {
                 return '21_0';
             }
 
             var map = {
-                'dvd'                         :   '7_2',
-                'holiday-title'              :   '7_2',
-                'juvenile-holiday-special'   :   '7_2',
-                'video-games'                :   '7_2',
-                'videos'                     :   '7_2'
+                'dvd': '7_2',
+                'holiday-title': '7_2',
+                'juvenile-holiday-special': '7_2',
+                'video-games': '7_2',
+                'videos': '7_2'
             };
 
             return map[circMod] || '21_2';
         },
 
-        getRecurringFine : function() {
-            /* returns config.rule_recuring_fine.name */
-            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+        getRecurringFine: function() {
             if (isGroupDescendant('InterLibraryLoan', patronProfile)) {
                 return 'zero';
             }
-            if(circMod == 'videos' || circMod == 'video-games' || circMod == 'dvd'){
+            if (circMod == 'videos' || circMod == 'video-games' || circMod == 'dvd') {
                 return 'video';
             }
-            if(circMod.match(/juvenile-/)){
-                return 'zero'; /* no fines for kids */
+            if (circMod.match(/juvenile-/)) {
+                return 'zero';
+                /* no fines for kids */
             }
             return 'whistler';
         },
 
-        getMaxFine : function() {
+        getMaxFine: function() {
             return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
-                   log_debug("exceedsMaxCheckoutsByCircMod()");
-               
-                   if(isGroupDescendant('Staff', patronProfile)){
-                           return false;
+        exceedsMaxCheckoutsByCircMod: function() {
+            log_debug("exceedsMaxCheckoutsByCircMod()");
+
+            if (isGroupDescendant('Staff', patronProfile)) {
+                return false;
             }
 
-                   var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
-                   var maxCount = maxByCircMod[circMod];
-                   log_debug("checking circ mod " + circMod);
-                   if(!maxCount || maxCount === null){
-                           return false;
+            var circMod = (copy && copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : '';
+            var maxCount = maxByCircMod[circMod];
+            log_debug("checking circ mod " + circMod);
+
+            if (!maxCount || maxCount === null) {
+                return false;
             }
-                   var outCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
-               
-               log_debug("found max out by circ mod "+maxCount+" and checked out count is "+outCount);
-               return outCount >= maxCount;
-           },
-
-    isAllowedCirc : function() {
-        return true;
-    },
-    isAllowedHold : function() {
-        return true;
-    },
-
-       getGroupConfig: function() {
-             /* XXX */
+            var outCount = checkoutsByCircModifier(patron.id)[circMod] || 0;
 
+            log_debug("found max out by circ mod " + maxCount + " and checked out count is " + outCount);
+            return outCount >= maxCount;
+        },
+
+        isAllowedCirc: function() {
+            return true;
+        },
+        isAllowedHold: function() {
+            return true;
+        },
+
+        getGroupConfig: function() {
             var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
 
             config.maxHolds = 10;
-            /*
-            config.maxItemsOut = 20;
-            config.fineThreshold = 5;
-            if(isGroupDescendant('NonResident', patronProfile)){
-                config.maxItemsOut = 10;
-            }
-           */
-            if(isGroupDescendant('Staff', patronProfile)){
+            if (isGroupDescendant('Staff', patronProfile)) {
                 config.maxHolds = 50;
             }
 
index 86eb878..6b40a43 100644 (file)
@@ -8,107 +8,83 @@ function getPolicy() {
 
     return {
 
-        getLoanDuration : function() {
-            if (copy.call_number == -1){
+        getLoanDuration: function() {
+            if (copy.call_number == -1) {
                 return '21_0';
             }
-            if(patronProfile == 'InterLibraryLoan'){
+            if (patronProfile == 'InterLibraryLoan') {
                 return '30_0';
             }
 
             var map = {
-              'videos'                 : '7_1',
-              'audio-cds'      : '7_1'
-                       };
+                'videos': '7_1',
+                'audio-cds': '7_1'
+            };
 
             return map[circMod] || '21_1';
 
         },
 
-        getRecurringFine : function() {
-           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
-           
-        var map = {
-              'videos'                            : 'default',
-              'talking-tape-cnib'          : 'default',
-              'audio-cds-cnib'            : 'default',
-              'audio-cds'                         : 'default',
-              'juvenile-collection'        : 'fivecents',
-              'compact-discs'              : 'default'
+        getRecurringFine: function() {
+
+            var map = {
+                'videos': 'default',
+                'talking-tape-cnib': 'default',
+                'audio-cds-cnib': 'default',
+                'audio-cds': 'default',
+                'juvenile-collection': 'fivecents',
+                'compact-discs': 'default'
             };
 
-           return map[circMod] || 'tencents';
+            return map[circMod] || 'tencents';
         },
-                       
 
-          
-        getMaxFine : function() {
 
-           return 'fivedollar';
+
+        getMaxFine: function() {
+
+            return 'fivedollar';
         },
 
-        exceedsMaxCheckoutsByCircMod : function() {
+        exceedsMaxCheckoutsByCircMod: function() {
             return false;
         },
 
-        isAllowedCirc : function() {
-          return true;
+        isAllowedCirc: function() {
+            return true;
         },
-        isAllowedHold : function() {
+        isAllowedHold: function() {
             return true;
         },
-        getGroupConfig : function() {
-
-          // set defaults
-          var maxItemsOutValue        =  99;
-          var maxHoldsValue           =  5;
-          var overdueThresholdValue   =  10;
-          var fineThresholdValue      =  10;
-  
-       // set special values for group
-       switch (patronProfile) {
-       case 'BCOneCard':
-               maxItemsOutValue = 5;
-               maxHoldsValue    = 5;
-               overdueThresholdValue  = 5;
-               break;
-       case 'Temporary':
-               maxItemsOutValue = 2;
-               maxHoldsValue    = 2;
-               overdueThresholdValue  = 1;
-               fineThresholdValue = 5;
-               break;
-       case 'InterLibraryLoan':
-               maxHoldsValue    = 99;
-               overdueThresholdValue  = 999;
-               fineThresholdValue = 9999;
-               break;
-       case 'NoFines':
-               fineThresholdValue = 15;
-               break;
-       case 'Catalogers':
-               fineThresholdValue = 15;
-               break;
-       case 'Circulators':
-               fineThresholdValue = 15;
-               break;
-       case 'Local System Administrator':
-               fineThresholdValue = 15;
-               break;
-       case 'CircCat':
-               fineThresholdValue = 15;
-               break;
-       }
-          // return group config
-          var config = {
-            'maxHolds'          :  maxHoldsValue,
-            'maxItemsOut'       :  maxItemsOutValue,
-            'overdueThreshold'  :  overdueThresholdValue,
-            'fineThreshold'     :  fineThresholdValue
-          };
-
-          return config;
+        getGroupConfig: function() {
+
+            // set defaults
+            var maxHoldsValue = 5;
+
+            // set special values for group
+            switch (patronProfile) {
+            case 'BCOneCard':
+                maxHoldsValue = 5;
+                break;
+            case 'Temporary':
+                maxHoldsValue = 2;
+                break;
+            case 'InterLibraryLoan':
+                maxHoldsValue = 99;
+                break;
+            case 'NoFines':
+            case 'Catalogers':
+            case 'Circulators':
+            case 'Local System Administrator':
+            case 'CircCat':
+            }
+            // return group config
+            var config = {
+                'maxHolds': maxHoldsValue,
+            };
+
+            return config;
         }
     };
 }
+
index 13aa6ea..aadb883 100644 (file)
@@ -1,54 +1,54 @@
 function getBranchPolicyMap(shortname) {
-            var map = {
-                'SITKA'     : 'BPR',
-                'BLP-GB'  :  'BLP',
-                'BLP-BR'  :  'BLP',
-                'BLP-LL'  :  'BLP',
-                'BMB-MB'    : 'BMB',
-                'BMB-LS'    : 'BMB',
-                'BCREK-CRA'   :  'BCREK',
-                'BCREK-CRE'   :  'BCREK',
-                'BCREK-FER'   :  'BCREK',
-                'BCREK-GCR'   :  'BCREK',
-                'BCREK-GOL'   :  'BCREK',
-                'BCREK-INV'   :  'BCREK',
-                'BCREK-KIM'   :  'BCREK',
-                'BCREK-SPA'   :  'BCREK',
-                'BKCT-NKM'       :  'BKCT',
-                'BKCT-MER'       :  'BKCT',
-                'BKCT-SVN'       :  'BKCT',                
-                'BKCT-LYT'       :  'BKCT',
-                'BKCT-LOG'       :  'BKCT',
-                'BKCT-CLI'       :  'BKCT',                
-                'BKCT-CLW'       :  'BKCT',
-                'BKCT-CHA'       :  'BKCT',
-                'BKCT-CCR'       :  'BKCT',                
-                'BKCT-BLU'       :  'BKCT',
-                'BKCT-BAR'       :  'BKCT',
-                'BKCT-ASH'       :  'BKCT',                
-                'BKCT-KAM'       :  'BKCT',
-                'BKCT-ADM'       :  'BKCT',
-                'BKCT-ZRQ'       :  'BKCT',
-                'BKCT-ILL'        :  'BKCT',                
-                'BKCT-BKM'       :  'BKCT',
-                'BWLCRL'    : 'BWLCR',
-                'BQ'        : 'BWLCR',
-                'BMH'       : 'BWLCR',
-                'BWLCR-AC'  : 'BWLCR',
-                'BWLCR-AL'  : 'BWLCR',
-                'BWLCR-BR'  : 'BWLCR',
-                'BWLCR-BI'  : 'BWLCR',
-                'BWLCR-FG'  : 'BWLCR',
-                'BWLCR-HF'  : 'BWLCR',
-                'BWLCR-LL'  : 'BWLCR',
-                'BWLCR-LI'  : 'BWLCR',
-                'BWLCR-MC'  : 'BWLCR',
-                'BWLCR-NA'  : 'BWLCR',
-                'BWLCR-TA'  : 'BWLCR',
-                'BWLCR-WE'  : 'BWLCR'
-            };
+    var map = {
+        'SITKA': 'BPR',
+        'BLP-GB': 'BLP',
+        'BLP-BR': 'BLP',
+        'BLP-LL': 'BLP',
+        'BMB-MB': 'BMB',
+        'BMB-LS': 'BMB',
+        'BCREK-CRA': 'BCREK',
+        'BCREK-CRE': 'BCREK',
+        'BCREK-FER': 'BCREK',
+        'BCREK-GCR': 'BCREK',
+        'BCREK-GOL': 'BCREK',
+        'BCREK-INV': 'BCREK',
+        'BCREK-KIM': 'BCREK',
+        'BCREK-SPA': 'BCREK',
+        'BKCT-NKM': 'BKCT',
+        'BKCT-MER': 'BKCT',
+        'BKCT-SVN': 'BKCT',
+        'BKCT-LYT': 'BKCT',
+        'BKCT-LOG': 'BKCT',
+        'BKCT-CLI': 'BKCT',
+        'BKCT-CLW': 'BKCT',
+        'BKCT-CHA': 'BKCT',
+        'BKCT-CCR': 'BKCT',
+        'BKCT-BLU': 'BKCT',
+        'BKCT-BAR': 'BKCT',
+        'BKCT-ASH': 'BKCT',
+        'BKCT-KAM': 'BKCT',
+        'BKCT-ADM': 'BKCT',
+        'BKCT-ZRQ': 'BKCT',
+        'BKCT-ILL': 'BKCT',
+        'BKCT-BKM': 'BKCT',
+        'BWLCRL': 'BWLCR',
+        'BQ': 'BWLCR',
+        'BMH': 'BWLCR',
+        'BWLCR-AC': 'BWLCR',
+        'BWLCR-AL': 'BWLCR',
+        'BWLCR-BR': 'BWLCR',
+        'BWLCR-BI': 'BWLCR',
+        'BWLCR-FG': 'BWLCR',
+        'BWLCR-HF': 'BWLCR',
+        'BWLCR-LL': 'BWLCR',
+        'BWLCR-LI': 'BWLCR',
+        'BWLCR-MC': 'BWLCR',
+        'BWLCR-NA': 'BWLCR',
+        'BWLCR-TA': 'BWLCR',
+        'BWLCR-WE': 'BWLCR'
+    };
 
-            return map[shortname] || shortname;
+    return map[shortname] || shortname;
 
 
 }