<script>
angular.module('egCoreMod').run(['egStrings', function(s) {
s.CONFIRM_DELETE_COPY_BUCKET_ITEMS_FROM_CATALOG =
- "[% l('Are you sure you want to delete all items in bucket from catalog?') %]";
+ "[% l('Are you sure you want to delete selected items in bucket from catalog?') %]";
}])
</script>
[% END %]
<eg-grid-action label="[% l('Remove Selected Copies') %]"
handler="detachCopies"></eg-grid-action>
- <eg-grid-action label="[% l('Delete All from Catalog') %]"
+ <eg-grid-action label="[% l('Delete Selected Copies from Catalog') %]"
handler="deleteCopiesFromCatalog"></eg-grid-action>
<eg-grid-field path="id" required hidden></eg-grid-field>
return $q.all(promises).then(drawBucket);
}
- $scope.deleteCopiesFromCatalog = function() {
+ $scope.deleteCopiesFromCatalog = function(copies) {
egConfirmDialog.open(
egCore.strings.CONFIRM_DELETE_COPY_BUCKET_ITEMS_FROM_CATALOG,
'', {}
).result.then(function() {
var fleshed_copies = [];
var promises = [];
- angular.forEach(bucketSvc.currentBucket.items(), function(i) {
+ angular.forEach(copies, function(i) {
promises.push(
egCore.net.request(
'open-ils.search',
'open-ils.search.asset.copy.fleshed2.retrieve',
- i.target_copy()
+ i.id
).then(function(copy) {
copy.ischanged(1);
copy.isdeleted(1);