create.html.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. /**
  3. * The create 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('weekend', $config->execution->weekend);
  13. jsVar('productID', $product->id);
  14. jsVar('lastLang', $lang->productplan->last);
  15. jsVar('parentPlanID', $parent);
  16. jsVar('parentList', $parentList);
  17. if($parent)
  18. {
  19. foreach($branches as $branchID => $branchName)
  20. {
  21. if(strpos(",$parentPlan->branch,", ",$branchID,") === false) unset($branches[$branchID]);
  22. }
  23. }
  24. formPanel
  25. (
  26. setID('createPlanPanel'),
  27. set::ajax(array('beforeSubmit' => jsRaw("clickSubmit"))),
  28. set::title($parent ? $lang->productplan->createChildren : $lang->productplan->create),
  29. $parent ? formGroup
  30. (
  31. set::className('items-center'),
  32. set::label($lang->productplan->parent),
  33. span($parentPlan->title)
  34. ) : null,
  35. !$parent && !$product->shadow ? formGroup
  36. (
  37. set::className('items-center'),
  38. set::label($lang->productplan->product),
  39. $product->name
  40. ) : null,
  41. !$parent ? formGroup
  42. (
  43. set::width('1/2'),
  44. set::label($lang->productplan->parent),
  45. picker
  46. (
  47. set::name('parent'),
  48. set::items($parentPlanPairs),
  49. $product->type != 'normal' ? on::change('loadBranches') : ''
  50. )
  51. ) : formHidden('parent', $parent),
  52. !$product->shadow && $product->type != 'normal' ? formGroup
  53. (
  54. set::width('1/2'),
  55. set::label($lang->productplan->branch),
  56. set::required(true),
  57. picker
  58. (
  59. set::name('branch[]'),
  60. set::items($branches),
  61. set::multiple(true),
  62. on::change('loadTitle')
  63. )
  64. ) : null,
  65. formRow
  66. (
  67. formGroup
  68. (
  69. set::width('1/2'),
  70. set::label($lang->productplan->title),
  71. set::name('title')
  72. ),
  73. $lastPlan ? formGroup
  74. (
  75. set::width('1/2'),
  76. setClass('items-center text-gray'),
  77. span
  78. (
  79. setClass('ml-4'),
  80. setID('lastTitleBox'),
  81. '(' . $lang->productplan->last . ': ' . $lastPlan->title . ')'
  82. )
  83. ) : null
  84. ),
  85. formRow
  86. (
  87. formGroup
  88. (
  89. set::width('1/3'),
  90. set::label($lang->productplan->begin),
  91. set::required(true),
  92. datepicker
  93. (
  94. setID('begin'),
  95. set::name('begin'),
  96. set::value(formatTime($begin))
  97. )
  98. ),
  99. formGroup
  100. (
  101. setClass('items-center'),
  102. set::width('2/3'),
  103. checkbox
  104. (
  105. set::name('future'),
  106. set::text($lang->productplan->future),
  107. set::value(1),
  108. set::rootClass('ml-4'),
  109. on::change('toggleDateBox')
  110. )
  111. )
  112. ),
  113. formRow
  114. (
  115. formGroup
  116. (
  117. set::width('1/3'),
  118. set::label($lang->productplan->end),
  119. set::required(true),
  120. set::control('date'),
  121. setID('end'),
  122. set::name('end')
  123. ),
  124. formGroup
  125. (
  126. set::width('2/3'),
  127. radioList
  128. (
  129. set::name('delta'),
  130. set::inline(true),
  131. set::items($lang->productplan->endList),
  132. on::change('computeEndDate')
  133. )
  134. )
  135. ),
  136. formGroup
  137. (
  138. set::label($lang->productplan->desc),
  139. set::name('desc'),
  140. set::control('editor'),
  141. set::rows(10)
  142. ),
  143. formHidden('product', $product->id)
  144. );
  145. /* ====== Render page ====== */
  146. render();