[% INCLUDE 'staff/cat/bucket/copy/t_grid_menu.tt2' %]
- <eg-grid-action label="[% l('Request Selected Copies') %]"
+ <eg-grid-action label="[% l('Remove Selected Copies from Bucket') %]" group="[% l('Bucket') %]"
+ handler="detachCopies"></eg-grid-action>
+ <eg-grid-action label="[% l('Request Selected Copies') %]" group="[% l('Items') %]"
handler="requestItems"></eg-grid-action>
- <eg-grid-action label="[% l('Edit Selected Copies') %]"
+ <eg-grid-action label="[% l('Edit Selected Copies') %]" group="[% l('Items') %]"
handler="spawnHoldingsEdit"></eg-grid-action>
- <eg-grid-action label="[% l('Remove Selected Copies from Bucket') %]"
- handler="detachCopies"></eg-grid-action>
- <eg-grid-action label="[% l('Transfer Selected Copies to Marked Volume') %]"
+ <eg-grid-action handler="print_labels" group="[% l('Show') %]"
+ label="[% l('Print Labels') %]"></eg-grid-action>
+ <eg-grid-action label="[% l('Transfer Selected Copies to Marked Volume') %]" group="[% l('Items') %]"
handler="transferCopies"></eg-grid-action>
- <eg-grid-action label="[% l('Delete Selected Copies from Catalog') %]"
+ <eg-grid-action label="[% l('Delete Selected Copies from Catalog') %]" group="[% l('Items') %]"
handler="deleteCopiesFromCatalog"></eg-grid-action>
<eg-grid-field path="id" required hidden></eg-grid-field>
});
}
+ $scope.print_labels = function() {
+ var cp_list = []
+ angular.forEach($scope.gridControls.selectedItems(), function (i) {
+ cp_list.push(i.id);
+ })
+
+ egCore.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.anon_cache.set_value',
+ null, 'print-labels-these-copies', {
+ copies : cp_list
+ }
+ ).then(function(key) {
+ if (key) {
+ var url = egCore.env.basePath + 'cat/printlabels/' + key;
+ $timeout(function() { $window.open(url, '_blank') });
+ } else {
+ alert('Could not create anonymous cache key!');
+ }
+ });
+ }
+
$scope.requestItems = function() {
var copy_list = $scope.gridControls.selectedItems().map(
function (i) {