[open-ils-commits] r632 - conifer/trunk/circ (pzed)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Aug 21 12:15:25 EDT 2009
Author: pzed
Date: 2009-08-21 12:15:21 -0400 (Fri, 21 Aug 2009)
New Revision: 632
Modified:
conifer/trunk/circ/circ_duration_OWA.js
conifer/trunk/circ/circ_duration_OWAL.js
conifer/trunk/circ/circ_permit_copy.js
Log:
updated to use isValidPatron function, which now resides in circ_lib.js
Modified: conifer/trunk/circ/circ_duration_OWA.js
===================================================================
--- conifer/trunk/circ/circ_duration_OWA.js 2009-08-21 16:14:40 UTC (rev 631)
+++ conifer/trunk/circ/circ_duration_OWA.js 2009-08-21 16:15:21 UTC (rev 632)
@@ -95,13 +95,3 @@
}
}
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
Modified: conifer/trunk/circ/circ_duration_OWAL.js
===================================================================
--- conifer/trunk/circ/circ_duration_OWAL.js 2009-08-21 16:14:40 UTC (rev 631)
+++ conifer/trunk/circ/circ_duration_OWAL.js 2009-08-21 16:15:21 UTC (rev 632)
@@ -76,13 +76,3 @@
}
}
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
Modified: conifer/trunk/circ/circ_permit_copy.js
===================================================================
--- conifer/trunk/circ/circ_permit_copy.js 2009-08-21 16:14:40 UTC (rev 631)
+++ conifer/trunk/circ/circ_permit_copy.js 2009-08-21 16:15:21 UTC (rev 632)
@@ -51,9 +51,7 @@
// 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,10 +83,8 @@
// set permissions for Windsor Law
if (copy.circ_lib.shortname == 'OWAL') {
- var valid_patrons = ['Faculty', 'Graduate', 'Undergraduate', 'Staff members', 'Readers'];
+ if (isValidPatron(patronProfile)) {
- if (isValidPatron(patronProfile, valid_patrons)) {
-
// only Law external borrowers can borrow Law items
if (patronProfile == 'Readers' && patron.home_ou.shortname != 'OWAL') {
result.events.push('COPY_CIRC_NOT_ALLOWED');
@@ -134,15 +130,6 @@
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) {
More information about the open-ils-commits
mailing list