Exemplo n.º 1
0
 /**
  * Populates the array of calendar information
  * 
  * @return array
  */
 private function buildCal()
 {
     $counter = 0;
     $ms = new milestone();
     $tsk = new task();
     for ($j = 0; $j < $this->weeksInMonth; $j++) {
         for ($i = 0; $i < 7; $i++) {
             $counter++;
             $theday = $counter - $this->firstDay;
             if ($theday < 1) {
                 $this->calendar[$j][$i]["val"] = $this->daysLastMonth + $theday;
                 $this->calendar[$j][$i]["currmonth"] = 0;
             } elseif ($theday > $this->daysInMonth) {
                 $this->calendar[$j][$i]["val"] = $theday - $this->daysInMonth;
                 $this->calendar[$j][$i]["currmonth"] = 0;
             } else {
                 $miles = $ms->getTodayMilestones($this->month, $this->year, $theday, $this->project);
                 $milesnum = count($miles);
                 $tasks = $tsk->getTodayTasks($this->month, $this->year, $theday, $this->project);
                 $tasksnum = count($tasks);
                 $this->calendar[$j][$i] = array("val" => $theday, "milestones" => $miles, "milesnum" => $milesnum, "tasks" => $tasks, "tasksnum" => $tasksnum, "currmonth" => 1);
             }
         }
     }
     return $this;
 }