Make it overridable in copy buckets, and let Cancel on perm denied dialog fail gracefully.
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
);
if (robj == null) throw(robj);
if (typeof robj.ilsevent != 'undefined') {
- if ( (robj.ilsevent != 0) && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */) && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */) ) throw(robj);
+ if (
+ (robj.ilsevent != 0)
+ && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */)
+ && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */)
+ && (robj.ilsevent != 5000 /* PERM_DENIED */)
+ ) {
+ throw(robj);
+ }
}
obj.refresh_list();
}
{
'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.override'),
'overridable_events' : [
+ 1208 /* TITLE_LAST_COPY */,
+ 1227 /* COPY_DELETE_WARNING */
]
}
);
continue loop;
}
} else {
- if (robj.ilsevent != 0) throw(robj);
+ if (typeof robj.ilsevent != 'undefined') {
+ if (
+ (robj.ilsevent != 0)
+ && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */)
+ && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */)
+ && (robj.ilsevent != 5000 /* PERM_DENIED */)
+ ) {
+ throw(robj);
+ }
+ }
}
}
break loop;
{
'title' : document.getElementById('catStrings').getString('staff.cat.copy_buckets.batch.error'),
'overridable_events' : [
- 1208 /* TITLE_LAST_COPY */
+ 1208 /* TITLE_LAST_COPY */,
+ 1227 /* COPY_DELETE_WARNING */
]
}
);
if (typeof robj.ilsevent != 'undefined') {
switch(Number(robj.ilsevent)) {
case 1208 /* TITLE_LAST_COPY */ :
+ case 1227 /* COPY_DELETE_WARNING */ :
+ case 5000 /* PERM_DENIED */ :
// ignore this
break;
- case 1227 /* COPY_DELETE_WARNING */ :
- var copy;
- for (var i = 0; i < copies.length; i++) { if (copies[i].id()==robj.payload) copy = function(a){return a;}(copies[i]); }
- /* The copy in question is not in an ideal status for deleting */
- var err = '*** ' + robj.desc + ' ***\n';
- /* The barcode for the item is {1} */
- err += $('catStrings').getFormattedString('cat.barcode_for_item',[ copy.barcode() ]) + '\n';
- /* The whole batch operation failed */
- err += $('catStrings').getString('cat.batch_operation_failed') + '\n';
- alert(err);
- break;
default:
obj.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.copy_buckets.batch.error'), robj);
}
);
if (typeof robj.ilsevent != 'undefined') {
- throw(robj);
+ if (
+ (robj.ilsevent != 0)
+ && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */)
+ && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */)
+ && (robj.ilsevent != 5000 /* PERM_DENIED */)
+ ) {
+ throw(robj);
+ }
} else {
alert($("catStrings").getString('staff.cat.util.transfer_copies.successful_transfer'));
}
switch(Number(robj.ilsevent)) {
case 1208 /* TITLE_LAST_COPY */:
case 1227 /* COPY_DELETE_WARNING */:
+ case 5000 /* PERM_DENIED */:
break;
default:
obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.copy_status.del_items.success.error'), robj);
{
'title' : document.getElementById('circStrings').getString('staff.circ.copy_status.delete_volumes.override'),
'overridable_events' : [
+ 1208 /* TITLE_LAST_COPY */,
+ 1227 /* COPY_DELETE_WARNING */
]
}
);
continue loop;
}
} else {
- if (robj.ilsevent != 0) { throw(robj); }
+ if (typeof robj.ilsevent != 'undefined') {
+ if (
+ (robj.ilsevent != 0)
+ && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */)
+ && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */)
+ && (robj.ilsevent != 5000 /* PERM_DENIED */)
+ ) {
+ throw(robj);
+ }
+ }
}
}
break loop;