roadmap.html.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * The UI file of product module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  6. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Wang Yidong <yidong@easycorp.ltd>
  8. * @package product
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. $productModel = $this->product;
  13. $fnPrintSingleRoadmap = function($branchKey = 0) use ($roadmaps, $product, $productModel)
  14. {
  15. global $lang;
  16. $data = $productModel->buildRoadmapForUI($roadmaps, $branchKey);
  17. $hasRoadmaps = !empty($data) ;
  18. if(!$hasRoadmaps)
  19. {
  20. return div
  21. (
  22. setClass('empty-tip text-center'),
  23. span(setClass('text-gray'), $lang->release->noRelease),
  24. common::canModify('product', $product) && common::hasPriv('release', 'create') ? btn
  25. (
  26. setClass('ml-2'),
  27. setStyle('background', 'rgb(var(--color-primary-50-rgb))'),
  28. setStyle('box-shadow', 'none'),
  29. set::url(createLink('release', 'create', "productID=$product->id&branch=$branchKey")),
  30. span
  31. (
  32. icon('plus'),
  33. setClass('text-primary'),
  34. $lang->release->create
  35. )
  36. ) : null
  37. );
  38. }
  39. else
  40. {
  41. return roadMap(set::releases($data));
  42. }
  43. };
  44. $fnPrintBranchRoadmap = function() use ($branches, $roadmaps, $product, $productModel, $fnPrintSingleRoadmap)
  45. {
  46. $tabPaneItems = array();
  47. foreach($branches as $branchKey => $branchName)
  48. {
  49. $tabPaneItems[] = tabPane
  50. (
  51. set::key("roadmap_{$branchKey}"),
  52. set::title($branchName),
  53. set::active($branchKey == 0),
  54. $fnPrintSingleRoadmap($branchKey)
  55. );
  56. }
  57. return tabs($tabPaneItems);
  58. };
  59. panel
  60. (
  61. set::title($lang->product->iteration),
  62. set::titleClass('text-xl'),
  63. set::headingClass('justify-start'),
  64. to::heading
  65. (
  66. span(setClass('label light rounded-full text-dark'), sprintf($lang->product->iterationInfo, $roadmaps['total']))
  67. ),
  68. $product->type == 'normal' ? $fnPrintSingleRoadmap() : $fnPrintBranchRoadmap()
  69. );