Exemple #1
0
 public static function getCalendarData($firstDay, $lastDay)
 {
     $K = new Kalender();
     $AC = new anyC();
     $AC->setCollectionOf("Adresse");
     $AC->addAssocV3("type", "=", "default");
     $AC->addAssocV3("AuftragID", "=", "-1");
     $AC->addAssocV3("geb", "!=", "0");
     while ($t = $AC->getNextEntry()) {
         $K->addEvent(self::getCalendarDetails("mFAdresseGUI", $t->getID(), $t));
     }
     return $K;
 }
Exemple #2
0
 public static function getCalendarData($firstDay, $lastDay, $UserID = null)
 {
     $calendar = new Kalender();
     $AC = anyC::get("xCal", "xCalUserID", $UserID);
     $AC->addAssocV3("xCalServerActive", "=", "1");
     while ($server = $AC->getNextEntry()) {
         // XML
         $xmlBuffer = xCalUtil::getSimpleXmlByXCal($server->A("xCalCache"));
         // Events
         foreach ($xmlBuffer->vcalendar->vevent as $event) {
             // Überprüfung, ob es sich um DATE-TIME Einträge handelt
             $dateTimeFlag = false;
             foreach ($event->dtstart->attributes() as $dtStartAttributeKey => $dtStartAttributeValue) {
                 if ($dtStartAttributeKey == "value" && (string) $dtStartAttributeValue === "DATE-TIME") {
                     $dateTimeFlag = true;
                 }
             }
             if (!$dateTimeFlag) {
                 continue;
             }
             // Konvertierung der Zeitstempel
             $match = array();
             preg_match("/^(\\d{4})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})(\\d{2})Z\$/", (string) $event->dtstart, $match);
             $startTimestamp = gmmktime($match[4], $match[5], $match[6], $match[2], $match[3], $match[1]);
             $match = array();
             preg_match("/^(\\d{4})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})(\\d{2})Z\$/", (string) $event->dtend, $match);
             $endTimestamp = gmmktime($match[4], $match[5], $match[6], $match[2], $match[3], $match[1]);
             #echo date("d.m.Y H:i", $startTimestamp)." $event->dtstart $event->summary<br />";
             // Weiter wenn Terminende zu weit zurück liegt oder Anfangszeit zu weit in der Zukunft
             if ($endTimestamp < $firstDay or $startTimestamp > $lastDay) {
                 continue;
             }
             $calendarEvent = new KalenderEvent("mxCalGUI", $server->A("xCalID") . ":" . (string) $event->uid, $calendar->formatDay($startTimestamp), $calendar->formatTime($startTimestamp), (string) $event->summary);
             $calendar->addEvent($calendarEvent);
         }
     }
     return $calendar;
 }
Exemple #3
0
 public static function getCalendarData($firstDay, $lastDay)
 {
     $K = new Kalender();
     $AC = anyC::get("Folge");
     $AC->addAssocV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d')) + 120", ">=", $firstDay);
     $AC->addAssocV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d'))", "<=", $lastDay);
     $AC->addJoinV3("Serie", "SerieID", "=", "SerieID");
     #$AC->addAssocV3("type", "=", "default");
     #$AC->addAssocV3("AuftragID", "=", "-1");
     #$AC->addAssocV3("geb", "!=", "0");
     while ($t = $AC->getNextEntry()) {
         $K->addEvent(self::getCalendarDetails("mSerieGUI", $t->getID(), $t));
     }
     return $K;
 }
