browsebykanban.html.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. /**
  3. * The browsebykanban view file of productplan 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 productplan
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. foreach($kanbanList as $current => $region)
  12. {
  13. foreach($region['items'] as $index => $group)
  14. {
  15. $group['draggable'] = true;
  16. $group['colWidth'] = 'auto';
  17. $group['getCol'] = jsRaw('window.getCol');
  18. $group['getItem'] = jsRaw('window.getItem');
  19. $group['canDrop'] = jsRaw('window.canDrop');
  20. $group['onDrop'] = jsRaw('window.onDrop');
  21. $group['itemProps'] = array('actions' => jsRaw('window.getItemActions'));
  22. $kanbanList[$current]['items'][$index] = $group;
  23. }
  24. }
  25. $orderItems = array();
  26. foreach($lang->productplan->orderList as $order => $label)
  27. {
  28. $orderItems[] = array('text' => $label, 'active' => $orderBy == $order, 'url' => $this->createLink($app->rawModule, 'browse', "productID=$productID&branch=$branchID&browseType=$browseType&queryID=$queryID&orderBy=$order"));
  29. }
  30. $labelItems = array();
  31. if($product->type == 'normal')
  32. {
  33. $labelItems[] = array('text' => $lang->productplan->all . ' ' . $planCount, 'icon' => 'delay', 'class' => 'statistic-plan');
  34. }
  35. else
  36. {
  37. $branchItems = array();
  38. foreach($branches as $key => $value)
  39. {
  40. $branchItems[] = array('text' => $value, 'active' => $key == $branchID, 'url' => createLink($app->rawModule, 'browse', "productID={$productID}&branch={$key}"));
  41. }
  42. $labelItems[] = array('text' => $branches[$branchID], 'items' => $branchItems, 'type' => 'dropdown', 'icon' => 'delay', 'className' => 'statistic-plan btn btn-caret');
  43. }
  44. !empty($labelItems) ? featureBar
  45. (
  46. set::items($labelItems)
  47. ) : null;
  48. jsVar('plans', $plans);
  49. toolbar
  50. (
  51. set::className('w-full justify-end'),
  52. dropdown
  53. (
  54. btn(setClass('ghost'), isset($lang->productplan->orderList[$orderBy]) ? $lang->productplan->orderList[$orderBy] : $lang->productplan->orderList['begin_desc']),
  55. set::items($orderItems)
  56. ),
  57. btnGroup
  58. (
  59. btn(setClass($viewType == 'list' ? 'text-primary font-bold shadow-inner bg-canvas' : ''), set::icon('format-list-bulleted'), setData('type', 'list'), setClass('switchButton'), setData('app', $app->tab)),
  60. btn(setClass($viewType == 'kanban' ? 'text-primary font-bold shadow-inner bg-canvas' : ''), set::icon('kanban'), setData('type', 'kanban'), setClass('switchButton'), setData('app', $app->tab))
  61. ),
  62. common::hasPriv('productplan', 'create') ? item
  63. (
  64. set
  65. (
  66. array
  67. (
  68. 'text' => $lang->productplan->create,
  69. 'url' => $this->createLink($app->rawModule, 'create', "productID=$product->id&branch=$branch"),
  70. 'icon' => 'plus',
  71. 'class' => 'btn primary'
  72. )
  73. )
  74. ) : null
  75. );
  76. zui::kanbanList
  77. (
  78. set::key('kanban'),
  79. set::items($kanbanList),
  80. set::height('calc(100vh - 120px)')
  81. );
  82. modalTrigger
  83. (
  84. modal
  85. (
  86. setID('createExecutionModal'),
  87. set::modalProps(array('title' => $lang->productplan->selectProjects)),
  88. form
  89. (
  90. setID('createExecutionForm'),
  91. setClass('py-4'),
  92. set::actions
  93. (
  94. array
  95. (
  96. array
  97. (
  98. 'text' => !empty($projects) ? $lang->productplan->nextStep : $lang->productplan->enterProjectList,
  99. 'id' => !empty($projects) ? 'createExecutionButton' : '',
  100. 'type' => 'primary',
  101. 'url' => !empty($projects) ? '###' : createLink('product', 'project', "status=all&productID={$productID}&branch={$branch}")
  102. ),
  103. array
  104. (
  105. 'text' => $lang->cancel,
  106. 'data-dismiss' => 'modal'
  107. )
  108. )
  109. ),
  110. formGroup
  111. (
  112. set::label($lang->productplan->project),
  113. picker
  114. (
  115. set::name('project'),
  116. set::items($projects),
  117. set::required(true),
  118. set::disabled(empty($projects))
  119. )
  120. ),
  121. formRow
  122. (
  123. !empty($projects) ? setClass('hidden') : null,
  124. setClass('projectTips'),
  125. formGroup
  126. (
  127. set::label(''),
  128. span
  129. (
  130. setClass('text-danger'),
  131. $lang->productplan->noLinkedProject
  132. ),
  133. formHidden('planID', '')
  134. )
  135. )
  136. )
  137. )
  138. );
  139. render();