From 816999dbeb5c042de4da610b0241d1ca5f0a1f8f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 24 May 2022 14:41:42 +0800 Subject: [PATCH 1/3] * Finish task #55254. --- module/common/model.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index ab36bf5882..e84337e98d 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -918,6 +918,9 @@ class commonModel extends model public static function getMainNavList($moduleName) { global $lang; + global $app; + + $app->loadLang('my'); $menuOrder = $lang->mainNav->menuOrder; ksort($menuOrder); @@ -963,6 +966,22 @@ class commonModel extends model } } + /* Check whether other preference item under the module have permissions. If yes, point to other methods. */ + $moduleLinkList = $currentModule . 'LinkList'; + if(!$display and isset($lang->my->$moduleLinkList)) + { + foreach($lang->my->$moduleLinkList as $key => $linkList) + { + $method = explode('-', $key)[1]; + if(common::hasPriv($currentModule, $method)) + { + $display = true; + $currentMethod = $method; + break; + } + } + } + /* Check whether other methods under the module have permissions. If yes, point to other methods. */ if($display == false and isset($lang->$currentModule->menu)) { From 39a163e0a8a4a0a7a95db25b16ffdcc699a13a3b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 24 May 2022 16:04:10 +0800 Subject: [PATCH 2/3] * Fix bug for task #55254. --- module/common/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index e84337e98d..27e2443cc6 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -983,7 +983,7 @@ class commonModel extends model } /* Check whether other methods under the module have permissions. If yes, point to other methods. */ - if($display == false and isset($lang->$currentModule->menu)) + if($display == false and isset($lang->$currentModule->menu) and !in_array($currentModule, array('program', 'product', 'project', 'execution'))) { foreach($lang->$currentModule->menu as $menu) { From 7d4781fdd2ad73371d62b4d517641d0a2368f5a8 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 24 May 2022 16:13:37 +0800 Subject: [PATCH 3/3] * Fixed edit Execution Kanban save error. --- module/execution/model.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 108f02118b..3df5779489 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -369,12 +369,12 @@ class executionModel extends model $this->lang->project->code = $this->lang->execution->execCode; } - $sprintProject = isset($sprint->project) ? $sprint->project : ''; + $sprintProject = isset($sprint->project) ? $sprint->project : '0'; $this->dao->insert(TABLE_EXECUTION)->data($sprint) ->autoCheck($skipFields = 'begin,end') ->batchcheck($this->config->execution->create->requiredFields, 'notempty') ->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject") - ->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage')") + ->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban')") ->checkIF($sprint->begin != '', 'begin', 'date') ->checkIF($sprint->end != '', 'end', 'date') ->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin) @@ -511,18 +511,17 @@ class executionModel extends model } /* Update data. */ - $executionProject = isset($execution->project) ? $execution->project : ''; + $executionProject = isset($execution->project) ? $execution->project : '0'; $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck($skipFields = 'begin,end') ->batchcheck($this->config->execution->edit->requiredFields, 'notempty') ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) - ->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $executionProject") - ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')") + ->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject") + ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban')") ->checkFlow() ->where('id')->eq($executionID) - ->checkFlow() ->limit(1) ->exec();