batchclose.html.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * The UI view file of story 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 Wang Yidong <yidong@easycorp.ltd>
  7. * @package story
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. data('activeMenuID', $storyType);
  12. jsVar('twinsCount', $twinsCount);
  13. jsVar('langTwins', $lang->story->twins . ': ');
  14. if(!empty($errorTips)) pageJS("zui.Modal.alert({message: '{$errorTips}', icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'});\n");
  15. unset($lang->{$storyType}->reasonList['subdivided']);
  16. foreach($lang->{$storyType}->reasonList as $key => $value)
  17. {
  18. if($key == 'cancel') continue;
  19. $reasonList[] = array('text' => $value, 'value' => $key);
  20. }
  21. jsVar('reasonList', $reasonList);
  22. /* Build form field value for batch edit. */
  23. $data = array();
  24. foreach($stories as $storyID => $story)
  25. {
  26. $data[$storyID] = $story;
  27. $data[$storyID]->storyIdList = $story->id;
  28. $data[$storyID]->statusName = zget($lang->story->statusList, $story->status);
  29. }
  30. formBatchPanel
  31. (
  32. set::title($lang->story->batchClose),
  33. set::mode('edit'),
  34. set::data(array_values($data)),
  35. set::onRenderRow(jsRaw('renderRowData')),
  36. on::change('[data-name="closedReason"]', 'toggleDuplicateBox'),
  37. /* Field of id. */
  38. formBatchItem
  39. (
  40. set::name('id'),
  41. set::label($lang->idAB),
  42. set::control('hidden'),
  43. set::hidden(true)
  44. ),
  45. /* Field of storyIdList. */
  46. formBatchItem
  47. (
  48. set::name('storyIdList'),
  49. set::label($lang->idAB),
  50. set::control('hidden'),
  51. set::hidden(true)
  52. ),
  53. /* Field of id index. */
  54. formBatchItem
  55. (
  56. set::name('id'),
  57. set::label($lang->idAB),
  58. set::control('index'),
  59. set::width('60px')
  60. ),
  61. /* Field of title. */
  62. formBatchItem
  63. (
  64. set::name('title'),
  65. set::label($lang->story->title),
  66. set::disabled(true),
  67. set::width('300px')
  68. ),
  69. /* Field of status. */
  70. formBatchItem
  71. (
  72. set::name('statusName'),
  73. set::label($lang->story->status),
  74. set::disabled(true),
  75. set::width('60px')
  76. ),
  77. /* Field of closeReason. */
  78. formBatchItem
  79. (
  80. set::label($lang->story->closedReason),
  81. set::width('220px'),
  82. set::name('closedReasonBox'),
  83. set::control('inputGroup'),
  84. inputGroup
  85. (
  86. picker
  87. (
  88. setClass('closedReason-select'),
  89. set::name('closedReason'),
  90. set::items($lang->story->reasonList),
  91. set::required(true)
  92. ),
  93. picker(setClass('duplicate-select hidden'), set::name('duplicateStory'), set::items(array()))
  94. )
  95. ),
  96. /* Field of comment. */
  97. formBatchItem
  98. (
  99. set::name('comment'),
  100. set::label($lang->comment),
  101. set::width('300px')
  102. )
  103. );
  104. render();