'[% l("Item [_1] needs to be routed to [_2]",
"{{copy.barcode()}}","{{copy.location().name()}}") %]';
s.MARK_DAMAGED_CONFIRM = '[% l("Mark {{num_items}} items as DAMAGED?") %]';
+s.MARK_DISCARD_CONFIRM = '[% l("Mark {{num_items}} items as DISCARD/WEED?") %]';
s.MARK_MISSING_CONFIRM = '[% l("Mark {{num_items}} items as MISSING?") %]';
s.ABORT_TRANSIT_CONFIRM = '[% l("Cancel {{num_transits}} transits?") %]';
s.ROUTE_TO_HOLDS_SHELF = '[% l("Holds Shelf") %]';
}).result;
}
+ service.mark_discard = function(copy_ids) {
+ return egConfirmDialog.open(
+ egCore.strings.MARK_DISCARD_CONFIRM, '',
+ { num_items : copy_ids.length,
+ ok : function() {},
+ cancel : function() {}
+ }
+ ).result.then(function() {
+ var promises = [];
+ angular.forEach(copy_ids, function(copy_id) {
+ promises.push(
+ egCore.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.mark_item_discard',
+ egCore.auth.token(), copy_id
+ ).then(function(resp) {
+ if (evt = egCore.evt.parse(resp)) {
+ console.error('mark discard/weed failed: ' + evt);
+ }
+ })
+ );
+ });
+
+ return $q.all(promises);
+ });
+ }
+
service.mark_missing = function(copy_ids) {
return egConfirmDialog.open(
egCore.strings.MARK_MISSING_CONFIRM, '',