Пример #1
0
 public function executeSummary()
 {
     $user_id = $this->getUser()->getGuardUser()->getId();
     $thismonth = DaystatTable::getThisMonth($user_id);
     $thisweek = DaystatTable::getThisWeek($user_id);
     $thisday = DaystatTable::getThisDay($user_id);
     $this->month = $this->getSummary($user_id, $thismonth);
     $this->week = $this->getSummary($user_id, $thisweek);
     $this->day = $this->getSummary($user_id, $thisday);
     foreach ($this->month['groups'] as $name => $group) {
         if (!array_key_exists($name, $this->week['groups'])) {
             $this->week['groups'][$name] = array('tasks' => array(), 'minutes' => 0);
         }
         if (!array_key_exists($name, $this->day['groups'])) {
             $this->day['groups'][$name] = array('tasks' => array(), 'minutes' => 0);
         }
         foreach ($group['tasks'] as $namet => $task) {
             if (!array_key_exists($namet, $this->week['groups'][$name]['tasks'])) {
                 $this->week['groups'][$name]['tasks'][$namet] = array('color' => $task['color'], 'minutes' => 0);
             }
             if (!array_key_exists($namet, $this->day['groups'][$name]['tasks'])) {
                 $this->day['groups'][$name]['tasks'][$namet] = array('color' => $task['color'], 'minutes' => 0);
             }
         }
     }
 }