updated to use isValidPatron function, which now resides in circ_lib.js
authorpzed <pzed@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 21 Aug 2009 16:15:21 +0000 (16:15 +0000)
committerpzed <pzed@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 21 Aug 2009 16:15:21 +0000 (16:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/trunk@632 6d9bc8c9-1ec2-4278-b937-99fde70a366f

circ/circ_duration_OWA.js
circ/circ_duration_OWAL.js
circ/circ_permit_copy.js

index d7ff5d6..d3e6657 100644 (file)
@@ -95,13 +95,3 @@ if (isValidPatron(patronProfile)) {
     }\r
 }\r
 log_info("circ0814 - results: " + result.durationRule);\r
-\r
-function isValidPatron(patronProfile) {\r
-    var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers'];\r
-    for (var i = 0; i < valid_patrons.length; i++) {\r
-        if (valid_patrons[i] == patronProfile) {\r
-            return true;\r
-        }\r
-    }\r
-    return false;\r
-}
\ No newline at end of file
index 3f84940..6e15bfb 100644 (file)
@@ -76,13 +76,3 @@ if (isValidPatron(patronProfile)) {
     }\r
 }\r
 log_info("circ0814 - results: " + result.durationRule);\r
-\r
-function isValidPatron(patronProfile) {\r
-    var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers'];\r
-    for (var i = 0; i < valid_patrons.length; i++) {\r
-        if (valid_patrons[i] == patronProfile) {\r
-            return true;\r
-        }\r
-    }\r
-    return false;\r
-}
\ No newline at end of file
index bf276a5..530adfa 100644 (file)
@@ -51,9 +51,7 @@ if( ! isTrue(copy.circulate) ||
 // set permissions for Windsor Leddy\r
 if (copy.circ_lib.shortname == 'OWA') {\r
 \r
-       var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers'];\r
-\r
-       if (isValidPatron(patronProfile, valid_patrons)) {\r
+       if (isValidPatron(patronProfile)) {\r
   \r
                // permit circulations for the following circ modifiers to all patrons\r
                var circ_allow_list = ['CIRC', 'CRC MEDIA', 'CRC SPEC', 'CRC TEXT', 'DOC', 'DVD VIDEO', 'MEDIA', 'MFORM', 'REF', 'THESIS'];\r
@@ -85,9 +83,7 @@ if (copy.circ_lib.shortname == 'OWA') {
 // set permissions for Windsor Law\r
 if (copy.circ_lib.shortname == 'OWAL') {\r
 \r
-       var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers'];\r
-\r
-       if (isValidPatron(patronProfile, valid_patrons)) {\r
+       if (isValidPatron(patronProfile)) {\r
 \r
                // only Law external borrowers can borrow Law items\r
                if (patronProfile == 'Readers' && patron.home_ou.shortname != 'OWAL') {\r
@@ -134,15 +130,6 @@ function isAMember(shortname, group) {
        return false;\r
 }\r
 \r
-function isValidPatron(patronProfile, valid_patrons) {\r
-    for (var i = 0; i < valid_patrons.length; i++) {\r
-        if (valid_patrons[i] == patronProfile) {\r
-            return true;\r
-        }\r
-    }\r
-    return false;\r
-}\r
-\r
 function testCircAllow(circ_allow_list) {\r
        for (var i = 0; i < circ_allow_list.length; i++) {\r
                if (circ_allow_list[i] == copy.circ_modifier) {\r