</select>
</div>
<div class="col-md-1">
- <input ng-disabled="!item._receive || bind_or_none($index)" class="form-control" placeholder="[% l('Prefix') %]"
- ng-model="item._cn_prefix" type="text"/>
+ <eg-basic-combo-box eg-disabled="!item._receive || bind_or_none($index)" list="acnp_labels" selected="item._cn_prefix" placeholder="[% l('Prefix') %]"></eg-basic-combo-box>
<input ng-disabled="!item._receive || bind_or_none($index)" class="form-control" placeholder="[% l('Label') %]"
ng-required="item._receive && !bind_or_none($index)" ng-model="item._call_number" type="text"/>
- <input ng-disabled="!item._receive || bind_or_none($index)" class="form-control" placeholder="[% l('Suffix') %]"
- ng-model="item._cn_suffix" type="text"/><br/>
+ <eg-basic-combo-box eg-disabled="!item._receive || bind_or_none($index)" list="acns_labels" selected="item._cn_suffix" placeholder="[% l('Suffix') %]"></eg-basic-combo-box>
+ <br/>
</div>
<div class="col-md-1">
<select
$scope.bind = bind;
$scope.items = list;
$scope.acn_list = [];
+ $scope.acnp_labels = [];
+ $scope.acns_labels = [];
$scope.acpl_list = [];
$scope.cannot_print = function (index) {
$scope.ok = function(items) { $uibModalInstance.close(items) }
$scope.cancel = function () { $uibModalInstance.dismiss() }
+ var dist_libs = {};
var pile_o_promises = [$q.when()];
+
// let's gather what we need...
angular.forEach(list, function (i, index) {
+ var dlib = i.stream().distribution().holding_lib().id();
+ dist_libs[dlib] = egCore.org.fullPath(dlib, true);
if (i.unit()) {
i._barcode = i.unit().barcode();
pile_o_promises.push(
i._receive = true;
});
+ // build unique list of orgs from distribution.holding_lib fullPaths
+ var dist_lib_list = [];
+ angular.forEach(dist_libs, function (l) {
+ dist_lib_list = dist_lib_list.concat(l);
+ });
+ dist_lib_list = dist_lib_list.filter(function(v,i,s){
+ return s.indexOf(v) == i;
+ });
+
+ // Copy locations only come from the workstation location, same as XUL
pile_o_promises.push(egCore.pcrud.search(
'acpl',
{owning_lib : egCore.org.fullPath(egCore.auth.user().ws_ou(), true)},
return $q.when();
}));
+ // Call numbers, however, come from anywhere the distributions might live
pile_o_promises.push(egCore.pcrud.search(
'acn',
- {deleted : 'f', record : bibId, owning_lib : egCore.org.fullPath(egCore.auth.user().ws_ou(), true)},
+ {deleted : 'f', record : bibId, owning_lib : dist_lib_list},
{flesh : 1, flesh_fields : {acn : ['prefix','suffix']}},{ atomic : true }
).then(function (list) {
$scope.acn_list = list.map(function(i){return egCore.idl.toHash(i)});
return $q.when();
}));
+ // Likewise for prefix and suffix, for combo box
+ angular.forEach(['acnp','acns'], function (cl) {
+ pile_o_promises.push(egCore.pcrud.search(
+ cl,
+ {owning_lib : dist_lib_list},
+ {},{ atomic : true }
+ ).then(function (list) {
+ $scope[cl+'_labels'] = list.map(function(i){return i.label()});
+ return $q.when();
+ }));
+ });
+
pile_o_promises.push(egCore.pcrud.retrieveAll(
'ccm', {}, { atomic : true }
).then(function (list) {