LP#1502292 Add Volumes from Bib Record
authorKyle Huckins <khuckins@catalystdevworks.com>
Thu, 17 Nov 2016 19:47:31 +0000 (11:47 -0800)
committerKathy Lussier <klussier@masslnc.org>
Mon, 9 Jan 2017 15:59:00 +0000 (10:59 -0500)
Add 'Add Volumes' button to record summary pane to
add a new volume for a record.

Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
modified:   Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
modified:   Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index c57b542..632c0be 100644 (file)
@@ -4,7 +4,7 @@
 </div>
 
 <div ng-show="record_id" class="row col-md-12 pad-vert">
-  <div class="col-md-9">
+  <div class="col-md-8">
     <button type="button" ng-disabled="from_route" class="btn btn-default" ng-click="opac_call('rdetailStart')">
        [% l('Start') %]
     </button>
        [% l('Back To Results') %] ( {{ search_result_index }} / {{ search_result_hit_count }} )
     </button>
   </div>
-  <div class="col-md-3">
+  <div class="col-md-4">
+    <button type="button" class="btn btn-default" ng-click="selectedHoldingsVolCopyAdd()">
+        [% l('Add Volumes') %]
+    </button>
     <button type="button" class="btn btn-default" ng-click="add_to_record_bucket()">
         [% l('Add To Bucket') %]
     </button>
index 9423e50..3b48469 100644 (file)
@@ -954,12 +954,20 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
                 raw.push( {callnumber : v} );
             });
         } else if (vols) {
-            angular.forEach(
-                $scope.holdingsGridControls.selectedItems(),
-                function (item) {
-                    raw.push({owner : item.owner_id});
-                }
-            );
+            if (typeof $scope.holdingsGridControls.selectedItems == "function" &&
+                $scope.holdingsGridControls.selectedItems().length > 0) {
+                angular.forEach($scope.holdingsGridControls.selectedItems(),
+                    function (item) {
+                        raw.push({
+                            owner : item.owner_id,
+                            label : item.call_number.label
+                        });
+                    });
+            } else {
+                raw.push({
+                    owner : egCore.auth.user().ws_ou()
+                });
+            }
         }
 
         if (raw.length == 0) raw.push({});