From: Bill Erickson Date: Mon, 1 Apr 2019 15:28:08 +0000 (+0000) Subject: JBAS-2185 Batch MARC CN class repair X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5be332a00b637ca05f0a5c769eb476f979ea5efd;p=working%2FEvergreen.git JBAS-2185 Batch MARC CN class repair Be sure MARC call numbers are fetched using the correct call number classification in the batch call number editor. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index 05d1077bb7..b42ec32ca9 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -1075,14 +1075,41 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , if ($scope.defaults.auto_gen_barcode) itemSvc.auto_gen_barcode = true; } + populateBatchCallNumbers(); + }); + } + + function populateBatchCallNumbers() { + + var promise; + + if (!$scope.defaults.classification) { + promise = egCore.org.settings( + ['cat.default_classification_scheme'], + // In batch mode there's no context org unit, + // so default to the classification of the workstation org. + egCore.auth.user().ws_ou() + ).then(function (val) { + $scope.defaults.classification = + $scope.batch.classification = + val['cat.default_classification_scheme'] || 1; + }); + } else { + promise = $q.resolve(); + } + + promise.then(function() { + // Fetch the list of bib-level callnumbers based on the applied // classification scheme. If none is defined, default to "1" // (Generic) since it provides the most options. + console.debug('fetching call numbers for scheme ', + $scope.batch.classification); + egCore.net.request( 'open-ils.cat', 'open-ils.cat.biblio.record.marc_cn.retrieve', - $scope.record_id, - $scope.batch.classification || 1 + $scope.record_id, $scope.batch.classification ).then(function(list) { $scope.batch.marcCallNumbers = []; list.forEach(function(hash) {