@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @param int $id Id of the Backlog Item |
| 104 | 104 | * |
| 105 | - * @return array {@type Tuleap\AgileDashboard\REST\v1\BacklogItemRepresentation} |
|
| 105 | + * @return BacklogItemRepresentation {@type Tuleap\AgileDashboard\REST\v1\BacklogItemRepresentation} |
|
| 106 | 106 | * |
| 107 | 107 | * @throws 403 |
| 108 | 108 | * @throws 404 |
@@ -317,6 +317,9 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | + /** |
|
| 321 | + * @param integer $id |
|
| 322 | + */ |
|
| 320 | 323 | private function getArtifact($id) { |
| 321 | 324 | $artifact = $this->artifact_factory->getArtifactById($id); |
| 322 | 325 | $current_user = $this->getCurrentUser(); |
@@ -353,6 +356,9 @@ discard block |
||
| 353 | 356 | return new Tracker_SlicedArtifactsBuilder(new Tracker_ArtifactDao()); |
| 354 | 357 | } |
| 355 | 358 | |
| 359 | + /** |
|
| 360 | + * @param integer $limit |
|
| 361 | + */ |
|
| 356 | 362 | private function checkContentLimit($limit) { |
| 357 | 363 | if (! $this->limitValueIsAcceptable($limit)) { |
| 358 | 364 | throw new RestException(406, 'Maximum value for limit exceeded'); |
@@ -371,6 +377,11 @@ discard block |
||
| 371 | 377 | Header::allowOptionsGetPatch(); |
| 372 | 378 | } |
| 373 | 379 | |
| 380 | + /** |
|
| 381 | + * @param integer $limit |
|
| 382 | + * @param integer $offset |
|
| 383 | + * @param integer $size |
|
| 384 | + */ |
|
| 374 | 385 | private function sendPaginationHeaders($limit, $offset, $size) { |
| 375 | 386 | Header::sendPaginationHeaders($limit, $offset, $size, self::MAX_LIMIT); |
| 376 | 387 | } |
@@ -36,7 +36,6 @@ |
||
| 36 | 36 | use TrackerFactory; |
| 37 | 37 | use Tracker_SemanticManager; |
| 38 | 38 | use Tracker_SemanticCollection; |
| 39 | -use Tracker_FormElementFactory; |
|
| 40 | 39 | use Tracker_Semantic_Title; |
| 41 | 40 | use Tracker_Semantic_Status; |
| 42 | 41 | use AgileDashBoard_Semantic_InitialEffort; |
@@ -112,7 +112,6 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @param int $id Id of the column |
| 114 | 114 | * @param int $kanban_id Id of the Kanban {@from query} |
| 115 | - * @param KanbanColumnPATCHRepresentation $column The kanban column {@from body} {@type Tuleap\AgileDashboard\REST\v1\Kanban\KanbanColumnPATCHRepresentation} |
|
| 116 | 115 | * |
| 117 | 116 | * @throws 401 |
| 118 | 117 | * @throws 404 |
@@ -182,7 +181,8 @@ discard block |
||
| 182 | 181 | } |
| 183 | 182 | } |
| 184 | 183 | |
| 185 | - /** @return AgileDashboard_Kanban */ |
|
| 184 | + /** @param integer $id |
|
| 185 | +/** @return AgileDashboard_Kanban */ |
|
| 186 | 186 | private function getKanban(PFUser $user, $id) { |
| 187 | 187 | try { |
| 188 | 188 | $kanban = $this->kanban_factory->getKanban($user, $id); |
@@ -32,6 +32,11 @@ |
||
| 32 | 32 | /** @var int */ |
| 33 | 33 | public $total_size; |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param integer $column_id |
|
| 37 | + * @param integer $limit |
|
| 38 | + * @param integer $offset |
|
| 39 | + */ |
|
| 35 | 40 | public function build(PFUser $user, AgileDashboard_Kanban $kanban, $column_id, $limit, $offset) { |
| 36 | 41 | $dao = new AgileDashboard_KanbanItemDao(); |
| 37 | 42 | $factory = Tracker_ArtifactFactory::instance(); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | * @access hybrid |
| 230 | 230 | * |
| 231 | 231 | * @param int $id Id of the artifact |
| 232 | - * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanRepresentation |
|
| 232 | + * @return KanbanItemRepresentation |
|
| 233 | 233 | */ |
| 234 | 234 | protected function get($id) { |
| 235 | 235 | $this->checkAccess(); |
@@ -325,7 +325,8 @@ discard block |
||
| 325 | 325 | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | - /** @return AgileDashboard_Kanban */ |
|
| 328 | + /** @param integer $id |
|
| 329 | +/** @return AgileDashboard_Kanban */ |
|
| 329 | 330 | private function getKanban(PFUser $user, $id) { |
| 330 | 331 | try { |
| 331 | 332 | $kanban = $this->kanban_factory->getKanban($user, $id); |
@@ -42,10 +42,10 @@ |
||
| 42 | 42 | use PFUser; |
| 43 | 43 | use Tracker_FormElement_Field_List; |
| 44 | 44 | use Tracker_Semantic_Status; |
| 45 | -use Tracker_REST_Artifact_ArtifactCreator as ArtifactCreator; |
|
| 46 | -use Tracker_REST_Artifact_ArtifactValidator as ArtifactValidator; |
|
| 47 | -use Tuleap\Tracker\REST\TrackerReference as TrackerReference; |
|
| 48 | -use Tuleap\Tracker\REST\v1\ArtifactValuesRepresentation as ArtifactValuesRepresentation; |
|
| 45 | +use Tracker_REST_Artifact_ArtifactCreator as ArtifactCreator; |
|
| 46 | +use Tracker_REST_Artifact_ArtifactValidator as ArtifactValidator; |
|
| 47 | +use Tuleap\Tracker\REST\TrackerReference as TrackerReference; |
|
| 48 | +use Tuleap\Tracker\REST\v1\ArtifactValuesRepresentation as ArtifactValuesRepresentation; |
|
| 49 | 49 | use AgileDashboard_KanbanUserPreferences; |
| 50 | 50 | use AgileDashboard_KanbanItemManager; |
| 51 | 51 | use Tuleap\RealTime\NodeJSClient; |
@@ -85,6 +85,11 @@ |
||
| 85 | 85 | */ |
| 86 | 86 | public $user_can_reorder_columns; |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param boolean $user_can_add_columns |
|
| 90 | + * @param boolean $user_can_reorder_columns |
|
| 91 | + * @param boolean $user_can_add_in_place |
|
| 92 | + */ |
|
| 88 | 93 | public function build( |
| 89 | 94 | AgileDashboard_Kanban $kanban, |
| 90 | 95 | AgileDashboard_KanbanColumnFactory $column_factory, |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanRepresentation |
|
| 56 | + * @return KanbanRepresentation |
|
| 57 | 57 | */ |
| 58 | 58 | public function build(AgileDashboard_Kanban $kanban, PFUser $user) { |
| 59 | 59 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | * @param int $limit Number of elements displayed per page |
| 339 | 339 | * @param int $offset Position of the first element to display |
| 340 | 340 | * |
| 341 | - * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanBacklogRepresentation |
|
| 341 | + * @return KanbanBacklogRepresentation |
|
| 342 | 342 | * |
| 343 | 343 | * @throws 403 |
| 344 | 344 | * @throws 404 |
@@ -502,6 +502,9 @@ discard block |
||
| 502 | 502 | return count(array_diff($add->ids, $all_kanban_item_ids)) === 0; |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | + /** |
|
| 506 | + * @param integer $tracker_id |
|
| 507 | + */ |
|
| 505 | 508 | private function getKanbanBacklogItemIds($tracker_id) { |
| 506 | 509 | $backlog_item_ids = array(); |
| 507 | 510 | foreach ($this->kanban_item_dao->getKanbanBacklogItemIds($tracker_id) as $artifact) { |
@@ -539,7 +542,7 @@ discard block |
||
| 539 | 542 | * @param int $limit Number of elements displayed per page |
| 540 | 543 | * @param int $offset Position of the first element to display |
| 541 | 544 | * |
| 542 | - * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanArchiveRepresentation |
|
| 545 | + * @return KanbanArchiveRepresentation |
|
| 543 | 546 | * |
| 544 | 547 | * @throws 403 |
| 545 | 548 | * @throws 404 |
@@ -626,6 +629,9 @@ discard block |
||
| 626 | 629 | } |
| 627 | 630 | } |
| 628 | 631 | |
| 632 | + /** |
|
| 633 | + * @param integer $tracker_id |
|
| 634 | + */ |
|
| 629 | 635 | private function getKanbanArchiveItemIds($tracker_id) { |
| 630 | 636 | $archive_item_ids = array(); |
| 631 | 637 | foreach ($this->kanban_item_dao->getKanbanArchiveItemIds($tracker_id) as $artifact) { |
@@ -665,7 +671,7 @@ discard block |
||
| 665 | 671 | * @param int $limit Number of elements displayed per page |
| 666 | 672 | * @param int $offset Position of the first element to display |
| 667 | 673 | * |
| 668 | - * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanItemCollectionRepresentation |
|
| 674 | + * @return KanbanItemCollectionRepresentation |
|
| 669 | 675 | * |
| 670 | 676 | * @throws 403 |
| 671 | 677 | * @throws 404 |
@@ -773,6 +779,10 @@ discard block |
||
| 773 | 779 | } |
| 774 | 780 | } |
| 775 | 781 | |
| 782 | + /** |
|
| 783 | + * @param integer $tracker_id |
|
| 784 | + * @param integer $column_id |
|
| 785 | + */ |
|
| 776 | 786 | private function getItemsInColumn($tracker_id, $column_id) { |
| 777 | 787 | $column_item_ids = array(); |
| 778 | 788 | foreach ($this->kanban_item_dao->getItemsInColumn($tracker_id, $column_id) as $artifact) { |
@@ -851,7 +861,7 @@ discard block |
||
| 851 | 861 | * |
| 852 | 862 | * @status 201 |
| 853 | 863 | * |
| 854 | - * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanColumnRepresentation |
|
| 864 | + * @return KanbanColumnRepresentation |
|
| 855 | 865 | */ |
| 856 | 866 | protected function postColumns($id, KanbanColumnPOSTRepresentation $column) { |
| 857 | 867 | $current_user = $this->getCurrentUser(); |
@@ -983,7 +993,7 @@ discard block |
||
| 983 | 993 | } |
| 984 | 994 | |
| 985 | 995 | /** |
| 986 | - * @return Tracker |
|
| 996 | + * @return \Tracker |
|
| 987 | 997 | */ |
| 988 | 998 | private function getTrackerForKanban(AgileDashboard_Kanban $kanban) { |
| 989 | 999 | $tracker = $this->tracker_factory->getTrackerById($kanban->getTrackerId()); |
@@ -1001,6 +1011,12 @@ discard block |
||
| 1001 | 1011 | return $this->tracker_factory->getTrackerById($kanban->getTrackerId())->getGroupId(); |
| 1002 | 1012 | } |
| 1003 | 1013 | |
| 1014 | + /** |
|
| 1015 | + * @param PFUser $current_user |
|
| 1016 | + * @param AgileDashboard_Kanban $kanban |
|
| 1017 | + * @param OrderRepresentation|null $order |
|
| 1018 | + * @param KanbanAddRepresentation|null $add |
|
| 1019 | + */ |
|
| 1004 | 1020 | private function sendMessageForDroppingItem($current_user, $kanban, $order, $add, $in_column) { |
| 1005 | 1021 | if(isset($_SERVER[self::HTTP_CLIENT_UUID]) && $_SERVER[self::HTTP_CLIENT_UUID]) { |
| 1006 | 1022 | $data = array( |
@@ -26,9 +26,7 @@ |
||
| 26 | 26 | use Tuleap\Tracker\REST\Artifact\BurndownRepresentation; |
| 27 | 27 | use Tuleap\REST\JsonCast; |
| 28 | 28 | use PlanningFactory; |
| 29 | - |
|
| 30 | 29 | use AgileDashboard_MilestonesCardwallRepresentation; |
| 31 | -use Tuleap\Tracker\REST\TrackerRepresentation; |
|
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | 32 | * Representation of a milestone |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * |
| 252 | 252 | * @param int $id Id of the milestone |
| 253 | 253 | * |
| 254 | - * @return Tuleap\AgileDashboard\REST\v1\MilestoneRepresentation |
|
| 254 | + * @return MilestoneRepresentation |
|
| 255 | 255 | * |
| 256 | 256 | * @throws 403 |
| 257 | 257 | * @throws 404 |
@@ -800,6 +800,9 @@ discard block |
||
| 800 | 800 | $this->sendAllowHeaderForBacklog(); |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | + /** |
|
| 804 | + * @param PFUser $user |
|
| 805 | + */ |
|
| 803 | 806 | private function getBacklogItemAsArtifact($user, $artifact_id) { |
| 804 | 807 | $artifact = $this->tracker_artifact_factory->getArtifactById($artifact_id); |
| 805 | 808 | |
@@ -894,6 +897,9 @@ discard block |
||
| 894 | 897 | return $burndown; |
| 895 | 898 | } |
| 896 | 899 | |
| 900 | + /** |
|
| 901 | + * @param integer $id |
|
| 902 | + */ |
|
| 897 | 903 | private function getMilestoneById(PFUser $user, $id) { |
| 898 | 904 | try { |
| 899 | 905 | $milestone = $this->milestone_factory->getValidatedBareMilestoneByArtifactId($user, $id); |
@@ -917,6 +923,10 @@ discard block |
||
| 917 | 923 | return UserManager::instance()->getCurrentUser(); |
| 918 | 924 | } |
| 919 | 925 | |
| 926 | + /** |
|
| 927 | + * @param \Planning_ArtifactMilestone $milestone |
|
| 928 | + * @param \AgileDashboard_Milestone_Backlog_DescendantBacklogStrategy $strategy |
|
| 929 | + */ |
|
| 920 | 930 | private function getMilestoneContentItems($milestone, $strategy) { |
| 921 | 931 | return $this->backlog_item_collection_factory->getAllCollection( |
| 922 | 932 | $this->getCurrentUser(), |
@@ -926,6 +936,9 @@ discard block |
||
| 926 | 936 | ); |
| 927 | 937 | } |
| 928 | 938 | |
| 939 | + /** |
|
| 940 | + * @param integer $limit |
|
| 941 | + */ |
|
| 929 | 942 | private function checkContentLimit($limit) { |
| 930 | 943 | if (! $this->limitValueIsAcceptable($limit)) { |
| 931 | 944 | throw new RestException(406, 'Maximum value for limit exceeded'); |
@@ -940,6 +953,10 @@ discard block |
||
| 940 | 953 | Header::allowOptionsGetPutPatch(); |
| 941 | 954 | } |
| 942 | 955 | |
| 956 | + /** |
|
| 957 | + * @param integer $limit |
|
| 958 | + * @param integer $offset |
|
| 959 | + */ |
|
| 943 | 960 | private function sendPaginationHeaders($limit, $offset, $size) { |
| 944 | 961 | Header::sendPaginationHeaders($limit, $offset, $size, self::MAX_LIMIT); |
| 945 | 962 | } |
@@ -952,6 +969,9 @@ discard block |
||
| 952 | 969 | Header::allowOptionsGetPut(); |
| 953 | 970 | } |
| 954 | 971 | |
| 972 | + /** |
|
| 973 | + * @param \Planning_ArtifactMilestone $milestone |
|
| 974 | + */ |
|
| 955 | 975 | private function sendAllowHeadersForMilestone($milestone) { |
| 956 | 976 | $date = $milestone->getLastModifiedDate(); |
| 957 | 977 | Header::allowOptionsGet(); |