Beispiel #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;
 }
Beispiel #2
0
 /**
  * The project is the parent project of the milestone. 
  */
 public function getProject()
 {
     $milestone = $this->getMilestone();
     if ($milestone->ismilestone) {
         return $this->projectService->getProject($milestone->parentid);
     }
     return $milestone;
 }
Beispiel #3
0
 /**
  * Gets the hierarchy of this task
  * 
  * @return array()
  */
 public function getHierarchy()
 {
     $hierarchy = array();
     if ($this->projectid) {
         $parent = $this->projectService->getProject($this->projectid);
         $hierarchy = $parent->getHierarchy();
         $hierarchy[] = $parent;
     }
     return $hierarchy;
 }