0) { $calendar = dav_get_current_user_calendar_by_id($server, $calendar_id, DAV_ACL_WRITE); if (!$calendar) { $calendar = dav_get_current_user_calendar_by_id($server, $calendar_id, DAV_ACL_READ); $calendars = array(); } else { $calendars = dav_get_current_user_calendars($server, DAV_ACL_WRITE); } if ($calendar == null) return "Calendar not found"; $obj_uri = Sabre_CalDAV_Backend_Common::loadCalendarobjectById($uri); $vObject = dav_get_current_user_calendarobject($server, $calendar, $obj_uri["uri"], DAV_ACL_WRITE); $component = dav_get_eventComponent($vObject); if ($component == null) return t('Could not open component for editing'); /** @var Sabre_VObject_Property_DateTime $dtstart */ $dtstart = $component->__get("DTSTART"); $event = array( "id" => IntVal($uri), "Summary" => ($component->__get("SUMMARY") ? $component->__get("SUMMARY")->value : null), "StartTime" => $dtstart->getDateTime()->getTimeStamp(), "EndTime" => Sabre_CalDAV_Backend_Common::getDtEndTimeStamp($component), "IsAllDayEvent" => (strlen($dtstart->value) == 8), "Description" => ($component->__get("DESCRIPTION") ? $component->__get("DESCRIPTION")->value : null), "Location" => ($component->__get("LOCATION") ? $component->__get("LOCATION")->value : null), "Color" => ($component->__get("X-ANIMEXX-COLOR") ? $component->__get("X-ANIMEXX-COLOR")->value : null), ); $exdates = $component->select("EXDATE"); $recurrentce_exdates = array(); /** @var Sabre_VObject_Property_MultiDateTime $x */ foreach ($exdates as $x) { /** @var DateTime $y */ $z = $x->getDateTimes(); foreach ($z as $y) $recurrentce_exdates[] = $y->getTimeStamp(); } if ($component->select("RRULE")) $recurrence = new Sabre_VObject_RecurrenceIterator($vObject, (string)$component->__get("UID")); else $recurrence = null; } elseif (isset($_REQUEST["start"]) && $_REQUEST["start"] > 0) { $calendars = dav_get_current_user_calendars($server, DAV_ACL_WRITE); $calendar = dav_get_current_user_calendar_by_id($server, $calendar_id, DAV_ACL_WRITE); $event = array( "id" => 0, "Summary" => $_REQUEST["title"], "StartTime" => InTVal($_REQUEST["start"]), "EndTime" => IntVal($_REQUEST["end"]), "IsAllDayEvent" => $_REQUEST["isallday"], "Description" => "", "Location" => "", "Color" => null, ); if ($_REQUEST["isallday"]) { $notifications = array(array("rel" => "start", "type" => "duration", "period" => "hour", "period_val" => 24)); } else { $notifications = array(array("rel" => "start", "type" => "duration", "period" => "hour", "period_val" => 1)); } $recurrence = null; $recurrentce_exdates = array(); } else { $calendars = dav_get_current_user_calendars($server, DAV_ACL_WRITE); $calendar = dav_get_current_user_calendar_by_id($server, $calendar_id, DAV_ACL_WRITE); $event = array( "id" => 0, "Summary" => "", "StartTime" => time(), "EndTime" => time() + 3600, "IsAllDayEvent" => "0", "Description" => "", "Location" => "", "Color" => null, ); $notifications = array(array("rel" => "start", "type" => "duration", "period" => "hour", "period_val" => 1)); $recurrence = null; $recurrentce_exdates = array(); } $postto = $baseurl . "/dav/wdcal/" . ($uri == 0 ? "new/" : $calendar_id . "/" . $uri . "/edit/"); $out = "" . t("Go back to the calendar") . "

"; $out .= "
\n"; $out .= "

" . t("Event data") . "

"; $out .= ""; $out .= "