Пример #1
0
 function findMeetingEventsWithEmptyStatus($pidList)
 {
     if ($this->rightsObj->isLoggedIn()) {
         $start_date = new \TYPO3\CMS\Cal\Model\CalDate();
         $start_date->setTZById('UTC');
         $end_date = new \TYPO3\CMS\Cal\Model\CalDate();
         $end_date->copy($start_date);
         $end_date->addSeconds($this->conf['view.'][$this->conf['view'] . '.']['event.']['meeting.']['lookingAhead']);
         $this->setStartAndEndPoint($start_date, $end_date);
         $formattedStarttime = $this->starttime->format('%Y%m%d');
         $formattedEndtime = $this->endtime->format('%Y%m%d');
         $calendarService =& $this->modelObj->getServiceObjByKey('cal_calendar_model', 'calendar', 'tx_cal_calendar');
         $categoryService =& $this->modelObj->getServiceObjByKey('cal_category_model', 'category', $this->extConf['categoryService']);
         $calendarSearchString = $calendarService->getCalendarSearchString($pidList, true, $this->conf['calendar'] ? $this->conf['calendar'] : '');
         // putting everything together
         $additionalWhere = $calendarSearchString . ' AND tx_cal_event.pid IN (' . $pidList . ') ' . $this->cObj->enableFields('tx_cal_event') . ' AND ((tx_cal_event.start_date>=' . $formattedStarttime . ' AND tx_cal_event.start_date<=' . $formattedEndtime . ') OR (tx_cal_event.end_date<=' . $formattedEndtime . ' AND tx_cal_event.end_date>=' . $formattedStarttime . ') OR (tx_cal_event.end_date>=' . $formattedEndtime . ' AND tx_cal_event.start_date<=' . $formattedStarttime . ') OR (tx_cal_event.start_date<=' . $formattedEndtime . ' AND (tx_cal_event.freq IN ("day","week","month","year") AND tx_cal_event.until>=' . $formattedStarttime . ')))';
         $additionalWhere .= ' AND tx_cal_attendee.status IN ("0","NEEDS-ACTION") AND tx_cal_attendee.attendance <> "CHAIR" AND tx_cal_event.type = 3 AND tx_cal_attendee.fe_user_id = ' . $this->rightsObj->getUserId();
         // creating the arrays the user is allowed to see
         $categories = array();
         $categoryService->getCategoryArray($pidList, $categories);
         $includeRecurring = true;
         if ($this->conf['view'] == 'ics' || $this->conf['view'] == 'single_ics') {
             $includeRecurring = false;
         }
         // creating events
         return $this->getEventsFromTable($categories[0][0], $includeRecurring, $additionalWhere, $this->getServiceKey(), true, true, '3');
     }
 }