From 2a8d566bc2e206e8b58595dece7a906f6cad6755 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 6 Mar 2025 15:55:13 +0800 Subject: [PATCH] * [feedback#8646,done,1h] reload page if it's in task::view. --- module/task/config.php | 2 +- module/task/control.php | 2 ++ module/task/ui/view.html.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/task/config.php b/module/task/config.php index 33e2b08dcf..f3f666823a 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -156,7 +156,7 @@ $config->task->actionList['create']['data-app'] = $app->tab; $config->task->actionList['delete']['icon'] = 'trash'; $config->task->actionList['delete']['hint'] = $lang->task->delete; $config->task->actionList['delete']['text'] = $lang->task->delete; -$config->task->actionList['delete']['url'] = array('module' => 'task', 'method' => 'delete', 'params' => 'executionID={execution}&taskID={id}'); +$config->task->actionList['delete']['url'] = array('module' => 'task', 'method' => 'delete', 'params' => 'executionID={execution}&taskID={id}&from=view'); $config->task->actionList['delete']['data-confirm'] = array('message' => $lang->task->confirmDelete, 'icon' => 'icon-exclamation-sign', 'iconClass' => 'warning-pale rounded-full icon-2x'); $config->task->actionList['delete']['class'] = 'ajax-submit'; diff --git a/module/task/control.php b/module/task/control.php index 9c6a05a7d6..f6ce6c0e8b 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -999,6 +999,8 @@ class task extends control /* Respond when delete in kanban. */ if($from == 'taskkanban') return $this->send(array('result' => 'success', 'closeModal' => true, 'callback' => "refreshKanban()")); + if($from == 'view') return $this->send(array('result' => 'success', 'closeModal' => true, 'load' => true)); + $link = $this->session->taskList ? $this->session->taskList : $this->createLink('execution', 'task', "executionID={$task->execution}"); return $this->send(array('result' => 'success', 'load' => $link, 'closeModal' => true)); } diff --git a/module/task/ui/view.html.php b/module/task/ui/view.html.php index 1911864a79..78cf0e66c9 100644 --- a/module/task/ui/view.html.php +++ b/module/task/ui/view.html.php @@ -56,7 +56,7 @@ if(!empty($actions)) $actions = array_merge($actions['mainActions'], $hasDivider foreach($actions as $key => $action) { if(isset($action['url']) && strpos($action['url'], 'createBranch') !== false && empty($hasGitRepo)) unset($actions[$key]); - if(isset($action['url']) && strpos($action['url'], 'view') !== false && strpos($action['url'], 'review') === false) + if(isset($action['url']) && strpos($action['url'], 'view') !== false && strpos($action['url'], 'review') === false && strpos($action['url'], 'delete') === false) { if($isInModal) {