edit.html.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /**
  3. * The edit 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 Shujie Tian<tianshujie@easycorp.ltd>
  7. * @package productplan
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. include($this->app->getModuleRoot() . 'ai/ui/inputinject.html.php');
  12. jsVar('today', helper::today());
  13. jsVar('weekend', $config->execution->weekend);
  14. jsVar('productID', $productID);
  15. jsVar('oldBranch', $oldBranch);
  16. jsVar('planID', $plan->id);
  17. jsVar('parentList', $parentList);
  18. $deltaValue = $plan->end == $config->productplan->future ? 0 : (strtotime($plan->end) - strtotime($plan->begin)) / 3600 / 24 + 1;
  19. formPanel
  20. (
  21. setID('editForm'),
  22. set::title($lang->productplan->edit),
  23. !$product->shadow ? formGroup
  24. (
  25. set::className('items-center'),
  26. set::label($lang->productplan->product),
  27. span($product->name)
  28. ) : null,
  29. $plan->parent == '-1' ? formHidden('parent', $plan->parent) : formGroup
  30. (
  31. set::width('1/2'),
  32. set::label($lang->productplan->parent),
  33. set::name('parent'),
  34. set::items($parentPlanPairs),
  35. set::value($plan->parent),
  36. $product->type != 'normal' ? on::change('loadBranches') : ''
  37. ),
  38. !$product->shadow && $product->type != 'normal' ? formGroup
  39. (
  40. set::width('1/2'),
  41. set::label($lang->productplan->branch),
  42. set::required(true),
  43. picker
  44. (
  45. setID('branch'),
  46. set::name('branch[]'),
  47. set::items($branchTagOption),
  48. set::value($plan->branch),
  49. set::multiple(true)
  50. )
  51. ) : null,
  52. formGroup
  53. (
  54. set::width('1/2'),
  55. set::label($lang->productplan->title),
  56. set::name('title'),
  57. set::value($plan->title)
  58. ),
  59. formGroup
  60. (
  61. set::width('1/2'),
  62. set::label($lang->productplan->status),
  63. set::name('status'),
  64. set::items(array_slice($lang->productplan->statusList, ($plan->status == 'wait' ? 0 : 1))),
  65. set::value($plan->status),
  66. set::required(true),
  67. set::disabled($plan->parent == -1)
  68. ),
  69. formRow
  70. (
  71. formGroup
  72. (
  73. set::width('1/4'),
  74. set::label($lang->productplan->begin),
  75. set::required(true),
  76. datepicker
  77. (
  78. setID('begin'),
  79. set::name('begin'),
  80. set::value($plan->begin != $config->productplan->future ? formatTime($plan->begin) : ''),
  81. set::disabled(!$deltaValue)
  82. )
  83. ),
  84. formGroup
  85. (
  86. setClass('items-center'),
  87. checkbox
  88. (
  89. set::name('future'),
  90. set::text($lang->productplan->future),
  91. set::value(1),
  92. set::rootClass('ml-4'),
  93. set::checked($plan->begin == $config->productplan->future && $plan->end == $config->productplan->future),
  94. on::change('toggleDateBox')
  95. )
  96. )
  97. ),
  98. formRow
  99. (
  100. setClass($plan->begin == $config->productplan->future && $plan->end == $config->productplan->future ? 'hidden' : ''),
  101. formGroup
  102. (
  103. set::width('1/4'),
  104. set::label($lang->productplan->end),
  105. set::control('date'),
  106. set::required(true),
  107. setID('end'),
  108. set::name('end'),
  109. set::value($plan->end != $config->productplan->future ? formatTime($plan->end) : '')
  110. ),
  111. formGroup
  112. (
  113. radioList
  114. (
  115. set::name('delta'),
  116. set::inline(true),
  117. set::items($lang->productplan->endList),
  118. set::value($deltaValue),
  119. on::change('computeEndDate')
  120. )
  121. ),
  122. formHidden('product', $product->id)
  123. ),
  124. formGroup
  125. (
  126. set::label($lang->productplan->desc),
  127. set::required(strpos(",{$this->config->productplan->edit->requiredFields},", ",desc,") !== false),
  128. editor
  129. (
  130. set::name('desc'),
  131. html($plan->desc)
  132. )
  133. )
  134. );
  135. /* ====== Render page ====== */
  136. render();