build.html.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * The build view file of execution 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 Shujie Tian<tianshujie@easycorp.ltd>
  7. * @package execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. /* zin: Define the set::module('executionBuild') feature bar on main menu. */
  12. featureBar
  13. (
  14. set::current($type),
  15. set::linkParams("executionID={$execution->id}&type={key}&param={$param}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"),
  16. set::module('execution'),
  17. set::method('build'),
  18. div
  19. (
  20. set::className('w-44 mx-4'),
  21. picker
  22. (
  23. set::name('product'),
  24. set::value($product),
  25. set::items($products),
  26. set::placeholder($lang->product->common),
  27. on::change('changeProduct')
  28. )
  29. ),
  30. li(searchToggle(set::module('executionBuild'), set::open($type == 'bysearch')))
  31. );
  32. /* zin: Define the toolbar on main menu. */
  33. $canCreateBuild = hasPriv('build', 'create') && common::canModify('execution', $execution);
  34. if($canCreateBuild) $createItem = array('icon' => 'plus', 'class' => 'primary', 'text' => $lang->build->create, 'url' => $this->createLink('build', 'create', "executionID={$execution->id}"));
  35. toolbar(!empty($createItem) ? item(set($createItem)) : null);
  36. jsVar('executionID', $execution->id);
  37. jsVar('changeProductLink', helper::createLink('execution', 'build', "executionID={$execution->id}&type=product&param={productID}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"));
  38. jsVar('scmPathTip', $lang->build->scmPath);
  39. jsVar('filePathTip', $lang->build->filePath);
  40. jsVar('confirmDelete', $lang->build->confirmDelete);
  41. $fieldList = $this->loadModel('datatable')->getSetting('execution', 'build');
  42. if(!empty($fieldList['system'])) $fieldList['system']['map'] = $system;
  43. if($execution->type == 'kanban')
  44. {
  45. unset($fieldList['actions']['list']['createTest']['data-app']);
  46. $fieldList['actions']['list']['viewBug']['url'] = $config->build->actionList['bugList']['url'];
  47. }
  48. if(!common::canModify('execution', $execution)) unset($fieldList['actions']['list']['createTest']);
  49. $builds = initTableData($builds, $fieldList, $this->build);
  50. dtable
  51. (
  52. set::cols($fieldList),
  53. set::data($builds),
  54. set::plugins(array('cellspan')),
  55. set::userMap($users),
  56. set::customCols(true),
  57. set::onRenderCell(jsRaw('window.renderCell')),
  58. set::getCellSpan(jsRaw('window.getCellSpan')),
  59. set::orderBy($orderBy),
  60. set::sortLink(createLink('execution', 'build', "executionID={$execution->id}&type={$type}&param={$param}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")),
  61. set::footPager(usePager()),
  62. set::emptyTip($lang->build->noBuild),
  63. set::createTip($lang->build->create),
  64. set::createLink($canCreateBuild ? createLink('build', 'create', "executionID={$execution->id}") : '')
  65. );