);
};
+ service.fetch_locations = function(locs) {
+ return egCore.pcrud.search('acpl',
+ {id : locs},
+ {
+ flesh : 1,
+ flesh_fields : {
+ acpl : ['owning_lib']
+ },
+ order_by : { acpl : 'name' }
+ },
+ {atomic : true}
+ );
+ };
+
service.get_suffixes = function(org) {
return egCore.pcrud.search('acns',
{owning_lib : egCore.org.fullPath(org, true)},
}).then( function() {
$scope.data = itemSvc;
$scope.workingGridDataProvider.refresh();
+
+ return itemSvc.fetch_locations(
+ $scope.data.copies.map(function(cp){
+ return cp.location();
+ }).filter(function(e,i,a){
+ return a.lastIndexOf(e) === i;
+ })
+ ).then(function(list){
+ $scope.location_list = list;
+ });
+
});
$scope.can_save = false;
});
$scope.location_list = [];
- itemSvc.get_locations().then(function(list){
- $scope.location_list = list;
- });
createSimpleUpdateWatcher('location');
$scope.status_list = [];