service.mark_discard = function(copy) {
if (!copy) return $q.when();
- // Make sure the copy status is fleshed.
- if (!isNaN(copy.status)) {
- service.flesh_copy_status(copy);
- }
var doRefresh = copy.refresh;
var arg = {};
- if (copy.status.id == 1) {
+ if (copy["status.id"] == 1) {
egConfimDialog.open(
egCore.strings.MARK_DISCARD_CHECKED_OUT,
egCore.strings.MARK_DISCARD_CONTINUE,
).result.then(function() {
arg.handle_checkin = 1;
});
- } else if (copy.status.id == 6) {
+ } else if (copy["status.id"] == 6) {
egConfimDialog.open(
egCore.strings.MARK_DISCARD_IN_TRANSIT,
egCore.strings.MARK_DISCARD_CONTINUE,
).result.then(function() {
arg.handle_transit = 1;
});
- } else if (copy.status.restrict_copy_delete == "t") {
+ } else if (copy["status.restrict_copy_delete"] == "t") {
egConfimDialog.open(
egCore.strings.MARK_DISCARD_RESTRICT_DELETE,
egCore.strings.MARK_DISCARD_CONTINUE,