From a03c5b953e02ae187921b0fef6e33d841c596780 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 9 Jul 2018 16:01:07 +0800 Subject: [PATCH] * Finish task #4621. --- module/task/lang/en.php | 1 + module/task/lang/zh-cn.php | 1 + module/task/model.php | 6 ++++++ module/task/view/assignto.html.php | 10 ++++------ module/task/view/pause.html.php | 9 +++++++++ module/task/view/recordestimate.html.php | 10 ++++------ 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 3f9c88db00..38add30f65 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -183,6 +183,7 @@ $lang->task->error->left = 'Please enter "Left Hour"'; $lang->task->error->work = '"Remark" must be less than %d characteres.'; $lang->task->error->skipClose = 'Task: %s is not “Done” or “Cancelled”. Do you want to close it?'; $lang->task->error->consumed = 'Task: %s Hour must be more than 0. Ignore changes to this Task.'; +$lang->task->error->assignedTo = 'Multiple task in the current state cannot be assigned to member who outside the task team.'; /* Report. */ $lang->task->report = new stdclass(); diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index c77d1c29f3..dee4bdf397 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -183,6 +183,7 @@ $lang->task->error->left = '请填写"剩余"'; $lang->task->error->work = '"备注"必须小于%d个字符'; $lang->task->error->skipClose = '任务:%s 不是“已完成”或“已取消”状态,确定要关闭吗?'; $lang->task->error->consumed = '任务:%s工时不能小于0,忽略该任务工时的改动'; +$lang->task->error->assignedTo = '当前状态的多人任务不能指派给任务团队外的成员。'; /* Report. */ $lang->task->report = new stdclass(); diff --git a/module/task/model.php b/module/task/model.php index 7f0efdf5ac..65a7fec37b 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -581,6 +581,12 @@ class taskModel extends model $teams = array(); if($this->post->multiple) { + if(strpos(',done,closed,cancel,', ",{$task->status},") === false && !in_array($this->post->assignedTo, $this->post->team)) + { + dao::$errors[] = $this->lang->task->error->assignedTo; + return false; + } + foreach($this->post->team as $row => $account) { if(empty($account) or isset($team[$account])) continue; diff --git a/module/task/view/assignto.html.php b/module/task/view/assignto.html.php index befb86256e..b11a77de99 100644 --- a/module/task/view/assignto.html.php +++ b/module/task/view/assignto.html.php @@ -15,12 +15,10 @@
team) && $task->assignedTo != $this->app->user->account):?> -
-
- -
-

task->deniedNotice, '' . $task->assignedToRealName . '', $lang->task->transfer);?>

-
+
+ +
+

task->deniedNotice, '' . $task->assignedToRealName . '', $lang->task->transfer);?>

diff --git a/module/task/view/pause.html.php b/module/task/view/pause.html.php index 23ebab98e1..49e7b97ade 100644 --- a/module/task/view/pause.html.php +++ b/module/task/view/pause.html.php @@ -14,6 +14,14 @@
+ team) && $task->assignedTo != $this->app->user->account):?> +
+ +
+

task->deniedNotice, '' . $task->assignedToRealName . '', $lang->task->pause);?>

+
+
+

id;?> @@ -40,6 +48,7 @@
+

diff --git a/module/task/view/recordestimate.html.php b/module/task/view/recordestimate.html.php index 73d4b578f2..4f0ae677a1 100644 --- a/module/task/view/recordestimate.html.php +++ b/module/task/view/recordestimate.html.php @@ -18,12 +18,10 @@
team) && $task->assignedTo != $this->app->user->account):?> -
-
- -
-

task->deniedNotice, '' . $task->assignedToRealName . '', $lang->task->logEfforts);?>

-
+
+ +
+

task->deniedNotice, '' . $task->assignedToRealName . '', $lang->task->logEfforts);?>