-/i**
+**
* Copy Buckets
*
* Known Issues
angular.forEach($scope.gridControls.selectedItems(), function (i) {
cp_list.push(i.id);
})
- var cp_full = [], promises = [];
- promises.push(
- egCore.pcrud.search('ccbi', { bucket: bucketSvc.currentBucket.a[2], "target_copy": { "in": cp_list } }).then(
- null,
- null,
- function (ccbi) {
- cp_full.push(egCore.idl.toHash(ccbi, true));
- }
- )
- );
egCore.net.request(
'open-ils.actor',
'open-ils.actor.anon_cache.set_value',
null, 'print-labels-these-copies', {
- copies : cp_full
+ copies : cp_list
}
).then(function(key) {
- $q.all(promises).then(function () {
- if (cp_full.length > 0) {
- if (key) {
- var url = egCore.env.basePath + 'cat/printlabels/' + key;
- $timeout(function() { $window.open(url, '_blank') });
- } else {
- alert('Could not create anonymous cache key!');
- }
- } else {
- alert('Could not print label export');
- }
- });
+ if (key) {
+ var url = egCore.env.basePath + 'cat/printlabels/' + key;
+ $timeout(function() { $window.open(url, '_blank') });
+ } else {
+ alert('Could not create anonymous cache key!');
+ }
});
}