diff --git a/module/task/model.php b/module/task/model.php index 00cd12c2d3..bcf456d564 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -1652,7 +1652,7 @@ class taskModel extends model { $currentTeam = $this->getTeamByAccount($oldTask->team); if($currentTeam and $this->post->consumed < $currentTeam->consumed) dao::$errors['consumed'] = $this->lang->task->error->consumedSmall; - if($currentTeam and $currentTeam->status == 'doing') dao::$errors[] = $this->lang->task->error->alreadyStarted; + if($currentTeam and $currentTeam->status == 'doing' and $oldTask->status == 'doing') dao::$errors[] = $this->lang->task->error->alreadyStarted; } else { @@ -1695,7 +1695,7 @@ class taskModel extends model $estimate->left = zget($_POST, 'left', 0); $estimate->work = zget($task, 'work', ''); $estimate->account = $this->app->user->account; - $estimate->consumed = !empty($oldTask->team) ? $estimate->consumed - $oldTask->team[$this->app->user->account]->consumed : $estimate->consumed - $oldTask->consumed; + $estimate->consumed = (!empty($oldTask->team) and $currentTeam) ? $estimate->consumed - $currentTeam->consumed : $estimate->consumed - $oldTask->consumed; if($this->post->comment) $estimate->work = $this->post->comment; $this->addTaskEstimate($estimate); diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 8c7e71a1cd..ec27286625 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -283,10 +283,17 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field) status == 'done') $memberDisabled = true; - if($member->status != 'wait' and $task->mode == 'linear') $sortDisabled = true; + $memberStatus = $member->status; + if($memberStatus == 'done') $memberDisabled = true; + if($memberStatus != 'wait' and $task->mode == 'linear') $sortDisabled = true; + if($task->mode == 'linear' and strpos('|closed|cancel|pause|', $task->status) !== false) + { + $memberStatus = $task->status; + $memberDisabled = true; + $sortDisabled = true; + } ?> - + account, "class='form-control chosen'" . ($memberDisabled ? ' disabled' : ''))?> account);?>