public function get(PFUser $user, Planning_Milestone $milestone)
 {
     $artifact = $milestone->getArtifact();
     $field = $artifact->getABurndownField($user);
     if (!$field) {
         throw new RestException(404);
     }
     $rest = $field->getRESTValue($user, $artifact->getLastChangeset());
     Header::allowOptionsGet();
     return $rest->value;
 }
Exemplo n.º 2
0
 private function sendAllowHeader()
 {
     Header::allowOptionsGet();
 }
Exemplo n.º 3
0
 /**
  * Get artifacts
  *
  * Get artifacts matching criteria of a report.
  *
  * <p>
  * By default it does not return the values of the fields for performance reasons.
  * You can ask to include some specific values with the <strong>values</strong> parameter.<br>
  * Eg:
  * <ul>
  *  <li>…?id=123&values=summary,status //add summary and status values
  *  <li>…?id=123&values=all            //add all fields values
  *  <li>…?id=123&values=               //(empty string) do not add any field values
  * </ul>
  * </p>
  *
  * <p>
  *   <strong>/!\</strong> Please note that <strong>only "all" and "" (empty string) are available</strong> for now.
  * </p>
  *
  * @url GET {id}/artifacts
  * @access hybrid
  *
  * @param int    $id      Id of the report
  * @param string $values  Which fields to include in the response. Default is no field values {@from path}{@choice ,all}
  * @param int    $limit   Number of elements displayed per page {@from path}{@min 1}
  * @param int    $offset  Position of the first element to display {@from path}{@min 0}
  *
  * @return array {@type Tuleap\Tracker\REST\Artifact\ArtifactRepresentation}
  */
 public function getArtifacts($id, $values = self::DEFAULT_VALUES, $limit = self::DEFAULT_LIMIT, $offset = self::DEFAULT_OFFSET)
 {
     $this->checkAccess();
     $this->checkLimitValue($limit);
     $user = UserManager::instance()->getCurrentUser();
     $report = $this->getReportById($user, $id);
     $matching_ids = $report->getMatchingIds();
     if (!$matching_ids['id']) {
         return array();
     }
     $matching_artifact_ids = explode(',', $matching_ids['id']);
     $nb_matching = count($matching_artifact_ids);
     $slice_matching_ids = array_slice($matching_artifact_ids, $offset, $limit);
     $artifact_factory = Tracker_ArtifactFactory::instance();
     $artifacts = $artifact_factory->getArtifactsByArtifactIdList($slice_matching_ids);
     $with_all_field_values = $values == self::ALL_VALUES;
     Header::allowOptionsGet();
     Header::sendPaginationHeaders($limit, $offset, $nb_matching, self::MAX_LIMIT);
     return $this->getListOfArtifactRepresentation($user, $artifacts, $with_all_field_values);
 }
 private function sendAllowHeadersForChangesets()
 {
     Header::allowOptionsGet();
 }
 /**
  * Return info about repository if exists
  *
  * @url OPTIONS {id}
  *
  * @param string $id Id of the repository
  *
  * @throws 403
  * @throws 404
  */
 public function optionsId($id)
 {
     Header::allowOptionsGet();
 }
Exemplo n.º 6
0
 /**
  * Get items
  *
  * Get the items of a given kanban in a given column
  *
  * <pre>
  * /!\ Kanban REST routes are under construction and subject to changes /!\
  * </pre>
  *
  * @url GET {id}/items
  * @access hybrid
  *
  * @param int $id Id of the kanban
  * @param int $column_id Id of the column the item belongs to
  * @param int $limit  Number of elements displayed per page
  * @param int $offset Position of the first element to display
  *
  * @return Tuleap\AgileDashboard\REST\v1\Kanban\KanbanItemCollectionRepresentation
  *
  * @throws 403
  * @throws 404
  */
 public function getItems($id, $column_id, $limit = 10, $offset = 0)
 {
     $this->checkAccess();
     $user = $this->getCurrentUser();
     $kanban = $this->getKanban($user, $id);
     if (!$this->columnIsInTracker($kanban, $user, $column_id)) {
         throw new RestException(404);
     }
     $items_representation = new KanbanItemCollectionRepresentation();
     $items_representation->build($user, $kanban, $column_id, $limit, $offset);
     Header::allowOptionsGet();
     Header::sendPaginationHeaders($limit, $offset, $items_representation->total_size, self::MAX_LIMIT);
     return $items_representation;
 }
Exemplo n.º 7
0
 private function sendAllowHeadersForBurndown()
 {
     Header::allowOptionsGet();
 }
Exemplo n.º 8
0
 private function sendAllowHeadersForBacklog()
 {
     Header::allowOptionsGet();
 }
 private function sendAllowHeadersForArtifactFilesId()
 {
     Header::allowOptionsGet();
     Header::sendMaxFileChunkSizeHeaders(self::DEFAULT_LIMIT);
 }
Exemplo n.º 10
0
 private function sendAllowHeadersForUserGroup()
 {
     Header::allowOptionsGet();
 }
Exemplo n.º 11
0
 private function sendAllowHeadersForProject()
 {
     Header::allowOptionsGet();
 }
Exemplo n.º 12
0
 private function sendAllowHeadersForMilestones()
 {
     Header::allowOptionsGet();
 }
 private function sendAllowHeaderForCardwall()
 {
     Header::allowOptionsGet();
 }
Exemplo n.º 14
0
 /**
  * @url OPTIONS {id}/versions
  */
 public function optionsVersions($id)
 {
     Header::allowOptionsGet();
 }