* Update time of task when edit team time or record estimate.
This commit is contained in:
@@ -165,6 +165,7 @@ $lang->task->remindBug = "This Task is converted from a Bug. Do you
|
||||
$lang->task->confirmChangeProject = "If you change {$lang->projectCommon}, the related Module, Story and Assignor will be changed. Do you want to do it?";
|
||||
$lang->task->confirmFinish = '"Left Hour" is 0. Do you want to change the Status to "Done"?';
|
||||
$lang->task->confirmRecord = '"Left Hour" is 0. Do you want to set Task as "Done"?';
|
||||
$lang->task->confirmTransfer = '"Left Hour" is 0,Do you want to transfer task?';
|
||||
$lang->task->noticeLinkStory = "No story has been linked. You can %s for this project, then %s.";
|
||||
$lang->task->noticeSaveRecord = 'Your Hour is not saved. Please save it first.';
|
||||
$lang->task->commentActions = '%s. %s, commented by <strong>%s</strong>.';
|
||||
|
||||
@@ -165,6 +165,7 @@ $lang->task->remindBug = "该任务为Bug转化得到,是否更新
|
||||
$lang->task->confirmChangeProject = "修改{$lang->projectCommon}会导致相应的所属模块、相关需求和指派人发生变化,确定吗?";
|
||||
$lang->task->confirmFinish = '"预计剩余"为0,确认将任务状态改为"已完成"吗?';
|
||||
$lang->task->confirmRecord = '"剩余"为0,任务将标记为"已完成",您确定吗?';
|
||||
$lang->task->confirmTransfer = '"当前剩余"为0,任务将被转交,您确定吗?';
|
||||
$lang->task->noticeLinkStory = "没有可关联的相关需求,您可以为当前项目%s,然后%s";
|
||||
$lang->task->noticeSaveRecord = '您有尚未保存的工时记录,请先将其保存。';
|
||||
$lang->task->commentActions = '%s. %s, 由 <strong>%s</strong> 添加备注。';
|
||||
|
||||
+37
-14
@@ -445,6 +445,9 @@ class taskModel extends model
|
||||
$teams = array();
|
||||
if($this->post->multiple)
|
||||
{
|
||||
$consumed = 0;
|
||||
$estimate = 0;
|
||||
$left = 0;
|
||||
foreach($this->post->team as $row => $account)
|
||||
{
|
||||
if(empty($account) or isset($team[$account])) continue;
|
||||
@@ -457,15 +460,26 @@ class taskModel extends model
|
||||
$member->type = 'task';
|
||||
$member->estimate = $this->post->teamEstimate[$row] ? $this->post->teamEstimate[$row] : 0;
|
||||
$member->consumed = $this->post->teamConsumed[$row] ? $this->post->teamConsumed[$row] : 0;
|
||||
$member->left = $member->estimate - $member->consumed;
|
||||
$member->left = $this->post->teamLeft[$row] ? $this->post->teamLeft[$row] : ($member->estimate - $member->consumed);
|
||||
$member->order = $row;
|
||||
$teams[$account] = $member;
|
||||
}
|
||||
|
||||
if(!empty($teams) and !isset($task->assignedTo))
|
||||
$consumed += (float)$member->consumed;
|
||||
$estimate += (float)$member->estimate;
|
||||
$left += (float)$member->left;
|
||||
}
|
||||
|
||||
if(!empty($teams))
|
||||
{
|
||||
$firstMember = reset($teams);
|
||||
$task->assignedTo = $firstMember->account;
|
||||
$task->consumed = $consumed;
|
||||
$task->estimate = $estimate;
|
||||
$task->left = $left;
|
||||
|
||||
if(!isset($task->assignedTo))
|
||||
{
|
||||
$firstMember = reset($teams);
|
||||
$task->assignedTo = $firstMember->account;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -945,19 +959,28 @@ class taskModel extends model
|
||||
$data->consumed = $teamTime->consumed;
|
||||
$data->left = $teamTime->leftTime;
|
||||
|
||||
if($task->status == 'done')
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $data->left;
|
||||
$newTask->consumed = $data->consumed;
|
||||
|
||||
if($left != 0 || $task->assignedTo != $teams[count($teams) - 1])
|
||||
{
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $data->left;
|
||||
$newTask->consumed = $data->consumed;
|
||||
$newTask->assignedTo = $this->getNextUser($teams, $task->assignedTo);
|
||||
$newTask->assignedDate = $now;
|
||||
$newTask->status = 'doing';
|
||||
if($task->assignedTo != $teams[count($teams) - 1] && $left == 0)
|
||||
{
|
||||
$newTask->assignedTo = $this->getNextUser($teams, $task->assignedTo);
|
||||
$newTask->assignedDate = $now;
|
||||
}
|
||||
|
||||
$task->status = $oldStatus;
|
||||
$this->dao->update(TABLE_TASK)->data($newTask)->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($task->assignedTo != $teams[count($teams) - 1]) return common::createChanges($task, $newTask);
|
||||
|
||||
$data->assignedTo = $task->openedBy; // Fix bug#1345
|
||||
$changes = common::createChanges($task, $newTask);
|
||||
if(!empty($actionID)) $this->action->logHistory($actionID, $changes);
|
||||
return $changes;
|
||||
}
|
||||
|
||||
$data->assignedTo = $task->openedBy;
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($taskID)->exec();
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php js::set('confirmRecord', $lang->task->confirmRecord);?>
|
||||
<?php $team = array_keys($task->team);?>
|
||||
<?php js::set('confirmRecord', (!empty($team) && $task->assignedTo != end($team)) ? $lang->task->confirmTransfer : $lang->task->confirmRecord);?>
|
||||
<?php js::set('noticeSaveRecord', $lang->task->noticeSaveRecord);?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
|
||||
Reference in New Issue
Block a user