burn.html.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <?php
  2. /**
  3. * The burn 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. jsVar('workHour', $lang->execution->workHour);
  12. jsVar('storyPoint', $lang->execution->storyPoint);
  13. jsVar('burnBy', $burnBy);
  14. jsVar('+type', str_replace(',', '%2C', $type));
  15. jsVar('executionID', $executionID);
  16. jsVar('watermark', $lang->execution->watermark);
  17. jsVar('burnXUnit', $lang->execution->burnXUnit);
  18. jsVar('burnYUnit', $lang->execution->burnYUnit);
  19. jsVar('executionName', $execution->name);
  20. $weekend = strpos($type, 'noweekend') !== false ? 'withweekend' : 'noweekend';
  21. $delay = strpos($type, 'withdelay') !== false ? 'nodelay' : 'withdelay';
  22. $weekendParam = $delay == 'withdelay' ? "nodelay,{$weekend}" : "withdelay,{$weekend}";
  23. $delayParam = $weekend == 'noweekend' ? "withweekend,{$delay}" : "noweekend,{$delay}";
  24. $isEn = $app->getClientLang() == 'en';
  25. $intervalBoxWidth = $isEn ? '150px' :'100px';
  26. $intervalPickerProp = $isEn ? set::style(array('width' => '150px')) : null;
  27. featureBar
  28. (
  29. btn
  30. (
  31. set
  32. (
  33. array
  34. (
  35. 'class' => 'btn primary mr-5 ajax-submit',
  36. 'url' => createLink('execution', 'computeBurn', 'reload=yes'),
  37. 'icon' => 'refresh'
  38. )
  39. ),
  40. $lang->execution->computeBurn
  41. ),
  42. li
  43. (
  44. setClass('nav-item'),
  45. a
  46. (
  47. set::id('weekend'),
  48. set::href(createLink('execution', 'burn', "executionID={$execution->id}&type={$weekendParam}&interval={$interval}")),
  49. setData('app', $app->tab),
  50. $lang->execution->{$weekend}
  51. )
  52. ),
  53. li
  54. (
  55. setClass('nav-item'),
  56. a
  57. (
  58. set::id('delay'),
  59. set::href(createLink('execution', 'burn', "executionID={$execution->id}&type={$delayParam}")),
  60. setData('app', $app->tab),
  61. $lang->execution->{$delay}
  62. )
  63. ),
  64. common::canModify('execution', $execution) ? li
  65. (
  66. setClass('nav-item'),
  67. a
  68. (
  69. set
  70. (
  71. array
  72. (
  73. 'href' => createLink('execution', 'fixFirst', "id={$execution->id}"),
  74. 'data-toggle' => 'modal'
  75. )
  76. ),
  77. $lang->execution->fixFirst
  78. )
  79. ) : null,
  80. li
  81. (
  82. setClass('nav-item mr-3'),
  83. html($lang->execution->howToUpdateBurn)
  84. ),
  85. li
  86. (
  87. set::className('burnByBox'),
  88. set::style(array('width' => $isEn ? '160px' : '150px')),
  89. picker
  90. (
  91. set::id('burnBy'),
  92. set::name('burnBy'),
  93. set::items($lang->execution->burnByList),
  94. set::value($burnBy),
  95. $isEn ? set::style(array('width' => '160px')) : null,
  96. set::required(true)
  97. )
  98. ),
  99. $interval ? li
  100. (
  101. set::className('intervalBox ml-4'),
  102. set::style(array('width' => $intervalBoxWidth)),
  103. picker
  104. (
  105. set::id('interval'),
  106. set::name('interval'),
  107. set::items($dayList),
  108. set::value($interval),
  109. set::required(true),
  110. $intervalPickerProp
  111. )
  112. ) : null
  113. );
  114. toolbar
  115. (
  116. btn
  117. (
  118. setClass('btn primary'),
  119. $lang->export,
  120. on::click('downloadBurn')
  121. )
  122. );
  123. panel
  124. (
  125. setID('burnPanel'),
  126. h2
  127. (
  128. setClass('flex items-center justify-center'),
  129. $executionName . ' ' . $this->lang->execution->burn . '(' . zget($lang->execution->burnByList, $burnBy) . ')',
  130. isset($execution->delay) ? label(setClass('label danger-pale circle size-sm nowrap ml-3'), sprintf($lang->project->delayInfo, $execution->delay)) : null
  131. ),
  132. echarts
  133. (
  134. set::height(500),
  135. set::exts('timeline'),
  136. set::xAxis
  137. (
  138. array
  139. (
  140. 'type' => 'category',
  141. 'data' => $chartData['labels'],
  142. 'name' => $lang->execution->burnXUnit,
  143. 'boundaryGap' => false,
  144. 'axisLabel' => array('interval' => 0, 'rotate' => count($chartData['labels']) > 27 ? 45 : 0),
  145. )
  146. ),
  147. set::yAxis
  148. (
  149. array
  150. (
  151. 'type' => 'value',
  152. 'name' => $burnBy == 'storyPoint' ? "({$lang->execution->storyPoint})" : "({$lang->execution->workHour})",
  153. 'axisLine' => array('show' => true)
  154. )
  155. ),
  156. set::legend
  157. (
  158. array
  159. (
  160. 'selectedMode' => false,
  161. 'orient' => 'vertical',
  162. 'left' => 'right',
  163. 'top' => 'center',
  164. 'align' => 'left',
  165. 'data' => array($lang->execution->charts->burn->graph->actuality, $lang->execution->charts->burn->graph->reference, $lang->execution->charts->burn->graph->delay)
  166. )
  167. ),
  168. set::tooltip
  169. (
  170. array
  171. (
  172. 'trigger' => 'axis',
  173. 'axisPointer' => array(
  174. 'type' => 'none'
  175. ),
  176. 'formatter' => "RAWJS<function(rowDatas){return window.randTipInfo(rowDatas);}>RAWJS"
  177. )
  178. ),
  179. set::series
  180. (
  181. array
  182. (
  183. array
  184. (
  185. 'data' => $chartData['baseLine'],
  186. 'type' => 'line',
  187. 'name' => $lang->execution->charts->burn->graph->reference,
  188. 'symbolSize' => 8,
  189. 'symbol' => 'circle',
  190. 'itemStyle' => array
  191. (
  192. 'normal' => array
  193. (
  194. 'color' => '#D8D8D8',
  195. 'lineStyle' => array
  196. (
  197. 'width' => 3,
  198. 'color' => '#F1F1F1'
  199. )
  200. ),
  201. 'emphasis' => array
  202. (
  203. 'color' => '#FFF',
  204. 'borderColor' => '#D8D8D8',
  205. 'borderWidth' => 2
  206. )
  207. ),
  208. 'emphasis' => array
  209. (
  210. 'lineStyle' => array
  211. (
  212. 'width' => 3,
  213. 'color' => '#F1F1F1'
  214. )
  215. )
  216. ),
  217. array
  218. (
  219. 'data' => $chartData['burnLine'],
  220. 'type' => 'line',
  221. 'name' => $lang->execution->charts->burn->graph->actuality,
  222. 'symbolSize' => 8,
  223. 'symbol' => 'circle',
  224. 'itemStyle' => array
  225. (
  226. 'normal' => array
  227. (
  228. 'color' => '#006AF1',
  229. 'lineStyle' => array
  230. (
  231. 'width' => 3,
  232. 'color' => '#2B7DFE'
  233. )
  234. ),
  235. 'emphasis' => array
  236. (
  237. 'color' => '#fff',
  238. 'borderColor' => '#006AF1',
  239. 'borderWidth' => 2
  240. )
  241. )
  242. ),
  243. strpos($type, 'withdelay') !== false ? array
  244. (
  245. 'data' => empty($chartData['delayLine']) ? array() : $chartData['delayLine'],
  246. 'type' => 'line',
  247. 'name' => $lang->execution->charts->burn->graph->delay,
  248. 'symbolSize' => 8,
  249. 'symbol' => 'circle',
  250. 'itemStyle' => array
  251. (
  252. 'normal' => array
  253. (
  254. 'color' => '#F00',
  255. 'lineStyle' => array
  256. (
  257. 'color' => '#F00'
  258. )
  259. ),
  260. 'emphasis' => array
  261. (
  262. 'color' => '#fff',
  263. 'borderColor' => '#F00',
  264. 'borderWidth' => 2
  265. )
  266. ),
  267. ) : null
  268. )
  269. )
  270. )
  271. );