tree.html.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * The tree 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 Yanyi Cao <caoyanyi@easycorp.ltd>
  7. * @package execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. include 'header.html.php';
  12. /* zin: Define the feature bar on main menu. */
  13. featureBar
  14. (
  15. set::current('all'),
  16. set::linkParams("executionID={$execution->id}&status={key}"),
  17. checkbox
  18. (
  19. set::rootClass('ml-2'),
  20. set::name('showStory'),
  21. set::checked($this->cookie->showStory),
  22. set::text($lang->execution->treeLevel['story']),
  23. on::change('changeDisplay')
  24. )
  25. );
  26. /* zin: Define the toolbar on main menu. */
  27. if(!isset($browseType)) $browseType = 'all';
  28. if(!isset($orderBy)) $orderBy = '';
  29. $canImportTask = hasPriv('task', 'importTask');
  30. if(common::canModify('execution', $execution))
  31. {
  32. if($canImportTask && $execution->multiple) $importTaskItem = array('text' => $lang->execution->importTask, 'url' => $this->createLink('execution', 'importTask', "execution={$execution->id}"));
  33. }
  34. toolbar
  35. (
  36. hasPriv('task', 'report') ? item(set(array
  37. (
  38. 'class' => 'btn ghost',
  39. 'icon' => 'bar-chart',
  40. 'text' => $lang->task->report->common,
  41. 'url' => createLink('task', 'report', "execution={$executionID}&browseType={$browseType}")
  42. ))) : null,
  43. hasPriv('task', 'export') ? item(set(array
  44. (
  45. 'class' => 'btn ghost',
  46. 'icon' => 'export',
  47. 'text' => $lang->export,
  48. 'url' => createLink('task', 'export', "execution={$executionID}&orderBy={$orderBy}&type=tree"),
  49. 'data-toggle' => 'modal'
  50. ))) : null,
  51. !empty($importTaskItem) ? dropdown(
  52. btn(
  53. setClass('btn ghost'),
  54. set::icon('import'),
  55. $lang->import
  56. ),
  57. set::items(array_filter(array($importTaskItem))),
  58. set::placement('bottom-end')
  59. ) : null,
  60. hasPriv('task', 'create') ? item(set(array
  61. (
  62. 'icon' => 'plus',
  63. 'text' => $lang->task->create,
  64. 'class' => 'primary create-execution-btn',
  65. 'url' => createLink('task', 'create', "execution={$executionID}")
  66. ))) : null
  67. );
  68. $noData = null;
  69. if(empty($tree))
  70. {
  71. $noData = div(
  72. setClass('table-empty-tip h-60 flex items-center justify-center'),
  73. span
  74. (
  75. setClass('text-gray'),
  76. $lang->task->noTask
  77. ),
  78. common::hasPriv('task', 'create', $execution) ? btn
  79. (
  80. set::text($lang->task->create),
  81. set::icon('plus'),
  82. set::url(createLink('task', 'create', "execution={$executionID}" . (isset($moduleID) ? "&storyID=&moduleID={$moduleID}" : ''))),
  83. setClass('primary ml-2')
  84. ) : null
  85. );
  86. }
  87. div
  88. (
  89. setClass('flex flex-nowrap'),
  90. panel
  91. (
  92. setClass('flex-auto'),
  93. $noData ? $noData : tree
  94. (
  95. set::id('taskTree'),
  96. set::items($tree),
  97. set::canSplit(false),
  98. set::hover(true),
  99. set::defaultNestedShow(true),
  100. set::onClickItem(jsRaw('loadObject'))
  101. )
  102. ),
  103. div
  104. (
  105. setID('detailBlock'),
  106. setClass('w-96 ml-4 hidden')
  107. )
  108. );