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; }
/** * 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; }
/** * 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); } } }
/** * Gets all the authorities that represent this user. * * This includes Users and Groups * * @return DbResultSet */ public function getUserAuthorities() { $groups = $this->groupService->getGroupsForUser($this, false); }
/** * Get all the issues that make up the history of this issue * * @return ArrayList */ public function getHistory() { return $this->issueService->getIssueHistory($this->me()); }
/** * 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)); }
/** * 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; }