public function getEMailData($parameters) { $parameters = explode("::", $parameters); $className = $parameters[1]; $classID = $parameters[2]; $C = new $className($classID); $data = $C->getCalendarDetails($className, $classID); $adresse = $data->getAdresse(); $emailData = $adresse->getEMailData(); $emailData["body"] = "{Anrede},\n\nhiermit bestätige ich Ihnen unseren Termin:\n\nStart: " . Util::CLDateParser(Kalender::parseDay($data->getDay())) . " um " . Util::CLTimeParser(Kalender::parseTime($data->getTime())) . " Uhr" . ($data->getEndDay() > 0 ? "\nEnde: " . Util::CLDateParser(Kalender::parseDay($data->getEndDay())) . " um " . Util::CLTimeParser(Kalender::parseTime($data->getEndTime())) . " Uhr" : "") . "\n\nBeschreibung: " . str_replace("<br />\n", "\n", $data->summary()) . "\n\nFreundliche Grüße\n" . Session::currentUser()->A("name"); $emailData["subject"] = "Termininformation"; return $emailData; }
public function getEMailData($parameters) { $parameters = explode("::", $parameters); $className = $parameters[1]; $classID = $parameters[2]; $C = new $className($classID); $data = $C->getCalendarDetails($className, $classID); $adresse = $data->getAdresse(); $emailData = $adresse->getEMailData(); $sum = $data->summary(); if (strpos($sum, "<p") !== false) { $sum = "</p>{$sum}<p>"; } else { $sum = nl2br($sum); } $emailData["body"] = "<p>{Anrede},<br>\n<br>\nhiermit bestätige ich Ihnen unseren Termin:<br>\n<br>\nStart: " . Util::CLDateParser(Kalender::parseDay($data->getDay())) . " um " . Util::CLTimeParser(Kalender::parseTime($data->getTime())) . " Uhr" . ($data->getEndDay() > 0 ? "<br>\nEnde: " . Util::CLDateParser(Kalender::parseDay($data->getEndDay())) . " um " . Util::CLTimeParser(Kalender::parseTime($data->getEndTime())) . " Uhr" : "") . "<br>\n<br>\nBeschreibung: " . $sum . "\n\nFreundliche Grüße<br>\n" . Session::currentUser()->A("name"); $emailData["subject"] = "Termininformation"; return $emailData; }
/** * Gibt die xCal-Repräsentation dieses Objektes zurück. * @return DOMElement */ public function toXCal() { $xCalData = new xCalDataEvent(); #$dateTime = new DateTime(); $xCalData->setUid($this->UID); $xCalData->setSummary($this->title); // TODO: Wiederholende Termine über when holen --> Wiederholungen über xCal angeben // Parameter vermutlich Timestamp /*if (is_null($this->time)) { $dtStart = $this->day; // TODO: Testen ob Timestamp oder nicht $xCalData->setDtStartValue(xCalDataEvent::DTVALUE_DATE); $xCalData->setDtStart(gmdate("Ymd", $dtStart)); } else {*/ $dtStart = Kalender::parseDay($this->day) + Kalender::parseTime($this->time) - 60; #echo date("dmY His", $dtStart).": ".$this->title."<br />"; // TODO: Test des Formats // parseTime parseDay Kalender-Klasse $xCalData->setDtStartValue(xCalDataEvent::DTVALUE_DATETIME); $xCalData->setDtStart(gmdate("Ymd", $dtStart) . "T" . gmdate("His", $dtStart) . "Z"); #} /*if (is_null($this->endTime)) { $dtEnd = $this->endDay; $xCalData->setDtEnd(gmdate("Ymd", $dtEnd)); $xCalData->setDtEndValue(xCalDataEvent::DTVALUE_DATE);*/ #} else { $dtEnd = Kalender::parseDay($this->endDay) + Kalender::parseTime($this->endTime) - 60; $xCalData->setDtEnd(gmdate("Ymd", $dtEnd) . "T" . gmdate("His", $dtEnd) . "Z"); $xCalData->setDtEndValue(xCalDataEvent::DTVALUE_DATETIME); #} #$dateTime->setTimestamp($dtStart); return xCalUtil::getXCalEventByXCalDataEvent($xCalData); }
public function reminderList() { #$T = new HTMLTable(2); #$T->setTableStyle("width:100%;"); #$T->setColWidth(1, "30%"); $B = $this->reminderCheck(); $R = array(); $Kal = new Kalender(); foreach ($B as $E) { switch (get_class($E)) { case "KalenderEvent": $id = str_replace("@", "", $E->UID()); $BD = new Button("Erledigt", "check", "iconic"); $BD->style("color:#333;"); $BD->doBefore("event.stopPropagation(); %AFTER"); $BD->rmePCR("Util", "-1", "reminderDone", array("'KalenderEvent'", "'" . $E->UID() . "'"), "function(){ \$j('#bottom').html(''); \$j('#{$id}').hide(); if(!\$j('.event:visible').length) window.close(); }"); $R[] = array($id, "<div class=\"event\" id=\"{$id}\" style=\"padding:5px;cursor:pointer;\" onclick=\"\$j('.confirm').removeClass('confirm'); \$j(this).addClass('confirm');\$j('#bottom').html('" . str_replace("\n", "", $E->summary() != "" ? addslashes($E->summary()) : "Keine Beschreibung") . "');\" onmouseover=\"\$j(this).addClass('highlight');\" onmouseout=\"\$j(this).removeClass('highlight');\">\n\t\t\t\t\t\t\t<div style=\"width:15%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t\t\t\tKalender\n\t\t\t\t\t\t\t</div><div style=\"width:45%;display:inline-block;overflow:hidden;vertical-align:top;\">\n\t\t\t\t\t\t\t\t" . $E->title() . "\n\t\t\t\t\t\t\t</div><div style=\"width:33%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t\t\t\t" . Util::CLTimeParser($Kal->parseTime($E->getTime())) . " - " . Util::CLTimeParser($Kal->parseTime($E->getEndTime())) . " Uhr" . "\n\t\t\t\t\t\t\t</div><div style=\"width:7%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t\t\t\t{$BD}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>"); break; case "Aufgabe": $id = "Aufgabe_" . $E->getID(); $BD = new Button("Erledigt", "check", "iconic"); $BD->style("color:#333;"); $BD->doBefore("event.stopPropagation(); %AFTER"); $BD->rmePCR("Util", "-1", "reminderDone", array("'Aufgabe'", "'" . $E->getID() . "'"), "function(){ \$j('#bottom').html(''); \$j('#{$id}').hide(); if(!\$j('.event:visible').length) window.close(); }"); $R[] = array($id, "<div class=\"event\" id=\"{$id}\" style=\"padding:5px;cursor:pointer;\" onclick=\"\$j('.confirm').removeClass('confirm'); \$j(this).addClass('confirm');\$j('#bottom').html('" . str_replace("\n", "", addslashes(nl2br($E->A("AufgabeText")))) . "');\" onmouseover=\"\$j(this).addClass('highlight');\" onmouseout=\"\$j(this).removeClass('highlight');\">\n\t\t\t\t\t\t\t<div style=\"width:15%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t\t\t\tAufgabe\n\t\t\t\t\t\t\t</div><div style=\"width:45%;display:inline-block;overflow:hidden;vertical-align:top;\">\n\t\t\t\t\t\t\t\t" . mb_substr($E->A("AufgabeText"), 0, 30) . "\n\t\t\t\t\t\t\t</div><div style=\"width:33%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t\t\t\t" . Util::CLTimeParser($E->A("AufgabeUhrzeitVon")) . " Uhr" . "\n\t\t\t\t\t\t\t</div><div style=\"width:7%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t\t\t\t{$BD}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>"); /*$id = str_replace("@", "", $E->UID()); $BD = new Button("Erledigt", "check", "iconic"); $BD->style("color:#333;"); $BD->doBefore("event.stopPropagation(); %AFTER"); $BD->rmePCR("Util", "-1", "reminderDone", array("'KalenderEvent'", "'".$E->UID()."'"), "function(){ \$j('#bottom').html(''); \$j('#$id').hide(); if(!\$j('.event:visible').length) window.close(); }"); $R[] = array( $id, "<div class=\"event\" id=\"$id\" style=\"padding:5px;cursor:pointer;\" onclick=\"\$j('.confirm').removeClass('confirm'); \$j(this).addClass('confirm');\$j('#bottom').html('".str_replace("\n", "", addslashes($E->summary()))."');\" onmouseover=\"\$j(this).addClass('highlight');\" onmouseout=\"\$j(this).removeClass('highlight');\"> <div style=\"width:15%;display:inline-block;vertical-align:top;\"> Kalender </div><div style=\"width:45%;display:inline-block;overflow:hidden;vertical-align:top;\"> ".$E->title()." </div><div style=\"width:33%;display:inline-block;vertical-align:top;\"> ".Util::CLTimeParser($Kal->parseTime($E->getTime()))." - ".Util::CLTimeParser($Kal->parseTime($E->getEndTime()))." Uhr"." </div><div style=\"width:7%;display:inline-block;vertical-align:top;\"> $BD </div> </div>" );*/ break; } } echo json_encode($R, JSON_UNESCAPED_UNICODE); }
public function getPDFContent($save = false) { if ($this->userdata == null or count($this->userdata) == 0) { die(Util::getBasicHTMLError("Bitte wählen Sie Monat und Jahr aus", "Fehler")); } self::$pdf->SetAutoPageBreak(false); $this->AddPage(); $D = new Datum(mktime(0, 0, 1, $this->userdata["lightCRMKalBerichtMonth"], 1, $this->userdata["lightCRMKalBerichtYear"])); $day = clone $D; $D->setToMonthLast(); $lastDay = $D; $Kalender = new mKalenderGUI(); $K = $Kalender->getData($day->time(), $lastDay->time()); $i = 0; while ($day->time() <= $lastDay->time()) { $events = $K->getEventsOnDay(date("dmY", $day->time())); if (count($events) == 0) { $day->addDay(); continue; } if (self::$pdf->getY() > $this->pageBreakMargin - 15) { $this->AddPage(); $i = 0; } if ($i > 0) { self::$pdf->ln(10); } self::$pdf->SetFont($this->defaultFont, "B", $this->defaultFontSize); self::$pdf->Cell(0, $this->defaultCellHeight, "Termine am " . Util::CLWeekdayName(date("w", $day->time())) . ", " . Util::CLFormatDate($day->time()), 0, 1); self::$pdf->Line(10, self::$pdf->GetY(), 200, self::$pdf->GetY()); self::$pdf->SetFont($this->defaultFont, $this->defaultFontStyle, $this->defaultFontSize); foreach ($events as $time) { foreach ($time as $event) { if (self::$pdf->getY() > $this->pageBreakMargin) { $this->AddPage(); $i = 0; if ($this->between) { self::$pdf->SetFont($this->defaultFont, "B", $this->defaultFontSize); self::$pdf->Cell(0, $this->defaultCellHeight, "Termine am " . Util::CLWeekdayName(date("w", $day->time())) . ", " . Util::CLFormatDate($day->time()), 0, 1); self::$pdf->Line(10, self::$pdf->GetY(), 200, self::$pdf->GetY()); self::$pdf->SetFont($this->defaultFont, $this->defaultFontStyle, $this->defaultFontSize); } } $this->between = true; self::$pdf->Cell8(isset($this->widths["time"]) ? $this->widths["time"] : 20, $this->defaultCellHeight, Util::CLTimeParser(Kalender::parseTime($event->getTime())) . " - " . Util::CLTimeParser(Kalender::parseTime($event->getEndTime())), 0, 0); self::$pdf->Cell8(isset($this->widths["title"]) ? $this->widths["title"] : 20, $this->defaultCellHeight, $event->title(), 0, 0); self::$pdf->Cell8(isset($this->widths["location"]) ? $this->widths["location"] : 20, $this->defaultCellHeight, $event->location(), 0, 1); $summary = $event->summary(); if ($summary != "") { self::$pdf->setTextColor(100, 100, 100); self::$pdf->SetFont($this->defaultFont, $this->defaultFontStyle, $this->defaultFontSize - 1); self::$pdf->MultiCell8(isset($this->widths["summary"]) ? $this->widths["summary"] : 20, $this->defaultCellHeight - 1, trim(str_replace("<br />", "", $summary)), 0, 1); self::$pdf->setTextColor(0, 0, 0); self::$pdf->SetFont($this->defaultFont, $this->defaultFontStyle, $this->defaultFontSize); } self::$pdf->SetDrawColor(150, 150, 150); self::$pdf->Line(10, self::$pdf->GetY(), 200, self::$pdf->GetY()); self::$pdf->SetDrawColor(0, 0, 0); self::$pdf->ln(5); } } $this->between = false; $day->addDay(); $i++; } $tmpfname = Util::getTempFilename("Bericht"); self::$pdf->Output($tmpfname, $save ? "F" : "I"); if ($save) { return $tmpfname; } }
public static function newFromKalenderEvent(KalenderEvent $KE) { $T = new Todo(-1); $T->loadMeOrEmpty(); $T->changeA("TodoFromDay", Kalender::parseDay($KE->getDay())); $T->changeA("TodoFromTime", Kalender::parseTime($KE->getTime())); $T->changeA("TodoTillDay", Kalender::parseDay($KE->getEndDay())); $T->changeA("TodoTillTime", Kalender::parseTime($KE->getEndTime())); $T->changeA("TodoType", "2"); $T->changeA("TodoName", $KE->title()); $T->changeA("TodoClass", $KE->ownerClass()); $T->changeA("TodoClassID", $KE->ownerClassID()); $T->changeA("TodoUserID", Session::currentUser()->getID()); $T->changeA("TodoOrganizer", $KE->organizer()); return $T->newMe(); }