Exemple #4
0
 public static function getCalendarData($firstDay, $lastDay, $UserID = null)
 {
     if ($UserID === null) {
         $UserID = Session::currentUser()->getID();
     }
     #echo $UserID;
     $K = new Kalender();
     #$include = array();
     //TERMINE IN DIESEM MONAT
     $AC = new anyC();
     $AC->setCollectionOf("Todo");
     $AC->addAssocV3("TodoTillDay", ">=", $firstDay, "AND", "1");
     $AC->addAssocV3("TodoTillDay", "<=", $lastDay, "AND", "1");
     $AC->addAssocV3("TodoRepeat", "=", "", "AND", "1");
     if ($UserID != 0) {
         $AC->addAssocV3("TodoUserID", "=", $UserID, "AND", "2");
     } else {
         $AC->addAssocV3("TodoUserID", ">", "0", "AND", "2");
     }
     $AC->addAssocV3("TodoUserID", "=", "-1", "OR", "2");
     /*$ACS = anyC::get("Userdata", "name", "shareCalendarTo".($UserID != 0 ? $UserID : "0")); //disabled for all users at the moment!
     		while($Share = $ACS->getNextEntry()){
     			$include[$Share->A("UserID")] = mUserdata::getUDValueS("showCalendarOf".$Share->A("UserID"), "1");
     			if($include[$Share->A("UserID")] == "1")
     				$AC->addAssocV3("TodoUserID", "=", $Share->A("UserID"), "OR", "2");
     		}*/
     $AC->addOrderV3("TodoTillTime");
     while ($t = $AC->getNextEntry()) {
         $K->addEvent(self::getCalendarDetails("mTodoGUI", $t->getID(), $t));
     }
     //TERMINE ÜBER DIESEN MONAT HINAUS
     $AC = new anyC();
     $AC->setCollectionOf("Todo");
     $AC->addAssocV3("TodoFromDay", "<=", $lastDay, "AND", "1");
     $AC->addAssocV3("TodoTillDay", ">", $lastDay, "AND", "1");
     $AC->addAssocV3("TodoRepeat", "=", "", "AND", "1");
     if ($UserID != 0) {
         $AC->addAssocV3("TodoUserID", "=", $UserID, "AND", "2");
     } else {
         $AC->addAssocV3("TodoUserID", ">", "0", "AND", "2");
     }
     $AC->addAssocV3("TodoUserID", "=", "-1", "OR", "2");
     #$ACS->resetPointer();
     #while($Share = $ACS->getNextEntry()){
     #	if($include[$Share->A("UserID")] == "1")
     #		$AC->addAssocV3("TodoUserID", "=", $Share->A("UserID"), "OR", "2");
     #}
     $AC->addOrderV3("TodoTillTime");
     while ($t = $AC->getNextEntry()) {
         $K->addEvent(self::getCalendarDetails("mTodoGUI", $t->getID(), $t));
     }
     //WIEDERHOLTE TERMINE
     $AC = new anyC();
     $AC->setCollectionOf("Todo");
     $AC->addAssocV3("TodoFromDay", "<=", $lastDay, "AND", "1");
     $AC->addAssocV3("TodoRepeat", "!=", "", "AND", "1");
     /*$AC->addAssocV3("MONTH(FROM_UNIXTIME(TodoFromDay))","=", date("m", $lastDay), "AND", "1");
     		if(date("m", $firstDay) != date("m", $lastDay))
     			$AC->addAssocV3("MONTH(FROM_UNIXTIME(TodoFromDay))","=", date("m", $firstDay), "OR", "1");
     		$AC->addAssocV3("TodoRepeat", "!=", "", "AND", "3");*/
     if ($UserID != 0) {
         $AC->addAssocV3("TodoUserID", "=", $UserID, "AND", "2");
     } else {
         $AC->addAssocV3("TodoUserID", ">", "0", "AND", "2");
     }
     $AC->addAssocV3("TodoUserID", "=", "-1", "OR", "2");
     $AC->addAssocV3("TodoRepeatUntil", "=", "0", "AND", "3");
     $AC->addAssocV3("TodoRepeatUntil", ">=", $firstDay, "OR", "3");
     #$ACS->resetPointer();
     #while($Share = $ACS->getNextEntry()){
     #	if($include[$Share->A("UserID")] == "1")
     #		$AC->addAssocV3("TodoUserID", "=", $Share->A("UserID"), "OR", "2");
     #}
     $AC->addOrderV3("TodoTillTime");
     while ($t = $AC->getNextEntry()) {
         $K->addEvent(self::getCalendarDetails("mTodoGUI", $t->getID(), $t));
     }
     return $K;
 }