adding McBride script
authorjames <jfournie@sitka.bclibraries.ca>
Thu, 8 Apr 2010 03:46:06 +0000 (20:46 -0700)
committerjames <jfournie@sitka.bclibraries.ca>
Thu, 8 Apr 2010 03:46:06 +0000 (20:46 -0700)
circ/config_BMB.js [new file with mode: 0644]

diff --git a/circ/config_BMB.js b/circ/config_BMB.js
new file mode 100644 (file)
index 0000000..fdb34f4
--- /dev/null
@@ -0,0 +1,77 @@
+/** Policies for BMB **/
+
+function getPolicy() {
+
+    load_lib('circ/circ_lib.js');
+    log_info("Loading policy info for BMB");
+
+    return {
+
+        getLoanDuration : function() {
+            if (copy.call_number == -1){
+                return '21_0';
+            }
+            /* returns config.rule_circ_duration.name */
+            var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+            var map = {
+              'inter-library-loan'              : '21_1'
+            };
+
+            return map[circMod] || '21_2';
+
+        },
+
+        getRecurringFine : function() {
+
+           /* returns config.rule_recuring_fine.name */
+           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+            var map = {
+              'inter-library-loan'              : 'twentyfivecents'
+            };
+
+           return map[circMod] || 'fivecents';
+        },
+
+          
+        getMaxFine : function() {
+           /* returns config.rule_max_fine.name */
+           var circMod = copy.circ_modifier ? copy.circ_modifier.toLowerCase() : '';
+
+            var map = {
+              'inter-library-loan'              : 'fivedollar'
+            };
+           
+           return map[circMod] || 'threedollar';
+        },
+
+        exceedsMaxCheckoutsByCircMod : function() {
+            return false;
+        },
+
+
+        isAllowedCirc : function() {
+               return true;
+        },
+        isAllowedHold : function() {
+            return true;
+        },
+
+       getGroupConfig : function() {
+
+        GROUP_CONFIG.BCOneCard.maxHolds = 0;
+        GROUP_CONFIG.InterLibraryLoan.maxHolds = 0;
+        GROUP_CONFIG.Temporary.maxHolds = 0;
+       
+       var config = findGroupConfig(patronProfile) || findGroupConfig('Patrons');
+
+       // set defaults
+        config.maxHolds           =  -1;
+
+       return config;
+       }
+    };
+
+}