Пример #1
0
 private function row(poolAnzeige $A)
 {
     $html = "\n\t\t\t<div style=\"height:auto;padding-top:30px;padding-bottom:25px;border-bottom: 1px solid #ddd;\">";
     $I = new HTMLInput("poolAnzeigeName", "text", $A->A("poolAnzeigeName"));
     $I->activateMultiEdit("poolAnzeige", $A->getID());
     $I->style("text-align: right;width:90%;");
     $I->placeholder("Beschriftung");
     $B = new Button("Zeile löschen", "trash_stroke", "iconicL");
     $B->style("margin-top:10px;");
     $B->doBefore("if(confirm('Die Zeile löschen?')) %AFTER");
     $B->rmePCR("poolAnzeige", $A->getID(), "deleteMe", "", OnEvent::reload("Screen"));
     $html .= "\n\t\t\t\t<div style=\"text-align: right;color: #777;font-size: 1.5em;display: inline-block;width: 195px;height: auto;vertical-align: top;margin-top: 7px;margin-right: 21px;\">\n\t\t\t\t\t{$I}{$B}\n\t\t\t\t</div>";
     $close = 0;
     $AC = anyC::get("poolAnzeigeControl", "poolAnzeigeControlpoolAnzeigeID", $A->getID());
     $AC->addOrderV3("poolAnzeigeControlOrder");
     $AC->addOrderV3("poolAnzeigeControlID");
     while ($C = $AC->n()) {
         if ($C->A("poolAnzeigeControlNewLine")) {
             $html .= "<div style=\"margin-top:15px;\">\n\t\t\t\t\t<div style=\"display: inline-block;width: 195px;height: 120px;vertical-align: top;margin-top: 7px;margin-right: 21px;\"></div>";
             $close++;
         }
         $html .= $this->control($C);
     }
     $B = new Button("Element\nhinzufügen", "new");
     $B->style("margin:10px;display:inline-block;vertical-align:top;");
     $B->popup("", "Element hinzufügen", "mpoolAnzeige", "-1", "addElementPopup", array($A->getID()));
     $html .= $B;
     for ($i = 0; $i < $close; $i++) {
         $html .= "</div>";
     }
     $html .= "</div>";
     return $html;
 }
Пример #2
0
 public function browser()
 {
     $BA = new Button("Eintrag\nhinzufügen", "new");
     $BA->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
     $BA->rmePCR($this->object->getClearClass(), "-1", "create", $this->parametersCreate, OnEvent::reloadPopup($this->object->getClearClass()));
     $BA->style("margin:10px;");
     $cols = 3 + count($this->colsLeft) + count($this->colsRight);
     $TE = new HTMLTable($cols, "Einträge");
     $TE->setColWidth(1, 20);
     $TE->setColWidth($cols, 20);
     $TE->useForSelection(false);
     $TE->maxHeight(400);
     $TE->weight("light");
     $BE = new Button("Eintrag bearbeiten", "arrow_right", "iconic");
     $autoLoad = false;
     while ($A = $this->object->getNextEntry()) {
         $BD = new Button("Eintrag löschen", "trash_stroke", "iconic");
         $BD->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
         $BD->onclick("deleteClass('" . get_class($A) . "','" . $A->getID() . "', function() { " . OnEvent::reloadPopup($this->object->getClearClass()) . " },'Eintrag wirklich löschen?');");
         $isEmpty = false;
         if ($this->emptyCheckField != null and $A->A($this->emptyCheckField) == "") {
             $autoLoad = $A->getID();
             $isEmpty = true;
         }
         if (!$isEmpty) {
             $div = Util::invokeStaticMethod(get_class($this->object), $this->parsers["main"], array($A));
         } else {
             $div = "Neuer Eintrag";
         }
         $row = array();
         $row[] = $BD;
         $row[] = $div;
         foreach ($this->colsRight as $col) {
             $c = Util::invokeStaticMethod(get_class($this->object), $col[0], array($A));
             $row[] = $c;
         }
         $row[] = $BE;
         $TE->addRow($row);
         $action = "contentManager.selectRow(this); \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'800px'}, 200, 'swing', function(){ " . OnEvent::frame("popupEditEntry", get_class($A), $A->getID(), "0", "function(){ \$j('#popupEditEntry').fadeIn(); }") . " });";
         $TE->addCellEvent(2, "click", $action);
         $TE->addCellID(2, "popupEntryID" . $A->getID());
         $TE->addCellEvent(count($row), "click", $action);
     }
     if ($this->object->numLoaded() == 0) {
         $TE->addRow("Keine Einträge");
         $TE->addRowColspan(1, 3);
     }
     return "{$BA}\n\t\t\t<div style=\"float:right;width:400px;height:500px;display:none;\" id=\"popupEditEntry\"></div>\n\t\t\t<div id=\"popupListEntries\" style=\"width:400px;height:440px;overflow:auto;\">{$TE}</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t" . ($autoLoad ? OnEvent::script("\$j('#popupEntryID" . $autoLoad . "').trigger(Touch.trigger);") : "");
 }
