var sourceReq = new Request(FETCH_BIB_SOURCE, G.user.session, bib.source());
sourceReq.send(true);
var source = sourceReq.result();
- if (source.can_have_copies() == 'f') {
+ if (source && source.can_have_copies() == 'f') {
alert(dojo.string.substitute(opac_strings.SOURCE_CANNOT_HAVE_COPIES, [source.source()]));
} else {
var req = new Request(CREATE_MFHD_RECORD, G.user.session, 1, here.id(), getRid());
[ ses(), bibObj.source() ]
);
- if (cbsObj.can_have_copies() != get_db_true()) {
+ if (cbsObj && cbsObj.can_have_copies() != get_db_true()) {
alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
return;
}
[ ses(), bibObj.source() ]
);
- if (cbsObj.can_have_copies() != get_db_true()) {
+ if (cbdObj && cbsObj.can_have_copies() != get_db_true()) {
alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
return;
}
try {
JSAN.use('cat.util');
var cbsObj = cat.util.get_cbs_for_bre_id(docid);
- if (cbsObj.can_have_copies() != get_db_true()) {
+ if (cbsObj && cbsObj.can_have_copies() != get_db_true()) {
alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
return;
}
try {
JSAN.use('cat.util');
var cbsObj = cat.util.get_cbs_for_bre_id(obj.docid);
- obj.can_have_copies = (cbsObj.can_have_copies() == get_db_true());
- obj.source = cbsObj.source();
+ if(cbsObj) {
+ obj.can_have_copies = (cbsObj.can_have_copies() == get_db_true());
+ obj.source = cbsObj.source();
+ } else {
+ obj.can_have_copies = true;
+ }
} catch(E) {
obj.error.sdump('D_ERROR','can have copies check: ' + E);
alert(E);