function getCMSHTML() { $key = substr(Util::eK(), 0, 5); if (!isset($_GET["key"]) or $key != $_GET["key"]) { return "<span style=\"color:red;\">Bitte geben Sie den richtigen Schlüssel zum Aufrufen der Seite in der Adresszeile an.</span>"; } registerClassPath("Einkaufszettel", Util::getRootPath() . "fheME/Einkaufszettel/Einkaufszettel.class.php"); /* registerClassPath("GSRaumgruppe", Util::getRootPath()."FCalc/GSRaumgruppe/GSRaumgruppe.class.php"); registerClassPath("ObjektL", Util::getRootPath()."personalKartei/ObjekteL/ObjektL.class.php"); registerClassPath("mGSTaetigkeitGUI", Util::getRootPath()."FCalc/GSTaetigkeit/mGSTaetigkeitGUI.class.php"); registerClassPath("GSTaetigkeit", Util::getRootPath()."FCalc/GSTaetigkeit/GSTaetigkeit.class.php"); * */ $AC = anyC::get("Einkaufszettel"); $AC->addAssocV3("EinkaufszettelBought", "=", "0"); $AC->addOrderV3("EinkaufszettelName"); $html = "<style type=\"text/css\">\n\t\t\t\tbody {\n\t\t\t\t\tmargin:0px;\n\t\t\t\t\tmargin-top:10px;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entry {\n\t\t\t\t\tpadding:10px;\n\t\t\t\t\tborder-top-width:1px;\n\t\t\t\t\tborder-top-style:solid;\n\t\t\t\t\tborder-bottom-width:1px;\n\t\t\t\t\tborder-bottom-style:solid;\n\t\t\t\t\tfont-size:2em;\n\t\t\t\t\tmargin-bottom:10px;\n\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t\t-webkit-user-select: none;\n\t\t\t\t\t-khtml-user-select: none;\n\t\t\t\t\t-moz-user-select: none;\n\t\t\t\t\t-ms-user-select: none;\n\t\t\t\t\tuser-select: none;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entryTouch {\n\t\t\t\t\tbackground-color: #c5d674;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div id=\"einkaufsliste\">"; while ($E = $AC->getNextEntry()) { $html .= "<div id=\"entry" . $E->getID() . "\" onclick=\"CustomerPage.rme('setBought', [" . $E->getID() . "], function(){ \$('#entry" . $E->getID() . "').remove(); if(\$('#einkaufsliste .nonEmpty').length == 0) \$('#emptyEntry').show(); });\" class=\"nonEmpty entry backgroundColor1 borderColor1\">" . ($E->A("EinkaufszettelMenge") > 1 ? $E->A("EinkaufszettelMenge") . " x " : "") . $E->A("EinkaufszettelName") . ($E->A("EinkaufszettelNameDetails") != "" ? "<br /><small style=\"color:grey;\">" . $E->A("EinkaufszettelNameDetails") . "</small>" : "") . "</div>"; } $html .= "<div style=\"" . ($AC->numLoaded() == 0 ? "" : "display:none;") . "\" class=\"entry backgroundColor1 borderColor1\" id=\"emptyEntry\">Die Einkaufsliste enthält keine Einträge.<br /><small style=\"color:grey;\">" . Util::CLDateParser(time()) . "</small></div>"; $html .= "</div>"; return $html . OnEvent::script("\$('.entry').hammer().on('touch', function(){ \$(this).addClass('entryTouch'); }); \$('.entry').hammer().on('release', function(){ \$(this).removeClass('entryTouch'); });"); }
function getCMSHTML() { $key = substr(Util::eK(), 0, 5); if (!isset($_GET["key"]) or $key != $_GET["key"]) { return "<span style=\"color:red;\">Bitte geben Sie den richtigen Schlüssel zum Aufrufen der Seite in der Adresszeile an.</span>"; } registerClassPath("Einkaufszettel", Util::getRootPath() . "fheME/Einkaufszettel/Einkaufszettel.class.php"); /* registerClassPath("GSRaumgruppe", Util::getRootPath()."FCalc/GSRaumgruppe/GSRaumgruppe.class.php"); registerClassPath("ObjektL", Util::getRootPath()."personalKartei/ObjekteL/ObjektL.class.php"); registerClassPath("mGSTaetigkeitGUI", Util::getRootPath()."FCalc/GSTaetigkeit/mGSTaetigkeitGUI.class.php"); registerClassPath("GSTaetigkeit", Util::getRootPath()."FCalc/GSTaetigkeit/GSTaetigkeit.class.php"); * */ $AC = anyC::get("Einkaufszettel"); $AC->addAssocV3("EinkaufszettelBought", "=", "0"); $AC->addJoinV3("EinkaufszettelKategorie", "EinkaufszettelEinkaufszettelKategorieID", "=", "EinkaufszettelKategorieID"); $AC->addOrderV3("EinkaufszettelKategorieName"); $AC->addOrderV3("EinkaufszettelName"); $html = "<style type=\"text/css\">\n\t\t\t\tbody {\n\t\t\t\t\tmargin:0px;\n\t\t\t\t\tmargin-top:10px;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@media only screen and (max-width: 360px) {\n\t\t\t\t\thtml {\n\t\t\t\t\t\tzoom: .8;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t.entry {\n\t\t\t\t\tpadding:10px;\n\t\t\t\t\tborder-top-width:1px;\n\t\t\t\t\tborder-top-style:solid;\n\t\t\t\t\tborder-bottom-width:1px;\n\t\t\t\t\tborder-bottom-style:solid;\n\t\t\t\t\tfont-size:2em;\n\t\t\t\t\tmargin-bottom:10px;\n\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t\t-webkit-user-select: none;\n\t\t\t\t\t-khtml-user-select: none;\n\t\t\t\t\t-moz-user-select: none;\n\t\t\t\t\t-ms-user-select: none;\n\t\t\t\t\tuser-select: none;\n\t\t\t\t\t-webkit-tap-highlight-color:rgba(255,255,255,0);\n\t\t\t\t\twidth:100%;\n\t\t\t\t\tbox-sizing:border-box;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entryRestore {\n\t\t\t\t\tborder-top-width:1px;\n\t\t\t\t\tborder-top-style:solid;\n\t\t\t\t\tborder-bottom-width:1px;\n\t\t\t\t\tborder-bottom-style:solid;\n\t\t\t\t\tpadding:10px;\n\t\t\t\t\tfont-size:2em;\n\t\t\t\t\tmargin-bottom:10px;\n\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t\t-webkit-user-select: none;\n\t\t\t\t\t-khtml-user-select: none;\n\t\t\t\t\t-moz-user-select: none;\n\t\t\t\t\t-ms-user-select: none;\n\t\t\t\t\tuser-select: none;\n\t\t\t\t\tcolor:#444;\n\t\t\t\t\t-webkit-tap-highlight-color:rgba(255,255,255,0);\n\t\t\t\t\twidth:100%;\n\t\t\t\t\tbox-sizing:border-box;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.backgroundColor4 {\n\t\t\t\t\tbackground-color: #eee;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entryTouch {\n\t\t\t\t\tbackground-color: #c5d674;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.borderColor0 {\n\t\t\t\t\tborder-color:white;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div id=\"einkaufsliste\">"; $B = new Button("Wiederherstellen", "undo", "iconicL"); $last = null; while ($E = $AC->getNextEntry()) { if ($last != $E->A("EinkaufszettelKategorieName") and $last !== null) { $html .= "<h1 style=\"padding-left:10px;padding-top:15px;padding-bottom:7px;\">" . $E->A("EinkaufszettelKategorieName") . "</h1>"; } $html .= "\n\t\t\t\t<div\n\t\t\t\t\tid=\"entry" . $E->getID() . "\"\n\t\t\t\t\tontouchend=\"if(Touch.cancelNext) return; CustomerPage.rme('setBought', [" . $E->getID() . "], function(){ \$('#entry" . $E->getID() . "').hide(); \$('#restoreEntry" . $E->getID() . "').show(); \$('#emptyEntry').hide(); if(\$('#einkaufsliste .nonEmpty').length == 0) \$('#emptyEntry').show(); });\"\n\t\t\t\t\tclass=\"nonEmpty entry backgroundColor1 borderColor1\">\n\t\t\t\t\t\n\t\t\t\t\t" . ($E->A("EinkaufszettelMenge") > 1 ? $E->A("EinkaufszettelMenge") . " x " : "") . $E->A("EinkaufszettelName") . ($E->A("EinkaufszettelNameDetails") != "" ? "<br /><small style=\"color:grey;\">" . $E->A("EinkaufszettelNameDetails") . "</small>" : "") . "\n\t\t\t\t</div>\n\t\t\t\t<div \n\t\t\t\t\tclass=\"nonEmpty entryRestore backgroundColor4 borderColor0\"\n\t\t\t\t\tontouchend=\"if(Touch.cancelNext) return; CustomerPage.rme('setUnBought', [" . $E->getID() . "], function(){ \$('#entry" . $E->getID() . "').show(); \$('#restoreEntry" . $E->getID() . "').hide(); \$('#emptyEntry').hide(); if(\$('#einkaufsliste .nonEmpty').length == 0) \$('#emptyEntry').show(); });\"\n\t\t\t\t\tid=\"restoreEntry" . $E->getID() . "\" style=\"display:none;\">" . $E->A("EinkaufszettelName") . " {$B}</div>"; $last = $E->A("EinkaufszettelKategorieName"); } $html .= "<div style=\"" . ($AC->numLoaded() == 0 ? "" : "display:none;") . "\" class=\"entry backgroundColor1 borderColor1\" id=\"emptyEntry\">Die Einkaufsliste enthält keine Einträge.<br /><small style=\"color:grey;\">" . Util::CLDateParser(time()) . "</small></div>"; $html .= "</div>"; return $html . OnEvent::script("\n\t\tvar Touch = {};\n\t\t\n\t\t\$(document).on('touchstart mousedown', '[ontouchend]', function(ev){\n\t\t\t\$(this).addClass('entryTouch'); \n\t\t\t\n\t\t\tTouch.startPos = [ev.clientX, ev.clientY];\n\t\t\tTouch.cancelNext = false;\n\t\t\tTouch.inAction = this;\n\t\t\n\t\t}); \n\t\t\n\t\t\$(document).on('touchend mouseup', '[ontouchend]', function(ev){\n\t\t\t\$(this).removeClass('entryTouch');\n\t\t\tTouch.inAction = false;\n\t\t});\n\t\t\t\n\t\t\$(document).on('touchmove mousemove', '[ontouchend]', function(ev){\n\t\t\tif(!Touch.inAction)\n\t\t\t\treturn;\n\n\t\t\tif(Math.abs(ev.clientX - Touch.startPos[0]) < 15 && Math.abs(ev.clientY - Touch.startPos[1]) < 15)\n\t\t\t\treturn;\n\n\t\t\tTouch.cancelNext = true;\n\t\t\t\$('.entryTouch').removeClass('entryTouch');\n\t\t\t\n\t\t\t//\$(ev.target).trigger('touchend');\n\t\t});\n\t"); }
public function getAngebote($data) { if (!$this->loggedIn) { return "TIMEOUT"; } $html = ""; $T = new HTMLTable(2); #, "Bitte wählen Sie einen Lieferschein"); $T->setTableStyle("width:100%;margin-top:10px;"); $T->setColWidth(1, 130); $T->useForSelection(false); $T->maxHeight(400); $AC = anyC::get("GRLBM", "isA", "1"); $AC->addJoinV3("Auftrag", "AuftragID", "=", "AuftragID"); $AC->addAssocV3("UserID", "=", Session::currentUser()->getID()); $AC->addAssocV3("status", "=", "open"); #$AC->addOrderV3("datum", "DESC"); $AC->addOrderV3("nummer", "DESC"); #$AC->setLimitV3(100); #$AC->addJoinV3("Adresse", "t2.AdresseID", "=", "AdresseID"); $i = 0; while ($B = $AC->n()) { $Adresse = new Adresse($B->A("AdresseID")); $T->addRow(array("<span style=\"font-size:20px;font-weight:bold;\">" . $B->A("prefix") . $B->A("nummer") . "</span><br><span style=\"color:grey;\">" . Util::CLDateParser($B->A("datum")) . "</span>", $Adresse->getHTMLFormattedAddress())); $T->addCellStyle(1, "vertical-align:top;"); $T->addRowStyle("cursor:pointer;border-bottom:1px solid #ccc;"); #if($i % 2 == 1) # $T->addRowStyle ("background-color:#eee;"); $T->addRowEvent("click", "\n\t\t\t\t\$(this).addClass('selected');\n\t\t\t\t\n\t\t\t\tCustomerPage.rme('getAuftrag', {GRLBMID: " . $B->getID() . "}, function(transport){ \n\t\t\t\t\t\tif(transport == 'TIMEOUT') { document.location.reload(); return; } \n\t\t\t\t\t\t\$('#contentLeft').html(transport); \n\t\t\t\t\t}, \n\t\t\t\t\tfunction(){},\n\t\t\t\t\t'POST');\n\t\t\t\t\t\n\t\t\t\tCustomerPage.rme('getArtikel', {GRLBMID: " . $B->getID() . ", query : '', KategorieID: ''}, function(transport){ \n\t\t\t\t\t\tif(transport == 'TIMEOUT') { document.location.reload(); return; } \n\t\t\t\t\t\t\$('#contentRight').html(transport); \n\t\t\t\t\t\t\$('.selected').removeClass('selected');\n\t\t\t\t\t\t\$('#frameSelect').hide(); \$('#frameEdit').show();\n\t\t\t\t\t}, \n\t\t\t\t\tfunction(){},\n\t\t\t\t\t'POST');"); $i++; } $html .= $T; return $html; }
public function check($touch = false) { $mbox = $this->connection(); #echo "<h1>Nachrichten in INBOX</h1><div style=\"overflow:auto;max-height:400px;\"><pre>"; $MC = imap_check($mbox); $T = new HTMLTable(1, $touch ? "Mails" : ""); $T->setTableStyle("font-size:11px;"); $T->useForSelection(); $start = $MC->Nmsgs - 10; if ($start < 1) { $start = 1; } $result = imap_fetch_overview($mbox, "{$start}:{$MC->Nmsgs}", 0); $result = array_reverse($result); foreach ($result as $overview) { #print_r($overview); $T->addRow(array("\n\t\t\t\t<small style=\"color:grey;float:right;\">" . Util::CLDateParser($overview->udate) . "</small>\n\t\t\t\t" . str_replace("\"", "", $this->decodeBlubb($overview->from)) . "<br />\n\t\t\t\t<small style=\"color:grey;\">" . substr($this->decodeBlubb($overview->subject), 0, 50) . "</small>")); $T->addCellEvent(1, "click", "\$j('#MailFrame').attr('src', './interface/rme.php?class=MailCheck&constructor=" . $this->getID() . "&method=showMailBody¶meters=\\'{$overview->uid}\\'');"); } imap_close($mbox); #echo "</pre></div>"; $BC = ""; if ($touch) { $BC = new Button("Fenster\nschließen", "stop"); $BC->style("float:right;margin:10px;"); $BC->onclick(OnEvent::closePopup("MailCheck")); } echo "<div style=\"float:right;width:300px;\">"; echo $BC; echo "<p>{$MC->Nmsgs} Nachricht" . ($MC->Nmsgs == 1 ? "" : "en") . "</p><div style=\"clear:both;\"></div>"; echo $T; echo "</div>"; echo "\n\t\t\t<div style=\"border-right-style:solid;border-right-width:1px;width:699px;\" class=\"borderColor1\">\n\t\t\t\t<iframe id=\"MailFrame\" style=\"border:0px;width:699px;height:520px;\" src=\"./fheME/MailCheck/Home/index.html\"></iframe>\n\t\t\t</div>"; echo "<div style=\"clear:both;\"></div>"; }
function __construct($date = null) { $timestamp = time(); if ($date !== null) { if (is_numeric($date)) { $timestamp = $date; } else { $timestamp = Util::CLDateParser($date, "store"); } } $this->timestamp = $timestamp; }
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; }
function formatDay($day) { $timestamp = $this->parseDay($day); return Util::CLDateParser($timestamp); }
public function getOverviewListEntry($name, $time) { return "<div style=\"padding-bottom:5px;\"><small style=\"float:right;color:grey;\">" . Util::CLDateParser($time) . "</small>" . ($name != "" ? $name : "Artikel {$EAN} nicht gefunden!") . "</div>"; }
public static function lastUpdateParser($w) { return Util::CLDateParser($w) . " " . Util::CLTimeParser($w); }
function getInfo($time) { $BE = ""; $BD = ""; $BDS = ""; if ($this->editable != null) { if ($this->editable[0] != null) { $BE = new Button("Bearbeiten", "edit", "icon"); $BE->style("margin:10px;float:right;"); $BE->popup("", "Kalendereintrag bearbeiten", "mKalender", $this->classID, "editInPopup", array("'" . $this->className . "'", $this->classID, "'{$this->editable[0]}'")); } $BD = new Button("Dieses Event löschen", "trash", "icon"); $BD->style("float:right;margin:10px;"); $BD->doBefore("if(confirm('Löschen?')) %AFTER"); $BD->rmePCR(str_replace("GUI", "", $this->className), $this->classID, $this->editable[1], $this->classID, "contentManager.reloadFrame('contentScreen'); Popup.close('mKalender', 'edit');"); if ($this->repeat() !== false) { $BD->rmePCR(str_replace("GUI", "", $this->className), $this->classID, $this->editable[1], array($this->classID, $time + Kalender::parseTime($this->time) - 60), "contentManager.reloadFrame('contentLeft'); Popup.close('mKalender', 'edit');"); $BDS = new Button("Alle Events Löschen", "./ubiquitous/Kalender/deleteSeries.png", "icon"); $BDS->style("float:right;margin:10px;"); $BDS->doBefore("if(confirm('Löschen?')) %AFTER"); $BDS->rmePCR(str_replace("GUI", "", $this->className), $this->classID, $this->editable[1], $this->classID, "contentManager.reloadFrame('contentLeft'); Popup.close('mKalender', 'edit');"); } } $T = new HTMLTable(2, "Eventdetails"); $T->setColWidth(1, 120); $T->addColStyle(1, "vertical-align:top;"); $T->addLV("Betreff", $this->title); $T->addLV("Tag", Util::CLDateParser($time)); if (!$this->allDay) { $T->addLV("Uhrzeit", $this->formatTime($this->time)); } else { $T->addLV("Uhrzeit", "Ganzer Tag"); } $T->addLV("Details", "<div style=\"max-height:300px;overflow:auto;\">" . $this->summary . "</div>"); if ($this->organizer) { $T->addLV("Organisator", $this->organizer); } if (count($this->values) > 0) { $T->insertSpaceAbove(); } foreach ($this->values as $label => $value) { $T->addLV($label, $value); } $BN = ""; if ($this->canNotify) { // TODO: Entfernen sobald Einladungen funktionieren $BN = new Button("Terminbestätigung", "mail" . ($this->notified ? "ed" : ""), "icon"); $BN->style("margin-top:10px;margin-left:10px;"); $BN->popup("", "Terminbestätigung", "Util", "-1", "EMailPopup", array("'mKalender'", "-1", "'notification::{$this->className}::{$this->classID}::{$time}'", "'function(){ Kalender.refreshInfoPopup(); }'")); } $BR = ""; if ($this->isRepeatable and $this->getException() === false) { $BR = new Button("Wiederholungen", "refresh", "icon"); $BR->style("margin:10px;float:right;"); $BR->rmePCR("mKalender", "-1", "getRepeatable", array("'{$this->className}'", "'{$this->classID}'", "'{$this->isRepeatable}'"), "function(transport){ \$j('#eventSideContent').html(''); \$j('#editDetailsmKalender').animate({'width':'400px'}, 200, 'swing'); \$j('#eventAdditionalContent').html(transport.responseText).slideDown(); }"); } $BI = new Button("Teilnehmer", "./ubiquitous/Kalender/einladungen.png", "icon"); $BI->style("margin: 10px; float: right;"); $BI->rmePCR("mKalender", "-1", "getInvitees", array("'{$this->className}'", "'{$this->classID}'"), "function(t){ \$j('#eventAdditionalContent').html(''); \$j('#editDetailsmKalender').animate({'width':'800px'}, 200, 'swing', function(){ \$j('#eventSideContent').html(t.responseText).fadeIn(); }); }"); if (!$this->canInvite) { $BI = ""; } $closed = ""; if ($this->closeable) { $BC = new Button("Termin abschließen", "bestaetigung", "icon"); $BC->style("margin: 10px; float: right;"); $BC->rmePCR("mKalender", "-1", "getClose", array("'{$this->className}'", "'{$this->classID}'"), "function(t){ \$j('#editDetailsContentmKalender').html(t.responseText); }"); if ($this->closed[0]) { $BC = ""; $closed = "<p>Termin abgeschlossen am " . Util::CLDateParser($this->closed[0]) . ($this->closed[1] != "" ? ":<br>" . nl2br($this->closed[1]) : "") . "</p>"; } } $topButtons = ""; foreach ($this->topButtons as $B) { $B->type("icon"); $B->style("margin-top:10px;margin-left:10px;"); $topButtons .= $B; } return "<div style=\"width:400px;\">" . $BDS . $BD . $BE . $BN . $topButtons . $BR . $BI . $BC . $closed . "</div><div style=\"clear:both;\"></div><div style=\"display:none;\" id=\"eventAdditionalContent\"></div><div style=\"display:none;width:400px;float:right;\" id=\"eventSideContent\"></div><div style=\"width:400px;float:left;\" id=\"eventDefaultContent\"{$T}</div>"; }
function newEpisodes() { $html = "<h1>Demnächst</h1>"; $AC = anyC::get("Folge"); $AC->addAssocV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d')) + 120", ">=", mktime(0, 0, 1)); $AC->addAssocV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d'))", "<=", time() + 3600 * 24 * 6); $AC->addAssocV3("RSSFilterID", ">", "0"); $AC->addJoinV3("Serie", "SerieID", "=", "SerieID"); $AC->addOrderV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d 18:00'))", "ASC"); $i = 0; $lastAD = null; while ($S = $AC->getNextEntry()) { if ($lastAD != $S->A("airDate")) { if ($lastAD !== null) { $html .= "</div>"; } $date = strtotime($S->A("airDate")); $html .= "<div class=\"comingUp\" style=\"box-sizing:border-box;" . ($i % 2 == 0 ? "background-color: #F2F2F2;" : "") . "padding:10px;display:inline-block;width:calc(100% / 7);vertical-align:top;\"><h2 style=\"margin-top:0;padding-top:0;\">" . mb_substr(Util::CLWeekdayName(date("w", $date)), 0, 2) . ", " . Util::CLDateParser($date) . "</h2>"; $i++; } $html .= $S->A("name") . " <span style=\"color:grey;\">S" . ($S->A("season") < 10 ? "0" : "") . $S->A("season") . "E" . ($S->A("episode") < 10 ? "0" : "") . $S->A("episode") . "</span><br>"; $lastAD = $S->A("airDate"); } $html .= "</div>" . OnEvent::script("g.sameHeight('.comingUp');"); $html .= "<h1>Neue Folgen</h1>"; $AC = anyC::get("JDownload"); $AC->addAssocV3("JDownloadDate", ">", time() - 3600 * 24 * 7); $AC->addOrderV3("JDownloadDate", "DESC"); $AC->addAssocV3("JDownloadSerieID", "!=", "0"); $AC->addJoinV3("Serie", "JDownloadSerieID", "=", "SerieID"); while ($D = $AC->getNextEntry()) { if ($D->A("JDownloadSerieID") != "0" and $D->A("cover") != "" and trim($D->A("coverThumb")) == "") { $S = new Serie($D->A("JDownloadSerieID")); $S->changeA("coverThumb", DBImageGUI::stringifyDataS("image/png", DBImageGUI::getData($S->A("cover")), 150, 220)); $S->saveMe(true, false); $D->changeA("coverThumb", $S->A("coverThumb")); } preg_match("/S([0-9]+)E([0-9]+)/", $D->A("JDownloadRenameto"), $matches); $ACF = anyC::get("Folge", "SerieID", $D->A("SerieID")); $ACF->addAssocV3("season", "=", $matches[1]); $ACF->addAssocV3("episode", "=", $matches[2]); $ACF->setLimitV3(1); $F = $ACF->getNextEntry(); $B = new Button("Abspielen", "play", "touch"); $B->onclick("parent.UPnP.search('" . Util::makeFilename(str_replace(" ", ".", $D->A("JDownloadRenameto"))) . "');"); $html .= "\n\t\t\t<div style=\"display:inline-block;width:33%;margin-bottom:2%;vertical-align:top;\">\n\t\t\t\t<div style=\"margin-right:20px;float:left;width:150px;\">\n\t\t\t\t\t<img style=\"width:150px;height:220px;margin-bottom:5px;\" src=\"./index.php?D=trinityDB/Serien&M=getCover&P0=" . $D->A("SerieID") . "\" />\n\t\t\t\t\t\t{$B}\n\t\t\t\t</div>\n\t\t\t\t<h2 style=\"margin-top:0px;padding-top:0px;\">" . $D->A("JDownloadRenameto") . "</h2>\n\t\t\t\t<p style=\"color:grey;\">" . ($F != null ? $F->A("description") : "Keine Beschreibung") . " <small>" . Util::CLDateParser($D->A("JDownloadDate")) . "</small></p>\n\t\t\t</div>"; } return $html; }
function getInfo($time) { $BE = ""; $BD = ""; $BDS = ""; if ($this->editable != null) { if ($this->editable[0] != null) { $BE = new Button("Bearbeiten", "edit", "icon"); $BE->style("margin:10px;float:right;"); $BE->popup("", "Kalendereintrag bearbeiten", "mKalender", $this->classID, "editInPopup", array("'" . $this->className . "'", $this->classID, "'{$this->editable[0]}'")); } $BD = new Button("Dieses Event Löschen", "trash", "icon"); $BD->style("float:right;margin:10px;"); $BD->onclick("if(confirm('Löschen?')) "); $BD->rmePCR(str_replace("GUI", "", $this->className), $this->classID, $this->editable[1], $this->classID, "contentManager.reloadFrame('contentLeft'); Popup.close('mKalender', 'edit');"); if ($this->repeat() !== false) { $BD->rmePCR(str_replace("GUI", "", $this->className), $this->classID, $this->editable[1], array($this->classID, $time + Kalender::parseTime($this->time) - 60), "contentManager.reloadFrame('contentLeft'); Popup.close('mKalender', 'edit');"); $BDS = new Button("Alle Events Löschen", "./ubiquitous/Kalender/deleteSeries.png", "icon"); $BDS->style("float:right;margin:10px;"); $BDS->onclick("if(confirm('Löschen?')) "); $BDS->rmePCR(str_replace("GUI", "", $this->className), $this->classID, $this->editable[1], $this->classID, "contentManager.reloadFrame('contentLeft'); Popup.close('mKalender', 'edit');"); } } $T = new HTMLTable(2, "Eventdetails"); $T->setColWidth(1, 120); $T->addColStyle(1, "vertical-align:top;"); $T->addLV("Betreff", $this->title); $T->addLV("Tag", Util::CLDateParser($time)); if (!$this->allDay) { $T->addLV("Uhrzeit", $this->formatTime($this->time)); } else { $T->addLV("Uhrzeit", "Ganzer Tag"); } $T->addLV("Details", "<div style=\"max-height:300px;overflow:auto;\">" . $this->summary . "</div>"); if ($this->organizer) { $T->addLV("Organisator", $this->organizer); } if (count($this->values) > 0) { $T->insertSpaceAbove(); } foreach ($this->values as $label => $value) { $T->addLV($label, $value); } $BN = ""; if ($this->canNotify) { // TODO: Entfernen sobald Einladungen funktionieren $BN = new Button("Termin-\nbestätigung", "mail" . ($this->notified ? "ed" : ""), "icon"); $BN->style("margin-top:10px;margin-left:10px;"); $BN->popup("", "Terminbestätigung", "Util", "-1", "EMailPopup", array("'mKalender'", "-1", "'notification::{$this->className}::{$this->classID}::{$time}'", "'function(){ Kalender.refreshInfoPopup(); }'")); } $BR = ""; if ($this->isRepeatable and $this->getException() === false) { $BR = new Button("Wiederholungen", "refresh", "icon"); $BR->style("margin:10px;float:right;"); $BR->rmePCR("mKalender", "-1", "getRepeatable", array("'{$this->className}'", "'{$this->classID}'", "'{$this->isRepeatable}'"), "function(transport){ \$j('#eventAdditionalContent').html(transport.responseText).slideDown(); }"); } // TODO: Flag für Teilnehmer erstellen // nur anzeigen, wenn es sich um eine ToDo handelt // $buttonInvite = new Button("Teilnehmer einladen", "refresh", "icon"); // $buttonInvite->style("margin: 10px; float: right;"); // $buttonInvite->rmePCR("mKalender", "-1", "getInviteForm", array("'$this->className'", "'$this->classID'", "'getInviteForm'"), "function(transport){ \$j('#eventAdditionalContent').html(transport.responseText).slideDown(); }"); $topButtons = ""; foreach ($this->topButtons as $B) { $B->type("icon"); $B->style("margin-top:10px;margin-left:10px;"); $topButtons .= $B; } return $BDS . $BD . $BE . $BN . $topButtons . $BR . $buttonInvite . "<div style=\"clear:both;\"></div><div style=\"display:none;\" id=\"eventAdditionalContent\"></div>" . $T; }
static function CLDateParser($date, $l = "load") { echo Util::CLDateParser($date, $l); }
function getBusyList($UserID = null, $echo = false) { $cutoffDatePast = time() - 2 * 24 * 3600; $cutoffDateFuture = time() + 84 * 24 * 3600; $Kal = new mKalender(); $K = $Kal->getData($cutoffDatePast, $cutoffDateFuture, $UserID); $Datum = new Datum(); $Datum->normalize(); $htmlEvents = ""; $htmlEvents .= "<div class=\"backgroundColor2\"><p class=\"prettySubtitle\">KW " . date("W", $Datum->time()) . "</p></div>"; while ($Datum->time() < $cutoffDateFuture) { $list = ""; $events = $K->getEventsOnDay(date("dmY", $Datum->time())); if ($events != null and count($events) > 0) { foreach ($events as $ev) { foreach ($ev as $KE) { $list .= "<div style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\" title=\"" . $KE->title() . "\"><span>" . Util::CLTimeParser($K->parseTime($KE->currentWhen()->time)) . " - " . Util::CLTimeParser($K->parseTime($KE->getEndTime())) . "</span> <small style=\"color:grey;\">" . $KE->title() . "</small></div>"; } } } $Datum->addDay(); $style = ""; if ($Datum->w() == 0 or $Datum->w() == 6) { continue; } #$style = "background-color:#DDD;"; if ($Datum->w() == 1) { $htmlEvents .= "<div class=\"backgroundColor2\"><p class=\"prettySubtitle\">KW " . date("W", $Datum->time()) . "</p></div>"; } $htmlEvents .= "<div style=\"margin-bottom:20px;{$style}display:inline-block;width:50%;box-sizing:border-box;vertical-align:top;min-height:60px;\">\n\t\t\t\t<div style=\"background-color:#EEE;padding:5px;\">\n\t\t\t\t\t<span style=\"display:inline-block;width:30px;font-weight:bold;\">" . mb_substr(Util::CLWeekdayName($Datum->w()), 0, 2) . "</span>\n\t\t\t\t\t<span style=\"color:grey;\">" . Util::CLDateParser($Datum->time()) . "</span>\n\t\t\t\t</div>\n\t\t\t\t<div style=\"padding:5px;\">\n\t\t\t\t\t{$list}\n\t\t\t\t</div>\n\t\t\t\t</div>"; } if ($echo) { echo $htmlEvents; } return $htmlEvents; }
public static function CLDateTimeParser($dateTime, $l = "load") { if ($dateTime == "0" and $l == "load") { return ""; } if ($dateTime == "" and $l == "store") { return "0"; } if ($l == "load") { return Util::CLDateParser($dateTime) . " " . Util::CLTimeParser($dateTime); } if ($l == "store") { $ex = explode(" ", $dateTime); return Util::CLDateParser($ex[0], "store") - 60 + Util::CLTimeParser($ex[1], "store"); } }
public static function dateParser($w) { return Util::CLDateParser($w); }
public function data($UserID = 0, $start = null, $ende = null) { $p = mUserdata::getPluginSpecificData("mStatistik"); $ps = mUserdata::getPluginSpecificData("mAkquise"); $AC = anyC::get("Todo"); $AC->addAssocV3("TodoFromDay", ">=", $start ? $start : Util::CLDateParser($this->startDatum, "store")); $AC->addAssocV3("TodoFromDay", "<=", $ende ? $ende : Util::CLDateParser($this->endDatum, "store")); if ($UserID) { $AC->addAssocV3("TodoUserID", "=", $UserID); } $AC->addGroupV3("TodoUserID"); if (!isset($p["pluginSpecificCanUseControlling"])) { $AC->addAssocV3("TodoUserID", "=", Session::currentUser()->getID(), "AND", "2"); foreach ($ps as $key => $value) { if (strstr($key, "pluginSpecificCanSeeFrom")) { $AC->addAssocV3("TodoUserID", "=", str_replace("pluginSpecificCanSeeFrom", "", $key), "OR", "2"); } } } $AC->setFieldsV3(array("TodoUserID", "COUNT(*) AS gesamt", "COUNT(CASE WHEN TodoDoneTime > 0 THEN 1 END) AS gesamtDM", "COUNT(CASE WHEN TodoType = 3 THEN 1 END) AS gesamtKalt", "COUNT(CASE WHEN TodoType = 4 THEN 1 END) AS gesamtErst", "COUNT(CASE WHEN TodoType = 5 THEN 1 END) AS gesamtFolge")); $AC->addOrderV3("gesamt ", "DESC"); return $AC; }
function getHTML($id) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> $this->loadMeOrEmpty(); $bps = $this->getMyBPSData(); $allowed = array(); $ACS = anyC::get("Userdata", "name", "shareCalendarTo" . Session::currentUser()->getID()); $ACS->addAssocV3("name", "=", "shareCalendarTo0", "OR"); while ($Share = $ACS->getNextEntry()) { $allowed[$Share->A("UserID")] = $Share->A("wert"); } if ($id == -1) { $this->A->TodoTillDay = Util::CLDateParser(time() + 7 * 24 * 3600); $this->A->TodoTillTime = Util::CLTimeParser(10 * 3600); $this->A->TodoFromDay = Util::CLDateParser(time() + 7 * 24 * 3600); $this->A->TodoFromTime = Util::CLTimeParser(9 * 3600); $this->A->TodoType = "2"; if ($bps != -1 and isset($bps["TodoTillDay"])) { $this->A->TodoTillDay = $bps["TodoTillDay"]; $this->A->TodoFromDay = $bps["TodoTillDay"]; BPS::unsetProperty("TodoGUI", "TodoTillDay"); } if ($bps != -1 and isset($bps["TodoFromTime"])) { $this->A->TodoFromTime = Util::CLTimeParser($bps["TodoFromTime"] * 3600); $this->A->TodoTillTime = Util::CLTimeParser(($bps["TodoFromTime"] + 1) * 3600); BPS::unsetProperty("TodoGUI", "TodoFromTime"); } if ($bps != -1 and isset($bps["TodoDescription"])) { $this->A->TodoDescription = $bps["TodoDescription"]; BPS::unsetProperty("TodoGUI", "TodoDescription"); } if ($bps != -1 and isset($bps["TodoLocation"])) { $this->A->TodoLocation = $bps["TodoLocation"]; BPS::unsetProperty("TodoGUI", "TodoLocation"); } if ($bps != -1 and isset($bps["TodoName"])) { $this->A->TodoName = $bps["TodoName"]; BPS::unsetProperty("TodoGUI", "TodoName"); } $for = BPS::getProperty("mKalenderGUI", "KID", Session::currentUser()->getID()); if ($for != Session::currentUser()->getID() and strpos($allowed[$for], "create") === false) { $for = Session::currentUser()->getID(); } $this->A->TodoUserID = $for; $this->A->TodoClass = BPS::getProperty("mTodoGUI", "ownerClass"); $this->A->TodoClassID = BPS::getProperty("mTodoGUI", "ownerClassID"); } $gui = $this->GUI; $gui->name("Termin"); $gui->label("TodoDescription", "Details"); $gui->label("TodoTillDay", "Ende"); $gui->label("TodoTillTime", "Uhrzeit"); $gui->label("TodoFromDay", "Anfang"); $gui->label("TodoFromTime", "Uhrzeit"); $gui->label("TodoType", "Typ"); $gui->label("TodoUserID", "Zuständig"); $gui->label("TodoStatus", "Status"); $gui->label("TodoRemind", "Erinnerung"); $gui->label("TodoName", "Betreff"); $gui->label("TodoRepeat", "Wiederholen"); #$gui->label("TodoRepeatInterval","Intervall"); $gui->label("TodoClassID", "Kunde"); $gui->label("TodoLocation", "Ort"); $gui->label("TodoAllDay", "Ganzer Tag"); $gui->space("TodoRemind", "Optionen"); $gui->space("TodoFromDay", "Zeit"); if ($this->A("TodoFromDay") == "01.01.1970" and $this->A("TodoFromTime") == "00:00") { $this->changeA("TodoFromDay", $this->A("TodoTillDay")); $this->changeA("TodoFromTime", $this->A("TodoTillTime")); } $gui->attributes(array("TodoType", "TodoClass", "TodoClassID", "TodoDescription", "TodoLocation", "TodoFromDay", "TodoTillDay", "TodoAllDay", "TodoRemind", "TodoUserID")); $gui->type("TodoType", "select", TodoGUI::types()); $gui->type("TodoRemind", "select", array("-1" => "keine Erinnerung", "60" => "1 Minute vorher", "300" => "5 Minuten vorher", "600" => "10 Minuten vorher", "900" => "15 Minuten vorher", "1800" => "30 Minuten vorher", "2700" => "45 Minuten vorher", "3600" => "1 Stunde vorher")); $gui->type("TodoClass", "hidden"); $gui->type("TodoDescription", "textarea"); $gui->type("TodoAllDay", "checkbox"); $gui->addFieldEvent("TodoAllDay", "onchange", "\$j('#TodoFromTimeDisplay').css('display', this.checked ? 'none' : 'inline'); \$j('#TodoTillTimeDisplay').css('display', this.checked ? 'none' : 'inline');"); $gui->parser("TodoFromDay", "TodoGUI::dayFromParser"); $gui->parser("TodoTillDay", "TodoGUI::dayTillParser"); $ac = Users::getUsers(); $users = array(); while ($u = $ac->getNextEntry()) { if (!isset($allowed[$u->getID()]) and $u->getID() != Session::currentUser()->getID()) { continue; } if (isset($allowed[$u->getID()]) and strpos($allowed[$u->getID()], "create") === false) { continue; } $users[$u->getID()] = $u->A("name"); } $ac = Users::getUsers(1); while ($u = $ac->getNextEntry()) { if (!isset($allowed[$u->getID()]) and $u->getID() != Session::currentUser()->getID()) { continue; } if (isset($allowed[$u->getID()]) and strpos($allowed[$u->getID()], "create") === false) { continue; } $users[$u->getID()] = $u->A("name"); } $users["-1"] = "Alle"; if (Session::isPluginLoaded("mWAdresse") and ($this->A("TodoClass") == "WAdresse" or $this->A("TodoClass") == "Kalender")) { $gui->parser("TodoClassID", "TodoGUI::parserKunde"); } else { $gui->type("TodoClassID", "hidden"); } $gui->type("TodoUserID", "select", $users); $gui->type("TodoStatus", "select", $this->getStatus()); $gui->activateFeature("CRMEditAbove", $this); if ($gui instanceof CRMHTMLGUI) { return $gui->getEditTableHTML(4); } }
public function saveMe($checkUserData = true, $output = false, $update = true) { $old = new Todo($this->getID()); $old->loadMe(); #$fromDay = date("Y-m-d", Util::CLDateParser($this->A("TodoFromDay"), "store")); #$fromTime = Util::formatTime("de_DE", Util::CLTimeParser($this->A("TodoFromTime"), "store")); #die($this->getID()); if ($update) { $this->changeA("TodoLastChange", time()); $this->changeA("TodoReminded", "0"); } #$name = $this->getOwnerObject()->getCalendarTitle(); if ($this->A("TodoAllDay")) { $this->changeA("TodoFromTime", Util::CLTimeParser(0)); $this->changeA("TodoTillTime", Util::CLTimeParser(0)); } if ($this->A("TodoRepeatWeekOfMonth") > 0 and $this->A("TodoRepeatWeekOfMonth") != 127) { $D = new Datum($this->hasParsers ? Util::CLDateParser($this->A("TodoFromDay"), "store") : $this->A("TodoFromDay")); $nthDay = $D->getNthDayOfMonth(); if ($nthDay > 4) { $nthDay = 4; } $this->changeA("TodoRepeatWeekOfMonth", $nthDay); } if ($this->A("TodoClass") != "" and $this->A("TodoClass") != "Kalender" and $this->A("TodoName") == "") { $this->changeA("TodoName", $this->getOwnerObject()->getCalendarTitle()); } if (Session::isPluginLoaded("mAufgabe") and ($this->A("TodoType") == 3 or $this->A("TodoType") == 4 or $this->A("TodoType") == 5) and $this->A("TodoUserID") > 0) { $F = new Factory("Aufgabe"); $F->sA("AufgabeByClass", "Todo"); $F->sA("AufgabeByClassID", $this->getID()); $E = $F->exists(true); if (!$E) { $F->sA("AufgabeUserID", $this->A("TodoUserID")); $F->sA("AufgabeText", "Bericht für Termin '" . $this->A("TodoName") . "' eintragen"); $F->sA("AufgabeCreated", time()); if ($this->A("TodoDoneTime") > 0) { $F->sA("AufgabeStatus", "5"); $F->sA("AufgabeDone", time()); } if ($this->hasParsers) { $F->sA("AufgabeUntil", Util::CLDateParser($this->A("TodoFromDay"), "store")); $F->sA("AufgabeUhrzeitVon", Util::CLTimeParser($this->A("TodoTillTime"), "store")); } else { $F->sA("AufgabeUntil", $this->A("TodoFromDay")); $F->sA("AufgabeUhrzeitVon", $this->A("TodoTillTime")); } $F->store(); } else { $E->changeA("AufgabeText", "Bericht für Termin '" . $this->A("TodoName") . "' eintragen"); if ($this->hasParsers) { $E->changeA("AufgabeUntil", Util::CLDateParser($this->A("TodoFromDay"), "store")); $E->changeA("AufgabeUhrzeitVon", Util::CLTimeParser($this->A("TodoTillTime"), "store")); } else { $E->changeA("AufgabeUntil", $this->A("TodoFromDay")); $E->changeA("AufgabeUhrzeitVon", $this->A("TodoTillTime")); } if ($this->A("TodoDoneTime") > 0) { $E->changeA("AufgabeStatus", "5"); $E->changeA("AufgabeDone", time()); } $E->saveMe(); } } parent::saveMe($checkUserData, false); if (Session::isPluginLoaded("mGoogle") and $this->updateGoogle) { $KE = mTodoGUI::getCalendarDetails("Todo", $this->getID()); if ($this->A("TodoUserID") == Session::currentUser()->getID()) { if ($old->A("TodoUserID") == $this->A("TodoUserID")) { Google::calendarUpdateEvent(mTodoGUI::getCalendarDetails("Todo", $this->getID())); } else { Google::calendarDeleteEvent($KE); #"Todo", $this->getID()); Google::calendarCreateEvent($KE); } } else { Google::calendarDeleteEvent($KE); #"Todo", $this->getID()); Google::calendarCreateEvent($KE, $this->A("TodoUserID")); } } }
function showWarenkorb() { $AC = anyC::get("Seminar"); $AC->addAssocV3("SeminarVon", ">=", Util::parseDate("de_DE", Util::formatDate("de_DE", time()))); $count = array(); for ($i = 0; $i < 21; $i++) { $count[$i] = $i; } $T = new HTMLTable(3, "Events"); $T->setTableStyle("width:100%;"); while ($S = $AC->getNextEntry()) { $I = new HTMLInput("AnzahlKarten" . $S->getID(), "select", "0", $count); $I->style("width:80px;text-align:right;"); $I->onchange("CustomerPage.rme('recalc', ['" . $S->getID() . "', this.value], function(response){ \$('#PreisGesamt" . $S->getID() . "').html(response) });"); if (isset($_SESSION["ticketDataSelection"])) { $I->setValue($_SESSION["ticketDataSelection"][$S->getID()]); } $Adresse = new Adresse($S->A("SeminarAdresseID")); $T->addRow(array("<b>" . $S->A("SeminarName") . "</b>, " . Util::CLDateParser($S->A("SeminarVon")) . " ab " . Util::CLTimeParser($S->A("SeminarStart")) . " Uhr, " . $Adresse->A("ort"))); $T->addRowColspan(1, 3); $T->addRow(array($I, Util::formatCurrency("de_DE", $S->A("SeminarPreisErwachsene") * 1, true), Util::formatCurrency("de_DE", $S->A("SeminarPreisErwachsene") * $I->getValue(), true))); $T->addCellStyle(1, "text-align:right;"); $T->addCellStyle(2, "text-align:right;"); $T->addCellStyle(3, "text-align:right;"); $T->addCellID(3, "PreisGesamt" . $S->getID()); $T->addRow(array(" ")); $T->addRowColspan(1, 3); } $I = new Button("Weiter", ""); $I->onclick("CustomerPage.rme('handleForm', \$('#ticketShop').serialize(), function(){ document.location.reload(); })"); $I->className("submitFormButton"); $T->addRow($I); $T->addRowColspan(1, 3); $IA = new HTMLInput("action", "hidden", "handleSelection"); return "<form id=\"ticketShop\">" . $T . $IA . "</form>"; }
public static function parserDG($w) { $ex = explode("-", $w); $D = new Datum(mktime(0, 1, 0, $ex[1], $ex[2], $ex[0])); return Util::CLDateParser($D->time()); }
public function getOverviewContent($echo = true) { $time = mktime(0, 0, 1); $Datum = new Datum($time); $Datum->addMonth(); $lastTime = $Datum->time(); $Datum->subMonth(); $Woche = date("W"); $K = $this->getData($time, $lastTime); $hasEvent = array(); $html = "<div class=\"touchHeader\"><span class=\"lastUpdate\" id=\"lastUpdatemKalenderGUI\"></span><p>Kalender</p></div><div style=\"padding:10px;padding-left:0px;\">"; $html .= "<div style=\"width:25px;float:left;margin-right:5px;color:grey;font-size:11px;\">%%SMALLCALCONTENT%%</div>"; $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-left:30px;\" class=\"borderColor1\">Heute</div>"; $list = new HTMLList(); $list->addListStyle("list-style-type:none;margin-left:30px;"); $events = $K->getEventsOnDay(date("dmY", $Datum->time())); if ($events != null and count($events) > 0) { foreach ($events as $ev) { foreach ($ev as $KE) { $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true; $B = new Button("", $KE->icon(), "icon"); $B->style("float:left;margin-right:5px;margin-bottom:10px;"); $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . " " . Util::CLTimeParser($K->parseTime($KE->getTime())) . "</small>"); } } } if (count($events) == 0) { $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>"); } $html .= $list; $Datum->addDay(); $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-top:15px;margin-left:30px;\" class=\"borderColor1\">Morgen</div>"; $list = new HTMLList(); $list->addListStyle("list-style-type:none;margin-left:30px;"); $events = $K->getEventsOnDay(date("dmY", $Datum->time())); if ($events != null and count($events) > 0) { foreach ($events as $ev) { foreach ($ev as $KE) { $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true; $B = new Button("", $KE->icon(), "icon"); $B->style("float:left;margin-right:5px;margin-bottom:10px;"); $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . " " . Util::CLTimeParser($K->parseTime($KE->getTime())) . "</small>"); } } } if (count($events) == 0) { $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>"); } $html .= $list; $Datum->addDay(); $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-top:15px;margin-left:30px;\" class=\"borderColor1\">Später</div>"; $list = new HTMLList(); $list->addListStyle("list-style-type:none;margin-left:30px;"); $c = 0; while ($Datum->time() < $lastTime) { $events = $K->getEventsOnDay(date("dmY", $Datum->time())); if ($events != null and count($events) > 0) { foreach ($events as $ev) { foreach ($ev as $KE) { $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true; $B = new Button("", $KE->icon(), "icon"); $B->style("float:left;margin-right:5px;margin-bottom:10px;"); $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . "</small>"); if (date("W", $K->parseDay($KE->getDay())) > $Woche + 1) { $list->addItemStyle("color:grey;"); } $c++; } } } $Datum->addDay(); } if ($c == 0) { $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>"); } $html .= $list . "</div>"; $smallCal = ""; $DatumC = clone $Datum; for ($i = 0; $i < 14; $i++) { $smallCal .= "<div style=\"padding:5px;text-align:right;" . (isset($hasEvent[date("d", $DatumC->time())]) ? "color:black;" : "") . "\" " . (isset($hasEvent[date("d", $DatumC->time())]) ? "class=\"backgroundColor3\"" : "") . "\">" . date("d", $DatumC->time()) . "</div>"; $DatumC->addDay(); } $html = str_replace("%%SMALLCALCONTENT%%", $smallCal, $html); if ($echo) { echo $html; } return $html; }
public function getService($data) { if (!$this->loggedIn) { return "TIMEOUT"; } $html = ""; $T = new HTMLTable(4); #, "Bitte wählen Sie einen Lieferschein"); $T->setTableStyle("width:100%;margin-top:10px;"); $T->setColWidth(1, 200); $T->setColWidth(4, 200); $T->useForSelection(false); $T->maxHeight(400); $AC = anyC::get("GRLBM", "isWhat", "S"); $AC->addJoinV3("Auftrag", "AuftragID", "=", "AuftragID"); #$AC->addAssocV3("UserID", "=", Session::currentUser()->getID()); $AC->addAssocV3("isPrinted", "=", "0"); $AC->addAssocV3("isEMailed", "=", "0"); $AC->addAssocV3("isPixelLetteredTime", "=", "0"); #$AC->addAssocV3("status", "=", "delivered"); $AC->addAssocV3("GRLBMServiceMitarbeiter", "=", Session::currentUser()->getID(), "AND", "2"); $AC->addAssocV3("GRLBMServiceMitarbeiter2", "=", Session::currentUser()->getID(), "OR", "2"); $AC->addAssocV3("GRLBMServiceMitarbeiter3", "=", Session::currentUser()->getID(), "OR", "2"); $AC->addAssocV3("GRLBMServiceMitarbeiter4", "=", Session::currentUser()->getID(), "OR", "2"); $AC->addOrderV3("datum", "DESC"); #$AC->addOrderV3("nummer", "DESC"); #$AC->setLimitV3(100); #$AC->addJoinV3("Adresse", "t2.AdresseID", "=", "AdresseID"); $i = 0; while ($B = $AC->n()) { $BPDF = new Button("PDF anzeigen"); $BPDF->className("submitFormButton"); $BPDF->style("background-color:#DDD;color:grey;float:right;"); $BPDF->onclick("CustomerPage.popup('Service PDF', 'getPDFViewer', {GRLBMID: '" . $B->getID() . "'}, {width:'800px'});"); $BOK = ""; if ($B->A("GRLBMServiceSigAG") != "" and $B->A("GRLBMServiceSigAG") != "[]") { $BOK = new Button("Kunde hat unterschrieben", "check", "iconic"); $BOK->style("font-size:55px;"); } $Adresse = new Adresse($B->A("AdresseID")); $T->addRow(array("<span style=\"font-size:20px;font-weight:bold;\">" . $B->A("prefix") . $B->A("nummer") . "</span><br><span style=\"color:grey;\">" . Util::CLDateParser($B->A("datum")) . "</span>", $Adresse->getHTMLFormattedAddress(), $BOK, $BPDF)); $T->addCellStyle(1, "vertical-align:top;"); $T->addRowStyle("border-bottom:1px solid #ccc;"); #if($i % 2 == 1) # $T->addRowStyle ("background-color:#eee;"); $event = "\n\t\t\t\t\$(this).addClass('selected');\n\t\t\t\tCCAuftrag.lastTextbausteinUnten = null;\n\t\t\t\t\n\t\t\t\tCustomerPage.rme('getAuftrag', {GRLBMID: " . $B->getID() . "}, function(transport){ \n\t\t\t\t\t\tif(transport == 'TIMEOUT') { document.location.reload(); return; } \n\t\t\t\t\t\t\$('#contentLeft').html(transport); \n\t\t\t\t\t\t\$('#frameSelect').hide(); \$('#frameEdit').show();\n\t\t\t\t\t}, \n\t\t\t\t\tfunction(){},\n\t\t\t\t\t'POST');\n\t\t\t\t\t\n\t\t\t\tCustomerPage.rme('getArtikel', {GRLBMID: " . $B->getID() . ", query : '', KategorieID: ''}, function(transport){ \n\t\t\t\t\t\tif(transport == 'TIMEOUT') { document.location.reload(); return; } \n\t\t\t\t\t\t\$('#contentRight').html(transport); \n\t\t\t\t\t\t\$('.selected').removeClass('selected');\n\t\t\t\t\t}, \n\t\t\t\t\tfunction(){},\n\t\t\t\t\t'POST');"; if ($B->A("GRLBMServiceSigAG") == "" or $B->A("GRLBMServiceSigAG") == "[]") { $T->addCellEvent(1, "click", $event); $T->addCellEvent(2, "click", $event); $T->addRowStyle("cursor:pointer;"); } else { $T->addRowStyle("cursor:default;"); } $i++; } $html .= $T; return $html; }