diff --git a/module/testcase/control.php b/module/testcase/control.php index fda3c10423..ec1599aa1b 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1902,7 +1902,7 @@ class testcase extends control $this->view->product = $product; $this->view->productID = $productID; $this->view->branch = $branch; - $this->view->cases = $this->loadModel('testsuite')->getNotImportedCases($productID, $libID, $orderBy, $pager, $browseType, $queryID); + $this->view->cases = $this->loadModel('testsuite')->getLibCases($productID, $libID, $orderBy, $pager, $browseType, $queryID); $this->view->modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch === 'all' ? 0 : (int)$branch); $this->view->libModules = $this->tree->getOptionMenu($libID, 'caselib'); $this->view->pager = $pager; diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 9a905698b3..f995a6dc75 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -314,7 +314,7 @@ class testsuiteModel extends model } /** - * Get not imported cases. + * Get lib cases. * * @param int $productID * @param int $libID @@ -323,7 +323,7 @@ class testsuiteModel extends model * @access public * @return array */ - public function getNotImportedCases($productID, $libID, $orderBy = 'id_desc', $pager = null, $browseType = '', $queryID = 0) + public function getLibCases($productID, $libID, $orderBy = 'id_desc', $pager = null, $browseType = '', $queryID = 0, $param = '') { $importedCases = $this->dao->select('fromCaseID')->from(TABLE_CASE) ->where('product')->eq($productID) @@ -361,18 +361,17 @@ class testsuiteModel extends model ->beginIF($browseType != 'bysearch')->andWhere('lib')->eq($libID)->fi() ->beginIF($browseType == 'bysearch')->andWhere($query)->fi() ->andWhere('product')->eq(0) - ->andWhere('id')->notIN($importedCases) + ->beginIF(strpos($param, "canimport") !== false)->andWhere('id')->notIN($importedCases)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); } - /** - * Build testsuite menu. - * - * @param object $suite - * @param string $type + * Build testsuite menu. + * + * @param object $suite + * @param string $type * @access public * @return string */