From d2782dc46ac92a0bb2ce2d1bbf151543c9826cb3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 13 Apr 2023 16:37:20 +0800 Subject: [PATCH] * Resolve issue #775. --- module/common/model.php | 1 - module/doc/control.php | 2 +- module/doc/view/doclist.html.php | 1 - module/doc/view/tablecontents.html.php | 2 +- module/execution/control.php | 4 ++-- module/execution/model.php | 4 ---- 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 836b67b452..6213c93030 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -605,7 +605,6 @@ class commonModel extends model if(strpos('|bug|execution|kanbanspace|', "|$objectType|") !== false) $needPrintDivider = true; $hasPriv = common::hasPriv($module, $createMethod); - if($hasPriv and $objectType == 'doc' and !common::hasPriv('doc', 'tableContents')) $hasPriv = false; if(!$hasPriv and $objectType == 'doc' and common::hasPriv('api', 'create')) $hasPriv = true; if(!$hasPriv) continue; diff --git a/module/doc/control.php b/module/doc/control.php index 292aca8197..76e954e343 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1282,7 +1282,7 @@ class doc extends control $queryID = $browseType == 'bySearch' ? (int)$param : 0; $params = "objectID=$objectID&libID=$libID&moduleID=0&browseType=bySearch&orderBy=$orderBy¶m=myQueryID"; if($this->app->rawMethod == 'tablecontents') $params = "type=$type&" . $params; - $actionURL = $this->createLink('doc', $this->app->rawMethod, $params); + $actionURL = $this->createLink($this->app->rawModule, $this->app->rawMethod, $params); if($libType == 'api') { $this->loadModel('api')->buildSearchForm($lib, $queryID, $actionURL, $libs, $type); diff --git a/module/doc/view/doclist.html.php b/module/doc/view/doclist.html.php index 7f6e2e26bd..e20f81e770 100644 --- a/module/doc/view/doclist.html.php +++ b/module/doc/view/doclist.html.php @@ -42,7 +42,6 @@ body {margin-bottom: 25px;} recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> -rawMethod == 'tablecontents') $vars = "type=$type&" . $vars;?>
diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index 6167492df2..8e1561939b 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -22,7 +22,7 @@ doc->featureBar['tableContents'] as $barType => $barName):?> - rawMethod == 'tablecontents' ? "type=$type&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$barType": "objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$barType";?> + createLink('doc', $app->rawMethod, $linkParams), "{$barName}" . ($active ? " {$pager->recTotal}" : ''), '', "class='btn btn-link $active' id='{$barType}Tab'");?> diff --git a/module/execution/control.php b/module/execution/control.php index b965e77c91..234acba3dc 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4181,9 +4181,9 @@ class execution extends control * @access public * @return void */ - public function doc($executionID) + public function doc($executionID, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { - echo $this->fetch('doc', 'tableContents', "type=execution&objectID=$executionID"); + echo $this->fetch('doc', 'tableContents', "type=execution&objectID=$executionID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy¶m=$param&recTotal=$recTotal&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); } /** diff --git a/module/execution/model.php b/module/execution/model.php index 6128e7ffc2..faa7a92ad8 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2212,10 +2212,6 @@ class executionModel extends model { $link = helper::createLink('doc', $method, "type=execution&objectID=%s&from=execution"); } - elseif($module == 'api') - { - $link = helper::createLink('doc', 'tableContents', "type=execution&objectID=%s&from=execution"); - } elseif(in_array($module, array('issue', 'risk', 'opportunity', 'pssp', 'auditplan', 'nc', 'meeting'))) { $link = helper::createLink($module, 'browse', "executionID=%s&from=execution");