* finish task #1202.

This commit is contained in:
wangyidong
2014-08-13 09:03:41 +00:00
parent 5e9ac3f2bc
commit fd0f8e02f2
13 changed files with 117 additions and 3 deletions

View File

@@ -595,6 +595,38 @@ class task extends control
$this->display();
}
/**
* Pause task.
*
* @param int $taskID
* @access public
* @return void
*/
public function pause($taskID)
{
$this->commonAction($taskID);
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->task->pause($taskID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('task', $taskID, 'Paused', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
$this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->pause;
$this->view->position[] = $this->lang->task->pause;
$this->display();
}
/**
* Close a task.
*