From: Mike Rylander Date: Mon, 30 Apr 2018 20:52:05 +0000 (-0400) Subject: LP#1738242 & LP#1753005: Checkbox issues X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fmiker%2Fholdings-view-omnibus;p=working%2FEvergreen.git LP#1738242 & LP#1753005: Checkbox issues 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 --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 9d7b329c22..30cea7bf8d 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -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){ diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js index 4df63c4d46..ec387ec0f2 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js @@ -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 };