LP#1402797 make it "delete selected" rather than "delete all"
authorGalen Charlton <gmc@esilibrary.com>
Mon, 26 Jan 2015 19:54:41 +0000 (19:54 +0000)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Feb 2015 16:16:06 +0000 (11:16 -0500)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/cat/bucket/copy/index.tt2
Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js

index 8a81f6d..259beea 100644 (file)
@@ -12,7 +12,7 @@
 <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 %]
index e9446bd..07e5f23 100644 (file)
@@ -12,7 +12,7 @@
 
   <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>
index 3a9bf0e..8f6e3f6 100644 (file)
@@ -449,19 +449,19 @@ function($scope,  $q , $routeParams,  bucketSvc, egCore,
         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);