control.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <?php
  2. /**
  3. * The control file of caselib module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package caselib
  9. * @version $Id: control.php 5114 2013-07-12 06:02:59Z chencongzhi520@gmail.com $
  10. * @link https://www.zentao.net
  11. */
  12. class caselib extends control
  13. {
  14. /**
  15. * 主页,跳转到浏览页面。
  16. * Index page, header to browse.
  17. *
  18. * @access public
  19. * @return void
  20. */
  21. public function index()
  22. {
  23. $this->locate($this->createLink('caselib', 'browse'));
  24. }
  25. /**
  26. * 创建一个用例库。
  27. * Create a lib.
  28. *
  29. * @access public
  30. * @return void
  31. */
  32. public function create()
  33. {
  34. if(!empty($_POST))
  35. {
  36. /* Set case lib. */
  37. $data = form::data($this->config->caselib->form->create);
  38. $lib = $data->setForce('type', 'library')
  39. ->add('addedBy', $this->app->user->account)
  40. ->add('addedDate', helper::now())
  41. ->setIF($this->lang->navGroup->caselib != 'qa', 'project', (int)$this->session->project)
  42. ->stripTags($this->config->caselib->editor->create['id'], $this->config->allowedTags)
  43. ->get();
  44. $lib = $this->loadModel('file')->processImgURL($lib, $this->config->caselib->editor->create['id'], $this->post->uid);
  45. /* Insert case lib. */
  46. $libID = $this->caselib->create($lib);
  47. if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
  48. if($this->viewType == 'json') return array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $libID);
  49. return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'load' => $this->createLink('caselib', 'browse', "libID=$libID")));
  50. }
  51. $libraries = $this->caselib->getLibraries();
  52. $libID = $this->caselibZen->saveLibState(0, $libraries);
  53. $this->caselib->setLibMenu($libraries, $libID);
  54. $this->view->title = $this->lang->caselib->common . $this->lang->hyphen . $this->lang->caselib->create;
  55. $this->display();
  56. }
  57. /**
  58. * 编辑用例库。
  59. * Edit a case lib.
  60. *
  61. * @param int $libID
  62. * @access public
  63. * @return void
  64. */
  65. public function edit($libID)
  66. {
  67. if(!empty($_POST))
  68. {
  69. $formData = form::data($this->config->caselib->form->edit, $libID);
  70. $lib = $this->caselibZen->prepareEditExtras($formData, $libID);
  71. $this->caselib->update($lib);
  72. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  73. $message = $this->executeHooks($libID);
  74. if(!$message) $message = $this->lang->saveSuccess;
  75. $link = inlink('browse', "libID={$libID}");
  76. return $this->sendSuccess(array('message' => $message, 'closeModal' => true, 'callback' => "loadPage(\"$link\", '#heading #dropmenu, #main');"));
  77. }
  78. /* Set lib menu. */
  79. $libraries = $this->caselib->getLibraries();
  80. $libID = $this->caselibZen->saveLibState($libID, $libraries);
  81. $this->caselib->setLibMenu($libraries, $libID);
  82. $this->view->title = $libraries[$libID] . $this->lang->hyphen . $this->lang->caselib->edit;
  83. $this->view->lib = $this->caselib->getByID($libID);
  84. $this->display();
  85. }
  86. /**
  87. * 编辑用例。
  88. * Edit a case.
  89. *
  90. * @param int $caseID
  91. * @access public
  92. * @return void
  93. */
  94. public function editCase($caseID)
  95. {
  96. echo $this->fetch('testcase', 'edit', "caseID=$caseID");
  97. }
  98. /**
  99. * 删除一个用例库。
  100. * Delete a case lib.
  101. *
  102. * @param int $libID
  103. * @access public
  104. * @return void
  105. */
  106. public function delete($libID)
  107. {
  108. $this->caselib->delete($libID);
  109. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  110. $message = $this->executeHooks($libID);
  111. if(!$message) $message = $this->lang->saveSuccess;
  112. return $this->send(array('result' => 'success', 'message' => $message, 'load' => $this->createLink('caselib', 'browse'), 'closeModal' => true));
  113. }
  114. /**
  115. * 展示用例库的用例。
  116. * Show library case.
  117. *
  118. * @param int $libID
  119. * @param string $browseType
  120. * @param int $param
  121. * @param string $orderBy
  122. * @param int $recTotal
  123. * @param int $recPerPage
  124. * @param int $pageID
  125. * @access public
  126. * @return void
  127. * @param string $from
  128. * @param int $blockID
  129. */
  130. public function browse($libID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $from = 'qa', $blockID = 0)
  131. {
  132. $libraries = $this->caselib->getLibraries();
  133. if(empty($libraries))
  134. {
  135. if($from == 'doc' || $from == 'ai')
  136. {
  137. $this->app->loadLang('doc');
  138. return $this->send(array('result' => 'fail', 'message' => $this->lang->doc->tips->noCaselib));
  139. }
  140. $this->locate(inlink('create'));
  141. }
  142. /* Set browse type. */
  143. $browseType = strtolower($browseType);
  144. $libID = $this->caselibZen->saveLibState($libID, $libraries);
  145. /* Save session and cookie. */
  146. $this->caselibZen->setBrowseSessionAndCookie($libID, $browseType, $param);
  147. /* Set lib menu. */
  148. $this->caselib->setLibMenu($libraries, $libID);
  149. /* Set module and query id. */
  150. $moduleID = ($browseType == 'bymodule') ? $param : ($browseType == 'bysearch' ? 0 : ($this->cookie->libCaseModule ? $this->cookie->libCaseModule : 0));
  151. $queryID = ($browseType == 'bysearch') ? $param : 0;
  152. /* Build the search form. */
  153. $actionURL = $this->createLink('caselib', 'browse', "libID={$libID}&browseType=bySearch&queryID=myQueryID&orderBy={$orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}&from={$from}&blockID={$blockID}");
  154. $this->caselibZen->buildSearchForm($libID, $libraries, $queryID, $actionURL);
  155. /* Load pager. */
  156. $this->app->loadClass('pager', true);
  157. $pager = pager::init($recTotal, $recPerPage, $pageID);
  158. /* Save query session .*/
  159. $sort = common::appendOrder($orderBy);
  160. $cases = $this->caselib->getLibCases($libID, $browseType, (int)$queryID, $moduleID, $sort, $pager, $from);
  161. $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', true);
  162. $this->loadModel('testcase');
  163. $this->view->title = $this->lang->caselib->common . $this->lang->hyphen . $libraries[$libID];
  164. $this->view->libID = $libID;
  165. $this->view->libName = $libraries[$libID];
  166. $this->view->cases = $cases;
  167. $this->view->orderBy = $orderBy;
  168. $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
  169. $this->view->modules = $this->loadModel('tree')->getOptionMenu($libID, 'caselib', 0);
  170. $this->view->moduleTree = $this->tree->getTreeMenu($libID, 'caselib', 0, array('treeModel', 'createCaseLibLink'));
  171. $this->view->modulePairs = !empty($this->config->caselib->browse->showModule) ? $this->tree->getModulePairs($libID, 'caselib', $this->config->caselib->browse->showModule) : array();
  172. $this->view->pager = $pager;
  173. $this->view->browseType = $browseType;
  174. $this->view->moduleID = $moduleID;
  175. $this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all;
  176. $this->view->param = $param;
  177. $this->view->setModule = true;
  178. $this->view->showBranch = false;
  179. $this->view->from = $from;
  180. $this->view->blockID = $blockID;
  181. $this->view->idList = '';
  182. if($from == 'doc')
  183. {
  184. $docBlock = $this->loadModel('doc')->getDocBlock($blockID);
  185. $this->view->docBlock = $docBlock;
  186. if($docBlock)
  187. {
  188. $content = json_decode($docBlock->content, true);
  189. if(isset($content['idList'])) $this->view->idList = $content['idList'];
  190. }
  191. }
  192. $this->display();
  193. }
  194. /**
  195. * 创建用例库的测试用例。
  196. * Create case for library.
  197. *
  198. * @param int $libID
  199. * @param int $moduleID
  200. * @param int $param
  201. * @access public
  202. * @return void
  203. */
  204. public function createCase($libID, $moduleID = 0, $param = 0)
  205. {
  206. if(!empty($_POST))
  207. {
  208. $this->loadModel('testcase');
  209. helper::setcookie('lastLibCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
  210. $case = form::data($this->config->testcase->form->create)->add('lib', $_POST['lib'] ? $this->post->lib : $libID)
  211. ->setIF(($this->config->testcase->needReview && strpos($this->config->testcase->forceNotReview, $this->app->user->account) === false) || (!empty($this->config->testcase->forceReview) && strpos($this->config->testcase->forceReview, $this->app->user->account) !== false), 'status', 'wait')
  212. ->get();
  213. $steps = $case->steps;
  214. $expects = $case->expects;
  215. foreach($expects as $key => $value)
  216. {
  217. if(!empty($value) and empty($steps[$key])) dao::$errors['message']["steps$key"] = sprintf($this->lang->testcase->stepsEmpty, $key);
  218. }
  219. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  220. $this->testcase->create($case);
  221. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  222. /* If link from no head then reload. */
  223. if(isInModal()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
  224. $params = $libID == $case->lib ? "libID={$libID}&browseType=byModule&param={$_POST['module']}" : "libID={$libID}";
  225. return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $this->createLink('caselib', 'browse', $params)));
  226. }
  227. /* Set lib menu. */
  228. $libraries = $this->caselib->getLibraries();
  229. $libID = $this->caselibZen->saveLibState($libID, $libraries);
  230. $this->caselib->setLibMenu($libraries, $libID);
  231. /* Assign case params. */
  232. $this->caselibZen->assignCaseParamsForCreateCase($param);
  233. foreach(explode(',', $this->config->caselib->customCreateFields) as $field) $customFields[$field] = $this->lang->testcase->$field;
  234. /* Show the variables associated. */
  235. $this->app->loadLang('testcase');
  236. $this->view->title = $libraries[$libID] . $this->lang->hyphen . $this->lang->testcase->create;
  237. $this->view->showFields = $this->config->caselib->custom->createFields;
  238. $this->view->customFields = $customFields;
  239. $this->view->libraries = $libraries;
  240. $this->view->libID = $libID;
  241. $this->view->currentModuleID = $moduleID ? $moduleID : $this->cookie->lastLibCaseModule;
  242. $this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, 'caselib', 0);
  243. $this->display();
  244. }
  245. /**
  246. * 批量创建用例。
  247. * Batch create case.
  248. *
  249. * @param int $libID
  250. * @param int $moduleID
  251. * @access public
  252. * @return void
  253. */
  254. public function batchCreateCase($libID, $moduleID = 0)
  255. {
  256. $this->loadModel('testcase');
  257. if(!empty($_POST))
  258. {
  259. $cases = $this->caselibZen->prepareCasesForBathcCreate($libID);
  260. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  261. foreach($cases as $case) $this->testcase->create($case);
  262. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  263. if(isInModal()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
  264. return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $this->createLink('caselib', 'browse', "libID={$libID}&browseType=byModule&param={$moduleID}"), 'closeModal' => true));
  265. }
  266. $libraries = $this->caselib->getLibraries();
  267. if(empty($libraries)) $this->locate(inlink('create'));
  268. /* Set lib menu. */
  269. $this->caselib->setLibMenu($libraries, $libID);
  270. $this->view->title = $libraries[$libID] . $this->lang->hyphen . $this->lang->testcase->batchCreate;
  271. $this->view->libID = $libID;
  272. $this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, 'caselib', 0);
  273. $this->view->currentModuleID = $moduleID;
  274. $this->display();
  275. }
  276. /**
  277. * 批量编辑用例。
  278. * Batch edit case.
  279. *
  280. * @param int $libID
  281. * @param string|int $branch
  282. * @param string $type
  283. * @access public
  284. * @return void
  285. */
  286. public function batchEditCase($libID, $branch = '', $type = '')
  287. {
  288. $this->config->testcase->edit->requiredFields = str_replace(array('story', 'scene'), '', $this->config->testcase->edit->requiredFields);
  289. $this->config->testcase->list->customBatchEditFields = 'module,stage,precondition,status,pri,keywords';
  290. echo $this->fetch('testcase', 'batchEdit', "libID=$libID&branch=$branch&type=$type");
  291. }
  292. /**
  293. * 查看用例库信息。
  294. * View a library.
  295. *
  296. * @param int $libID
  297. * @access public
  298. * @return void
  299. */
  300. public function view($libID)
  301. {
  302. $lib = $this->caselib->getByID($libID, true);
  303. if(!$lib) return $this->send(array('result' => 'success', 'load' => array('alert' => $this->lang->notFound, 'locate' => $this->createLink('qa', 'index'))));
  304. /* Set lib menu. */
  305. $libraries = $this->caselib->getLibraries();
  306. $this->caselib->setLibMenu($libraries, $libID);
  307. $this->app->loadLang('testcase');
  308. $this->view->title = $lib->name . $this->lang->hyphen . $this->lang->caselib->view;
  309. $this->view->lib = $lib;
  310. $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
  311. $this->view->actions = $this->loadModel('action')->getList('caselib', $libID);
  312. $this->display();
  313. }
  314. /**
  315. * 查看用例。
  316. * View a case.
  317. *
  318. * @param int $caseID
  319. * @param int $version
  320. * @access public
  321. * @return void
  322. * @param string $from
  323. * @param int $taskID
  324. */
  325. public function viewCase($caseID, $version = 0, $from = 'testcase', $taskID = 0, $stepsType = '')
  326. {
  327. echo $this->fetch('testcase', 'view', "caseID=$caseID&version=$version&from=$from&taskID=$taskID&stepsType=$stepsType");
  328. }
  329. /**
  330. * 通过 AJAX 获取用例库的 1.5 级菜单。
  331. * Ajax get drop menu.
  332. *
  333. * @param int $libID
  334. * @param string $module
  335. * @param string $method
  336. * @param string $extra
  337. * @access public
  338. * @return void
  339. */
  340. public function ajaxGetDropMenu($libID, $module, $method, $extra = '')
  341. {
  342. $libraries = $this->caselib->getLibraries();
  343. $this->view->link = $this->caselib->getLibLink($module, $method);
  344. $this->view->libID = $libID;
  345. $this->view->libraries = $libraries;
  346. $this->view->librariesPinyin = common::convert2Pinyin($libraries);
  347. $this->display();
  348. }
  349. /**
  350. * Export template.
  351. *
  352. * @param int $libID
  353. * @access public
  354. * @return void
  355. */
  356. public function exportTemplate($libID)
  357. {
  358. if($_POST)
  359. {
  360. $this->loadModel('testcase');
  361. $modules = $this->loadModel('tree')->getOptionMenu($libID, 'caselib', 0);
  362. $fields = $this->caselibZen->getFieldsForExportTemplate();
  363. $rows = $this->caselibZen->getRowsForExportTemplate($this->post->num ? (int)$this->post->num : 0, $modules);
  364. $this->post->set('fields', $fields);
  365. $this->post->set('kind', 'testcase');
  366. $this->post->set('rows', $rows);
  367. $this->post->set('extraNum', $num);
  368. $this->post->set('fileName', 'template');
  369. $this->fetch('file', 'export2csv', $_POST);
  370. }
  371. $this->display();
  372. }
  373. /**
  374. * 导入用例。
  375. * Import case by csv file.
  376. *
  377. * @param int $libID
  378. * @access public
  379. * @return void
  380. */
  381. public function import($libID)
  382. {
  383. $this->loadModel('testcase');
  384. if($_POST)
  385. {
  386. $file = $this->loadModel('file')->getUpload('file');
  387. if(empty($_FILES)) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
  388. if(empty($file[0])) return $this->send(array('result' => 'fail', 'message' => $this->lang->testcase->errorFileNotEmpty));
  389. $file = $file[0];
  390. if(!$file || (isset($file['extension']) && $file['extension'] != 'csv')) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
  391. $fileName = $this->file->savePath . $this->file->getSaveName($file['pathname']);
  392. move_uploaded_file($file['tmpname'], $fileName);
  393. $fields = $this->testcase->getImportFields();
  394. $fields = array_flip($fields);
  395. list($header, $columns) = $this->caselibZen->getImportHeaderAndColumns($fileName, $fields);
  396. if(count($columns) <= 3 || $this->post->encode != 'utf-8')
  397. {
  398. $encode = $this->post->encode != 'utf-8' ? $this->post->encode : 'gbk';
  399. $fc = file_get_contents($fileName);
  400. $fc = helper::convertEncoding($fc, $encode, 'utf-8');
  401. file_put_contents($fileName, $fc);
  402. list($header, $columns) = $this->caselibZen->getImportHeaderAndColumns($fileName, $fields);
  403. if(count($columns) == 0) return $this->send(array('result' => 'fail', 'message' => $this->lang->testcase->errorEncode));
  404. }
  405. $this->session->set('fileImport', $fileName);
  406. return $this->send(array('result' => 'success', 'load' => inlink('showImport', "libID={$libID}"), 'closeModal' => true));
  407. }
  408. $this->display();
  409. }
  410. /**
  411. * 展示导入的用例记录。
  412. * Show import case.
  413. *
  414. * @param int $libID
  415. * @param int $pageID
  416. * @param int $maxImport
  417. * @param string|int $insert 0 is covered old, 1 is insert new.
  418. * @access public
  419. * @return void
  420. */
  421. public function showImport($libID, $pageID = 1, $maxImport = 0, $insert = '')
  422. {
  423. $this->loadModel('testcase');
  424. $file = $this->session->fileImport;
  425. $tmpPath = $this->loadModel('file')->getPathOfImportedFile();
  426. $tmpFile = $tmpPath . DS . md5(basename($file));
  427. if($_POST)
  428. {
  429. $this->caselib->createFromImport($libID);
  430. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  431. if(!$this->post->isEndPage) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('showImport', "libID=$libID&pageID=" . ((int)$this->post->pageID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', ''))));
  432. @unlink($tmpFile);
  433. return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('browse', "libID=$libID")));
  434. }
  435. $libraries = $this->caselib->getLibraries();
  436. if(empty($libraries)) $this->locate(inlink('create'));
  437. $this->caselib->setLibMenu($libraries, $libID);
  438. $fields = $this->caselibZen->getFieldsForImport();
  439. list($caseData, $stepVars) = $this->caselibZen->getDataForImport($maxImport, $tmpFile, $fields);
  440. if(empty($maxImport) || !file_exists($tmpFile)) $pageID = 1;
  441. $this->caselibZen->responseAfterShowImport($libID, $caseData, $maxImport, $pageID, $stepVars);
  442. $totalPages = 1;
  443. $totalAmount = count($caseData);
  444. if($totalAmount > $this->config->file->maxImport && $maxImport)
  445. {
  446. $totalPages = ceil($totalAmount / $maxImport);
  447. $caseData = array_slice($caseData, ($pageID - 1) * $maxImport, $maxImport, true);
  448. }
  449. $this->view->title = $this->lang->caselib->common . $this->lang->hyphen . $this->lang->testcase->showImport;
  450. $this->view->cases = $this->dao->select('id,module,stage,status,pri,type')->from(TABLE_CASE)->where('lib')->eq($libID)->andWhere('deleted')->eq(0)->andWhere('product')->eq(0)->fetchAll('id');
  451. $this->view->modules = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0);
  452. $this->view->caseData = $caseData;
  453. $this->view->libID = $libID;
  454. $this->view->isEndPage = $pageID >= $totalPages;
  455. $this->view->totalAmount = $totalAmount;
  456. $this->view->totalPages = $totalPages;
  457. $this->view->pageID = $pageID;
  458. $this->view->maxImport = $maxImport;
  459. $this->view->dataInsert = $insert;
  460. $this->display();
  461. }
  462. /**
  463. * 导出用例。
  464. * Export case.
  465. *
  466. * @param int $libID
  467. * @param string $orderBy
  468. * @param string $browseType
  469. * @access public
  470. * @return void
  471. */
  472. public function exportCase($libID, $orderBy = 'id_desc', $browseType = 'all')
  473. {
  474. $lib = $this->caselib->getById($libID);
  475. if($_POST)
  476. {
  477. $fields = $this->caselibZen->getExportCasesFields();
  478. $cases = $this->caselib->getCasesToExport($this->post->exportType, $orderBy, (int)$this->post->limit);
  479. $cases = $this->caselibZen->processCasesForExport($cases, $libID);
  480. $this->post->set('fields', $fields);
  481. $this->post->set('rows', $cases);
  482. $this->post->set('kind', 'testcase');
  483. $this->fetch('file', 'export2' . $this->post->fileType, $_POST);
  484. }
  485. $fileName = $this->lang->testcase->common;
  486. $browseType = isset($this->lang->caselib->featureBar['browse'][$browseType]) ? $this->lang->caselib->featureBar['browse'][$browseType] : '';
  487. $this->view->fileName = $lib->name . $this->lang->dash . $browseType . $fileName;
  488. $this->view->allExportFields = $this->config->caselib->exportFields;
  489. $this->view->customExport = true;
  490. $this->display();
  491. }
  492. }