batchedit.html.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?php
  2. /**
  3. * The batchedit view file of execution 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 Sun Guangming<sunguangming@easycorp.ltd>
  7. * @package execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. if(!empty($frozenStages))
  12. {
  13. $frozenTip = sprintf($lang->execution->frozenTip, $frozenStages);
  14. pageJS("zui.Modal.alert({message: '{$frozenTip}', icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'});\n");
  15. }
  16. $setCode = (isset($config->setCode) and $config->setCode == 1);
  17. $showMethod = $app->tab == 'project' && isset($project) && ($project->model == 'agileplus' || $project->model == 'waterfallplus');
  18. jsVar('weekend', $config->execution->weekend);
  19. jsVar('stageList', $lang->stage->typeList);
  20. jsVar('ipdTypeList', $lang->stage->ipdTypeList);
  21. jsVar('confirmSync', $lang->execution->confirmSync);
  22. jsVar('noticeChangeAttr', $lang->programplan->noticeChangeAttr);
  23. jsVar('parents', $parents);
  24. $items = array();
  25. $items[] = array
  26. (
  27. 'name' => 'id',
  28. 'label' => $lang->idAB,
  29. 'control' => 'hidden',
  30. 'hidden' => true
  31. );
  32. $items[] = array
  33. (
  34. 'name' => 'id',
  35. 'label' => $lang->idAB,
  36. 'control' => 'index',
  37. 'width' => '38px'
  38. );
  39. if(isset($project) && $project->model == 'scrum' && $project->hasProduct) $items[] = array
  40. (
  41. 'label' => $lang->execution->projectName,
  42. 'control' => 'picker',
  43. 'name' => "project",
  44. 'items' => $allProjects,
  45. 'required' => true,
  46. 'width' => '136px'
  47. );
  48. $items[] = array
  49. (
  50. 'name' => 'name',
  51. 'label' => $app->tab == 'execution' ? $lang->execution->execName : $lang->execution->name,
  52. 'width' => '240px',
  53. 'required' => true
  54. );
  55. if($showMethod) $items[] = array
  56. (
  57. 'name' => 'type',
  58. 'label' => $lang->execution->method,
  59. 'control' => array('control' => 'picker', 'required' => true),
  60. 'items' => $lang->execution->typeList,
  61. 'disabled' => true,
  62. 'width' => '100px'
  63. );
  64. if($setCode) $items[] = array
  65. (
  66. 'name' => 'code',
  67. 'label' => $app->tab == 'execution' ? $lang->execution->execCode : $lang->execution->code,
  68. 'width' => '136px',
  69. 'required' => strpos(",{$config->execution->edit->requiredFields},", ',code,') !== false
  70. );
  71. $items[] = array
  72. (
  73. 'name' => 'PM',
  74. 'label' => $app->tab == 'execution' ? $lang->execution->execPM : $lang->execution->PM,
  75. 'control' => 'picker',
  76. 'ditto' => true,
  77. 'defaultDitto' => 'off',
  78. 'items' => $pmUsers,
  79. 'hidden' => strpos("{$showFields}", 'PM') === false,
  80. 'width' => '112px'
  81. );
  82. $items[] = array
  83. (
  84. 'name' => 'PO',
  85. 'label' => $lang->execution->PO,
  86. 'control' => 'picker',
  87. 'ditto' => true,
  88. 'defaultDitto' => 'off',
  89. 'items' => $poUsers,
  90. 'hidden' => strpos("{$showFields}", 'PO') === false,
  91. 'width' => '180px'
  92. );
  93. $items[] = array
  94. (
  95. 'name' => 'QD',
  96. 'label' => $lang->execution->QD,
  97. 'control' => 'picker',
  98. 'ditto' => true,
  99. 'defaultDitto' => 'off',
  100. 'items' => $qdUsers,
  101. 'hidden' => strpos("{$showFields}", 'QD') === false,
  102. 'width' => '180px'
  103. );
  104. $items[] = array
  105. (
  106. 'name' => 'RD',
  107. 'label' => $lang->execution->RD,
  108. 'control' => 'picker',
  109. 'ditto' => true,
  110. 'defaultDitto' => 'off',
  111. 'items' => $rdUsers,
  112. 'hidden' => strpos("{$showFields}", 'RD') === false,
  113. 'width' => '180px'
  114. );
  115. $items[] = array
  116. (
  117. 'name' => 'lifetime',
  118. 'label' => $app->tab == 'execution' ? $lang->execution->execType : $lang->execution->type,
  119. 'control' => 'picker',
  120. 'items' => $lang->execution->lifeTimeList,
  121. 'width' => '120px',
  122. 'tipIcon' => 'help',
  123. 'hidden' => strpos("{$showFields}", 'lifetime') === false,
  124. 'tip' => $lang->execution->typeTip,
  125. 'tipProps' => array
  126. (
  127. 'id' => 'tooltipHover',
  128. 'data-toggle' => 'tooltip',
  129. 'data-placement' => 'right',
  130. 'data-type' => 'white',
  131. 'data-class-name' => 'text-gray border border-gray-300'
  132. )
  133. );
  134. $items[] = array
  135. (
  136. 'name' => 'begin',
  137. 'label' => $lang->execution->begin,
  138. 'control' => 'date',
  139. 'width' => '120px',
  140. 'required' => true
  141. );
  142. $items[] = array
  143. (
  144. 'name' => 'end',
  145. 'label' => $lang->execution->end,
  146. 'control' => 'date',
  147. 'width' => '120px',
  148. 'required' => true
  149. );
  150. $items[] = array
  151. (
  152. 'name' => 'team',
  153. 'label' => $lang->execution->teamName,
  154. 'width' => '136px',
  155. 'hidden' => strpos("{$showFields}", 'team') === false
  156. );
  157. $items[] = array
  158. (
  159. 'name' => 'desc',
  160. 'label' => $app->tab == 'execution' ? $lang->execution->execDesc : $lang->execution->desc,
  161. 'control' => 'textarea',
  162. 'width' => '160px',
  163. 'hidden' => strpos("{$showFields}", 'desc') === false
  164. );
  165. $items[] = array
  166. (
  167. 'name' => 'days',
  168. 'label' => $lang->execution->days,
  169. 'control' => array
  170. (
  171. 'control' => 'inputControl',
  172. 'suffix' => $lang->execution->day,
  173. 'suffixWidth' => 20
  174. ),
  175. 'width' => '80px',
  176. 'hidden' => strpos("{$showFields}", 'days') === false
  177. );
  178. formBatchPanel
  179. (
  180. set::title($lang->execution->batchEditAction),
  181. set::mode('edit'),
  182. set::title($lang->execution->batchEdit),
  183. set::customFields(array('list' => $customFields, 'show' => explode(',', $showFields), 'key' => 'batchEditFields')),
  184. set::data(array_values($executions)),
  185. set::onRenderRow(jsRaw('renderRowData')),
  186. on::change('[data-name="project"]', 'changeProject'),
  187. on::change('[data-name="begin"]', "computeWorkDays($(e.target).attr('name'))"),
  188. on::change('[data-name="end"]', "computeWorkDays($(e.target).attr('name'))"),
  189. on::change('[data-name="attribute"]', 'changeAttribute(e.target)'),
  190. set::items($items)
  191. );
  192. render();