unitcases.html.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * The unitcases view file of testtask module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Yuting Wang <wangyuting@easycorp.ltd>
  7. * @package testtask
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('allTestcases', $lang->testcase->allTestcases);
  12. $canExport = hasPriv('testcase', 'export');
  13. featureBar();
  14. toolbar
  15. (
  16. set::items
  17. (
  18. array
  19. (
  20. $canExport ? array('class' => 'ghost', 'icon' => 'export', 'text' => $lang->export, 'url' => $this->createLink('testcase', 'export', "productID=$productID&orderBy=t1.id&taskID=$taskID&browseType="), 'data-toggle' => 'modal') : null,
  21. array('class' => 'ghost', 'icon' => 'back', 'text' => $lang->goback, 'url' => $this->session->testtaskList ? $this->session->testtaskList : $this->createLink('testtask', 'browseUnits'))
  22. )
  23. )
  24. );
  25. $config->testcase->actionList['runResult']['url'] = array('module' => 'testtask', 'method' => 'results', 'params' => 'runID={id}&caseID={case}');
  26. $cols = $config->testtask->unitgroup->dtable->fieldList;
  27. $cols['actions']['list'] = $config->testcase->actionList;
  28. $cols['actions']['width'] = '60px';
  29. $cols['id']['name'] = 'case';
  30. $cols['title']['link']['params'] = 'caseID={case}';
  31. $cols['bugs']['link']['params'] = 'runID={id}&caseID={case}';
  32. foreach($cols as $field => $param) $cols[$field]['sortType'] = false;
  33. $runs = initTableData($runs, $cols);
  34. dtable
  35. (
  36. set::id('groupCaseTable'),
  37. set::userMap($users),
  38. set::cols($cols),
  39. set::data($runs),
  40. set::plugins(array('cellspan')),
  41. set::onRenderCell(jsRaw('window.onRenderCell')),
  42. set::getCellSpan(jsRaw('window.getCellSpan')),
  43. set::footPager(usePager(array
  44. (
  45. 'recPerPage' => $pager->recPerPage,
  46. 'recTotal' => $pager->recTotal
  47. )))
  48. );
  49. render();