diff --git a/module/task/model.php b/module/task/model.php index 1b7d064e60..e704e0cf98 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2899,9 +2899,10 @@ class taskModel extends model $estimate = fixer::input('post')->cleanINT('consumed,left')->get(); $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->gt, $this->lang->task->record, '0'); - if($estimate->left < 0) return dao::$errors[] = sprintf($this->lang->error->ge, $this->lang->task->left, '0'); + if(helper::isZeroDate($estimate->date)) return dao::$errors[] = $this->lang->task->error->dateEmpty; + if($estimate->date > $today) return dao::$errors[] = $this->lang->task->error->date; + if($estimate->consumed <= 0) return dao::$errors[] = sprintf($this->lang->error->gt, $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); $this->dao->update(TABLE_EFFORT)->data($estimate) diff --git a/module/task/view/editestimate.html.php b/module/task/view/editestimate.html.php index adcf41f721..68e530732c 100644 --- a/module/task/view/editestimate.html.php +++ b/module/task/view/editestimate.html.php @@ -23,12 +23,12 @@
| task->date;?> | -date, 'class="form-control form-date"');?> | +date, 'class="form-control form-date"');?> | |
|---|---|---|---|
| task->record;?> | -consumed, 'class="form-control"');?> | +consumed, 'class="form-control"');?> | |
| task->left;?> | @@ -57,7 +57,8 @@ $(function() var $this = $(this); var $left = $('#left'); - if(!$left.prop('readonly') && $left.val() === '0') + var left = $.trim($left.val()); + if(!$left.prop('readonly') && left == 0) { e.preventDefault(); bootbox.confirm(confirmRecord, function(result)