Пример #3
0
 public function bricklets()
 {
     $BA = new Button("Bricklet\nhinzufügen", "new");
     $BA->doBefore("\$j('#editAP').fadeOut(400, function(){ \$j('#editDetailsTinkerforge').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
     $BA->rmePCR("Tinkerforge", $this->getID(), "createNew", "", OnEvent::reloadPopup("Tinkerforge"));
     $BA->style("margin:10px;");
     $TE = new HTMLTable(4, "Bricklets");
     $TE->setColWidth(1, 20);
     $TE->setColWidth(2, 35);
     $TE->setColWidth(4, 20);
     $TE->useForSelection(false);
     $TE->maxHeight(400);
     $TE->weight("light");
     $BE = new Button("Eintrag bearbeiten", "arrow_right", "iconic");
     $autoLoad = false;
     $AC = anyC::get("TinkerforgeBricklet", "TinkerforgeBrickletTinkerforgeID", $this->getID());
     while ($A = $AC->getNextEntry()) {
         $B = new Button("Master", "bars", "iconicL");
         $B->popup("", "Plot", "TinkerforgeBricklet", $A->getID(), "getControls", "", "", "{width:820}");
         $B->style("float:right;");
         $BD = new Button("Eintrag löschen", "trash_stroke", "iconic");
         $BD->doBefore("\$j('#editAP').fadeOut(400, function(){ \$j('#editDetailsTinkerforge').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
         $BD->onclick("deleteClass('TinkerforgeBricklet','" . $A->getID() . "', function() { Popup.refresh('Tinkerforge'); },'Eintrag wirklich löschen?');");
         if ($A->A("TinkerforgeBrickletUID") == "") {
             $autoLoad = $A->getID();
         }
         $div = "<span id=\"TinkerforgeBrickletUID" . $A->getID() . "\">" . ($A->A("TinkerforgeBrickletUID") != "" ? $A->A("TinkerforgeBrickletUID") : "Neues Bricklet") . "</span>&nbsp;<br />\n\t\t\t\t\t<small style=\"color:grey;\" id=\"TinkerforgeBrickletType" . $A->getID() . "\">" . ($A->A("TinkerforgeBrickletType") != "" ? TinkerforgeBricklet::$types[$A->A("TinkerforgeBrickletType")] : "") . "</small>";
         $TE->addRow(array($BD, $B, $div, $BE));
         $TE->addCellEvent(3, "click", "contentManager.selectRow(this); \$j('#editDetailsTinkerforge').animate({'width':'800px'}, 200, 'swing', function(){ " . OnEvent::frame("editAP", "TinkerforgeBricklet", $A->getID(), "0", "function(){ \$j('#editAP').fadeIn(); }") . " });");
     }
     if ($AC->numLoaded() == 0) {
         $TE->addRow("Keine Bricklets eingetragen");
         $TE->addRowColspan(1, 3);
     }
     echo "{$BA}\n\t\t\t<div style=\"float:right;width:400px;height:500px;display:none;\" id=\"editAP\"></div>\n\t\t\t<div id=\"listAP\" style=\"width:400px;height:440px;overflow:auto;\">{$TE}</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t" . ($autoLoad ? OnEvent::script("\$j('#TinkerforgeBrickletUID" . $autoLoad . "').parent().trigger(Touch.trigger);") : "");
 }
Пример #4
0
 /**
  * Method to display an E-Mail popup for easy E-Mail sending
  * 
  * Requires a method named "getEMailData" in $dataClass which returns an array:
  * array(fromName, fromAddress, recipientName, recipientAddress, subject, body)
  * 
  * Will call $dataClass($dataClassID)::sendEmail afterwards
  * 
  * @param string $dataClass
  * @param string $dataClassID 
  */
 public static function EMailPopup($dataClass, $dataClassID, $callbackParameter = null, $onSuccessFunction = null, $onAbortFunction = null, $return = false)
 {
     $c = new $dataClass($dataClassID);
     $data = $c->getEMailData($callbackParameter);
     $html = "";
     $tab = new HTMLTable(2);
     $tab->setColWidth(1, "120px;");
     $tab->addLV("Absender:", "{$data['fromName']}<br /><small>&lt;{$data['fromAddress']}&gt;</small>");
     if (is_array($data["recipients"])) {
         if (count($data["recipients"]) == 1) {
             $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small>&lt;" . $data["recipients"][0][1] . "&gt;</small>");
         } else {
             $recipients = array();
             foreach ($data["recipients"] as $ID => $Rec) {
                 $recipients[$ID] = new HTMLInput($Rec[0] . " &lt;" . $Rec[1] . "&gt;", "option", $ID);
             }
             $IS = new HTMLInput("EMailRecipient{$dataClassID}", "select", isset($data["default"]) ? $data["default"] : "0", $recipients);
             $IS->id("EMailRecipient{$dataClassID}");
             $tab->addLV("Empfänger:", $IS);
         }
     } else {
         $IS = new HTMLInput("EMailRecipient{$dataClassID}", "text", $data["recipients"]);
         $IS->id("EMailRecipient{$dataClassID}");
         $tab->addLV("Empfänger:", $IS);
     }
     $tab->addLV("Betreff:", "<input type=\"text\" id=\"EMailSubject{$dataClassID}\" value=\"{$data['subject']}\" />");
     $html .= $tab;
     $html .= "<div style=\"width:94%;margin:auto;\"><textarea id=\"EMailBody{$dataClassID}\" style=\"width:100%;height:300px;font-size:10px;\">{$data['body']}</textarea></div>";
     #$tab->addRow(array(""));
     #$tab->addRowColspan(1, 2);
     #$tab->addRowClass("backgroundColor0");
     $tab = new HTMLTable(2);
     $tab->setColWidth(1, "120px;");
     if ($onSuccessFunction == null) {
         $onSuccessFunction = "" . OnEvent::reload("Left") . " Popup.close('Util', 'edit');";
     }
     $BAbort = new Button("Abbrechen", "stop");
     if ($onAbortFunction == null) {
         $BAbort->onclick("Popup.close('Util', 'edit');");
     } else {
         $BAbort->onclick($onAbortFunction);
     }
     $BAbort->style("margin-bottom:10px;margin-top:10px;");
     $BGo = new Button("E-Mail\nsenden", "okCatch");
     $BGo->style("float:right;margin-top:10px;");
     if (strpos($data["body"], "<p") !== false) {
         $BGo->doBefore("nicEditors.findEditor('EMailBody{$dataClassID}').saveContent(); %AFTER");
     }
     $BGo->rmePCR(str_replace("GUI", "", $dataClass), $dataClassID, "sendEmail", array("\$('EMailSubject{$dataClassID}').value", "\$('EMailBody{$dataClassID}').value", (is_array($data["recipients"]) and count($data["recipients"]) == 1) ? "0" : "\$('EMailRecipient{$dataClassID}').value", "'" . $callbackParameter . "'"), $onSuccessFunction);
     #$BGo->onclick("CloudKunde.directMail('$this->ID', '$data[recipientAddress]', $('EMailSubject$this->ID').value, $('EMailBody$this->ID').value); ");
     $tab->addRow(array($BGo . $BAbort));
     $tab->addRowColspan(1, 2);
     #$tab->addRowClass("backgroundColor0");
     $html .= $tab;
     if (strpos($data["body"], "<p") !== false) {
         echo OnEvent::script("\n\t\t\t\tsetTimeout(function(){\n\t\t\tnew nicEditor({\n\t\t\t\ticonsPath : './libraries/nicEdit/nicEditorIconsTiny.gif',\n\t\t\t\tbuttonList : ['bold','italic','underline'],\n\t\t\t\tmaxHeight : 400\n\t\t\t}).panelInstance('EMailBody{$dataClassID}');}, 100);");
     }
     if ($return) {
         return $html;
     } else {
         echo $html;
     }
 }
Пример #5
0
 public function pluginShow(Device $Device, $plugin, $isLast = false, $options = null)
 {
     try {
         $C = new $plugin();
     } catch (ClassNotFoundException $e) {
         return "Laden des Plugins fehlgeschlagen!";
     }
     $E = $C->getOverviewPlugin();
     $styles = "";
     if ($options != null) {
         $styles = "position:absolute;top:{$options->top}px;left:{$options->left}px;";
     }
     $html = "<div id=\"fheOverviewContent" . $plugin . "_getOverviewContent\" data-plugin=\"{$plugin}\" class=\"desktopDraggable\" style=\"" . (($isLast or $E->minHeight() === 0) ? "" : ($Device->A("DeviceType") == 4 ? "min-" : "") . "height:" . $E->minHeight() . "px;overflow:hidden;") . ($Device->A("DeviceType") == 4 ? "width:300px;" : "") . "{$styles}\">";
     $BM = new Button("Plugin verschieben", "move", "iconicL");
     $BM->style("cursor:move;");
     $BM->addClass("handleMove");
     $BC = new Button("Plugin schließen", "x", "iconicL");
     $BC->addClass("handleClose");
     $BC->doBefore("var currentPlugin = this; %AFTER");
     $BC->rmePCR("mfheOverview", "-1", "pluginDelete", array($Device->getID(), "'{$plugin}'"), "function(){ \$j(currentPlugin).closest('.desktopDraggable').remove(); \$j('#addPlugin{$plugin}').show(); }");
     $html .= "<div class=\"desktopAlterIcons\">{$BM}{$BC}</div>";
     ob_start();
     $C->getOverviewContent($Device->getID());
     $html .= ob_get_contents();
     ob_end_clean();
     $html .= "</div>";
     if ($E->updateInterval()) {
         $this->addPlugin($E->className(), $E->updateInterval(), $E->updateFunction());
     }
     return $html;
 }
Пример #6
0
 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>";
 }
Пример #7
0
 public function browser()
 {
     $BA = new Button("Eintrag\nhinzufügen", "new");
     $BA->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
     $BA->rmePCR($this->object->getClearClass(), "-1", "create", $this->parametersCreate, OnEvent::reloadPopup($this->object->getClearClass()));
     $BA->style("margin:10px;");
     if (!$this->showNew) {
         $BA = "";
     }
     $cols = ($this->showTrash ? 1 : 0) + ($this->showEdit ? 1 : 0) + 1 + count($this->colsLeft) + count($this->colsRight);
     $TE = new HTMLTable($cols, "Einträge");
     if ($this->showTrash) {
         $TE->setColWidth(1, 20);
     }
     if ($this->showEdit) {
         $TE->setColWidth($cols, 20);
         $TE->useForSelection(false);
     }
     $TE->maxHeight(400);
     $TE->weight("light");
     $BE = new Button("Eintrag bearbeiten", "arrow_right", "iconic");
     $autoLoad = false;
     while ($A = $this->object->getNextEntry()) {
         $action = "contentManager.selectRow(this); \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'800px'}, 200, 'swing', function(){ " . OnEvent::frame("popupEditEntry", get_class($A), $A->getID(), "0", "function(){ \$j('#popupEditEntry').fadeIn(); }") . " });";
         $BD = new Button("Eintrag löschen", "trash_stroke", "iconic");
         $BD->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
         $BD->onclick("deleteClass('" . get_class($A) . "','" . $A->getID() . "', function() { " . OnEvent::reloadPopup($this->object->getClearClass()) . " },'Eintrag wirklich löschen?');");
         $isEmpty = false;
         if ($this->emptyCheckField != null and !is_array($this->emptyCheckField) and $A->A($this->emptyCheckField) == $this->emptyCheckValue) {
             $autoLoad = $action;
             $isEmpty = true;
         }
         if ($this->emptyCheckField != null and is_array($this->emptyCheckField)) {
             $ec = 0;
             foreach ($this->emptyCheckField as $field) {
                 if ($A->A($field) != "") {
                     continue;
                 }
                 $autoLoad = $action;
                 $isEmpty = true;
                 $ec++;
             }
             $isEmpty = $ec == count($this->emptyCheckField);
         }
         if (!$isEmpty) {
             $obj = get_class($this->object);
             $meth = $this->parsers["main"];
             if (strpos($this->parsers["main"], "::")) {
                 $ex = explode("::", $this->parsers["main"]);
                 $obj = $ex[0];
                 $meth = $ex[1];
             }
             $div = Util::invokeStaticMethod($obj, $meth, array($A));
             #($A->A("TinkerforgeBrickletUID") != "" ? $A->A("TinkerforgeBrickletUID") : "Neuer Eintrag");
         } else {
             $div = "Neuer Eintrag";
         }
         $row = array();
         if ($this->showTrash) {
             $row[] = $BD;
         }
         $row[] = $div;
         foreach ($this->colsRight as $col) {
             $obj = get_class($this->object);
             $meth = $col[0];
             if (strpos($col[0], "::")) {
                 $ex = explode("::", $col[0]);
                 $obj = $ex[0];
                 $meth = $ex[1];
             }
             $row[] = Util::invokeStaticMethod($obj, $meth, array($A));
         }
         if ($this->showEdit) {
             $row[] = $BE;
         }
         $TE->addRow($row);
         if ($this->showTrash) {
             $TE->addCellStyle(1, "vertical-align:top;");
         }
         #$TE->addCellEvent(2, "click", $action);
         if ($this->showEdit) {
             $TE->addCellID(count($row), "popupEntryID" . $A->getID());
             $TE->addCellStyle(count($row), "vertical-align:top;");
             $TE->addCellEvent(count($row), "click", $action);
         }
     }
     if ($this->object->numLoaded() == 0) {
         $TE->addRow("Keine Einträge");
         $TE->addRowColspan(1, $cols);
     }
     return "{$BA}\n\t\t\t<div style=\"float:right;width:calc(100% - 400px);height:500px;display:none;background-color:#f4f4f4;overflow:auto;\" id=\"popupEditEntry\"></div>\n\t\t\t<div id=\"popupListEntries\" style=\"width:400px;height:440px;overflow:auto;\">{$TE}</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t" . ($autoLoad ? OnEvent::script($autoLoad) : "");
 }
Пример #8
0
 public function __toString()
 {
     #$style = "";
     if ($this->type == "date" and strpos($this->style, "width:") === false) {
         $this->style .= "width:87%;";
     }
     #if($this->style != null) $style = " style=\"$this->style\"";
     switch ($this->type) {
         case "audio":
             return "<audio controls preload=\"auto\" autobuffer style=\"{$this->style}\"><source src=\"{$this->value}\"></audio>";
             break;
         case "search":
             $currentId = $this->id != null ? $this->id : $this->name . rand(100, 100000000);
             $enter = "if(\$j('#{$currentId}').val() != ''){ \$j('#SB{$currentId}').fadeOut(200, function(){ \$j('#SA{$currentId}').fadeIn();}); } else { \$j('#SA{$currentId}').fadeOut(200, function(){ \$j('#SB{$currentId}').fadeIn(); }); }";
             $I = new HTMLInput($this->name, "text", $this->value, $this->options);
             $I->style($this->style);
             $I->placeholder($this->placeholder);
             $I->onEnter($this->onenter . $enter);
             #$I->onEnter(" ");
             $I->id($currentId);
             $BSearch = new Button("Suchen", "question_mark", "iconicG");
             $BSearch->style("margin-left:5px;");
             $BSearch->id("SB{$currentId}");
             $BSearch->onclick($this->onenter . $enter);
             #$BSearch->id("searchMailsInfo");
             $BSearchClear = new Button("Suche beenden", "x_alt", "iconicR");
             $BSearchClear->style("margin-left:5px;display:none;");
             $BSearchClear->id("SA{$currentId}");
             $BSearchClear->onclick("\$j('#{$currentId}').val('').trigger('blur'); {$this->onenter}{$enter}");
             #$BSearchClear->id("searchMailsClear");
             return $I . $BSearch . $BSearchClear . $this->requestFocus;
             break;
         case "HTMLEditor":
             $B = new Button("in HTML-Editor\nbearbeiten", "editor");
             $B->windowRme("Wysiwyg", "", "getEditor", "", "WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->className("backgroundColor2");
             return $B->__toString();
             break;
         case "TextEditor":
             #return "<input ".(isset($this->events[$as]) ? $eve : "")." style=\"background-image:url(./images/navi/editor.png);".(isset($this->inputStyle[$as]) ? "".$this->inputStyle[$as]."" : "")."\" type=\"button\" class=\"bigButton backgroundColor2\" onclick=\"TextEditor.show('$as','$this->FormID');\" value=\"".$this->texts["in Editor bearbeiten"]."\" /><textarea style=\"display:none;\" name=\"".$as."\" id=\"".$as."\">".$this->attributes->$as."</textarea>";
             $B = new Button("in Editor\nbearbeiten", "editor");
             $B->className("backgroundColor2");
             $B->onclick("TextEditor.show('{$this->name}','{$this->options[0]}');");
             $ITA = new HTMLInput($this->name, "textarea", $this->value);
             $ITA->id($this->name);
             $ITA->style("display:none;");
             return $B->__toString() . $ITA;
             break;
         case "nicEdit":
             $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'");
             if (isset($this->options[2])) {
                 $BO[] = "'{$this->options[2]}'";
             }
             $B = new Button("in Editor\nbearbeiten", "editor");
             #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->doBefore("Overlay.showDark(); %AFTER");
             $B->popup("", "Editor", "nicEdit", "-1", "editInPopup", $BO, "", "Popup.presets.large");
             $B->className("backgroundColor2");
             $ITA = new HTMLInput($this->name, "hidden", $this->value);
             return $B->__toString() . $ITA;
             break;
         case "tinyMCE":
             $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'");
             if (isset($this->options[2])) {
                 $BO[] = "'{$this->options[2]}'";
             }
             $B = new Button("in Editor\nbearbeiten", "editor");
             #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->popup("", "Editor", "Wysiwyg", "-1", "editInPopup", $BO, "", "Popup.presets.large");
             $B->className("backgroundColor2");
             $ITA = new HTMLInput($this->name, "textarea", $this->value);
             return $B->__toString() . $ITA;
             break;
         case "multiInput":
             return "<input\n\t\t\t\t\tclass=\"multiEditInput2\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tvalue=\"" . htmlspecialchars($this->value) . "\"\n\t\t\t\t\tonfocus=\"oldValue = this.value;\"\n\t\t\t\t\tid=\"" . $this->options[2] . "ID" . $this->options[1] . "\"\n\t\t\t\t\tonblur=\"if(oldValue != this.value) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"\n\t\t\t\t\tonkeydown=\"if(event.keyCode == 13) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"/>";
             break;
             /*case "customSelection":
             				$B = new Button("Eintrag auswählen...", "gutschrift");
             				$B->type("LPBig");
             				$B->style("float:right;margin-left:10px;");
             				#				 "contentRight"		"callingPluginID"  "selectPlugin"
             				$B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]);
             
             				return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />";
             			break;*/
         /*case "customSelection":
         				$B = new Button("Eintrag auswählen...", "gutschrift");
         				$B->type("LPBig");
         				$B->style("float:right;margin-left:10px;");
         				#				 "contentRight"		"callingPluginID"  "selectPlugin"
         				$B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]);
         
         				return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />";
         			break;*/
         case "textarea":
             if ($this->isDisplayMode) {
                 return nl2br($this->value);
             }
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
                 $this->onfocus .= " contentManager.oldValue = this.value;";
                 $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 $this->onblur .= "if(contentManager.oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 if ($this->hasFocusEvent) {
                     $this->onfocus .= "focusMe(this);";
                     $this->onblur .= "blurMe(this);";
                 }
                 $this->hasFocusEvent = false;
             }
             return "<textarea\n\t\t\t\t\t" . ($this->placeholder != null ? " placeholder=\"{$this->placeholder}\"" : "") . "\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . (!$this->autocorrect ? "autocorrect=\"off\"" : "") . "\n\t\t\t\t\t" . (!$this->spellcheck ? "spellcheck=\"false\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->hasFocusEvent ? "onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">{$this->value}</textarea>";
             break;
         case "file":
             $physion = Session::physion();
             $currentId = ($this->id != null ? $this->id : $this->name) . rand(100, 100000000);
             if (isset($this->options["autoUpload"]) and !$this->options["autoUpload"]) {
                 $this->callback = "QQUploader{$currentId}.uploadStoredFiles();";
             }
             return "\n\t\t\t\t\t<div id=\"progress_{$currentId}\" style=\"height:10px;width:95%;display:none;\" class=\"\">\n\t\t\t\t\t\t<div id=\"progressBar_{$currentId}\" style=\"height:10px;width:0%;\" class=\"backgroundColor1\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"{$currentId}\" style=\"width:100%;{$this->style}\"></div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tQQUploader{$currentId} = new qq.FileUploader({\n\t\t\t\t\t\t\tmaxSizePossible: '" . ini_get("upload_max_filesize") . "B',\n\t\t\t\t\t\t\tsizeLimit: " . Util::toBytes(ini_get("upload_max_filesize")) . ",\n\t\t\t\t\t\t\telement: \$j('#{$currentId}')[0],\n\t\t\t\t\t\t\taction: './interface/set.php',\n\t\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\t\t'class': '" . (($this->options == null or !isset($this->options["class"])) ? "TempFile" : $this->options["class"]) . "'\n\t\t\t\t\t\t\t\t,'id':'-1'\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["path"])) ? ",'path':'" . $this->options["path"] . "'" : "") . "\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["targetFilename"])) ? ",'targetFilename':'" . $this->options["targetFilename"] . "'" : "") . "\n\t\t\t\t\t\t\t\t" . ($physion ? ",'physion':'{$physion['0']}'" : "") . "\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t" . (isset($this->options["autoUpload"]) ? "autoUpload: " . ($this->options["autoUpload"] ? "true" : "false") . "," : "") . "\n\t\t\t\t\t\t\t" . (isset($this->options["multiple"]) ? "multiple: " . ($this->options["multiple"] ? "true" : "false") . "," : "") . "\n\t\t\t\t\t\t\tonSubmit: function(id, fileName){ \$j('#progress_{$currentId}').css('display', 'block');},\n\t\t\t\t\t\t\tonComplete: function(id, fileName, transport){ \$j('progress_{$currentId}').css('display', 'none'); {$this->onchange} },\n\t\t\t\t\t\t\tonProgress: function(id, fileName, loaded, total){ \$j('#progressBar_{$currentId}').css('width', Math.ceil((loaded / total) * 100)+'%'); }});\n\t\t\t\t\t</script>";
             break;
         case "time":
             $this->type = "text";
             if (!$this->id) {
                 $this->id = rand(100000, 9999999) . $this->name;
             }
             #$this->onkeyup .= "if(\$j(this).val().length == 2 && \$j(this).val().lastIndexOf(':') == -1) \$j(this).val(\$j(this).val()+':'); ";
             if ($this->connectTo) {
                 $this->onkeyup .= "contentManager.connectedTimeInput(event, '{$this->id}', '{$this->connectTo}'); ";
             } else {
                 $this->onkeyup .= "contentManager.timeInput(event, '{$this->id}'); ";
             }
         case "radio1":
         case "date":
         case "email":
         case "text":
         case "hidden":
         case "submit":
         case "number":
         case "button":
         case "password":
         case "checkbox":
         case "readonly":
         case "fileold":
             $JS = "";
             if ($this->type == "radio1") {
                 $this->type = "radio";
             }
             if ($this->type == "fileold") {
                 $this->type = "file";
             }
             if ($this->isDisplayMode) {
                 if ($this->type == "checkbox") {
                     return Util::catchParser($this->value);
                 }
                 if ($this->type == "hidden") {
                     return "";
                 }
                 if ($this->type == "password") {
                     return str_repeat("*", mb_strlen($this->value));
                 }
                 return $this->value . "";
             }
             if ($this->hasFocusEvent) {
                 $this->onfocus .= "focusMe(this);";
                 $this->onblur .= "blurMe(this);";
             }
             $cal = "";
             $B2 = "";
             if ($this->type == "date") {
                 if ($this->id == null) {
                     $this->id = rand(10000, 90000);
                 }
                 $cal = new Button("Kalender anzeigen", "calendar", "iconic");
                 $cal->onclick("\$j('#{$this->id}').focus();");
                 $cal->style("float:right;");
                 $JS = "<script type=\"text/javascript\">\$j('#{$this->id}').datepicker();</script>";
                 $this->type = "text";
             }
             $value = "value=\"" . htmlspecialchars($this->value) . "\"";
             if ($this->type == "checkbox") {
                 $value = $this->value == "1" ? "checked=\"checked\"" : "";
             }
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
                 if ($this->type == "checkbox") {
                     $this->onchange = "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 } else {
                     $this->onfocus .= " oldValue = this.value;";
                     $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                     $this->onblur .= "if(oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 }
             }
             if ($this->autocomplete != null) {
                 if ($this->id == null) {
                     $this->id = $this->name;
                 }
                 /*$this->onfocus .= " ACInputHasFocus=true; AC.start(this);";
                 		$this->onblur .= " ACInputHasFocus = false; AC.end(this);";
                 		$this->onkeyup .= " AC.update(event.keyCode, this, '".$this->autocomplete[0]."');";*/
                 $this->autocompleteBrowser = false;
                 $cal = $this->autocomplete[5];
                 #new Button("Suche", "./images/i2/details.png");
                 $cal->onclick("\$('{$this->id}').style.display = ''; \$('{$this->id}').value = ''; \$('{$this->id}').focus();");
                 if ($cal->getStyle() == "") {
                     $cal->style("float:right;");
                 }
                 if ($this->autocomplete[4] != null) {
                     $B2 = $this->autocomplete[4];
                     $B2->style("float:right;margin-left:5px;");
                     if (strpos($this->style, "width") === false) {
                         $this->style .= "width:80%";
                     }
                 } else {
                     if (strpos($this->style, "width") === false) {
                         $this->style .= "width:87%";
                     }
                 }
                 if ($this->autocomplete[1] == null) {
                     $cal->onclick("\$('{$this->id}Display').style.display = ''; \$('{$this->id}Display').value = ''; \$('{$this->id}').value = ''; \$('{$this->id}Display').focus();");
                     $IN = new HTMLInput($this->name, "hidden", htmlspecialchars($this->value));
                     $IN->id($this->name);
                     $JS .= $IN;
                     $this->autocomplete[1] = "function(selection){ \$('{$this->id}').value = selection.value; \$('{$this->id}Display').value = selection.label; return false; }";
                     if ($this->value != "") {
                         $C = substr($this->autocomplete[0], 1) . "GUI";
                         $C = new $C($this->value);
                         $value = "value=\"" . htmlspecialchars($C->ACLabel()) . "\"";
                     }
                     $this->id .= "Display";
                 }
                 $JS .= OnEvent::script("var OnSelectCallback{$this->id} = " . $this->autocomplete[1] . "; \$j(\"input#{$this->id}\").autocomplete({\n\t\t\t\t\t\tsource: function(request, response){ \n\t\t\t\t\t\t\t " . OnEvent::rme($this->autocomplete[0], "getACData", array("'{$this->name}'", "request.term", $this->autocomplete[3]), "function(transport){ response(jQuery.parseJSON(transport.responseText)); }") . "\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t},\n\t\t\t\t\t\tselect: function(event, ui) { var r = OnSelectCallback{$this->id}(ui.item); " . ($this->autocomplete[2] ? "\$('{$this->id}').style.display = 'none';" : "") . " return r; }\n\t\t\t\t\t}).data(\"ui-autocomplete\")._renderItem = function( ul, item ) {\n\t\t\t\t\t\treturn \$j( \"<li>\" )\n\t\t\t\t\t\t\t.data( \"item.ui-autocomplete\", item )\n\t\t\t\t\t\t\t.append( \"<a>\" + item.label + (item.description ? \"<br /><small>\"+item.description+\"</small>\" : \"\")+\"</a>\" )\n\t\t\t\t\t\t\t.appendTo( ul );\n\t\t\t\t\t};");
             }
             return "{$B2}{$cal}<input\n\t\t\t\t\t" . ($this->maxlength != null ? " maxlength=\"{$this->maxlength}\"" : "") . "\n\t\t\t\t\t" . ($this->placeholder != null ? " placeholder=\"{$this->placeholder}\"" : "") . "\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\t" . (!$this->autocompleteBrowser ? "autocomplete=\"off\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onclick != null ? "onclick=\"{$this->onclick}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeydown != null ? "onkeydown=\"{$this->onkeydown}\"" : "") . "\n\t\t\t\t\t" . ($this->tabindex != null ? "tabindex=\"{$this->tabindex}\"" : "") . "\n\t\t\t\t\t" . ($this->isSelected ? "checked=\"checked\"" : "") . "\n\t\t\t\t\t" . ($this->type == "file" ? "size=\"1\"" : "") . "\n\t\t\t\t\t" . ($this->type == "readonly" ? "readonly=\"readonly\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . ($this->isDisabled ? "disabled=\"disabled\"" : "") . "\n\t\t\t\t\ttype=\"" . ($this->type != "readonly" ? $this->type : "text") . "\"\n\t\t\t\t\t" . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . "\n\t\t\t\t\t{$value} />{$this->requestFocus}{$JS}";
             break;
         case "option":
             return "<option" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->isSelected ? "selected=\"selected\"" : "") . " value=\"{$this->value}\">{$this->name}</option>";
             break;
         case "radio":
             $html = "";
             foreach ($this->options as $k => $v) {
                 $html .= "<div style=\"margin-bottom:5px;\"><input name=\"{$this->name}\" value=\"{$k}\" " . ($k == $this->value ? "checked=\"checked\"" : "") . " style=\"float:left;margin-right:5px;\" type=\"radio\">{$v}</div>";
             }
             return $html;
             break;
         case "select":
         case "select-multiple":
             if ($this->hasFocusEvent) {
                 $this->onfocus .= "focusMe(this);";
                 $this->onblur .= "blurMe(this);";
             }
             if ($this->type == "select-multiple") {
                 $values = trim($this->value) != "" ? explode(";:;", $this->value) : array();
             }
             if ($this->isDisplayMode) {
                 return is_object($this->options[$this->value]) ? $this->options[$this->value]->__toString() : $this->options[$this->value];
             }
             if ($this->multiEditOptions != null) {
                 $this->onchange("saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");");
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
             }
             $html = "<select " . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . " " . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . " " . ($this->size ? "size=\"{$this->size}\"" : "") . " " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->type == "select-multiple" ? " multiple=\"multiple\"" : "") . "" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . " name=\"{$this->name}\" " . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">";
             if ($this->options != null and is_array($this->options)) {
                 foreach ($this->options as $k => $v) {
                     if (!is_object($v)) {
                         if ($this->type == "select") {
                             $isThisIt = $this->value == $k;
                         } else {
                             $isThisIt = in_array($k, $values);
                         }
                         $html .= "<option " . ($isThisIt ? "selected=\"selected\"" : "") . " value=\"{$k}\">{$v}</option>";
                     } else {
                         if ($this->value == $k or $v->getValue() == $this->value) {
                             $v->isSelected(true);
                         }
                         $html .= $v;
                     }
                 }
             }
             $html .= "</select>";
             return $html;
             break;
     }
 }
