From 52fe01ba0d8f45efdbb1ffe13591d3268cd3c447 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 29 Dec 2025 10:29:44 +0800 Subject: [PATCH 1/2] * [refac bug #68659] Check isClickable when feedback convert to story. --- framework/base/router.class.php | 4 ++-- module/story/model.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 3d0dcad3a4..c6873e4418 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -3926,8 +3926,8 @@ class ztSessionHandler implements SessionHandlerInterface public function gc($maxlifeTime): int|false { /* API session never expires. */ - if(!isset($this->config->sessionVar)) return 0; - if((defined('RUN_MODE') && RUN_MODE == 'api') || isset($_GET[$this->config->sessionVar])) return 0; + global $config; + if((defined('RUN_MODE') && RUN_MODE == 'api') || isset($_GET[$config->sessionVar])) return 0; $time = time(); $count = 0; diff --git a/module/story/model.php b/module/story/model.php index 1520e73c0b..16a7cc44db 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3892,6 +3892,9 @@ class storyModel extends model if($action == 'submitreview' && strpos('draft,changing', $story->status) === false) return false; if($action == 'createtestcase' || $action == 'batchcreatetestcase') return $config->vision != 'lite' && $story->isParent == '0' && $story->type == 'story'; + /* Check isClickable when feedback convert to story. */ + if($action == 'create' && $app->rawModule == 'feedback') return ($config->global->flow == 'full' && strpos('closed|clarify|noreview', $story->status) === false); + if($action == 'createtask') { if($app->tab == 'project' && !empty($_SESSION['project'])) From 2f714fc96a8a6d029cb07babc37a58fa9f1023a2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 29 Dec 2025 10:46:31 +0800 Subject: [PATCH 2/2] * [refac bug #68659] Adjust unit test. --- module/story/test/model/isclickable.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/test/model/isclickable.php b/module/story/test/model/isclickable.php index 0d4cce389c..299d397b22 100755 --- a/module/story/test/model/isclickable.php +++ b/module/story/test/model/isclickable.php @@ -20,6 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php'; su('admin'); zenData('story')->gen(5); +zenData('case')->gen(0); global $tester; $storyModel = $tester->loadModel('story'); @@ -31,4 +32,4 @@ r($storyModel::isClickable($story, 'close')) && p() && e('1'); // 判断 r($storyModel::isClickable($story, 'activate')) && p() && e('0'); // 判断需求2是否有激活按钮操作权限 r($storyModel::isClickable($story, 'assignto')) && p() && e('1'); // 判断需求2是否有指派按钮操作权限 r($storyModel::isClickable($story, 'createcase')) && p() && e('1'); // 判断需求2是否有创建用例按钮操作权限 -r($storyModel::isClickable($story, 'batchcreate')) && p() && e('0'); // 判断需求2是否有批量创建按钮操作权限 \ No newline at end of file +r($storyModel::isClickable($story, 'batchcreate')) && p() && e('1'); // 判断需求2是否有批量创建按钮操作权限 \ No newline at end of file