@@ -33,6 +33,10 @@ discard block |
||
| 33 | 33 | return $this->retrieve($sql); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param integer $kanban_id |
|
| 38 | + * @param integer $column_id |
|
| 39 | + */ |
|
| 36 | 40 | public function setColumnWipLimit($kanban_id, $column_id, $wip_limit) { |
| 37 | 41 | $kanban_id = $this->da->escapeInt($kanban_id); |
| 38 | 42 | $column_id = $this->da->escapeInt($column_id); |
@@ -44,6 +48,10 @@ discard block |
||
| 44 | 48 | return $this->update($sql); |
| 45 | 49 | } |
| 46 | 50 | |
| 51 | + /** |
|
| 52 | + * @param integer $kanban_id |
|
| 53 | + * @param integer $column_id |
|
| 54 | + */ |
|
| 47 | 55 | public function deleteColumn($kanban_id, $column_id) { |
| 48 | 56 | $kanban_id = $this->da->escapeInt($kanban_id); |
| 49 | 57 | $column_id = $this->da->escapeInt($column_id); |
@@ -89,6 +89,9 @@ |
||
| 89 | 89 | throw new AgileDashboard_KanbanColumnNotFoundException($kanban, $column_id); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | + /** |
|
| 93 | + * @param Tracker_FormElement_Field_List_BindValue[] $field_values |
|
| 94 | + */ |
|
| 92 | 95 | private function instantiate(AgileDashboard_Kanban $kanban, $id, PFUser $user, $field_values) { |
| 93 | 96 | return new AgileDashboard_KanbanColumn( |
| 94 | 97 | $id, |
@@ -40,6 +40,9 @@ discard block |
||
| 40 | 40 | $this->kanban_actions_checker = $kanban_actions_checker; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $label |
|
| 45 | + */ |
|
| 43 | 46 | public function createColumn(PFUser $user, AgileDashboard_Kanban $kanban, $label) { |
| 44 | 47 | $this->kanban_actions_checker->checkUserCanAddColumns($user, $kanban); |
| 45 | 48 | |
@@ -81,12 +84,18 @@ discard block |
||
| 81 | 84 | return true; |
| 82 | 85 | } |
| 83 | 86 | |
| 87 | + /** |
|
| 88 | + * @param integer $wip_limit |
|
| 89 | + */ |
|
| 84 | 90 | public function updateWipLimit(PFUser $user, AgileDashboard_Kanban $kanban, AgileDashboard_KanbanColumn $column, $wip_limit) { |
| 85 | 91 | $this->kanban_actions_checker->checkUserCanAdministrate($user, $kanban); |
| 86 | 92 | |
| 87 | 93 | return $this->column_dao->setColumnWipLimit($column->getKanbanId(), $column->getId(), $wip_limit); |
| 88 | 94 | } |
| 89 | 95 | |
| 96 | + /** |
|
| 97 | + * @param string $label |
|
| 98 | + */ |
|
| 90 | 99 | public function updateLabel(PFUser $user, AgileDashboard_Kanban $kanban, AgileDashboard_KanbanColumn $column, $label) { |
| 91 | 100 | $this->kanban_actions_checker->checkUserCanAdministrate($user, $kanban); |
| 92 | 101 | $this->kanban_actions_checker->checkUserCanEditColumnLabel($user, $kanban); |
@@ -17,8 +17,6 @@ |
||
| 17 | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -use Tuleap\AgileDashboard\REST\v1\Kanban\KanbanColumnPATCHRepresentation; |
|
| 21 | - |
|
| 22 | 20 | class AgileDashboard_KanbanColumnManager { |
| 23 | 21 | |
| 24 | 22 | /** @var AgileDashboard_KanbanColumnDao */ |
@@ -77,6 +77,10 @@ discard block |
||
| 77 | 77 | return $this->updateAndGetLastId($sql); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | + /** |
|
| 81 | + * @param integer $kanban_id |
|
| 82 | + * @param string $kanban_name |
|
| 83 | + */ |
|
| 80 | 84 | public function save($kanban_id, $kanban_name) { |
| 81 | 85 | $kanban_id = $this->da->escapeInt($kanban_id); |
| 82 | 86 | $kanban_name = $this->da->quoteSmart($kanban_name); |
@@ -88,6 +92,9 @@ discard block |
||
| 88 | 92 | return $this->update($sql); |
| 89 | 93 | } |
| 90 | 94 | |
| 95 | + /** |
|
| 96 | + * @param string $kanban_id |
|
| 97 | + */ |
|
| 91 | 98 | public function delete($kanban_id) { |
| 92 | 99 | $kanban_id = $this->da->escapeInt($kanban_id); |
| 93 | 100 | |
@@ -106,6 +113,9 @@ discard block |
||
| 106 | 113 | $this->commit(); |
| 107 | 114 | } |
| 108 | 115 | |
| 116 | + /** |
|
| 117 | + * @param integer $tracker_kanban |
|
| 118 | + */ |
|
| 109 | 119 | public function getKanbanByTrackerId($tracker_kanban) { |
| 110 | 120 | $tracker_kanban = $this->da->escapeInt($tracker_kanban); |
| 111 | 121 | |
@@ -21,6 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | class AgileDashboard_KanbanItemDao extends DataAccessObject { |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param integer $tracker_id |
|
| 26 | + */ |
|
| 24 | 27 | public function getAllKanbanItemIds($tracker_id) { |
| 25 | 28 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 26 | 29 | |
@@ -34,6 +37,7 @@ discard block |
||
| 34 | 37 | |
| 35 | 38 | /** |
| 36 | 39 | * Backlog items for a kanban are artifacts that have no value for the semantic status field |
| 40 | + * @param integer $tracker_id |
|
| 37 | 41 | */ |
| 38 | 42 | public function searchPaginatedBacklogItemsByTrackerId($tracker_id, $limit, $offset) { |
| 39 | 43 | $tracker_id = $this->da->escapeInt($tracker_id); |
@@ -82,6 +86,7 @@ discard block |
||
| 82 | 86 | |
| 83 | 87 | /** |
| 84 | 88 | * Archived items for a kanban are artifacts that have "closed" value for the semantic status field |
| 89 | + * @param integer $tracker_id |
|
| 85 | 90 | */ |
| 86 | 91 | public function searchPaginatedArchivedItemsByTrackerId($tracker_id, $limit, $offset) { |
| 87 | 92 | $tracker_id = $this->da->escapeInt($tracker_id); |
@@ -132,6 +137,9 @@ discard block |
||
| 132 | 137 | return $this->retrieve($sql); |
| 133 | 138 | } |
| 134 | 139 | |
| 140 | + /** |
|
| 141 | + * @param integer $tracker_id |
|
| 142 | + */ |
|
| 135 | 143 | public function searchPaginatedItemsInColumn($tracker_id, $column_id, $limit, $offset) { |
| 136 | 144 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 137 | 145 | $column_id = $this->da->escapeInt($column_id); |
@@ -177,6 +185,9 @@ discard block |
||
| 177 | 185 | return $this->retrieve($sql); |
| 178 | 186 | } |
| 179 | 187 | |
| 188 | + /** |
|
| 189 | + * @param integer $tracker_id |
|
| 190 | + */ |
|
| 180 | 191 | public function getOpenItemIds($tracker_id) { |
| 181 | 192 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 182 | 193 | |
@@ -197,6 +208,10 @@ discard block |
||
| 197 | 208 | return $this->retrieve($sql); |
| 198 | 209 | } |
| 199 | 210 | |
| 211 | + /** |
|
| 212 | + * @param integer $tracker_id |
|
| 213 | + * @param integer $item_id |
|
| 214 | + */ |
|
| 200 | 215 | public function searchTimeInfoForItem($tracker_id, $item_id) { |
| 201 | 216 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 202 | 217 | $item_id = $this->da->escapeInt($item_id); |
@@ -234,7 +249,7 @@ discard block |
||
| 234 | 249 | * then goes back to Done column at t4, and finally come back at t5. |
| 235 | 250 | * The returned value is expected to be t5. |
| 236 | 251 | * |
| 237 | - * @param type $item_id The archived item id |
|
| 252 | + * @param integer $item_id The archived item id |
|
| 238 | 253 | * |
| 239 | 254 | * @return int|null |
| 240 | 255 | */ |
@@ -268,6 +283,10 @@ discard block |
||
| 268 | 283 | return is_array($row) ? (int)$row['submitted_on'] : null; |
| 269 | 284 | } |
| 270 | 285 | |
| 286 | + /** |
|
| 287 | + * @param integer $tracker_id |
|
| 288 | + * @param integer $artifact_id |
|
| 289 | + */ |
|
| 271 | 290 | public function isKanbanItemInBacklog($tracker_id, $artifact_id) { |
| 272 | 291 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 273 | 292 | $artifact_id = $this->da->escapeInt($artifact_id); |
@@ -290,6 +309,10 @@ discard block |
||
| 290 | 309 | return $this->retrieve($sql); |
| 291 | 310 | } |
| 292 | 311 | |
| 312 | + /** |
|
| 313 | + * @param integer $tracker_id |
|
| 314 | + * @param integer $artifact_id |
|
| 315 | + */ |
|
| 293 | 316 | public function isKanbanItemInArchive($tracker_id, $artifact_id) { |
| 294 | 317 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 295 | 318 | $artifact_id = $this->da->escapeInt($artifact_id); |
@@ -314,6 +337,10 @@ discard block |
||
| 314 | 337 | return $this->retrieve($sql); |
| 315 | 338 | } |
| 316 | 339 | |
| 340 | + /** |
|
| 341 | + * @param integer $tracker_id |
|
| 342 | + * @param integer $artifact_id |
|
| 343 | + */ |
|
| 317 | 344 | public function getColumnIdOfKanbanItem($tracker_id, $artifact_id) { |
| 318 | 345 | $tracker_id = $this->da->escapeInt($tracker_id); |
| 319 | 346 | $artifact_id = $this->da->escapeInt($artifact_id); |
@@ -41,6 +41,11 @@ |
||
| 41 | 41 | /** @var string */ |
| 42 | 42 | public $nodejs_server; |
| 43 | 43 | |
| 44 | + /** |
|
| 45 | + * @param boolean $user_is_kanban_admin |
|
| 46 | + * @param string $language |
|
| 47 | + * @param integer $project_id |
|
| 48 | + */ |
|
| 44 | 49 | public function __construct( |
| 45 | 50 | AgileDashboard_Kanban $kanban, |
| 46 | 51 | PFUser $user, |
@@ -108,6 +108,9 @@ discard block |
||
| 108 | 108 | return $this->done_collection[$milestone->getArtifactId()]; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | + /** |
|
| 112 | + * @param false|string $redirect_to_self |
|
| 113 | + */ |
|
| 111 | 114 | public function getUnassignedOpenCollection( |
| 112 | 115 | PFUser $user, |
| 113 | 116 | Planning_Milestone $milestone, |
@@ -119,6 +122,9 @@ discard block |
||
| 119 | 122 | return $this->filterOutAssignedBacklogItems($collection, $user); |
| 120 | 123 | } |
| 121 | 124 | |
| 125 | + /** |
|
| 126 | + * @param boolean $redirect_to_self |
|
| 127 | + */ |
|
| 122 | 128 | public function getUnassignedCollection( |
| 123 | 129 | PFUser $user, |
| 124 | 130 | Planning_Milestone $milestone, |
@@ -221,6 +227,9 @@ discard block |
||
| 221 | 227 | return $collection; |
| 222 | 228 | } |
| 223 | 229 | |
| 230 | + /** |
|
| 231 | + * @param string $redirect_to_self |
|
| 232 | + */ |
|
| 224 | 233 | public function getInconsistentCollection( |
| 225 | 234 | PFUser $user, |
| 226 | 235 | Planning_Milestone $milestone, |
@@ -232,6 +241,9 @@ discard block |
||
| 232 | 241 | return $this->inconsistent_collection[$milestone->getArtifactId()]; |
| 233 | 242 | } |
| 234 | 243 | |
| 244 | + /** |
|
| 245 | + * @param string $redirect_to_self |
|
| 246 | + */ |
|
| 235 | 247 | public function getAllCollection( |
| 236 | 248 | PFUser $user, |
| 237 | 249 | Planning_Milestone $milestone, |
@@ -471,6 +483,9 @@ discard block |
||
| 471 | 483 | } |
| 472 | 484 | } |
| 473 | 485 | |
| 486 | + /** |
|
| 487 | + * @param integer $artifact_id |
|
| 488 | + */ |
|
| 474 | 489 | private function pushItemInDoneCollection(Planning_Milestone $milestone, array $semantics, $artifact_id, AgileDashboard_Milestone_Backlog_IBacklogItem $backlog_item) { |
| 475 | 490 | $this->setInitialEffort($backlog_item, $semantics[$artifact_id]); |
| 476 | 491 | |
@@ -24,12 +24,21 @@ |
||
| 24 | 24 | |
| 25 | 25 | interface AgileDashboard_Milestone_Backlog_BacklogRowPresenter { |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @return string |
|
| 29 | + */ |
|
| 27 | 30 | public function title(); |
| 28 | 31 | |
| 29 | 32 | public function url(); |
| 30 | 33 | |
| 34 | + /** |
|
| 35 | + * @return integer |
|
| 36 | + */ |
|
| 31 | 37 | public function points(); |
| 32 | 38 | |
| 39 | + /** |
|
| 40 | + * @return string|null |
|
| 41 | + */ |
|
| 33 | 42 | public function parent_title(); |
| 34 | 43 | |
| 35 | 44 | public function parent_url(); |
@@ -275,6 +275,7 @@ discard block |
||
| 275 | 275 | * We only want the section of the tree that goes from a |
| 276 | 276 | * tracker in a milestone to a tracker in a submilestone. |
| 277 | 277 | * |
| 278 | + * @param integer[] $submilestone_tracker_hierarchy_tree |
|
| 278 | 279 | */ |
| 279 | 280 | private function extractRelevantSubmilestoneBacklogTrackerHierarchyTreeSection(&$submilestone_tracker_hierarchy_tree) { |
| 280 | 281 | foreach ($submilestone_tracker_hierarchy_tree as $key => $value) { |
@@ -299,6 +300,7 @@ discard block |
||
| 299 | 300 | |
| 300 | 301 | /** |
| 301 | 302 | * get all children of a given type of any of the parent items |
| 303 | + * @param string $ids_of_parent_items_to_search_in |
|
| 302 | 304 | */ |
| 303 | 305 | private function getIdsOfChildItemsOfOneTrackerType($ids_of_parent_items_to_search_in, $tracker_id) { |
| 304 | 306 | $search = $this->artifact_dao->getLinkedArtifactsOfArtifactsOfTrackerTypeAsString( |
@@ -309,6 +311,9 @@ discard block |
||
| 309 | 311 | return (string) $search['artifact_ids']; |
| 310 | 312 | } |
| 311 | 313 | |
| 314 | + /** |
|
| 315 | + * @param string $children |
|
| 316 | + */ |
|
| 312 | 317 | private function canChildrenBePlanned($children, $tracker_id) { |
| 313 | 318 | return $children && in_array($tracker_id, $this->descendant_tracker_ids); |
| 314 | 319 | } |