Exemple #1
0
 public function getRecordedTime()
 {
     $theProject = $this->projectService->getProject($this->projectid);
     $records = $this->projectService->getTimesheetReport(null, $theProject, null, -1, $this->startdate, $this->enddate);
     $userTimeMapping = array();
     foreach ($records as $record) {
         $current = ifset($userTimeMapping, $record->user, 0);
         // go through all times
         foreach ($record->days as $daytime) {
             $current += $daytime;
         }
         $userTimeMapping[$record->user] = $current;
     }
     return $userTimeMapping;
 }
Exemple #2
0
 /**
  * Get all the tasks attached to this feature
  *
  * @return array
  */
 public function getTasks()
 {
     if ($this->tasks == null) {
         $this->tasks = $this->itemLinkService->getLinkedItemsOfType($this->me(), 'from', 'Task');
     }
     return $this->tasks;
 }
Exemple #3
0
 /**
  * Called when the task is 'started'
  *
  */
 public function start()
 {
     $issues = $this->itemLinkService->getLinkedItems($this, 'to', 'Issue');
     foreach ($issues as $issue) {
         if ($issue->status == 'New' || $issue->status == 'Open') {
             $this->log->debug("Updating status for request #{$issue->id}");
             $issue->status = 'In Progress';
             $this->issueService->saveIssue($issue);
         }
     }
 }
Exemple #4
0
 /**
  * Gets all the authorities that represent this user.
  *
  * This includes Users and Groups
  *
  * @return DbResultSet
  */
 public function getUserAuthorities()
 {
     $groups = $this->groupService->getGroupsForUser($this, false);
 }
Exemple #5
0
 /**
  * Get all the issues that make up the history of this issue
  *
  * @return ArrayList
  */
 public function getHistory()
 {
     return $this->issueService->getIssueHistory($this->me());
 }
Exemple #6
0
 /**
  * Get all the issues for a given client
  */
 public function getIssues()
 {
     return $this->issueService->getIssues(array('issue.clientid=' => $this->me()->id, 'status <> ' => Issue::STATUS_CLOSED));
 }
Exemple #7
0
 /**
  * Gets all the children of this project
  */
 private function getProjects($grandChildren = false, $milestones = 0)
 {
     $where = array('parentid=' => $this->id);
     if ($milestones !== null) {
         $where['ismilestone='] = $milestones;
     }
     $children = $this->projectService->getProjects($where, 'due asc');
     if (!$grandChildren) {
         return $children;
     }
     // now get all of its children too
     $grandkids = new ArrayObject();
     foreach ($children as $childProject) {
         $grandkids[] = $childProject;
         // get its children and add them too
         $nextChildren = $childProject->getProjects(true, $milestones);
         foreach ($nextChildren as $nc) {
             $grandkids->append($nc);
         }
     }
     return $grandkids;
 }