diff --git a/config/zentaopms.php b/config/zentaopms.php index d8f5a4e1ad..528edaf4d0 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -312,6 +312,7 @@ $config->openMethods[] = 'system.editdomain'; $config->openMethods[] = 'doc.uploaddocs'; $config->openMethods[] = 'cron.schedule'; $config->openMethods[] = 'cron.consume'; +$config->openMethods[] = 'caselib.importfromlib'; $config->openModules = array(); $config->openModules[] = 'install'; diff --git a/module/caselib/control.php b/module/caselib/control.php index c07ca9560d..34a4649497 100644 --- a/module/caselib/control.php +++ b/module/caselib/control.php @@ -560,6 +560,28 @@ class caselib extends control $this->display(); } + /** + * Import case from lib to caseLib. + * + * @param int $productID + * @param int $branch + * @param int $libID + * @param string $orderBy + * @param string $browseType + * @param int $queryID + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @param int $projectID + * @param bool $toLib + * @access public + * @return void + */ + public function importFromLib($productID, $branch = 0, $libID = 0, $orderBy = 'id_desc', $browseType = '', $queryID = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0, $toLib = true) + { + echo $this->fetch('testcase', 'importFromLib', "productID=$productID&libID=$libID&branch=$branch&orderBy=$orderBy&browseType=$browseType&queryID=$queryID&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID&toLib=$toLib"); + } + /** * Show import case. * diff --git a/module/caselib/view/browse.html.php b/module/caselib/view/browse.html.php index c4d6dc0b76..c888dc56a5 100644 --- a/module/caselib/view/browse.html.php +++ b/module/caselib/view/browse.html.php @@ -59,7 +59,17 @@ js::set('flow', $config->global->flow); ?>
" . $lang->caselib->exportTemplate, '', "class='btn btn-link export' data-width='40%'");?> - " . $lang->testcase->fileImport, '', "class='btn btn-link export'");?> +
+ + +
createLink('caselib', 'create'), " " . $lang->caselib->create, '', 'class="btn btn-secondary"');?>