browse.html.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * The browse view file of roadmap module of ZenTaoPMS.
  4. * @copyright Copyright 2026 禅道软件(青岛)有限公司(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 Hao Sun <sunhao@easycorp.ltd>
  7. * @package roadmap
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $zooming = isset($zooming) ? $zooming : 'month';
  12. $userList = array();
  13. if(!empty($users))
  14. {
  15. foreach($users as $account => $realname)
  16. {
  17. $user = array();
  18. $user['key'] = $account;
  19. $user['label'] = $realname;
  20. $userList[] = $user;
  21. }
  22. }
  23. featureBar
  24. (
  25. btn
  26. (
  27. setID('fullScreenBtn'),
  28. setClass('mr-4'),
  29. set::type('ghost'),
  30. set::icon('fullscreen'),
  31. on::click()->call('enterGanttFullscreen'),
  32. $lang->programplan->full
  33. ),
  34. div
  35. (
  36. setClass('row items-center gap-2'),
  37. strong($lang->execution->gantt->format . ':'),
  38. radioList
  39. (
  40. set::name('zooming'),
  41. set::value($zooming),
  42. set::items($lang->roadmap->zooming),
  43. set::inline(),
  44. on::change()->call('zoomTasks', jsRaw('event.target.value'))
  45. )
  46. )
  47. );
  48. if(hasPriv('roadmap', 'create') && $config->vision == 'or')
  49. {
  50. $toolbarItems = [];
  51. $toolbarItems[] = ['text' => $lang->roadmap->create, 'url' => createLink('roadmap', 'create', "productID={$productID}"), 'icon' => 'plus', 'type' => 'primary'];
  52. toolbar(set::items($toolbarItems));
  53. }
  54. $ganttFields = [];
  55. $ganttFields['text'] = $lang->roadmap->name;
  56. $ganttFields['status'] = $lang->roadmap->status;
  57. $ganttFields['start_date'] = $lang->roadmap->begin;
  58. $ganttFields['end_date'] = $lang->roadmap->end;
  59. $ganttFields['requirements'] = $lang->roadmap->requirments;
  60. if($config->vision == 'or') $ganttFields['actions'] = $lang->roadmap->actions;
  61. if($product->type != 'normal') $ganttFields['branch'] = sprintf($lang->roadmap->branch, $lang->product->branchName[$product->type]);
  62. div
  63. (
  64. setClass('.gantt_container'),
  65. style::height('calc(100vh - 120px)'),
  66. zui::gantt
  67. (
  68. set::_id('ganttView'),
  69. set::height('100%'),
  70. set::zooming($zooming),
  71. set::ganttType($ganttType),
  72. set::productType($product->type),
  73. set::ganttFields($ganttFields),
  74. set::progressColor($lang->execution->gantt->progressColor),
  75. set::readonly(true),
  76. set::userList($userList),
  77. set::roadmaps(json_decode($roadmaps)),
  78. set::exts('zentao'),
  79. set::todayTips($lang->programplan->today),
  80. set::errors([
  81. 'taskDrag' => $lang->programplan->error->taskDrag
  82. ]),
  83. set('$options', jsRaw('window.setGanttOptions'))
  84. )
  85. );