function get_status(id) {
var deferred = $q.defer()
- egCore.pcrud.retrieve('ccs', id, {atomic: true})
+ egCore.pcrud.search('ccs', ids)
.then(function(resp) {
- deferred.resolve(resp)
+ deferred.resolve(resp);
+ }, function(resp) {
+ deferred.reject(resp);
+ }, function(resp) {
+ deferred.notify(resp);
});
return deferred.promise;
}
- var promise = get_status(markstatus);
- return promise.then(function(newStatus) {
+ var newStatus, oldStatus;
+ var promise = get_status([markstatus,copy['status.id']]);
+ return promise.then(function(resp) {
return egConfirmDialog.open(
- 'Status',
- newStatus.name(),
+ 'Mark Item ' + newStatus.name(),
+ 'From ' + oldStatus.name(),
{
ok : function() {},
cancel : function() {}
}
).result;
+ }, function(resp) {
+ /* noop */
+ }, function(resp) {
+ if (resp.id() == markstatus)
+ newStatus = resp;
+ else
+ olStatus = resp;
});
}