function getMeetingData() { $currentTime = date("Hi"); //create obj for today $D = new Datum(); $D->normalize(); $DE = clone $D; $DE->addDay(); $T = new mTodoGUI(); $K = $T->getCalendarData($D->time(), $DE->time(), Session::currentUser()->getID()); while ($DE->time() > $D->time()) { $termine = $K->getEventsOnDay(date("dmY", $D->time())); //debug message echo "<div style='display:none'>"; print_r($termine); echo "</div>"; if ($termine != null) { foreach ($termine as $ev) { foreach ($ev as $v) { //start time in future = upcomming if ($v->getTime() > $currentTime) { array_push($this->upcommingMeetings, $v); //current events } else { if ($v->getTime() <= $currentTime && $v->getEndTime() > $currentTime) { array_push($this->currentMeetings, $v); } else { array_push($this->oldMeetings, $v); } } //echo get_class($v).": ".$v->title()."<br>"; } } } $D->addDay(); } }
die("incorrect date format"); } if (!preg_match("/^[0-9]*\$/i", $cutoffDateFuture)) { die("incorrect date format"); } if (empty($cutoffDatePast)) { $cutoffDatePast = time() - 14 * 24 * 3600; } if (empty($cutoffDateFuture)) { $cutoffDateFuture = time() + 84 * 24 * 3600; } if (isset($_GET["auth_token"])) { if (file_exists($absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php")) { require_once $absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php"; } $userToken = $_GET["auth_token"]; if (!preg_match("/^[a-z0-9]+\$/i", $userToken)) { die("incorrect login information"); } $user = mSync::getUserByToken($userToken); $E->login($user->A("username"), $user->A("SHApassword")); } else { $E->login($_GET["username"], $_GET["password"]); } $calendar = mTodoGUI::getCalendarData($cutoffDatePast, $cutoffDateFuture); $events = array(); foreach ($calendar->getEventsList() as $calendarEvent) { $events[] = $calendarEvent->toXCal(); } echo xCalUtil::getXCal($events); $E->cleanUp();