From 4778db197dfd2292d274ae4e0a8ec386a1c60bf7 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 28 Sep 2022 13:39:06 +0800 Subject: [PATCH 1/3] * Finish task #70017. --- module/execution/css/task.css | 1 + module/task/model.php | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/module/execution/css/task.css b/module/execution/css/task.css index 42eda4f7e7..20d6b20df0 100644 --- a/module/execution/css/task.css +++ b/module/execution/css/task.css @@ -11,3 +11,4 @@ td.delayed {background: #e84e0f !important; color: white;} #taskList .c-progress{padding-right: 8px; text-align: right;} #datatable-taskList .c-progress{padding-right: 8px; text-align: right;} .c-finishedBy, .c-lastEditedBy {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +#executionTaskForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #F4F5F7; margin: 0 4px 0 0;} diff --git a/module/task/model.php b/module/task/model.php index af049a7b81..a0108027e3 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -4140,10 +4140,24 @@ class taskModel extends model $storyChanged = !empty($task->storyStatus) && $task->storyStatus == 'active' && $task->latestStoryVersion > $task->storyVersion && !in_array($task->status, array('cancel', 'closed')); if($storyChanged) return $this->buildMenu('task', 'confirmStoryChange', $params, $task, 'browse', '', 'hiddenwin'); + $canStart = ($task->status != 'pause' and common::hasPriv('task', 'start')); + $canRestart = ($task->status == 'pause' and common::hasPriv('task', 'restart')); + $canFinish = common::hasPriv('task', 'finish'); + $canClose = common::hasPriv('task', 'close'); + $canRecordEstimate = common::hasPriv('task', 'recordEstimate'); + $canEdit = common::hasPriv('task', 'edit'); + $canBatchCreate = ($this->config->vision == 'rnd' and common::hasPriv('task', 'batchCreate')); + if($task->status != 'pause') $menu .= $this->buildMenu('task', 'start', $params, $task, 'browse', '', '', 'iframe', true); if($task->status == 'pause') $menu .= $this->buildMenu('task', 'restart', $params, $task, 'browse', '', '', 'iframe', true); - $menu .= $this->buildMenu('task', 'close', $params, $task, 'browse', '', '', 'iframe', true); $menu .= $this->buildMenu('task', 'finish', $params, $task, 'browse', '', '', 'iframe', true); + $menu .= $this->buildMenu('task', 'close', $params, $task, 'browse', '', '', 'iframe', true); + + if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate)) + { + $menu .= "
"; + } + $menu .= $this->buildMenu('task', 'recordEstimate', $params, $task, 'browse', 'time', '', 'iframe', true); $menu .= $this->buildMenu('task', 'edit', $params, $task, 'browse'); if($this->config->vision == 'rnd') From c20403745074db58e4cbde28791b2b8cb710ba80 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 28 Sep 2022 13:51:12 +0800 Subject: [PATCH 2/3] * Finish task #70017. --- module/my/css/task.css | 1 + module/my/view/task.html.php | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/module/my/css/task.css b/module/my/css/task.css index 55c85389c0..bb99a08527 100644 --- a/module/my/css/task.css +++ b/module/my/css/task.css @@ -36,3 +36,4 @@ html[lang="en"] .c-user-short {width: 88px;} [lang^=fr] #taskTable .assigned-title {width: 130px !important;} [lang^=fr] #taskTable .c-user-short {width: 75px;} [lang^=fr] #taskTable .c-status {width: 71px;} +#myTaskForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #F4F5F7; margin: 0 4px 0 0;} diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 69b47b7bfc..289ab3f422 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -44,8 +44,15 @@
- - +
@@ -151,11 +158,18 @@ } else { - $attr = isset($kanbanList[$task->execution]) ? "disabled" : ''; + $attr = isset($kanbanList[$task->execution]) ? "disabled" : ''; + $canStart = ($task->status != 'pause' and common::hasPriv('task', 'start')); + $canRestart = ($task->status == 'pause' and common::hasPriv('task', 'restart')); if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); + common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); + + if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate)) + { + echo "
"; + } common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true); common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, "data-width='95%'"); @@ -221,10 +235,17 @@ } else { + $canStart = ($child->status != 'pause' and common::hasPriv('task', 'start')); + $canRestart = ($child->status == 'pause' and common::hasPriv('task', 'restart')); if($child->status != 'pause') common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); if($child->status == 'pause') common::printIcon('task', 'restart', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); - common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); + common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); + + if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate)) + { + echo "
"; + } common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true); common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, "data-width='95%'"); From 6c4b6cd906702174355ca3b609985525ac4b938a Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 28 Sep 2022 13:54:52 +0800 Subject: [PATCH 3/3] * Finish task #70017. --- extension/lite/my/ext/view/task.html.php | 28 ++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/extension/lite/my/ext/view/task.html.php b/extension/lite/my/ext/view/task.html.php index 01f53c561d..51885c6128 100644 --- a/extension/lite/my/ext/view/task.html.php +++ b/extension/lite/my/ext/view/task.html.php @@ -35,8 +35,15 @@ - - +
@@ -134,10 +141,16 @@ } else { + $canStart = ($task->status != 'pause' and common::hasPriv('task', 'start')); + $canRestart = ($task->status == 'pause' and common::hasPriv('task', 'restart')); if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); - common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); + common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); + if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate)) + { + echo "
"; + } common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true, '', '', $task->project); common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, "data-width='95%'", '', $task->project); @@ -198,10 +211,17 @@ } else { + $canStart = ($child->status != 'pause' and common::hasPriv('task', 'start')); + $canRestart = ($child->status == 'pause' and common::hasPriv('task', 'restart')); if($child->status != 'pause') common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); if($child->status == 'pause') common::printIcon('task', 'restart', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); - common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); + common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); + + if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate)) + { + echo "
"; + } common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true, '', '', $child->project); common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', '', '', '', '', $child->project);