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) {