mergebyproduct.html.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * The mergebyproduct mode view file of upgrade 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 upgrade
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $getMergeData = function($data)
  12. {
  13. global $lang;
  14. include_once('createprogram.html.php');
  15. $checkBoxGroup = array();
  16. foreach($data->noMergedProducts as $productID => $product)
  17. {
  18. $productGroups = array();
  19. if(isset($data->productGroups[$productID]))
  20. {
  21. foreach($data->productGroups[$productID] as $sprint)
  22. {
  23. $productGroups[] = div
  24. (
  25. setClass('sprintItem mb-2'),
  26. checkbox(setID("sprints-{$productID}-{$sprint->id}"), set::name("sprints[{$productID}][]"), set::text($sprint->name), set::value($sprint->id), setData(array('on' => 'change', 'call' => 'changeSprints', 'params' => 'event', 'product' => $productID, 'begin' => $product->createdDate, 'end' => $sprint->end, 'status' => $sprint->status, 'pm' => $sprint->PM))),
  27. input(setClass('hidden'), set::name("sprintIdList[{$productID}][{$sprint->id}]"), set::value($sprint->id))
  28. );
  29. }
  30. }
  31. $checkBoxGroup[] = div
  32. (
  33. setClass('mt-4 flex py-4'),
  34. set::style(array('background-color' => 'var(--color-gray-50)')),
  35. cell
  36. (
  37. set::width('1/2'),
  38. setClass('productList px-4 flex items-center overflow-hidden'),
  39. checkbox(setID("products{$productID}"), set::name('products[]'), set::text($product->name), set::value($product->id), setData(array('on' => 'change', 'call' => 'changeProducts', 'params' => 'event', 'begin' => $product->createdDate, 'programid' => $product->program, 'productid' => $productID)))
  40. ),
  41. cell
  42. (
  43. set::width('1/2'),
  44. setClass('productList px-4'),
  45. div
  46. (
  47. setClass('scroll-handle'),
  48. $productGroups
  49. )
  50. )
  51. );
  52. }
  53. return div
  54. (
  55. setClass('flex mt-4'),
  56. cell
  57. (
  58. setID('source'),
  59. set::width('1/2'),
  60. setClass('border p-4 overflow-hidden'),
  61. div
  62. (
  63. setClass('flex'),
  64. cell
  65. (
  66. set::width('1/2'),
  67. setClass('item checkbox-primary px-4 overflow-hidden'),
  68. checkbox(setID('checkAllProducts'), set::text($lang->productCommon), setData(array('on' => 'change', 'call' => 'changeAllProducts')))
  69. ),
  70. cell
  71. (
  72. set::width('1/2'),
  73. setClass('item checkbox-primary px-4'),
  74. checkbox(setID('checkAllSprints'), set::text($lang->projectCommon), setData(array('on' => 'change', 'call' => 'changeAllSprints')))
  75. )
  76. ),
  77. div
  78. (
  79. $checkBoxGroup
  80. )
  81. ),
  82. cell
  83. (
  84. set::width('1/2'),
  85. setClass('border ml-4 p-4'),
  86. setID('programBox'),
  87. $createProgram($data)
  88. )
  89. );
  90. };