* adjust for edit effort.

This commit is contained in:
wangyidong
2022-09-13 13:37:13 +08:00
parent 0142653d2b
commit 09694f3751
2 changed files with 9 additions and 15 deletions
+6 -12
View File
@@ -1038,12 +1038,9 @@ class task extends control
return print(js::error(dao::getError()));
}
if($this->post->comment != '' or !empty($changes))
{
$act = $this->post->left == 0 ? 'Finished' : 'Started';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$act = $this->post->left == 0 ? 'Finished' : 'Started';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
$this->executeHooks($taskID);
$this->loadModel('common')->syncPPEStatus($taskID);
@@ -1447,12 +1444,9 @@ class task extends control
$changes = $this->task->start($taskID);
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$act = $this->post->left == 0 ? 'Finished' : 'Restarted';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$act = $this->post->left == 0 ? 'Finished' : 'Restarted';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
$this->executeHooks($taskID);
+3 -3
View File
@@ -1744,7 +1744,7 @@ class taskModel extends model
$estimate->account = $this->app->user->account;
$estimate->consumed = (!empty($oldTask->team) and $currentTeam) ? $estimate->consumed - $currentTeam->consumed : $estimate->consumed - $oldTask->consumed;
if($this->post->comment) $estimate->work = $this->post->comment;
$estimateID = $this->addTaskEstimate($estimate);
if($estimate->consumed > 0) $estimateID = $this->addTaskEstimate($estimate);
if(!empty($oldTask->team) and $currentTeam)
{
@@ -1754,7 +1754,7 @@ class taskModel extends model
$team->status = empty($team->left) ? 'done' : 'doing';
$this->dao->update(TABLE_TASKTEAM)->data($team)->where('id')->eq($currentTeam->id)->exec();
if($oldTask->mode == 'linear') $this->updateEstimateOrder($estimateID, $currentTeam->order);
if($oldTask->mode == 'linear' and !empty($estimateID)) $this->updateEstimateOrder($estimateID, $currentTeam->order);
$task = $this->computeHours4Multiple($oldTask, $task);
if($team->status == 'done')
@@ -2885,7 +2885,7 @@ class taskModel extends model
$today = helper::today();
if($estimate->date > $today) return dao::$errors[] = $this->lang->task->error->date;
if($estimate->consumed < 0) return dao::$errors[] = sprintf($this->lang->error->ge, $this->lang->task->record, '0');
if($estimate->consumed <= 0) return dao::$errors[] = sprintf($this->lang->error->ge, $this->lang->task->record, '0');
if($estimate->left < 0) return dao::$errors[] = sprintf($this->lang->error->ge, $this->lang->task->left, '0');
$task = $this->getById($oldEstimate->objectID);