* Finish task #83954.
This commit is contained in:
+26
-1
@@ -1887,7 +1887,7 @@ class actionModel extends model
|
||||
|
||||
if($action->objectType == 'execution')
|
||||
{
|
||||
$execution = $this->dao->select('id, project, grade, parent, status, deleted')->from(TABLE_EXECUTION)->where('id')->eq($action->objectID)->fetch();
|
||||
$execution = $this->dao->select('id, type, project, grade, parent, status, deleted')->from(TABLE_EXECUTION)->where('id')->eq($action->objectID)->fetch();
|
||||
$this->loadModel('common')->syncExecutionByChild($execution);
|
||||
}
|
||||
}
|
||||
@@ -2221,4 +2221,29 @@ class actionModel extends model
|
||||
|
||||
$this->loadModel('search')->setSearchParams($this->config->trash->search);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore stages.
|
||||
*
|
||||
* @param array $stageList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function restoreStages($stageList)
|
||||
{
|
||||
$deletedActions = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectID')->in(array_keys($stageList))
|
||||
->andWhere('objectType')->eq('execution')
|
||||
->andWhere('action')->eq('deleted')
|
||||
->orderBy('id_desc')
|
||||
->fetchGroup('objectID');
|
||||
|
||||
foreach($stageList as $stageID => $stage)
|
||||
{
|
||||
$deletedAction = $deletedActions[$stageID][0];
|
||||
$this->dao->update(TABLE_EXECUTION)->set('deleted')->eq('0')->where('id')->eq($stageID)->exec();
|
||||
$this->dao->update(TABLE_ACTION)->set('extra')->eq(ACTIONMODEL::BE_UNDELETED)->where('id')->eq($deletedAction->id)->exec();
|
||||
$this->create($deletedAction->objectType, $deletedAction->objectID, 'undeleted');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user