lp1735835 Transfer Bucket Contents to Pending master
authorKyle Huckins <khuckins@catalyte.io>
Mon, 20 May 2019 17:54:00 +0000 (17:54 +0000)
committerBill Erickson <berickxx@gmail.com>
Tue, 25 Jun 2019 14:17:03 +0000 (10:17 -0400)
- Add new option in Copy/Record buckets to transfer select
items to Pending Copy/Records.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
modified:   Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
modified:   Open-ILS/src/templates/staff/cat/bucket/record/t_view.tt2
modified:   Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
modified:   Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
Open-ILS/src/templates/staff/cat/bucket/record/t_view.tt2
Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index edb83bc..5eb522c 100644 (file)
@@ -12,6 +12,8 @@
 
   <eg-grid-action label="[% l('Remove Selected Items from Bucket') %]" group="[% l('Bucket') %]"
     handler="detachCopies"></eg-grid-action>
+  <eg-grid-action label="[% l('Move Selected Items to Pending Items') %]" group="[% l('Bucket') %]"
+    handler="moveToPending"></eg-grid-action>
   <eg-grid-action label="[% l('Request Selected Items') %]" group="[% l('Items') %]"
     handler="requestItems"></eg-grid-action>
   <eg-grid-action label="[% l('Edit Selected Items') %]" group="[% l('Items') %]"
index ab7461b..a30697c 100644 (file)
@@ -16,6 +16,9 @@
   <eg-grid-action label="[% l('Remove Selected Records from Bucket') %]" 
     handler="detachRecords"></eg-grid-action>
 
+  <eg-grid-action label="[% l('Move Selected Records to Pending Records') %]" 
+    handler="moveToPending"></eg-grid-action>
+
   <eg-grid-action label="[% l('Delete Selected Records from Catalog') %]" 
     handler="deleteRecordsFromCatalog"></eg-grid-action>
 
index 70eb084..f23b8a9 100644 (file)
@@ -560,6 +560,13 @@ function($scope,  $q , $routeParams , $timeout , $window , $uibModal , bucketSvc
         bucketSvc.bucketNeedsRefresh = true;
         return $q.all(promises).then(drawBucket);
     }
+    
+    $scope.moveToPending = function(copies) {
+        angular.forEach(copies, function(copy) {
+            bucketSvc.pendingList.push(copy.id);
+        });
+        $scope.detachCopies(copies);
+    }
 
     $scope.spawnHoldingsEdit = function (copies) {
         var cp_list = []
index e7c80d3..8aaa4db 100644 (file)
@@ -751,6 +751,15 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
         return $q.all(promises).then(drawBucket);
     }
 
+    $scope.moveToPending = function(records) {
+        angular.forEach(records, function(rec) {
+            if (bucketSvc.pendingList.filter( // remove dupes
+                function(r) {return r.id == rec.id}).length) return;
+            bucketSvc.pendingList.push(rec);
+        });
+        $scope.detachRecords(records);
+    }
+
     $scope.deleteRecordsFromCatalog = function(records) {
         egConfirmDialog.open(
             egCore.strings.CONFIRM_DELETE_RECORD_BUCKET_ITEMS_FROM_CATALOG,