* Finish task#7109.

This commit is contained in:
leiyong
2020-04-28 02:29:20 -07:00
parent 1c29b742a0
commit 85a55e41bd
3 changed files with 21 additions and 1 deletions
+1
View File
@@ -728,6 +728,7 @@ class task extends control
if(!empty($_POST))
{
$changes = $this->task->recordEstimate($taskID);
if(dao::isError()) die(js::error(dao::getError()));
/* Remind whether to update status of the bug, if task which from that bug has been finished. */
$task = $this->task->getById($taskID);
+1
View File
@@ -198,6 +198,7 @@ $lang->task->createDenied = '你不能在该项目添加任务';
$lang->task->cannotDeleteParent = '不能删除父任务。';
$lang->task->error = new stdclass();
$lang->task->error->totalNumber = '"总计消耗"必须为数字';
$lang->task->error->consumedNumber = '"本次消耗"必须为数字';
$lang->task->error->estimateNumber = '"预计剩余"必须为数字';
$lang->task->error->recordMinus = '工时不能为负数';
+19 -1
View File
@@ -1205,7 +1205,25 @@ class taskModel extends model
*/
public function recordEstimate($taskID)
{
$record = fixer::input('post')->get();
$record = fixer::input('post')->get();
foreach($record->consumed as $item)
{
if(!is_numeric($item))
{
dao::$errors[] = $this->lang->task->error->totalNumber;
return false;
}
}
foreach($record->left as $item)
{
if(!is_numeric($item))
{
dao::$errors[] = $this->lang->task->error->estimateNumber;
return false;
}
}
$estimates = array();
$task = $this->getById($taskID);
$earliestTime = '';