Пример #9
0
 private function editIcon($aid)
 {
     $B = new Button("", "./images/i2/edit.png", "icon");
     $B->className("editButton");
     $onSuccessFunction = $this->JSOnEdit != null ? str_replace("%%VALUE%%", "{$aid}", "{$this->JSOnEdit}") : "";
     $B->doBefore("contentManager.selectRow(this); %AFTER");
     $B->loadFrame($this->editInDisplayModeTarget, $this->singularClass, $aid, 0, "", $onSuccessFunction);
     return "<td>{$B}</td>";
     /*
     * <img
     			onclick=\"
     				".($this->editInDisplayModeTarget == "contentLeft" ? "lastLoadedLeft = $aid;lastLoadedLeftPlugin = '$this->singularClass';" : "")."
     				new Ajax.Request('./interface/loadFrame.php?p=".$this->singularClass."&id=$aid'".($this->JSOnEdit != null ? str_replace("%%VALUE%%","$aid",",{onSuccess: $this->JSOnEdit}") : ",{onSuccess: function(transport){ if(checkResponse(transport)) $('$this->editInDisplayModeTarget').update(transport.responseText); }}").");\" src=\"./images/i2/edit.png\" class=\"mouseoverFade\" />
     */
 }
Пример #10
0
 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);
 }
Пример #11
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;
 }