LP#1738242 & LP#1753005: Checkbox issues user/dyrcona/holdings-view-omnibus-signoff
authorMike Rylander <mrylander@gmail.com>
Mon, 30 Apr 2018 20:52:05 +0000 (16:52 -0400)
committerJason Stephenson <jason@sigio.com>
Wed, 2 May 2018 01:47:08 +0000 (21:47 -0400)
The holdings view checkboxes for limiting detail display can cause console
alerts, and should be made visually interdependent.  This commit addresses
both of those issues.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/cat/services/holdings.js

index 9d7b329..30cea7b 100644 (file)
@@ -1037,7 +1037,7 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         holdingsSvcInst.fetch({
             rid : $scope.record_id,
             org : $scope.holdings_ou,
-            copy: $scope.holdings_show_copies,
+            copy: $scope.holdings_show_vols ? $scope.holdings_show_copies : false,
             vol : $scope.holdings_show_vols,
             empty: $scope.holdings_show_empty,
             empty_org: $scope.holdings_show_empty_org
@@ -1053,7 +1053,7 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         holdingsSvcInst.fetch({
             rid : $scope.record_id,
             org : $scope.holdings_ou,
-            copy: $scope.holdings_show_copies,
+            copy: $scope.holdings_show_vols ? $scope.holdings_show_copies : false,
             vol : $scope.holdings_show_vols,
             empty: $scope.holdings_show_empty,
             empty_org: $scope.holdings_show_empty_org
@@ -1064,11 +1064,13 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
 
     $scope.holdings_cb_changed = function(cb,newVal,norefresh) {
         $scope[cb] = newVal;
+        var x = $scope.holdings_show_vols ? $scope.holdings_show_copies : false;
+        $('#holdings_show_copies').prop('checked', x);
         egCore.hatch.setItem('cat.' + cb, newVal);
         if (!norefresh) holdingsSvcInst.fetch({
             rid : $scope.record_id,
             org : $scope.holdings_ou,
-            copy: $scope.holdings_show_copies,
+            copy: $scope.holdings_show_vols ? $scope.holdings_show_copies : false,
             vol : $scope.holdings_show_vols,
             empty: $scope.holdings_show_empty,
             empty_org: $scope.holdings_show_empty_org
@@ -1085,6 +1087,7 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         egCore.hatch.getItem('cat.holdings_show_copies').then(function(x){
             if (typeof x ==  'undefined') x = true;
             $scope.holdings_cb_changed('holdings_show_copies',x,true);
+            x = $scope.holdings_show_vols ? x : false;
             $('#holdings_show_copies').prop('checked', x);
         }).then(function(){
             egCore.hatch.getItem('cat.holdings_show_empty').then(function(x){
index 4df63c4..ec387ec 100644 (file)
@@ -217,7 +217,10 @@ function(egCore , $q) {
                                     current_blob.cn_count++;
                                     current_blob.copy_count += cp.copy_count;
                                     current_blob.id_list = current_blob.id_list.concat(cp.id_list);
-                                    if (cp.raw) current_blob.raw = current_blob.raw.concat(cp.raw);
+                                    if (cp.raw) {
+                                        if (current_blob.raw) current_blob.raw = current_blob.raw.concat(cp.raw);
+                                        else current_blob.raw = cp.raw;
+                                    }
                                 } else {
                                     current_blob.barcode = current_blob.copy_count;
                                     current_blob.call_number = { label : current_blob.cn_count };