control.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <?php
  2. class requirement extends control
  3. {
  4. /**
  5. * Create a requirement.
  6. *
  7. * @param int $productID
  8. * @param string $branch
  9. * @param int $moduleID
  10. * @param int $storyID
  11. * @param int $objectID projectID|executionID
  12. * @param int $bugID
  13. * @param int $planID
  14. * @param int $todoID
  15. * @param string $extra for example feedbackID=0
  16. * @access public
  17. * @return void
  18. */
  19. public function create($productID = 0, $branch = '', $moduleID = 0, $storyID = 0, $objectID = 0, $bugID = 0, $planID = 0, $todoID = 0, $extra = '')
  20. {
  21. echo $this->fetch('story', 'create', "productID=$productID&branch=$branch&moduleID=$moduleID&storyID=$storyID&objectID=$objectID&bugID=$bugID&planID=$planID&todoID=$todoID&extra=$extra&storyType=requirement");
  22. }
  23. /**
  24. * Create a batch stories.
  25. *
  26. * @param int $productID
  27. * @param string $branch
  28. * @param int $moduleID
  29. * @param int $storyID
  30. * @param int $executionID projectID|executionID
  31. * @param int $plan
  32. * @param string $storyType
  33. * @param string $extra for example feedbackID=0
  34. * @access public
  35. * @return void
  36. */
  37. public function batchCreate($productID = 0, $branch = '', $moduleID = 0, $storyID = 0, $executionID = 0, $plan = 0, $storyType = 'requirement', $extra = '')
  38. {
  39. echo $this->fetch('story', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$moduleID&storyID=$storyID&executionID=$executionID&plan=$plan&storyType=requirement&extra=$extra");
  40. }
  41. /**
  42. * View a requirement.
  43. *
  44. * @param int $storyID
  45. * @param int $version
  46. * @param int $param executionID|projectID
  47. * @param string $storyType
  48. * @access public
  49. * @return void
  50. */
  51. public function view($storyID, $version = 0, $param = 0)
  52. {
  53. echo $this->fetch('story', 'view', "storyID=$storyID&version=$version&param=$param&storyType=requirement");
  54. }
  55. /**
  56. * Edit a requirement.
  57. *
  58. * @param int $storyID
  59. * @param string $kanbanGroup
  60. * @access public
  61. * @return void
  62. */
  63. public function edit($storyID, $kanbanGroup = 'default')
  64. {
  65. echo $this->fetch('story', 'edit', "storyID=$storyID&kanbanGroup=$kanbanGroup&storyType=requirement");
  66. }
  67. /**
  68. * Batch edit requirement.
  69. *
  70. * @param int $productID
  71. * @param int $executionID
  72. * @param string $branch
  73. * @param string $storyType
  74. * @param string $from
  75. * @access public
  76. * @return void
  77. */
  78. public function batchEdit($productID = 0, $executionID = 0, $branch = '', $storyType = 'requirement', $from = '')
  79. {
  80. echo $this->fetch('story', 'batchEdit', "productID=$productID&executionID=$executionID&branch=$branch&storyType=requirement&from=$from");
  81. }
  82. /**
  83. * 用户需求详情页,关联软件需求,将用户需求关联到软件需求。
  84. * Link story and requirement.
  85. *
  86. * @param int $storyID
  87. * @param string $type linkStories|linkRelateUR|linkRelateSR
  88. * @param int $linkedStoryID
  89. * @param string $browseType ''|bySearch
  90. * @param int $queryID
  91. * @access public
  92. * @return void
  93. */
  94. public function linkStory($storyID, $type = 'linkStories', $linkedStoryID = 0, $browseType = '', $queryID = 0)
  95. {
  96. echo $this->fetch('story', 'linkStory', "storyID=$storyID&type=$type&linkedStoryID=$linkedStoryID&browseType=$browseType&queryID=$queryID&storyType=requirement");
  97. }
  98. /**
  99. * 导出需求数据。
  100. * Get the data of the requiremens to export.
  101. *
  102. * @param int $productID
  103. * @param string $orderBy
  104. * @param int $executionID
  105. * @param string $browseType
  106. * @access public
  107. * @return void
  108. */
  109. public function export($productID, $orderBy, $executionID = 0, $browseType = '')
  110. {
  111. echo $this->fetch('story', 'export', "productID=$productID&orderBy=$orderBy&executionID=$executionID&browseType=$browseType&storyType=requirement");
  112. }
  113. /**
  114. * 导入需求数据。
  115. * Import the data of the requiremens.
  116. *
  117. * @param int $productID
  118. * @param int $branch
  119. * @param string $storyType
  120. * @param int $projectID
  121. * @access public
  122. * @return void
  123. */
  124. public function import($productID, $branch = 0, $storyType = 'requirement', $projectID = 0)
  125. {
  126. echo $this->fetch('story', 'import', "productID=$productID&branch=$branch&storyType=requirement&projectID=$projectID");
  127. }
  128. /**
  129. * 显示导入需求数据的页面。
  130. * Show the page of importing the data of the requiremens.
  131. *
  132. * @param int $productID
  133. * @param int $branch
  134. * @param string $type
  135. * @param int $projectID
  136. * @param int $pagerID
  137. * @param int $maxImport
  138. * @param string $insert
  139. * @access public
  140. * @return void
  141. */
  142. public function showImport($productID, $branch = 0, $type = 'requirement', $projectID = 0, $pagerID = 1, $maxImport = 0, $insert = '')
  143. {
  144. echo $this->fetch('story', 'showImport', "productID=$productID&branch=$branch&type=requirement&projectID=$projectID&pagerID=$pagerID&maxImport=$maxImport&insert=$insert");
  145. }
  146. /**
  147. * 导出需求模板。
  148. * Export the template of the requiremens.
  149. *
  150. * @param int $productID
  151. * @param int $branch
  152. * @param string $storyType
  153. * @access public
  154. * @return void
  155. */
  156. public function exportTemplate($productID, $branch = 0, $storyType = 'requirement')
  157. {
  158. echo $this->fetch('story', 'exportTemplate', "productID=$productID&branch=$branch&storyType=requirement");
  159. }
  160. /**
  161. * Delete a requirement.
  162. *
  163. * @param int $storyID
  164. * @param string $confirm yes|no
  165. * @param string $from taskkanban
  166. * @access public
  167. * @return void
  168. */
  169. public function delete($storyID, $confirm = 'no', $from = '')
  170. {
  171. echo $this->fetch('story', 'delete', "storyID=$storyID&confirm=$confirm&from=$from&storyType=requirement");
  172. }
  173. /**
  174. * Change a requirement.
  175. *
  176. * @param int $storyID
  177. * @param string $from
  178. * @access public
  179. * @return void
  180. */
  181. public function change($storyID, $from = '')
  182. {
  183. echo $this->fetch('story', 'change', "storyID=$storyID&from=$from&storyType=requirement");
  184. }
  185. /**
  186. * Review a requirement.
  187. *
  188. * @param int $storyID
  189. * @param string $from product|project
  190. * @access public
  191. * @return void
  192. */
  193. public function review($storyID, $from = 'product')
  194. {
  195. echo $this->fetch('story', 'review', "storyID=$storyID&from=$from&storyType=requirement");
  196. }
  197. /**
  198. * Submit review.
  199. *
  200. * @param int $storyID
  201. * @access public
  202. * @return void
  203. */
  204. public function submitReview($storyID)
  205. {
  206. echo $this->fetch('story', 'submitReview', "storyID=$storyID&storyType=requirement");
  207. }
  208. /**
  209. * Batch review requirements.
  210. *
  211. * @param string $result
  212. * @param string $reason
  213. * @access public
  214. * @return void
  215. */
  216. public function batchReview($result, $reason = '')
  217. {
  218. echo $this->fetch('story', 'batchReview', "result=$result&reason=$reason&storyType=requirement");
  219. }
  220. /**
  221. * Recall the requirement review or requirement change.
  222. *
  223. * @param int $storyID
  224. * @param string $from list
  225. * @param string $confirm no|yes
  226. * @access public
  227. * @return void
  228. */
  229. public function recall($storyID, $from = 'list', $confirm = 'no')
  230. {
  231. echo $this->fetch('story', 'recall', "storyID=$storyID&from=$from&confirm=$confirm&storyType=requirement");
  232. }
  233. /**
  234. * 需求的指派给页面。
  235. * Assign the requirement to a user.
  236. *
  237. * @param int $storyID
  238. * @access public
  239. * @return void
  240. */
  241. public function assignTo($storyID)
  242. {
  243. echo $this->fetch('story', 'assignTo', "storyID=$storyID");
  244. }
  245. /**
  246. * 关闭需求。
  247. * Close the requirement.
  248. *
  249. * @param int $storyID
  250. * @param string $from taskkanban
  251. * @access public
  252. * @return void
  253. */
  254. public function close($storyID, $from = '')
  255. {
  256. echo $this->fetch('story', 'close', "storyID=$storyID&from=$from&storyType=requirement");
  257. }
  258. /**
  259. * 批量关闭需求。
  260. * Batch close the requiremens.
  261. *
  262. * @param int $productID
  263. * @param int $executionID
  264. * @param string $storyType
  265. * @param string $from contribute|work
  266. * @access public
  267. * @return void
  268. */
  269. public function batchClose($productID = 0, $executionID = 0, $storyType = 'requirement', $from = '')
  270. {
  271. echo $this->fetch('story', 'batchClose', "productID=$productID&executionID=$executionID&storyType=requirement&from=$from");
  272. }
  273. /**
  274. * 激活需求。
  275. * Activate a requirement.
  276. *
  277. * @param int $storyID
  278. * @access public
  279. * @return void
  280. */
  281. public function activate($storyID)
  282. {
  283. echo $this->fetch('story', 'activate', "storyID=$storyID&storyType=requirement");
  284. }
  285. /**
  286. * 查看需求的报告。
  287. * The report page.
  288. *
  289. * @param int $productID
  290. * @param int $branchID
  291. * @param string $storyType
  292. * @param string $browseType
  293. * @param int $moduleID
  294. * @param string $chartType
  295. * @param int $projectID
  296. * @access public
  297. * @return void
  298. */
  299. public function report($productID, $branchID, $storyType = 'requirement', $browseType = 'unclosed', $moduleID = 0, $chartType = 'pie', $projectID = 0)
  300. {
  301. echo $this->fetch('story', 'report', "productID=$productID&branchID=$branchID&storyType=requirement&browseType=$browseType&moduleID=$moduleID&chartType=$chartType&projectID=$projectID");
  302. }
  303. /**
  304. * Batch change branch.
  305. *
  306. * @param int $branchID
  307. * @param string $confirm yes|no
  308. * @param string $storyIdList
  309. * @access public
  310. * @return void
  311. */
  312. public function batchChangeBranch($branchID, $confirm = '', $storyIdList = '')
  313. {
  314. echo $this->fetch('story', 'batchChangeBranch', "branchID=$branchID&confirm=$confirm&storyIdList=$storyIdList&storyType=requirement");
  315. }
  316. /**
  317. * Batch change parent.
  318. *
  319. * @param int $productID
  320. * @param string $storyType
  321. * @access public
  322. * @return void
  323. */
  324. public function batchChangeParent($productID = 0, $storyType = 'requirement')
  325. {
  326. echo $this->fetch('story', 'batchChangeParent', "productID=$productID&storyType=requirement");
  327. }
  328. /**
  329. * Batch change grade.
  330. *
  331. * @param int $grade
  332. * @param string $storyType requirement|story|epic
  333. * @access public
  334. * @return void
  335. */
  336. public function batchChangeGrade($grade, $storyType = 'requirement')
  337. {
  338. echo $this->fetch('story', 'batchChangeGrade', "grade=$grade&storyType=requirement");
  339. }
  340. /**
  341. * Batch assign to.
  342. *
  343. * @param string $storyType story|requirement
  344. * @access public
  345. * @return void
  346. * @param string $assignedTo
  347. */
  348. public function batchAssignTo($storyType = 'requirement', $assignedTo = '')
  349. {
  350. echo $this->fetch('story', 'batchAssignTo', "storyType=requirement&assignedTo=$assignedTo");
  351. }
  352. /**
  353. * Batch change the module of story.
  354. *
  355. * @param int $moduleID
  356. * @access public
  357. * @return void
  358. */
  359. public function batchChangeModule($moduleID)
  360. {
  361. echo $this->fetch('story', 'batchChangeModule', "moduleID=$moduleID&storyType=requirement");
  362. }
  363. /**
  364. * Batch change plan.
  365. *
  366. * @param int $planID
  367. * @param int $oldPlanID
  368. * @access public
  369. * @return void
  370. */
  371. public function batchChangePlan($planID, $oldPlanID = 0)
  372. {
  373. echo $this->fetch('story', 'batchChangePlan', "planID=$planID&oldPlanID=$oldPlanID&storyType=epic");
  374. }
  375. /**
  376. * 关联用户需求。
  377. * Link related requirements.
  378. *
  379. * @param int $storyID
  380. * @param string $browseType
  381. * @param string $excludeStories
  382. * @param int $param
  383. * @param int $recTotal
  384. * @param int $recPerPage
  385. * @param int $pageID
  386. * @access public
  387. * @return void
  388. */
  389. public function linkRequirements($storyID, $browseType = '', $excludeStories = '', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
  390. {
  391. echo $this->fetch('story', 'linkRequirements', "storyID=$storyID&browseType=$browseType&excludeStories=$excludeStories&param=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
  392. }
  393. /**
  394. * Ajax get the stories of a user.
  395. *
  396. * @param int $userID
  397. * @param string $id
  398. * @param int $appendID
  399. * @param string $storyType
  400. * @access public
  401. * @return void
  402. */
  403. public function ajaxGetUserStories($userID = 0, $id = '', $appendID = 0, $storyType = 'requirement')
  404. {
  405. echo $this->fetch('story', 'ajaxGetUserStories', "userID=$userID&id=$id&appendID=$appendID&storyType=requirement");
  406. }
  407. /**
  408. * 需求的父需求变更时,子需求确认变更。
  409. * Confirm the change of the parent story.
  410. *
  411. * @param int $storyID
  412. * @access public
  413. * @return void
  414. */
  415. public function processStoryChange($storyID)
  416. {
  417. echo $this->fetch('story', 'processStoryChange', "storyID=$storyID");
  418. }
  419. }