treestory.html.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <?php
  2. /**
  3. * The treestory 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 Yanyi Cao <caoyanyi@easycorp.ltd>
  7. * @package execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. /* Get min stage. */
  12. $minStage = $story->stage;
  13. $stageList = implode(',', array_keys($this->lang->story->stageList));
  14. $minStagePos = strpos($stageList, $minStage);
  15. if($story->stages and $branches)
  16. {
  17. foreach($story->stages as $branch => $stage)
  18. {
  19. if(strpos($stageList, $stage) !== false and strpos($stageList, $stage) > $minStagePos)
  20. {
  21. $minStage = $stage;
  22. $minStagePos = strpos($stageList, $stage);
  23. }
  24. }
  25. }
  26. $reviewed = $lang->noData;
  27. $reviewedBy = explode(',', $story->reviewedBy);
  28. if(count($reviewedBy) > 1)
  29. {
  30. foreach($reviewedBy as $account) $reviewed .= ' ' . zget($users, trim($account));
  31. }
  32. div
  33. (
  34. setClass('section-list', 'canvas', 'pt-4', 'pb-6', 'px-4', 'mb-4'),
  35. div
  36. (
  37. setClass('flex items-center flex-nowrap mb-4'),
  38. label
  39. (
  40. setClass('flex-none rounded-full dark-outline'),
  41. $story->id
  42. ),
  43. label
  44. (
  45. setClass('mx-2 flex-none rounded-full status-' . $story->status),
  46. $this->processStatus('story', $story)
  47. ),
  48. span
  49. (
  50. setClass('text-md font-bold clip'),
  51. $story->title
  52. )
  53. ),
  54. div
  55. (
  56. div
  57. (
  58. $lang->story->stage,
  59. span
  60. (
  61. setClass('ml-2 font-bold'),
  62. $lang->story->stageList[$story->stage]
  63. )
  64. ),
  65. div
  66. (
  67. setClass('mt-4'),
  68. $lang->story->estimate,
  69. span
  70. (
  71. setClass('ml-2 font-bold'),
  72. $story->estimate
  73. )
  74. )
  75. ),
  76. btngroup
  77. (
  78. setID('actionButtons'),
  79. setClass('mb-4 mt-4'),
  80. hasPriv('story', 'change') ? btn
  81. (
  82. setClass('text-primary'),
  83. set::icon('alter'),
  84. set::hint($lang->story->operateList['changed']),
  85. set::url(createLink('story', 'change', array('storyID' => $story->id))),
  86. set::disabled(!$this->story->isClickable($story, 'change')),
  87. set('data-app', $app->tab)
  88. ) : null,
  89. hasPriv('story', 'delete') ? btn
  90. (
  91. setClass('text-primary ml-2 ajax-submit'),
  92. set::icon('trash'),
  93. set::hint($lang->story->delete),
  94. set::url(createLink('story', 'delete', array('storyID' => $story->id))),
  95. set::disabled(!$this->story->isClickable($story, 'delete')),
  96. set('data-confirm', $story->type == 'requirement' ? str_replace($lang->SRCommon, $lang->URCommon, $lang->story->confirmDelete) : $lang->story->confirmDelete)
  97. ) : null,
  98. hasPriv('story', 'review') ? btn
  99. (
  100. setClass('text-primary ml-2'),
  101. set::icon('search'),
  102. set::hint($lang->story->review),
  103. set::url(createLink('story', 'review', array('storyID' => $story->id))),
  104. set::disabled(!$this->story->isClickable($story, 'review')),
  105. set('data-app', $app->tab)
  106. ) : null,
  107. hasPriv('story', 'close') ? btn
  108. (
  109. setClass('text-primary ml-2'),
  110. set::icon('off'),
  111. set::hint($lang->story->close),
  112. set::url(createLink('story', 'close', array('storyID' => $story->id))),
  113. set::disabled(!$this->story->isClickable($story, 'close')),
  114. set('data-toggle', 'modal')
  115. ) : null,
  116. hasPriv('story', 'edit') ? btn
  117. (
  118. setClass('text-primary ml-2'),
  119. set::icon('edit'),
  120. set::hint($lang->story->edit),
  121. set::url(createLink('story', 'edit', array('storyID' => $story->id))),
  122. set::disabled(!$this->story->isClickable($story, 'edit')),
  123. set('data-app', $app->tab)
  124. ) : null
  125. ),
  126. hr(),
  127. section
  128. (
  129. set::title($lang->story->legendSpec),
  130. set::content(empty($story->spec) ? $lang->noData : $story->spec),
  131. set::useHtml(true)
  132. ),
  133. h::hr(set::className('mt-5 mb-1')),
  134. fileList
  135. (
  136. set::padding(false),
  137. set::files($story->files)
  138. ),
  139. hr(),
  140. section
  141. (
  142. set::title($lang->story->legendBasicInfo),
  143. tableData
  144. (
  145. item
  146. (
  147. set::name($lang->story->module),
  148. set::title($moduleTitle),
  149. $moduleItems
  150. ),
  151. item
  152. (
  153. set::name($lang->story->status),
  154. span
  155. (
  156. setClass("status-story status-{$story->status}"),
  157. $this->processStatus('story', $story)
  158. )
  159. ),
  160. item
  161. (
  162. set::name($lang->story->pri),
  163. priLabel($story->pri, set::text($lang->story->priList))
  164. ),
  165. item
  166. (
  167. set::name($lang->story->estimate),
  168. $story->estimate . $config->hourUnit
  169. ),
  170. in_array($story->source, $config->story->feedbackSource) ? item
  171. (
  172. set::name($lang->story->feedbackBy),
  173. $story->feedbackBy
  174. ) : null,
  175. in_array($story->source, $config->story->feedbackSource) ? item
  176. (
  177. set::name($lang->story->notifyEmail),
  178. $story->notifyEmail
  179. ) : null,
  180. item
  181. (
  182. set::name($lang->story->keywords),
  183. $story->keywords
  184. ),
  185. item
  186. (
  187. set::name($lang->story->legendMailto),
  188. $mailtoList
  189. )
  190. ),
  191. hr(),
  192. section
  193. (
  194. set::title($lang->story->legendLifeTime),
  195. tableData
  196. (
  197. item
  198. (
  199. set::name($lang->story->openedBy),
  200. zget($users, $story->openedBy) . $lang->at . $story->openedDate
  201. ),
  202. item
  203. (
  204. set::name($lang->story->assignedTo),
  205. $story->assignedTo ? zget($users, $story->assignedTo) . $lang->at . $story->assignedDate : $lang->noData
  206. ),
  207. item
  208. (
  209. set::name($lang->story->reviewedBy),
  210. $reviewed
  211. ),
  212. item
  213. (
  214. set::name($lang->story->reviewedDate),
  215. $story->reviewedBy ? $story->reviewedDate : $lang->noData
  216. ),
  217. item
  218. (
  219. set::name($lang->story->closedBy),
  220. $story->closedBy ? zget($users, $story->closedBy) . $lang->at . $story->closedDate : $lang->noData
  221. ),
  222. item
  223. (
  224. set::tdClass('resolution'),
  225. set::name($lang->story->closedReason),
  226. $story->closedReason ? zget($lang->story->reasonList, $story->closedReason) : $lang->noData,
  227. isset($story->extraStories[$story->duplicateStory]) ? a(set::href(createLink($story->extraStories[$story->duplicateStory]->type, 'view', "storyID=$story->duplicateStory")), set::title($story->extraStories[$story->duplicateStory]->title), "#{$story->duplicateStory} {$story->extraStories[$story->duplicateStory]->title}") : null
  228. ),
  229. item
  230. (
  231. set::name($lang->story->lastEditedBy),
  232. $story->lastEditedBy ? zget($users, $story->lastEditedBy) . $lang->at . $story->lastEditedDate : $lang->noData
  233. )
  234. )
  235. )
  236. )
  237. );
  238. history
  239. (
  240. set::commentBtn(true),
  241. set::commentUrl(createLink('action', 'comment', array('objectType' => 'story', 'objectID' => $story->id)))
  242. );