control.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?php
  2. /**
  3. * The control file of projectBuild module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  7. * @package projectBuild
  8. * @version $Id: control.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
  9. * @link https://www.zentao.net
  10. */
  11. class projectBuild extends control
  12. {
  13. /**
  14. * 获取项目的版本列表。
  15. * Browse builds of a project.
  16. *
  17. * @param int $projectID
  18. * @param string $type all|product|bysearch
  19. * @param int $param
  20. * @param string $orderBy
  21. * @param int $recTotal
  22. * @param int $recPerPage
  23. * @param int $pageID
  24. * @access public
  25. * @return void
  26. */
  27. public function browse($projectID = 0, $type = 'all', $param = 0, $orderBy = 't1.date_desc,t1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
  28. {
  29. echo $this->fetch('project', 'build', "projectID={$projectID}&type={$type}&param={$param}&orderBy={$orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}");
  30. }
  31. /**
  32. * 创建项目版本。
  33. * Create a build for project.
  34. *
  35. * @param int $projectID
  36. * @access public
  37. * @return void
  38. */
  39. public function create($projectID = 0)
  40. {
  41. $executionID = 0;
  42. $project = $this->loadModel('project')->fetchById($projectID);
  43. if($project->model == 'waterfall') $this->lang->projectbuild->execution = $this->lang->project->stage;
  44. if(strpos('stage,sprint,kanban', $project->type) !== false)
  45. {
  46. $executionID = $projectID;
  47. $projectID = $project->project;
  48. }
  49. echo $this->fetch('build', 'create', "executionID=$executionID&productID=0&projectID=$projectID");
  50. }
  51. /**
  52. * 编辑项目版本。
  53. * Edit a build for project.
  54. *
  55. * @param int $buildID
  56. * @access public
  57. * @return void
  58. */
  59. public function edit($buildID)
  60. {
  61. echo $this->fetch('build', 'edit', "buildID=$buildID");
  62. }
  63. /**
  64. * 查看项目版本。
  65. * View a build for project.
  66. *
  67. * @param int $buildID
  68. * @param string $type
  69. * @param string $link
  70. * @param string $param
  71. * @param string $orderBy
  72. * @param int $recTotal
  73. * @param int $recPerPage
  74. * @param int $pageID
  75. * @access public
  76. * @return void
  77. */
  78. public function view($buildID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
  79. {
  80. echo $this->fetch('build', 'view', "buildID=$buildID&type=$type&link=$link&param=$param&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
  81. }
  82. /**
  83. * 删除项目版本。
  84. * Delete a build for project.
  85. *
  86. * @param int $buildID
  87. * @access public
  88. * @return void
  89. */
  90. public function delete($buildID)
  91. {
  92. $this->locate($this->createLink('build', 'delete', "buildID={$buildID}&from=project"));
  93. }
  94. /**
  95. * 项目版本关联需求。
  96. * Link stories.
  97. *
  98. * @param int $buildID
  99. * @param string $browseType
  100. * @param int $param
  101. * @param string $orderBy
  102. * @param int $recTotal
  103. * @param int $recPerPage
  104. * @param int $pageID
  105. * @access public
  106. * @return void
  107. */
  108. public function linkStory($buildID = 0, $browseType = '', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
  109. {
  110. echo $this->fetch('build', 'linkStory', "buildID=$buildID&browseType=$browseType&param=$param&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
  111. }
  112. /**
  113. * 移除关联的需求。
  114. * Unlink story.
  115. *
  116. * @param int $buildID
  117. * @param int $storyID
  118. * @access public
  119. * @return void
  120. */
  121. public function unlinkStory($buildID, $storyID)
  122. {
  123. echo $this->fetch('build', 'unlinkStory', "buildID=$buildID&storyID=$storyID");
  124. }
  125. /**
  126. * 批量移除关联的需求。
  127. * Batch unlink story.
  128. *
  129. * @param int $buildID
  130. * @access public
  131. * @return void
  132. */
  133. public function batchUnlinkStory($buildID)
  134. {
  135. echo $this->fetch('build', 'batchUnlinkStory', "buildID=$buildID");
  136. }
  137. /**
  138. * 项目版本关联Bug。
  139. * Link bugs.
  140. *
  141. * @param int $buildID
  142. * @param string $browseType
  143. * @param int $param
  144. * @param int $recTotal
  145. * @param int $recPerPage
  146. * @param int $pageID
  147. * @access public
  148. * @return void
  149. */
  150. public function linkBug($buildID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 100, $pageID = 1)
  151. {
  152. echo $this->fetch('build', 'linkBug', "buildID=$buildID&browseType=$browseType&param=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
  153. }
  154. /**
  155. * 移除关联的Bug。
  156. * Unlink bug.
  157. *
  158. * @param int $buildID
  159. * @param int $bugID
  160. * @access public
  161. * @return void
  162. */
  163. public function unlinkBug($buildID, $bugID)
  164. {
  165. echo $this->fetch('build', 'unlinkBug', "buildID=$buildID&bugID=$bugID");
  166. }
  167. /**
  168. * 批量移除关联的Bug。
  169. * Batch unlink bug.
  170. *
  171. * @param int $buildID
  172. * @access public
  173. * @return void
  174. */
  175. public function batchUnlinkBug($buildID)
  176. {
  177. echo $this->fetch('build', 'batchUnlinkBug', "buildID=$buildID");
  178. }
  179. }