"[% l('Permanently delete selected items and/or call numbers from catalog?') %]";
s.CONFIRM_DELETE_COPIES_VOLUMES_MESSAGE =
"[% l('Will delete {{copies}} items and {{volumes}} call numbers') %]";
+ s.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_TITLE =
+ "[% l('One or more items could not be deleted. Override?') %]";
+ s.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_BODY =
+ "[% l('Reason(s) include: [_1]', '{{evt_desc}}') %]";
s.CONFIRM_DELETE_PEERS =
"[% l('Unlink selected conjoined items?') %]";
s.CONFIRM_DELETE_PEERS_MESSAGE =
'CLAIMSNEVERCHECKEDOUT' : '[% l("Item was marked claims never checked out") %]'
}
};
+s.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_TITLE =
+ "[% l('One or more items could not be deleted. Override?') %]";
+s.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_BODY =
+ "[% l('Reason(s) include: [_1]', '{{evt_desc}}') %]";
}]);
</script>
).result.then(function() {
egCore.net.request(
'open-ils.cat',
- 'open-ils.cat.asset.volume.fleshed.batch.update.override',
+ 'open-ils.cat.asset.volume.fleshed.batch.update',
egCore.auth.token(), cnList, 1, flags
- ).then(function(update_count) {
- holdingsSvcInst.fetchAgain().then(function() {
- $scope.holdingsGridDataProvider.refresh();
- });
+ ).then(function(resp) {
+ var evt = egCore.evt.parse(resp);
+ if (evt) {
+ egConfirmDialog.open(
+ egCore.strings.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_TITLE,
+ egCore.strings.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_BODY,
+ {'evt_desc': evt.desc}
+ ).result.then(function() {
+ egCore.net.request(
+ 'open-ils.cat',
+ 'open-ils.cat.asset.volume.fleshed.batch.update.override',
+ egCore.auth.token(), cnList, 1,
+ { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] }
+ ).then(function() {
+ holdingsSvcInst.fetchAgain().then(function() {
+ $scope.holdingsGridDataProvider.refresh();
+ });
+ });
+ });
+ } else {
+ holdingsSvcInst.fetchAgain().then(function() {
+ $scope.holdingsGridDataProvider.refresh();
+ });
+ }
});
});
}
).result.then(function() {
egCore.net.request(
'open-ils.cat',
- 'open-ils.cat.asset.volume.fleshed.batch.update.override',
+ 'open-ils.cat.asset.volume.fleshed.batch.update',
egCore.auth.token(), cnList, 1, flags
- ).then(function(){
- angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
+ ).then(function(resp){
+ var evt = egCore.evt.parse(resp);
+ if (evt) {
+ egConfirmDialog.open(
+ egCore.strings.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_TITLE,
+ egCore.strings.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_BODY,
+ {'evt_desc': evt.desc}
+ ).result.then(function() {
+ egCore.net.request(
+ 'open-ils.cat',
+ 'open-ils.cat.asset.volume.fleshed.batch.update.override',
+ egCore.auth.token(), cnList, 1,
+ { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] }
+ ).then(function() {
+ angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
+ });
+ });
+ } else {
+ angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
+ }
});
});
},
return service;
}])
.filter('string_pick', function() { return function(i){ return arguments[i] || ''; }; })
+