From f8d5bd6c78e4bf3826ed28fd286990bb86959ea4 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 17 Nov 2023 09:49:33 +0800 Subject: [PATCH] * Compatible parameter type. --- module/bug/control.php | 8 ++++---- module/bug/zen.php | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index a21444a55f..67c30f079a 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -105,7 +105,7 @@ class bug extends control /* Save the product id user last visited to session and cookie. */ $productID = $this->product->checkAccess($productID, $this->products); $product = $this->product->getByID($productID); - $branch = $this->bugZen->getBrowseBranch($branch, $product->type); + $branch = $this->bugZen->getBrowseBranch($branch, (string)$product->type); $browseType = $browseType ? strtolower($browseType) : 'unclosed'; /* 设置1.5级导航相关信息。*/ @@ -116,7 +116,7 @@ class bug extends control /* Set the order field. */ if(!$orderBy) $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc'; - $this->bugZen->setBrowseCookie($product, $branch, $browseType, $param, $orderBy); + $this->bugZen->setBrowseCookie((object)$product, $branch, $browseType, $param, $orderBy); $this->bugZen->setBrowseSession($browseType); @@ -127,9 +127,9 @@ class bug extends control $this->bugZen->buildBrowseSearchForm($productID, $branch, $queryID); $executions = $this->loadModel('execution')->getPairs($this->projectID, 'all', 'empty|withdelete|hideMultiple'); - $bugs = $this->bugZen->getBrowseBugs($product->id, $branch, $browseType, array_keys($executions), $moduleID, $queryID, $realOrderBy, $pager); + $bugs = $this->bugZen->getBrowseBugs((int)$product->id, $branch, $browseType, array_keys($executions), $moduleID, $queryID, $realOrderBy, $pager); - $this->bugZen->buildBrowseView($bugs, $product, $branch, $browseType, $moduleID, $executions, $param, $orderBy, $pager); + $this->bugZen->buildBrowseView($bugs, (object)$product, $branch, $browseType, $moduleID, $executions, $param, $orderBy, $pager); $this->display(); } diff --git a/module/bug/zen.php b/module/bug/zen.php index 27f9e16859..a775809c40 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -231,7 +231,8 @@ class bugZen extends bug */ private function getBranchOptions(int $productID): array { - $branches = $this->loadModel('branch')->getList($productID, 0, 'all'); + $branches = $this->loadModel('branch')->getList($productID, 0, 'all'); + $branchTagOption = array(); foreach($branches as $branchInfo) { $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); @@ -1028,7 +1029,7 @@ class bugZen extends bug /* 获取分支列表。*/ /* Get branch options. */ $branchTagOption = array(); - if($product->type != 'normal') $branchTagOption = $this->getBranchOptions($product->id); + if($product->type != 'normal') $branchTagOption = $this->getBranchOptions((int)$product->id); /* 获取需求和任务的 id 列表。*/ /* Get story and task id list. */ @@ -1052,12 +1053,12 @@ class bugZen extends bug $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($product->id, 'bug', $showModule) : array(); - $this->view->modules = $this->tree->getOptionMenu($product->id, 'bug', 0, $branch); - $this->view->moduleTree = $this->tree->getTreeMenu($product->id, 'bug', 0, array('treeModel', 'createBugLink'), array(), $branch); + $this->view->modules = $this->tree->getOptionMenu((int)$product->id, 'bug', 0, $branch); + $this->view->moduleTree = $this->tree->getTreeMenu((int)$product->id, 'bug', 0, array('treeModel', 'createBugLink'), array(), $branch); $this->view->branchTagOption = $branchTagOption; $this->view->projectPairs = $this->loadModel('project')->getPairsByProgram(); $this->view->executions = $executions; - $this->view->plans = $this->loadModel('productplan')->getPairs($product->id); + $this->view->plans = $this->loadModel('productplan')->getPairs((int)$product->id); $this->view->tasks = $this->loadModel('task')->getPairsByIdList($taskIdList); $this->view->stories = $this->loadModel('story')->getPairsByList($storyIdList); $this->view->builds = $this->loadModel('build')->getBuildPairs(array($product->id), $branch);