s.CONFIRM_CHANGE_ITEMS_MESSAGE.reset = "[% l('Will reset {{items}} item(s) to Expected and remove unit(s).') %]";
s.CONFIRM_CHANGE_ITEMS.receive = "[% l('Receive selected items?') %]"
s.CONFIRM_CHANGE_ITEMS_MESSAGE.receive = "[% l('Will receive {{items}} item(s) without barcoding.') %]";
+ s.CONFIRM_CHANGE_ITEMS.status = "[% l('Change status selected items?') %]"
+ s.CONFIRM_CHANGE_ITEMS_MESSAGE.status = "[% l('Will change status of {{items}} item(s).') %]";
s.CONFIRM_DELETE_MFHDS = "[% l('Delete selected MFHD(s)?') %]";
s.CONFIRM_DELETE_MFHDS_MESSAGE = "[% l('Will delete {{items}} MFHD(s).') %]";
<eg-grid-action handler="edit_issuance_holding_code"
label="[% l('Edit issue holding codes') %]"></eg-grid-action>
+ <eg-grid-action handler="set_selected_as_claimed"
+ label="[% l('Mark as claimed') %]"></eg-grid-action>
+ <eg-grid-action handler="set_selected_as_discarded"
+ label="[% l('Mark as discarded') %]"></eg-grid-action>
+ <eg-grid-action handler="set_selected_as_not_published"
+ label="[% l('Mark as not published') %]"></eg-grid-action>
+ <eg-grid-action handler="set_selected_as_not_held"
+ label="[% l('Mark as not held') %]"></eg-grid-action>
+
<eg-grid-action handler="reset_selected"
label="[% l('Reset items') %]"></eg-grid-action>
}), true, true, $scope.do_print_routing_lists, function(){reload($scope.ssubId,_paging_filter)});
}
+ $scope.set_selected_as_claimed = function(list) {
+ return egSerialsCoreSvc.set_item_status('Claimed', $scope.bibId, list.map(function(item) {
+ return egCore.idl.Clone(egSerialsCoreSvc.itemMap[item.id]);
+ }), function(){reload($scope.ssubId,_paging_filter)});
+ }
+ $scope.set_selected_as_discarded = function(list) {
+ return egSerialsCoreSvc.set_item_status('Discarded', $scope.bibId, list.map(function(item) {
+ return egCore.idl.Clone(egSerialsCoreSvc.itemMap[item.id]);
+ }), function(){reload($scope.ssubId,_paging_filter)});
+ }
+ $scope.set_selected_as_not_published = function(list) {
+ return egSerialsCoreSvc.set_item_status('Not Published', $scope.bibId, list.map(function(item) {
+ return egCore.idl.Clone(egSerialsCoreSvc.itemMap[item.id]);
+ }), function(){reload($scope.ssubId,_paging_filter)});
+ }
+ $scope.set_selected_as_not_held = function(list) {
+ return egSerialsCoreSvc.set_item_status('Not Held', $scope.bibId, list.map(function(item) {
+ return egCore.idl.Clone(egSerialsCoreSvc.itemMap[item.id]);
+ }), function(){reload($scope.ssubId,_paging_filter)});
+ }
+
$scope.menu_print_routing_lists = function (items) {
items = items.map(function(item) {
return egCore.idl.Clone(egSerialsCoreSvc.itemMap[item.id]);
}
+ service.set_item_status = function(newStatus, bibId, list, callback) {
+ if (!callback) callback = function () { return $q.when() }
+ if (!list.length) return $q.reject();
+
+ return egConfirmDialog.open(
+ egCore.strings.CONFIRM_CHANGE_ITEMS.status,
+ egCore.strings.CONFIRM_CHANGE_ITEMS_MESSAGE.status,
+ {items : list.length}
+ ).result.then(function () {
+ var promises = [$q.when()];
+ angular.forEach(list, function(item) {
+ item.status(newStatus);
+ promises.push(
+ egCore.net.request(
+ 'open-ils.serial',
+ 'open-ils.serial.item.update',
+ egCore.auth.token(),
+ item
+ ).then(function(res) {
+ return $q.when();
+ })
+ );
+ });
+ $q.all(promises).then(function() {
+ callback();
+ });
+ });
+ }
+
service.process_items = function (mode, bibId, list, do_barcode, bind, print_rl, callback) {
if (!callback) callback = function () { return $q.when() }
if (!list.length) return $q.reject();