* Finish task #42415.

This commit is contained in:
tianshujie
2021-09-08 13:51:43 +08:00
parent 6d45dea345
commit aecf12e083
8 changed files with 14 additions and 3 deletions
+1
View File
@@ -223,6 +223,7 @@ $lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
$lang->task->error->date = 'The date should be >= today.';
/* Report. */
$lang->task->report = new stdclass();
+1
View File
@@ -226,6 +226,7 @@ $lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
$lang->task->error->date = 'The date should be >= today.';
/* Report. */
$lang->task->report = new stdclass();
+1
View File
@@ -223,6 +223,7 @@ $lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
$lang->task->error->date = 'The date should be >= today.';
/* Report. */
$lang->task->report = new stdclass();
+1
View File
@@ -223,6 +223,7 @@ $lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
$lang->task->error->date = 'The date should be >= today.';
/* Report. */
$lang->task->report = new stdclass();
+1
View File
@@ -226,6 +226,7 @@ $lang->task->error->realStartedEmpty = '实际开始不能为空';
$lang->task->error->finishedDateEmpty = '实际完成不能为空';
$lang->task->error->finishedDateSmall = '实际完成不能小于实际开始';
$lang->task->error->alreadyConsumed = '当前选中的父任务已有消耗。';
$lang->task->error->date = '日期不能大于今天';
/* Report. */
$lang->task->report = new stdclass();
+7 -1
View File
@@ -1474,12 +1474,14 @@ class taskModel extends model
public function recordEstimate($taskID)
{
$record = fixer::input('post')->get();
$today = helper::today();
/* Fix bug#3036. */
foreach($record->consumed as $id => $item) $record->consumed[$id] = trim($item);
foreach($record->left as $id => $item) $record->left[$id] = trim($item);
foreach($record->consumed as $id => $item) if(!is_numeric($item) and !empty($item)) dao::$errors[] = 'ID #' . $id . ' ' . $this->lang->task->error->totalNumber;
foreach($record->left as $id => $item) if(!is_numeric($item) and !empty($item)) dao::$errors[] = 'ID #' . $id . ' ' . $this->lang->task->error->leftNumber;
foreach($record->dates as $id => $item) if($item > $today) dao::$errors[] = 'ID #' . $id . ' ' . $this->lang->task->error->date;
if(dao::isError()) return false;
$estimates = array();
@@ -2340,7 +2342,11 @@ class taskModel extends model
{
$oldEstimate = $this->getEstimateById($estimateID);
$estimate = fixer::input('post')->get();
$task = $this->getById($oldEstimate->task);
$today = helper::today();
if($estimate->date > $today) return dao::$errors[] = $this->lang->task->error->date;
$task = $this->getById($oldEstimate->task);
$this->dao->update(TABLE_TASKESTIMATE)->data($estimate)
->autoCheck()
->check('consumed', 'notempty')
+1 -1
View File
@@ -23,7 +23,7 @@
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->task->date;?></th>
<td class='w-p45'><?php echo html::input('date', $estimate->date, 'class="form-control form-date" readonly');?></td>
<td class='w-p45'><?php echo html::input('date', $estimate->date, 'class="form-control form-date"');?></td>
<td></td>
</tr>
<tr>
+1 -1
View File
@@ -86,7 +86,7 @@
<?php for($i = 1; $i <= 3; $i++):?>
<tr class="text-center">
<td><?php echo $i . html::hidden("id[$i]", $i);?></td>
<td><?php echo html::input("dates[$i]", helper::today(), "class='form-control text-center form-date' readonly");?></td>
<td><?php echo html::input("dates[$i]", helper::today(), "class='form-control text-center form-date'");?></td>
<td><?php echo html::input("consumed[$i]", '', "class='form-control text-center'");?></td>
<td><?php echo html::input("left[$i]", '', "class='form-control text-center left'");?></td>
<td class="text-left"><?php echo html::textarea("work[$i]", '', "class='form-control' style='height:50px;'");?></td>