-
var MARC_ITEM_TYPE_MAP = {
a : { /* Language material [Books] */
-
-
/* Get the load duration level directly from the copy */
result.durationLevel = copy.loan_duration;
provided circ_modifier, use that config. Otherwise fall back on the MARC
item type
----------------------------------------------------------------------------- */
-var marcType = getMARCItemType();
-var circMod = copy.circ_modifier;
-var itemForm = extractFixedField(marcXMLDoc,'Form');
+var marcType = getMARCItemType();
+var circMod = copy.circ_modifier;
+var itemForm = (marcXMLDoc) ? extractFixedField(marcXMLDoc,'Form') : "";
+
var config =
( circMod && CIRC_MOD_MAP[circMod] ) ?
log_debug("Copy circ modifier = " + circMod + " and item type = " + marcType );
-
-
/* -----------------------------------------------------------------------------
Now set the rule values based on the config. If there is no configured info
on this copy, fall back on defaults.
copy.circ_as_type != 'undef' )
return copy.circ_as_type;
- return extractFixedField(marcXMLDoc, 'Type');
+ return (marcXMLDoc) ? extractFixedField(marcXMLDoc, 'Type') : "";
}
str += ', Copy Barcode=' + copy.barcode;
str += ', Copy status=' + copyStatus;
str += ', Copy location=' + copy.location.name;
+ str += ', Circ Lib=' + copy.circ_lib.shortname;
}
if(volume) str += ', Volume=' + volume.id;
/* projected medium */
-if( getMARCItemType() == 'g'
- && copy.circ_lib != patron.home_ou.id )
+if( getMARCItemType() == 'g' &&
+ !isOrgDescendent(copy.circ_lib.shortname, patron.home_ou.id) )
result.events.push('CIRC_EXCEEDS_COPY_RANGE');
var patronFines = environment.patronFines;
var isRenewal = environment.isRenewal;
+/* XXX get me working again
var holds = copy.fetchHolds();
for( var i in holds ) {
var hold = holds[i];
if( hold && hold.usr != patron.id )
return result.events.push('COPY_NEEDED_FOR_HOLD');
}
+*/
} go();