diff --git a/module/task/js/recordestimate.js b/module/task/js/recordestimate.js index c6b8ad15d9..89b46d087b 100644 --- a/module/task/js/recordestimate.js +++ b/module/task/js/recordestimate.js @@ -7,3 +7,14 @@ $(function(){ }).dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_LEFT); }) +$("#recordForm").submit(function() +{ + $('#recordForm .left').each(function() + { + if($(this).val() !== '') left = $(this).val(); + }); + if(left === '0') + { + return confirm(confirmRecord); + } +}); diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 2e295a99c5..f40db8d6d2 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -142,6 +142,7 @@ $lang->task->delayWarning = " Postponed $lang->task->remindBug = "This task from Bug, update the Bug:%s or not?"; $lang->task->confirmChangeProject = 'Change project will change module, story and assignedTo also, are you sure?'; $lang->task->confirmFinish = '"Left" is 0, this task will be done. Are you sure?'; +$lang->task->confirmRecord = '"Left" is 0, this task will be done. Are you sure?'; $lang->task->error = new stdclass(); $lang->task->error->consumed = '"Consumed" must be number'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index ce07d7c0f7..d886da994b 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -142,6 +142,7 @@ $lang->task->delayWarning = " 延期%s $lang->task->remindBug = "该任务为Bug转化得到,是否更新Bug:%s ?"; $lang->task->confirmChangeProject = '修改项目会导致相应的所属模块、相关需求和指派人发生变化,确定吗?'; $lang->task->confirmFinish = '"预计剩余"为0,确认将任务状态改为"已完成"吗?'; +$lang->task->confirmRecord = '"剩余"为0,任务将标记为"已完成",您确定吗?'; $lang->task->error = new stdclass(); $lang->task->error->consumed = '"已经消耗"必须为数字'; diff --git a/module/task/model.php b/module/task/model.php index f0f79fad59..a6d9536223 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -437,6 +437,8 @@ class taskModel extends model } } + if(empty($estimates)) return; + $consumed = 0; $left = $task->left; $this->loadModel('action'); diff --git a/module/task/view/recordestimate.html.php b/module/task/view/recordestimate.html.php index 6faf9ce242..b891b0bf26 100644 --- a/module/task/view/recordestimate.html.php +++ b/module/task/view/recordestimate.html.php @@ -12,8 +12,8 @@ ?> -task->confirmFinish);?> -
+task->confirmRecord);?> + @@ -58,12 +58,12 @@ - + - +
name;?>