Beispiel #1
0
 public static function toKalenderEvent($iCal, $ownerClass = "iCal", $ownerClassID = "-1")
 {
     $VC = new vcalendar();
     $VC->parse($iCal);
     $event = $VC->getComponent("vevent");
     $dayStart = $event->getProperty("DTSTART");
     $dayEnd = $event->getProperty("DTEND");
     $dayStartTS = strtotime(implode("", $dayStart));
     $dayEndTS = strtotime(implode("", $dayEnd));
     $KE = new KalenderEvent($ownerClass, $ownerClassID, Kalender::formatDay($dayStartTS), Kalender::formatTime($dayStartTS), $event->getProperty("SUMMARY"));
     $KE->UID($event->getProperty("UID"));
     $organizer = $event->getProperty("ORGANIZER", 0, true);
     $organizer["value"] = str_replace("MAILTO:", "", $organizer["value"]);
     $ON = $organizer["value"];
     if (isset($organizer["params"]["CN"])) {
         $ON = $organizer["params"]["CN"];
     }
     $OE = $organizer["value"];
     $KE->organizer($ON, $OE);
     if ($dayStart["hour"] . $dayStart["min"] == "" and $dayEnd["hour"] . $dayEnd["min"] == "") {
         $KE->allDay(true);
     } else {
         $KE->endDay(Kalender::formatDay($dayEndTS));
         $KE->endTime(Kalender::formatTime($dayEndTS));
     }
     return $KE;
 }
Beispiel #2
0
 public static function getCalendarDetails($className, $classID, $T = null)
 {
     $K = new Kalender();
     if ($T == null) {
         $AC = anyC::get("Folge", "FolgeID", $classID);
         $AC->addJoinV3("Serie", "SerieID", "=", "SerieID");
         $AC->setFieldsV3(array("t1.name", "season", "episode", "t1.description", "airDate"));
         $T = $AC->getNextEntry();
     }
     $ex = explode("-", $T->A("airDate"));
     $day = mktime(8, 0, 0, $ex[1], $ex[2], $ex[0]);
     $KE = new KalenderEvent($className, $classID, $K->formatDay($day), "1800", $T->A("name") . " S" . ($T->A("season") < 10 ? "0" : "") . $T->A("season") . "E" . ($T->A("episode") < 10 ? "0" : "") . $T->A("episode"));
     #$KE->repeat(true, "yearly");
     $KE->endDay($K->formatDay($day));
     $KE->endTime("1845");
     $KE->icon("./fheME/FAdressen/birthday.png");
     $KE->summary($T->A("description"));
     return $KE;
 }
Beispiel #3
0
 public static function getCalendarDetails($className, $classID, $T = null)
 {
     $K = new Kalender();
     if ($T == null) {
         $T = new Todo($classID);
     }
     $name = "";
     if ($T->A("TodoClass") == "Projekt" or $T->A("TodoClass") == "GRLBM") {
         $O = $T->getOwnerObject();
         $name = $O->getCalendarTitle();
     } else {
         $name = $T->A("TodoName");
     }
     $day = $T->A("TodoTillDay");
     if ($T->A("TodoFromDay") != "0") {
         $day = $T->A("TodoFromDay");
     }
     $time = $T->A("TodoTillTime");
     if ($T->A("TodoFromTime") != "0") {
         $time = $T->A("TodoFromTime");
     }
     $KE = new KalenderEvent($className, $classID, $K->formatDay($day), $K->formatTime($time), $name);
     #echo $T->A("TodoOrt");
     if ($T->A("TodoClass") == "WAdresse") {
         $O = $T->getOwnerObject();
         $KE->value("Kunde", $O->getHTMLFormattedAddress());
     }
     $KE->value("Typ", TodoGUI::types($T->A("TodoType")));
     $KE->value("Ort", $T->A("TodoLocation"));
     #$KE->value("Status", TodoGUI::getStatus($T->A("TodoStatus")));
     $KE->owner($T->A("TodoUserID"));
     if ($T->A("TodoClass") == "WAdresse") {
         $KE->value("Telefon", $O->A("tel"));
         $KE->value("Notiz", nl2br($O->A("bemerkung")));
         $KE->canNotify(true, $T->A("TodoNotified") == "1");
         if ($T->A("TodoType") == "1" and Session::isPluginLoaded("mAkquise")) {
             $B = new Button("Akquise", "./lightCRM/Akquise/callTel.png");
             #$B->doBefore(OnEvent::rme($T, "setStatus", array("'2'"), OnEvent::closePopup("mKalender").OnEvent::reload("Screen"))." %AFTER");
             $B->doBefore(OnEvent::closePopup("mKalender") . "contentManager.emptyFrame('contentScreen'); %AFTER");
             $B->loadFrame("contentLeft", "WAdresse", $T->A("TodoClassID"), 0, "mWAdresseGUI;Akquise:1;from:mKalender");
             #$B->popup("", "Akquise", "mAkquise", "-1", "showTelPopup", array($T->A("TodoClassID")), "", "{width: 950, top:20, hPosition:'center'}");
             $KE->addTopButton($B);
         }
     }
     $KE->allDay($T->A("TodoAllDay") == "1");
     if ($T->A("TodoClass") == "Projekt" and $O->A("ProjektKunde") != "0") {
         $Adresse = new Adresse($O->A("ProjektKunde"));
         $KE->value("Telefon", $Adresse->A("tel"));
     }
     if ($T->A("TodoClass") == "GRLBM") {
         $Auftrag = new Auftrag($O->A("AuftragID"));
         $Adresse = new Adresse($Auftrag->A("AdresseID"));
         $KE->value("Telefon", $Adresse->A("tel"));
     }
     $KE->status($T->A("TodoStatus"));
     $KE->endDay($K->formatDay($T->A("TodoTillDay")));
     $KE->endTime($K->formatTime($T->A("TodoTillTime")));
     $KE->icon(TodoGUI::typesImage($T->A("TodoType"), true));
     $KE->summary(nl2br($T->A("TodoDescription")));
     if ($T->A("TodoExceptionForID") != "0") {
         $KE->exception($T->A("TodoExceptionStarttime"), $T->A("TodoIsDeleted") == "1", $T->A("TodoExceptionForID"));
     }
     if ($T->A("TodoRemind") != "-1") {
         $KE->remind($T->A("TodoRemind") / 60, $T->A("TodoReminded"));
     }
     $editMethod = "editInPopup";
     if ($T->A("TodoOrganizer") != "") {
         $editMethod = null;
         $KE->organizer($T->A("TodoOrganizer"));
     }
     if (!$T->A("TodoDoneTime")) {
         $KE->editable($editMethod, "deleteFromCalendar");
     }
     if ($T->A("TodoOrganizer") == "" and !$T->A("TodoDoneTime")) {
         $KE->repeatable("editRepeatable");
     }
     $KE->location($T->A("TodoLocation"));
     $KE->repeat($T->A("TodoRepeat") != "", $T->A("TodoRepeat"), $T->A("TodoRepeatWeekOfMonth") * 1, $T->A("TodoRepeatDayOfWeek"), $T->A("TodoRepeatInterval"), $T->A("TodoRepeatUntil"));
     $KE->UID("TodoID" . $T->getID() . "@" . substr(Util::eK(), 0, 20));
     $KE->closeable($T->A("TodoDoneTime"), $T->A("TodoReport"));
     if (!$T->A("TodoDoneTime")) {
         $KE->canInvite();
     }
     return $KE;
 }