* code for task#1478.

This commit is contained in:
zhujinyong
2013-07-03 06:15:37 +00:00
parent 1abc0b6546
commit db9a49eef6
2 changed files with 12 additions and 2 deletions
+2 -1
View File
@@ -448,7 +448,8 @@ class task extends control
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('task', $taskID, 'Started', $this->post->comment);
$act = $this->post->left == 0 ? 'Finished' : 'Started';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
+10 -1
View File
@@ -384,12 +384,21 @@ class taskModel extends model
if($this->post->consumed < $oldTask->consumed) die(js::error($this->lang->task->error->consumedSmall));
$now = helper::now();
$task = fixer::input('post')
->setDefault('status', 'doing')
->setDefault('assignedTo', $this->app->user->account)
->setDefault('assignedDate', $now)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->remove('comment')->get();
if($this->post->left == 0)
{
$task->status = 'done';
$task->finishedBy = $this->app->user->account;
$task->finishedDate = helper::now();
}
else
{
$task->status = 'doing';
}
$this->setStatus($task);
$this->dao->update(TABLE_TASK)->data($task)