From: pzed Date: Fri, 21 Aug 2009 16:15:21 +0000 (+0000) Subject: updated to use isValidPatron function, which now resides in circ_lib.js X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9766575739c458a8112beb5e549d123b548a4321;p=contrib%2FConifer.git updated to use isValidPatron function, which now resides in circ_lib.js git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/trunk@632 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/circ/circ_duration_OWA.js b/circ/circ_duration_OWA.js index d7ff5d6a85..d3e665740d 100644 --- a/circ/circ_duration_OWA.js +++ b/circ/circ_duration_OWA.js @@ -95,13 +95,3 @@ if (isValidPatron(patronProfile)) { } } log_info("circ0814 - results: " + result.durationRule); - -function isValidPatron(patronProfile) { - var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers']; - for (var i = 0; i < valid_patrons.length; i++) { - if (valid_patrons[i] == patronProfile) { - return true; - } - } - return false; -} \ No newline at end of file diff --git a/circ/circ_duration_OWAL.js b/circ/circ_duration_OWAL.js index 3f84940c6f..6e15bfb7be 100644 --- a/circ/circ_duration_OWAL.js +++ b/circ/circ_duration_OWAL.js @@ -76,13 +76,3 @@ if (isValidPatron(patronProfile)) { } } log_info("circ0814 - results: " + result.durationRule); - -function isValidPatron(patronProfile) { - var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers']; - for (var i = 0; i < valid_patrons.length; i++) { - if (valid_patrons[i] == patronProfile) { - return true; - } - } - return false; -} \ No newline at end of file diff --git a/circ/circ_permit_copy.js b/circ/circ_permit_copy.js index bf276a5635..530adfa29c 100644 --- a/circ/circ_permit_copy.js +++ b/circ/circ_permit_copy.js @@ -51,9 +51,7 @@ if( ! isTrue(copy.circulate) || // set permissions for Windsor Leddy if (copy.circ_lib.shortname == 'OWA') { - var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers']; - - if (isValidPatron(patronProfile, valid_patrons)) { + if (isValidPatron(patronProfile)) { // permit circulations for the following circ modifiers to all patrons var circ_allow_list = ['CIRC', 'CRC MEDIA', 'CRC SPEC', 'CRC TEXT', 'DOC', 'DVD VIDEO', 'MEDIA', 'MFORM', 'REF', 'THESIS']; @@ -85,9 +83,7 @@ if (copy.circ_lib.shortname == 'OWA') { // set permissions for Windsor Law if (copy.circ_lib.shortname == 'OWAL') { - var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers']; - - if (isValidPatron(patronProfile, valid_patrons)) { + if (isValidPatron(patronProfile)) { // only Law external borrowers can borrow Law items if (patronProfile == 'Readers' && patron.home_ou.shortname != 'OWAL') { @@ -134,15 +130,6 @@ function isAMember(shortname, group) { return false; } -function isValidPatron(patronProfile, valid_patrons) { - for (var i = 0; i < valid_patrons.length; i++) { - if (valid_patrons[i] == patronProfile) { - return true; - } - } - return false; -} - function testCircAllow(circ_allow_list) { for (var i = 0; i < circ_allow_list.length; i++) { if (circ_allow_list[i] == copy.circ_modifier) {