waterfallganttblock.html.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * The waterfallgantt block view file of block 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 block
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $waterfallGanttID = uniqid('wg');
  12. jsVar('waterfallGanttID', $waterfallGanttID);
  13. jsVar('ganttPlans', array_values($plans));
  14. jsVar('progressLang', $lang->programplan->progress);
  15. $productItems = array();
  16. foreach($products as $id => $productName)
  17. {
  18. $url = createLink('block', 'printBlock', "blockID={$block->id}&params=" . helper::safe64Encode("module={$block->module}&productID={$id}"));
  19. $productItems[] = array('text' => $productName, 'data-url' => $url, 'active' => $productID == $id, 'data-on' => 'click', 'data-do' => "loadBlock('$block->id', options.url)");
  20. }
  21. panel
  22. (
  23. to::titleSuffix
  24. (
  25. icon
  26. (
  27. setClass('text-light text-sm cursor-pointer'),
  28. toggle::tooltip
  29. (
  30. array
  31. (
  32. 'title' => sprintf($lang->block->tooltips['metricTime'], $metricTime),
  33. 'placement' => $app->getClientLang() == 'en' ? 'bottom-end' : 'bottom',
  34. 'type' => 'white',
  35. 'className' => 'text-dark border border-light leading-5'
  36. )
  37. ),
  38. 'help'
  39. ),
  40. $productItems ? dropdown
  41. (
  42. btn
  43. (
  44. setClass('ghost text-gray font-normal'),
  45. set::caret(true),
  46. $products[$productID]
  47. ),
  48. set::items($productItems)
  49. ) : null,
  50. $productItems ? span(setClass('text-gray-400 font-normal'), "* {$lang->block->selectProduct}") : null
  51. ),
  52. setID($waterfallGanttID),
  53. set('headingClass', 'border-b'),
  54. set::title($block->title),
  55. div
  56. (
  57. set::className('waterfall-gantt'),
  58. empty($plans) ? div(setClass('h-32 center text-gray'), $lang->error->noData) : div
  59. (
  60. setClass('gantt clearfix'),
  61. div(setClass('gantt-plans pull-left'), setID('ganttPlans')),
  62. div
  63. (
  64. setClass('gantt-container scrollbar-hover'),
  65. setID('ganttContainer'),
  66. div
  67. (
  68. setClass('gantt-canvas'),
  69. div
  70. (
  71. setClass('gantt-today'),
  72. div($lang->programplan->today)
  73. )
  74. )
  75. )
  76. )
  77. )
  78. );