From 8201825aa61b8ea8d104d39ffe25fdc7d65f77ee Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 23 Dec 2024 14:11:11 +0800 Subject: [PATCH] * [bug#58488,doing,1.5h] add confirm story change button. --- module/execution/model.php | 36 +++++++++++++++++++++------- module/project/config/dtable.php | 5 ++++ module/project/ui/execution.html.php | 1 + 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index d25b7ad0d9..d9b3162b31 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1971,6 +1971,14 @@ class executionModel extends model $delay = count($actualDays) - 1; if($delay > 0) $task->delay = $delay; } + + /* Story changed or not. */ + $task->needConfirm = false; + if(!empty($task->storyStatus) && $task->storyStatus == 'active' && $task->latestStoryVersion > $task->storyVersion) + { + $task->needConfirm = true; + $task->status = 'changed'; + } } } @@ -4772,17 +4780,27 @@ class executionModel extends model foreach($tasks as $task) { - foreach($this->config->project->execution->dtable->actionsRule['task'] as $action) + if(!$canModify) continue; + if($task->status == 'changed') { - $rawAction = str_replace('Task', '', $action); - if(!$canModify) continue; - if(!commonModel::hasPriv('task', $rawAction)) continue; - if(!common::hasDBPriv($task, 'task', $rawAction)) continue; + if(!commonModel::hasPriv('task', 'confirmStoryChange')) continue; + if(!common::hasDBPriv($task, 'task', 'confirmStoryChange')) continue; + $clickable = $this->task->isClickable($task, 'confirmStoryChange'); + $task->actions[] = array('name' => 'confirmStoryChange', 'disabled' => !$clickable); + } + else + { + foreach($this->config->project->execution->dtable->actionsRule['task'] as $action) + { + $rawAction = str_replace('Task', '', $action); + if(!commonModel::hasPriv('task', $rawAction)) continue; + if(!common::hasDBPriv($task, 'task', $rawAction)) continue; - $clickable = $this->task->isClickable($task, $rawAction); - $action = array('name' => $action); - if(!$clickable) $action['disabled'] = true; - $task->actions[] = $action; + $clickable = $this->task->isClickable($task, $rawAction); + $action = array('name' => $action); + if(!$clickable) $action['disabled'] = true; + $task->actions[] = $action; + } } $prefixLabel = "{$task->pri} "; diff --git a/module/project/config/dtable.php b/module/project/config/dtable.php index 89ca4e9b5b..9b405f2c79 100755 --- a/module/project/config/dtable.php +++ b/module/project/config/dtable.php @@ -313,6 +313,11 @@ $config->project->execution->dtable->fieldList['actions']['actionsMap']['batchCr $config->project->execution->dtable->fieldList['actions']['actionsMap']['batchCreate']['hint'] = $lang->task->batchCreate; $config->project->execution->dtable->fieldList['actions']['actionsMap']['batchCreate']['url'] = helper::createLink('task', 'batchCreate', 'execution={execution}&storyID={story}&moduleID={module}&taskID={rawID}'); +$config->project->execution->dtable->fieldList['actions']['actionsMap']['confirmStoryChange']['icon'] = 'search'; +$config->project->execution->dtable->fieldList['actions']['actionsMap']['confirmStoryChange']['hint'] = $lang->task->confirmStoryChange; +$config->project->execution->dtable->fieldList['actions']['actionsMap']['confirmStoryChange']['url'] = helper::createLink('task', 'confirmStoryChange', 'taskID={rawID}'); +$config->project->execution->dtable->fieldList['actions']['actionsMap']['confirmStoryChange']['data-app'] = $app->tab; + $config->project->execution->dtable->actionsRule['scrum'] = array('start', 'createTask', 'edit', 'close|activate', 'delete'); $config->project->execution->dtable->actionsRule['kanban'] = array('start', 'createTask', 'edit', 'close|activate', 'delete'); $config->project->execution->dtable->actionsRule['agileplus'] = array('start', 'createTask', 'edit', 'close|activate', 'delete'); diff --git a/module/project/ui/execution.html.php b/module/project/ui/execution.html.php index 33d5c88997..eac1fae9ab 100644 --- a/module/project/ui/execution.html.php +++ b/module/project/ui/execution.html.php @@ -81,6 +81,7 @@ $fieldList['name']['name'] = 'nameCol'; $fieldList['actions']['width'] = '160'; foreach(array_keys($fieldList['actions']['actionsMap']) as $actionKey) unset($fieldList['actions']['actionsMap'][$actionKey]['text']); +$fieldList['status']['statusMap']['changed'] = $lang->task->storyChange; $executions = $this->execution->generateRow($executionStats, $users, $avatarList);