function getHTML($id) { #$p = mUserdata::getPluginSpecificData("mStatistik"); #if(!isset($p["pluginSpecificCanUseControlling"])) # return; $html = ""; #parent::getHTML($id); $tab = new HTMLTable(1); $tab->addRow("<div id=\"my_chartTodo\" style=\"height:200px;width:470px;\"></div>"); $tab->addRowClass("backgroundColor0"); $AC = $this->data(); $U = Users::getUsersArray(null, true); $U[-1] = "Allgemein"; $T = new HTMLTable(6); $T->addColStyle(2, "text-align:right;"); $T->addColStyle(3, "text-align:right;"); $T->addColStyle(4, "text-align:right;"); $T->addColStyle(5, "text-align:right;"); $T->addColStyle(6, "text-align:right;"); $T->addHeaderRow(array("Benutzer", "Gesamt", "Abgesch.", "Kalt", "Erst", "Folge")); while ($A = $AC->n()) { $T->addRow(array(isset($U[$A->A("TodoUserID")]) ? $U[$A->A("TodoUserID")] : "Benutzer ID " . $A->A("TodoUserID"), $A->A("gesamt"), $A->A("gesamtDM") . " (" . Util::CLNumberParserZ($A->A("gesamt") != 0 ? round($A->A("gesamtDM") / $A->A("gesamt") * 100, 2) : 0) . "%)", $A->A("gesamtKalt"), $A->A("gesamtErst"), $A->A("gesamtFolge"))); $T->addRowStyle("cursor:pointer;"); $T->addRowEvent("click", OnEvent::rme($this, "details", array($A->A("TodoUserID")), "function(t){ \$j('#contentScreenLeft').html(t.responseText); }")); } if ($AC->numLoaded() == 0) { $T->addRow(array("Es liegen keine Daten vor")); $T->addRowColspan(1, 4); } return "<p class=\"prettySubtitle\">Termine</p>" . $tab . $html . $T . OnEvent::script("\n\t\t\tvar plot = \$j.plot(\$j('#my_chartTodo'), " . $this->chart() . ", {\n\t\t\tseries: {\n\t\t\t\tpie: { show: true, innerRadius: 0.4 }\n\t\t\t}\n\t\t\t});" . OnEvent::rme($this, "getHeaderCenter", "", "function(transport){ \$j('#contentScreenCenterHeader').html(transport.responseText); }")); }
/** * 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) { $c = new $dataClass($dataClassID); $data = $c->getEMailData($callbackParameter); $tab = new HTMLTable(2); $tab->setColWidth(1, "120px;"); $tab->addLV("Absender:", "{$data['fromName']}<br /><small><{$data['fromAddress']}></small>"); if (count($data["recipients"]) == 1) { $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small><" . $data["recipients"][0][1] . "></small>"); } else { $recipients = array(); foreach ($data["recipients"] as $ID => $Rec) { $recipients[$ID] = new HTMLInput($Rec[0] . " <" . $Rec[1] . ">", "option", $ID); } $IS = new HTMLInput("EMailRecipient{$dataClassID}", "select", "0", $recipients); $IS->id("EMailRecipient{$dataClassID}"); $tab->addLV("Empfänger:", $IS); } $tab->addLV("Betreff:", "<input type=\"text\" id=\"EMailSubject{$dataClassID}\" value=\"{$data['subject']}\" />"); $tab->addRow(array("<textarea id=\"EMailBody{$dataClassID}\" style=\"width:100%;height:300px;font-size:10px;\">{$data['body']}</textarea>")); $tab->addRowColspan(1, 2); $tab->addRowClass("backgroundColor0"); if ($onSuccessFunction == null) { $onSuccessFunction = "" . OnEvent::reload("Left") . " Popup.close('Util', 'edit');"; } $BAbort = new Button("Abbrechen", "stop"); $BAbort->onclick("Popup.close('Util', 'edit');"); $BAbort->style("margin-bottom:10px;margin-top:10px;"); $BGo = new Button("E-Mail\nsenden", "okCatch"); $BGo->style("float:right;margin-top:10px;"); $BGo->rmePCR($dataClass, $dataClassID, "sendEmail", array("\$('EMailSubject{$dataClassID}').value", "\$('EMailBody{$dataClassID}').value", 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"); echo $tab; }
public function getWindowHTML() { $bps = $this->getMyBPSData(); #print_r($bps); $v = false; $b = false; $von = "Bitte ziehen Sie ein <img src=\"./images/i2/add.png\" style=\"margin-bottom:-5px;\" />-Symbol auf dieses Feld."; $bis = "Bitte ziehen Sie ein <img src=\"./images/i2/add.png\" style=\"margin-bottom:-5px;\" />-Symbol auf dieses Feld."; if ($bps != -1 and isset($bps["VonClass"])) { $VonClass = $bps["VonClass"]; $VonClass = new $VonClass($bps["VonID"]); $von = $VonClass->getCategorizerLabel(); $v = true; } if ($bps != -1 and isset($bps["BisClass"])) { $BisClass = $bps["BisClass"]; $BisClass = new $BisClass($bps["BisID"]); $bis = $BisClass->getCategorizerLabel(); $b = true; } $t = new HTMLTable(2); $t->addColStyle(1, "width:120px;"); $t->addRow(array("<label>Von:</label>", $von)); $t->addCellID(2, "droppableVon"); $t->addCellStyle(2, "height:30px;"); $t->addRow(array("<label>Bis:</label>", $bis)); $t->addCellID(2, "droppableBis"); $t->addCellStyle(2, "height:30px;"); if ($v and $b) { $K = $BisClass->getCategorizerOptions(); $o = HTMLGUI::getOptions(array_keys($K), array_values($K)); $t->addRow(array("<label>Kategorie:</label>", "<select id=\"categorizeWithCategory\">{$o}</select>")); $t->addRow(array("<input\n\t\t\ttype=\"button\"\n\t\t\tclass=\"bigButton backgroundColor3\"\n\t\t\tvalue=\"Kategorisieren\"\n\t\t\tstyle=\"background-image:url(./images/navi/okCatch.png);float:right;\"\n\t\t\tonclick=\"rme('Categorizer','','categorize',Array(\$('categorizeWithCategory').value),'if(checkResponse(transport)) { Popup.close(\\'Categorizer\\', 0); contentManager.reloadFrameRight(); }');\" />")); $t->addRowColspan(1, 2); } $html = "\n\t\t<script type=\"text/javascript\">\n\t\t\tDroppables.add('droppableVon', {hoverclass: 'backgroundColor1', accept: 'draggable', onDrop: function(element){ rme('Categorizer','','saveVon',Array(element.id),'Popup.update(transport, \\'Categorizer\\', 0);'); }});\n\t\t\tDroppables.add('droppableBis', {hoverclass: 'backgroundColor1', accept: 'draggable', onDrop: function(element){ rme('Categorizer','','saveBis',Array(element.id),'Popup.update(transport, \\'Categorizer\\', 0);'); }});\n\t\t</script>"; echo $t->getHTML() . $html; }
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> <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);") : ""); }
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>"; }
/** * 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><{$data['fromAddress']}></small>"); if (is_array($data["recipients"])) { if (count($data["recipients"]) == 1) { $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small><" . $data["recipients"][0][1] . "></small>"); } else { $recipients = array(); foreach ($data["recipients"] as $ID => $Rec) { $recipients[$ID] = new HTMLInput($Rec[0] . " <" . $Rec[1] . ">", "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; } }
public function getListTable() { $T = new HTMLTable(2); $T->maxHeight(400); $T->setColWidth(2, 30); $T->weight("light"); $T->useForSelection(false); $AC = anyC::get("Einkaufszettel", "EinkaufszettelBought", "0"); $AC->addOrderV3("EinkaufszettelTime", "DESC"); while ($E = $AC->getNextEntry()) { $BT = new Button("Löschen", "trash_stroke", "iconicL"); #$BT->onclick(); $T->addRow(array(($E->A("EinkaufszettelMenge") > 1 ? $E->A("EinkaufszettelMenge") . " x " : "") . $E->A("EinkaufszettelName") . ($E->A("EinkaufszettelNameDetails") != "" ? "<br /><small style=\"color:grey;\">" . $E->A("EinkaufszettelNameDetails") . "</small>" : ""), $BT)); $T->addRowStyle("font-size:20px;"); $T->addRowEvent("click", OnEvent::rme($E, "deleteMe", "", OnEvent::reloadPopup("mEinkaufszettel"))); #$T->addCellEvent(1, "click", OnEvent::rme($this, "boughtItem", $E->getID(), "function(transport){ \$j('#currentList').html(transport.responseText); }")); } if ($AC->numLoaded() == 0) { $T->addRow(array("Die Einkaufsliste enthält keine Einträge.")); $T->addRowColspan(1, 2); } return $T . OnEvent::script("\$j('#currentList div div').css('max-height', contentManager.maxHeight() - \$j('#headerList').outerHeight());"); }
public function getListTable() { $T = new HTMLTable(2, "Gerichte"); $T->maxHeight(480); $T->setColWidth(2, 30); $T->weight("light"); $T->useForSelection(false); $AC = anyC::get("Gericht"); $AC->addAssocV3("GerichtAdded", ">", "0"); while ($E = $AC->getNextEntry()) { $BT = new Button("Löschen", "trash_stroke", "iconicL"); $BT->onclick(OnEvent::rme($this, "reMoveItem", $E->getID(), OnEvent::reloadPopup("mGericht"))); $T->addRow(array($E->A("GerichtName"), $BT)); $T->addRowStyle("font-size:20px;"); #$T->addCellEvent(1, "click", OnEvent::rme($this, "boughtItem", $E->getID(), "function(transport){ \$j('#currentList').html(transport.responseText); }")); } if ($AC->numLoaded() == 0) { $T->addRow(array("Die Liste enthält keine Einträge.")); $T->addRowColspan(1, 2); } return $T; }
public function getArtikel($data) { $TKategorien = new HTMLTable(2, "Kategorien"); $TKategorien->setTableStyle("width:100%;"); $TKategorien->setTableID("tableKategorien"); $TKategorien->setColWidth(1, 20); $B = new Button("Nach Kategorie filtern", "arrow_down", "iconic"); $B->className("reverse"); $AC = anyC::get("Kategorie", "type", "2"); $AC->addOrderV3("name"); $TKategorien->addRow(array($B, "Alle Kategorien")); $TKategorien->addRowClass("selectable"); $TKategorien->addRowEvent("click", "CustomerPage.rme('getArtikel', {KategorieID: '', query : '{$data['query']}', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); if ($data["KategorieID"] == "") { $TKategorien->addRowStyle("text-decoration:underline;"); } while ($K = $AC->getNextEntry()) { $B = new Button("Nach Kategorie filtern", "arrow_down", "iconic"); if ($data["KategorieID"] != $K->getID()) { $B->className("reverse"); } $TKategorien->addRow(array($B, $K->A("name"))); $TKategorien->addRowClass("selectable"); $TKategorien->addRowEvent("click", "CustomerPage.rme('getArtikel', {KategorieID: '" . $K->getID() . "', query : '{$data['query']}', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); #if($data["KategorieID"] == $K->getID()) # $TKategorien->addRowStyle ("text-decoration:underline;"); } $TArtikel = new HTMLTable(4, "Artikel"); $TArtikel->setTableStyle("width:100%;"); $TArtikel->setColWidth(1, 26); $TArtikel->setColWidth(2, 100); $TArtikel->setColStyle(4, "text-align:right;"); $BQ = ""; if ($data["query"] != "") { $BQ = new Button("Suche löschen", "x_alt", "iconic"); $BQ->onclick("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : '', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); $BQ->style("color:darkred;float:left;"); } else { $BQ = new Button("Suche", "question_mark", "iconic"); } $I = new HTMLInput("query", "text", $data["query"]); $I->placeholder("Suche nach Name, Nummer oder Beschreibung"); $I->style("width:90%;"); $I->onEnter("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : this.value, GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); $BS = new Button("Los", "arrow_right", "iconic"); $BS->onclick("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : \$j('[name=query]').val(), GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); $TArtikel->addRow(array($BQ, $I . " " . $BS)); $TArtikel->addRowColspan(2, 3); $AC = anyC::get("Artikel"); if ($data["KategorieID"] != "") { $AC->addAssocV3("KategorieID", "=", $data["KategorieID"], "AND", "1"); } if ($data["query"] != "") { $AC->addAssocV3("artikelnummer", "LIKE", "%{$data['query']}%", "AND", "2"); $AC->addAssocV3("name", "LIKE", "%{$data['query']}%", "OR", "2"); $AC->addAssocV3("beschreibung", "LIKE", "%{$data['query']}%", "OR", "2"); } $AC->addOrderV3("artikelnummer"); $AC->addOrderV3("name"); $AC->setLimitV3(100); while ($A = $AC->getNextEntry()) { $B = new Button("Artikel hinzufügen", "arrow_left", "iconic"); $B->className("reverse"); #$B->onclick("CustomerPage.rme('delPosten', {PostenID: '".$P->getID()."'}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: $data[GRLBMID]}, function(transport){ $('#contentLeft').html(transport); }); });"); $A->resetParsers(); $TArtikel->addRow(array($B, $A->A("artikelnummer"), $A->A("name") . ($A->A("bemerkung") != "" ? "<br /><small style=\"color:grey;\">" . $A->A("bemerkung") . "</small>" : ""), $this->showPrices ? Util::CLFormatCurrency($A->getGesamtBruttoVK() * 1, true) . "<br /><small style=\"color:grey;\">" . Util::CLFormatCurrency($A->getGesamtNettoVK() * 1, true) . "</small>" : "")); $TArtikel->addRowClass("selectable"); $TArtikel->addRowEvent("click", "CCAuftrag.lastTextbausteinUnten = \$('[name=textbausteinUnten]').val(); CustomerPage.rme('addArtikel', {ArtikelID: '" . $A->getID() . "', GRLBMID: {$data['GRLBMID']}}, function(transport){ CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); }); });"); } if ($AC->numLoaded() == 0) { $TArtikel->addRow(array("", "Keine Artikel gefunden")); $TArtikel->setColWidth(2, 200); } $html = "<h1>Artikel</h1>\n\t\t\t\t{$TKategorien}\n\t\t\t\t{$TArtikel}"; return $html; }
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);") : ""); }
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) : ""); }
function getBrowserHTML($lineWithId = -1) { $this->texts = $this->languageClass->getBrowserTexts(); $singularLanguageClass = $this->loadLanguageClass($this->singularClass); $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $this->singularClass); $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $this->singularClass); $userHiddenFields = mUserdata::getHides($this->singularClass); $defaultTarget = "contentRight"; if ($this->displaySide != "default") { $defaultTarget = "content" . ucfirst($this->displaySide); } if ($this->singularClass == "none") { echo "collectionOf is not set. See message log for further details."; throw new CollectionOfNotSetException(); } if ($this->name == "Noname") { $_SESSION["messages"]->addMessage("There is no name set. You might use setName of HTMLGUI to do that."); } /** * ERROR-TABLE */ $errorTab = new HTMLTable(1); if (isset($_SESSION["phynx_errors"]) and $lineWithId == -1 and ($_SERVER["HTTP_HOST"] == "dev.furtmeier.lan" or strpos(__FILE__, "nemiah") !== false)) { $errorTab->addRow("\n\t\t\t\t\t<img style=\"float:left;margin-right:10px;\" src=\"./images/navi/warning.png\" />\n\t\t\t\t\t<b>Es " . (count($_SESSION["phynx_errors"]) != 1 ? "liegen" : "liegt") . " " . count($_SESSION["phynx_errors"]) . " PHP-Fehler vor:</b><br />\n\t\t\t\t\t<a href=\"javascript:windowWithRme('Util','','showPHPErrors','');\">Fehler anzeigen</a>,<br />\n\t\t\t\t\t<a href=\"javascript:rme('Util','','deletePHPErrors','','contentManager.reloadFrameRight();');\">Fehler löschen</a>"); } /** * RETURN-BUTTON */ $returnTab = new HTMLTable(1); if ($this->isSelection) { $BReturn = new Button("Auswahl\nbeenden", "back"); $BReturn->onclick("contentManager.restoreFrame('content" . ucfirst($this->displaySide) . "','selectionOverlay');"); #return "<input type=\"button\" value=\"zurück zu\n".$p2[$s[0]]."\" style=\"background-image:url(./images/navi/back.png);\" class=\"bigButton backgroundColor3\" onclick=\"loadFrameV2('contentRight','$s[0]');\" />"; $returnTab->addRow($BReturn); } /** * DELETE-BUTTON */ if ((!$this->onlyDisplayMode or $this->deleteInDisplayMode) and $userCanDelete and !$this->isSelection and $this->showDeleteButton) { $this->newColsRight["delete"] = "\n\t\t\t<span class=\"iconic trash_stroke\" onclick=\"deleteClass('" . $this->singularClass . "','%%VALUE%%', " . ($this->JSOnDelete == null ? "function() { " . ($this->displaySide == "left" ? "contentManager.reloadFrameLeft();" : "contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '%%VALUE%%') \$('contentLeft').update('');") . " }" : $this->JSOnDelete) . ",'" . str_replace("%1", $this->singularName, $this->texts["%1 wirklich löschen?"]) . "');\"></span>"; } elseif (!$userCanDelete) { $this->newColsRight["delete"] = "<img src=\"./images/i2/empty.png\" />"; } /** * EDIT-BUTTON */ if (!isset($this->newColsLeft["select"]) and (!$this->onlyDisplayMode or $this->editInDisplayMode) and $this->showEditButton) { $EB = new Button("", "./images/i2/edit.png"); $EB->type("icon"); $EB->className("editButton"); if ($this->JSOnEdit == null) { $EB->onclick("contentManager.selectRow(this); contentManager.loadFrame('contentLeft','" . $this->singularClass . "','%%VALUE%%','0');"); } else { $EB->onclick($this->JSOnEdit); } $this->newColsLeft["select"] = $EB; } $cols = count($this->showAttributes) + count($this->newColsLeft) + count($this->newColsRight); $valuesTab = new HTMLTable($cols, $lineWithId == -1 ? $this->displaySide == "left" ? $this->name : "" : null); $valuesTab->addTableClass("contentBrowser"); /*if(isset($this->newColsRight["delete"]) AND ($this->displaySide == "default" OR $this->displaySide == "right")) $valuesTab->setColClass($cols, "backgroundColor0"); if(isset($this->newColsRight["delete"]) AND $this->displaySide == "left") $valuesTab->setColClass(1, "backgroundColor0");*/ /** * QUICKSEARCH */ #$quickSearchRow = ""; if ($this->quickSearchPlugin != "" and $lineWithId == -1) { list($quickSearchRow, $BSearchInfo) = $this->getQuicksearchField(); if ($this->displaySide == "left") { $insertRow = array($quickSearchRow); for ($i = 1; $i < $cols - 1; $i++) { $insertRow[] = ""; } $insertRow[] = $BSearchInfo; $valuesTab->addRow($insertRow); $valuesTab->addRowColspan(1, $cols - 1); } else { $valuesTab->addRow(array($BSearchInfo, $quickSearchRow)); $valuesTab->addRowColspan(2, $cols - 1); } $valuesTab->addRowClass("backgroundColorHeader"); } if ($this->headerRow != null) { $valuesTab->addHeaderRow($this->headerRow); } /** * PAGE-BROWSER */ #$multiPageRow = ""; $separator = ""; $userDefinedEntriesPerPage = false; $isMultiPageMode = false; if (count($this->multiPageMode) > 0) { $isMultiPageMode = true; $this->multiPageMode[3] = $defaultTarget; if ($this->multiPageMode[2] == 0) { $userDefinedEntriesPerPage = true; #$mU = new mUserdata(); #$this->multiPageMode[2] = $mU->getUDValue("entriesPerPage{$this->multiPageMode[4]}"); #if($this->multiPageMode[2] == null) $this->multiPageMode[2] = 20; } /* if($this->multiPageMode[1] == "undefined") $this->multiPageMode[1] = 0; $pages = ceil($this->multiPageMode[0] / $this->multiPageMode[2]); if($this->multiPageMode[1] != 0) $pageLinks = "<a href=\"javascript:contentManager.loadPage('$defaultTarget', '0');\"> << </a> "; else $pageLinks = " << "; if($this->multiPageMode[1] != 0) $pageLinks .= "<a href=\"javascript:contentManager.backwardOnePage('$defaultTarget');\"> < </a> "; else $pageLinks .= " < "; if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.forwardOnePage('$defaultTarget');\"> > </a> "; else $pageLinks .= " > "; if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget',".($pages-1).");\"> >> </a> | "; else $pageLinks .= " >> | "; $start = $this->multiPageMode[1] - 3; if($start < 0) $start = 0; $end = $this->multiPageMode[1] + 3; if($end > $pages - 1) $end = $pages - 1; for($i=$start; $i<=$end; $i++) if($this->multiPageMode[1] != "$i") $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget','".$i."');\">".($i+1)."</a> "; else $pageLinks .= ($i+1)." "; $pageLinks = "".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": ".$pageLinks; */ if ($this->displaySide == "left") { $pageLinks = "<span style=\"float:right;\">" . $this->getMultiPageButtons() . "</span>"; } else { $pageLinks = $this->getMultiPageButtons(); } /*if($lineWithId == -1) $multiPageRow = " <tr> ".($userDefinedEntriesPerPage ? "<td><img class=\"mouseoverFade\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','multiPageSettings:{$this->multiPageMode[4]}','".$this->texts["Einstellungen"].":');\" /></td>" : "")." <td colspan=\"".($colspan+1+($userDefinedEntriesPerPage ? 0 : 1))."\"><input type=\"text\"onkeydown=\"if(event.keyCode == 13) loadFrameV2('".$this->multiPageMode[3]."','".$this->multiPageMode[4]."','',this.value - 1);\" style=\"width:30px;float:right;text-align:right;\" value=\"".($this->multiPageMode[1]+1)."\" onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\" />".$this->multiPageMode[0]." ".($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"])."<!--, ".$pages." ".($pages != 1 ? $this->texts["Seiten"] : $this->texts["Seite"])."--></td> </tr> <tr> <td colspan=\"$determinedNumberofCols\">".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": $pageLinks</td> </tr>"; */ if ($lineWithId == -1) { $BSettings = $this->getPageOptionsButton(); #$IPage = $this->getPageSelectionField(); #$IPage->style("width:30px;float:right;text-align:right;"); $pageOptions = $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . ", {$pageLinks}"; if (!$userDefinedEntriesPerPage) { $valuesTab->addRow(array($pageOptions)); $valuesTab->addRowColspan(1, $cols); } else { if ($this->displaySide == "left") { $insertRow = array($pageOptions); for ($i = 1; $i < $cols - 1; $i++) { $insertRow[] = ""; } $insertRow[] = $BSettings; $valuesTab->addRow($insertRow); #$valuesTab->addRow(array($pageOptions,$BSettings)); $valuesTab->addRowColspan(1, $cols - 1); } else { /*$insertRow = array($BSettings); for($i=1; $i<$cols-1; $i++) $insertRow[] = ""; $insertRow[] = $pageOptions; $valuesTab->addRow($insertRow);*/ $valuesTab->addRow(array($BSettings, $pageOptions)); $valuesTab->addRowColspan(2, $cols - 1); } } $valuesTab->addRowClass("backgroundColorHeader"); #$valuesTab->addRow(array($pageLinks)); #$valuesTab->addRowColspan(1, $cols); #$valuesTab->addRowClass("backgroundColorHeader"); $valuesTab->addRow(""); $valuesTab->addRowColspan(1, $cols); $valuesTab->addRowClass("backgroundColor0 browserSeparatorTop"); } } $filteredCol = null; if ($lineWithId == -1 and $this->showFilteredCategoriesWarning != null and $this->showFilteredCategoriesWarning[0]) { $dB = new Button($this->texts["Filter löschen"], "./images/i2/delete.gif"); $dB->style("float:right;"); $dB->type("icon"); $dB->rme("HTML", "", "saveContextMenu", array("'deleteFilters'", "'{$this->showFilteredCategoriesWarning[1]}'"), "if(checkResponse(transport)) contentManager.reloadFrameRight();"); /*$separator = " <tr> <td class=\"backgroundColor0\"".((isset($this->showFilteredCategoriesWarning[0]) AND $this->showFilteredCategoriesWarning[0] == true) ? "<img src=\"./images/i2/note.png\" /></td><td class=\"backgroundColor0\" colspan=\"".($determinedNumberofCols - 2)."\" style=\"color:grey;\" >".$this->texts["Anzeige wurde gefiltert"]."</td><td class=\"backgroundColor0\">$dB</td>" : " >")."</td> </tr>";*/ $filteredCol = array("<img src=\"./images/i2/note.png\" />", $dB . $this->texts["Anzeige wurde gefiltert"]); $valuesTab->addRow($filteredCol); $valuesTab->addRowColspan(2, $cols - 1); $valuesTab->addRowClass("backgroundColor0"); $valuesTab->addRowStyle("color:grey;"); } /** * NEW-BUTTON */ if (!$this->onlyDisplayMode and $userCanCreate and $this->showNewButton and $lineWithId == -1) { $BNew = new Button("", "./images/i2/new.gif"); $BNew->type("icon"); $BNew->id("buttonNewEntry{$this->singularClass}"); #$BNew->onclick($this->JSOnNew == null ? "contentManager.newClassButton('$this->singularClass','');" : $this->JSOnNew); if ($this->displaySide == "left") { #$valuesTab->addRow(array("<b>$this->singularName neu anlegen</b>",$BNew)); #$valuesTab->addRowColspan(1, $cols-1); } else { $valuesTab->addRow(array($BNew, "<b>{$this->singularName} neu anlegen</b>")); $valuesTab->addRowColspan(2, $cols - 1); $valuesTab->addRowEvent("click", $this->JSOnNew == null ? "contentManager.newClassButton('{$this->singularClass}','');" : $this->JSOnNew); $valuesTab->addRowStyle("cursor:pointer;"); } #$valuesTab->addRowColspan(2, $cols-1); } /** * TABLE-CONTENT */ $displayGroup = null; for ($i = 0; $i < count($this->attributes); $i++) { $aid = $this->attributes[$i]->getID(); // get the id of an object separately $sc = $this->attributes[$i]->getA(); // get the attributes-object from the object if ($this->displayGroupBy != null) { $displayGroupField = $this->displayGroupBy; if ($sc->{$displayGroupField} != $displayGroup and $i > 0) { $valuesTab->addRow(""); $valuesTab->addRowClass("backgroundColor0"); } } $row = array(); $styles = array(); if ($this->displaySide == "left") { $colsLeft = $this->newColsRight; $colsRight = $this->newColsLeft; } else { $colsLeft = $this->newColsLeft; $colsRight = $this->newColsRight; } if (count($colsLeft) > 0) { foreach ($colsLeft as $key => $value) { $row[] = str_replace("%%VALUE%%", $aid, $value); $valuesTab->setColWidth(count($row), "20px"); } } foreach ($this->showAttributes as $key => $value) { if (isset($userHiddenFields[$value])) { continue; } if (isset($this->parsers[$value])) { $t = $this->invokeParser($this->parsers[$value], $sc->{$value}, $this->makeParameterStringFromArray($this->parserParameters[$value], $sc, $aid)); } else { $t = htmlspecialchars($sc->{$value}); } if ($this->multiEditMode != null and in_array($value, $this->multiEditMode)) { $posInArray = array_search($value, $this->multiEditMode); if ($this->multiEditModeInputs[$posInArray] == null) { $MI = new HTMLInput($value . "ID{$aid}", "multiInput", $sc->{$value}, array($this->singularClass, $aid, $value)); if ($this->multiEditModeStyle != null) { $MI->style($this->multiEditModeStyle[$posInArray]); } } else { $MI = clone $this->multiEditModeInputs[$posInArray]; $MI->setValue($sc->{$value}); $MI->activateMultiEdit($this->singularClass, $aid); } $t = $MI; } #<td id=\"Browser".$value."$aid\" ".(isset($this->colStyles[$value]) ? "style=\"".$this->colStyles[$value]."\"" : "").">".$t."</td>"; $row[] = $t; if (isset($this->colStyles[$value])) { $styles[count($row)] = $this->colStyles[$value]; } } if (count($colsRight) > 0) { foreach ($colsRight as $key => $value) { $row[] = str_replace("%%VALUE%%", $aid, $value); $valuesTab->setColWidth(count($row), "20px"); } } $valuesTab->addRow($row); if (count($styles) > 0) { foreach ($styles as $col => $s) { $valuesTab->addColStyle($col, $s); } } $valuesTab->setRowID("BrowserMain{$aid}"); #foreach($this->showAttributes as $key => $value) { # $valuesTab->addCellID($cellNo, "Browser".$value."$aid"); #} if ($this->displayGroupBy != null) { $displayGroup = $sc->{$displayGroupField}; } } if ($filteredCol !== null) { $valuesTab->addRow($filteredCol); $valuesTab->addRowColspan(2, $cols - 1); $valuesTab->addRowClass("backgroundColor0"); $valuesTab->addRowStyle("color:grey;"); } if ($lineWithId == -1 and $isMultiPageMode) { $valuesTab->addRow(""); $valuesTab->addRowColspan(1, $cols); $valuesTab->addRowClass("backgroundColor0 browserSeparatorBottom"); if (!$userDefinedEntriesPerPage) { $valuesTab->addRow(array($pageOptions)); $valuesTab->addRowColspan(1, $cols); } else { if ($this->displaySide == "left") { $valuesTab->addRow(array($pageOptions, $BSettings)); $valuesTab->addRowColspan(1, $cols - 1); } else { $valuesTab->addRow(array($BSettings, $pageOptions)); $valuesTab->addRowColspan(2, $cols - 1); } } $valuesTab->addRowClass("backgroundColorHeader"); #$valuesTab->addRow(array($pageLinks)); #$valuesTab->addRowColspan(1, $cols); #$valuesTab->addRowClass("backgroundColorHeader"); } if (count($this->attributes) == 0) { $valuesTab->addRow(array("keine Einträge")); $valuesTab->addRowColspan(1, $cols); } if ($lineWithId != -1) { $valuesTab = $valuesTab->getHTMLForUpdate(); } return $errorTab . $returnTab . $valuesTab . ($lineWithId == -1 ? $this->tip : ""); }
public function getContactPopup($kundennummer) { $A = new Adresse(Kappendix::getAdresseIDToKundennummer($kundennummer)); $T = new HTMLTable(2); $T->setColWidth(1, 120); $T->addRow(array($A->getHTMLFormattedAddress())); $T->addRowColspan(1, 2); if ($A->getA() == null) { die($T); } if ($A->A("tel") != "") { $T->addLV("Telefon:", $A->A("tel")); } if ($A->A("fax") != "") { $T->addLV("Fax:", $A->A("fax")); } if ($A->A("mobil") != "") { $T->addLV("Mobil:", $A->A("mobil")); } if ($A->A("email") != "") { $T->addLV("E-Mail:", $A->A("email")); } if (!Session::isPluginLoaded("mAnsprechpartner")) { die($T); } $AC = Ansprechpartner::getAnsprechpartner("Adresse", $kundennummer); $TAP = new HTMLTable(2); $TAP->setColWidth(1, 120); while ($AP = $AC->getNextEntry()) { if (trim($AP->A("AnsprechpartnerVorname") . " " . $AP->A("AnsprechpartnerNachname")) != "") { $TAP->insertSpaceAbove($AP->A("AnsprechpartnerPosition")); $TAP->addLV("Name:", $AP->A("AnsprechpartnerVorname") . " " . $AP->A("AnsprechpartnerNachname")); if ($AP->A("AnsprechpartnerTel") != "") { $TAP->addLV("Telefon:", $AP->A("AnsprechpartnerTel")); } if ($AP->A("AnsprechpartnerEmail") != "") { $TAP->addLV("E-Mail:", $AP->A("AnsprechpartnerEmail")); } } } echo $T . $TAP; }
/** * 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 = ""; if (isset($data["attachmentsAlways"])) { /*$B = new Button("Anhänge", "export", "LPBig"); $B->style("margin:10px;float:right;"); $B->sidePanel("Util", "-1", "EMailPopupAttachmentsSP", array("'$dataClass'", "'$dataClassID'", "'$callbackParameter'")); $html .= $B;*/ $html .= OnEvent::script(OnEvent::popupSidePanel("Util", "-1", "EMailPopupAttachmentsSP", array("'{$dataClass}'", "'{$dataClassID}'", "'{$callbackParameter}'"))); } #$html .= "<p class=\"prettyTitle\">Neue E-Mail</p>"; #$html .= "<div style=\"clear:both;\"></div>"; $tab = new HTMLTable(2); $tab->setColWidth(1, "120px;"); $tab->addLV("Absender:", "{$data['fromName']}<br /><small style=\"color:grey;\"><{$data['fromAddress']}></small>"); if (is_array($data["recipients"])) { if (count($data["recipients"]) == 1) { $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small style=\"color:grey;\"><" . $data["recipients"][0][1] . "></small>"); } else { $recipients = array(); foreach ($data["recipients"] as $ID => $Rec) { $recipients[$ID] = new HTMLInput($Rec[0] . " <" . $Rec[1] . ">", "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); } if (isset($data["bcc"]) and count($data["bcc"]) > 0) { foreach ($data["bcc"] as $bcc) { $tab->addLV("BCC:", $bcc); } } $tab->addLV("Betreff:", "<input type=\"text\" id=\"EMailSubject{$dataClassID}\" value=\"{$data['subject']}\" />"); $html .= $tab; $html .= "<div style=\"width:94%;margin:auto;\"><textarea class=\"tinyMCEEditor\" 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;"); $optional = "var files = '';"; if (isset($data["attachmentsOptional"])) { $optional .= "\$j('#UtilEmailFormAttachments input[type=checkbox]:checked').each(function(k, v){ files += \$j(v).data('value')+'##'; });"; } $BGo = new Button("E-Mail\nsenden", "okCatch"); $BGo->style("float:right;margin-top:10px;"); $BGo->loading(); $BGo->doBefore("{$optional} %AFTER"); if (strpos($data["body"], "<p") !== false or trim($data["body"]) == "") { $BGo->doBefore("{$optional} \$j('#EMailBody{$dataClassID}').val(tinyMCE.get('EMailBody{$dataClassID}').getContent()); %AFTER"); } $BGo->rmePCR(str_replace("GUI", "", $dataClass), $dataClassID, "sendEmail", array("\$('EMailSubject{$dataClassID}').value", "\$j('#EMailBody{$dataClassID}').val()", (is_array($data["recipients"]) and count($data["recipients"]) == 1) ? "0" : "\$('EMailRecipient{$dataClassID}').value", "'" . $callbackParameter . "'", "files"), $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 or trim($data["body"]) == "") { echo OnEvent::script("\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t" . tinyMCEGUI::editorMail("EMailBody{$dataClassID}", null, "undo redo | pastetext | bold italic underline | fullscreen code") . "\n\t\t\t}, 100);"); } if ($return) { return $html; } else { echo $html; } }
public function getWindow() { $F = new File(Util::getRootPath() . "system/Backup"); if (!$F->A("FileIsWritable")) { $B = new Button("Achtung", "restrictions"); $B->type("icon"); $B->style("float:left;margin-right:10px;"); $T = new HTMLTable(1); $T->addRow($B . "Es können keine Backups von Ihrer Datenbank angelegt werden, da das Verzeichnis /system/Backup nicht durch den Webserver beschreibbar ist."); $T->addRow("Machen Sie das Verzeichnis mit einem FTP-Programm beschreibbar. Klicken Sie dazu mit der rechten Maustaste auf das Verzeichnis auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 777 an, damit es durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist."); $BRefresh = new Button("Aktualisieren", "refresh"); $BRefresh->rmePCR("BackupManager", "", "getWindow", "", "Popup.displayNamed('BackupManagerGUI','Backup-Manager',transport);"); $BRefresh->style("float:right;"); $T->addRow($BRefresh); $T->addRow(""); $T->addRowClass("backgroundColor0"); $T->addRow($this->noBackupButton()); die($T); } $html = ""; if (!BackupManagerGUI::checkForTodaysBackup()) { $T = new HTMLTable(1); $BOK = $this->makeBackupOfToday(); $F = new File(BackupManagerGUI::getNewBackupName()); $F->loadMe(); if ($BOK === basename(BackupManagerGUI::getNewBackupName()) and $F->A("FileSize") > 100) { $B = new Button("Backup abgeschlossen", "okCatch"); $B->type("icon"); $B->style("float:left;margin-right:10px;"); $T->addRow($B . "Das Backup wurde erfolgreich abgeschlossen!<br />Die Größe des Backups beträgt " . Util::formatByte($F->A("FileSize"), 2)); try { $ftpUpload = $this->FTPUpload(Util::getRootPath() . "system/Backup/{$BOK}"); if ($ftpUpload === true) { $B = new Button("FTP-Upload erfolgreich", "okCatch"); $B->type("icon"); $B->style("float:left;margin-right:10px;"); $T->addRow(array($B . "Das Backup wurde erfolgreich auf den FTP-Server hochgeladen")); } } catch (Exception $e) { $T->addRow(array($B . $e->getMessage())); } $html .= $T; } else { $B = new Button("Es ist ein Fehler aufgetreten", "stop"); $B->type("icon"); $B->style("float:left;margin-right:10px;"); $T->addRow($B . "Beim Erstellen des Backups ist ein Fehler aufgetreten: {$BOK}"); $html .= $T; } $html .= "<script type=\"text/javascript\">contentManager.reloadFrame('contentLeft');</script>"; } $gesamt = 0; $data = $this->getBackupsList(); $i = 0; $maxD = 5; if (count($data) < $maxD) { $maxD = count($data); } $TF = new HTMLTable(2, "Backups ({$maxD}/" . count($data) . ")"); $TF->addColStyle(2, "text-align:right;"); $TF->setColWidth(2, "80px"); foreach ($data as $name => $size) { if ($i < 5) { if ($name == basename(BackupManagerGUI::getNewBackupName())) { $name = "<span style=\"color:green;\">{$name}</span>"; } $TF->addRow(array($name, Util::formatByte($size, 2))); } $i++; $gesamt += $size; } $TF->addRow(""); $TF->addRowClass("backgroundColor0"); $TF->addRow(array("<b>Gesamt:</b>", "<b>" . Util::formatByte($gesamt, 2) . "</b>")); $TF->addCellStyle(1, "text-align:right"); $TF->addRow(array("Diese Backups können als Admin-Benutzer im Installation-Plugin heruntergeladen und wiederhergestellt werden.")); $TF->addRowColspan(1, 2); $TF->addRow(""); $TF->addRowClass("backgroundColor0"); $TF->addRow(array($this->noBackupButton())); $TF->addRowColspan(1, 2); echo $html . $TF; }
public function getInvitees($TodoID) { $AC = anyC::get("TodoInvitation", "TodoInvitationTodoID", $TodoID); $AC->addOrderV3("TodoInvitationID", "DESC"); $T = new HTMLTable(3, "Teilnehmer"); $T->setColWidth(1, 20); $T->setColWidth(3, 20); $T->maxHeight(200); while ($I = $AC->n()) { $IH = new HTMLInput("TodoInvitationIsHead", "checkbox", $I->A("TodoInvitationIsHead")); $IH->activateMultiEdit("TodoInvitation", $I->getID()); $IH->title("Moderator?"); $BD = new Button("Teilnehmer entfernen", "trash_stroke", "iconic"); $BD->rmePCR("mTodo", "-1", "removeInvitee", array($TodoID, $I->getID()), "function(t){ \$j('#eventSideContent').html(t.responseText); }"); $T->addRow(array($IH, $I->A("TodoInvitationName") . "<br><small style=\"color:grey;\"><" . $I->A("TodoInvitationUserEmail") . "></small>", $BD)); } if ($AC->numLoaded() == 0) { $T->addRow(array("Keine Teilnehmer")); $T->addRowColspan(1, 2); } #$T->addRow(array("HI", "HO")); echo $T; $Todo = new Todo($TodoID); $BN = new Button("Neuer Teilnehmer", "new", "icon"); $BN->className("highlight"); $BN->style("padding:10px;"); $BN->onclick("\$j('#containerButtons .highlight').removeClass('highlight'); \$j(this).addClass('highlight'); \$j('.teilnehmerContainer').hide(); \$j('#containerNew').show(); "); $BS = new Button("Systembenutzer", "users", "icon"); $BS->style("padding:10px;"); $BS->onclick("\$j('#containerButtons .highlight').removeClass('highlight'); \$j(this).addClass('highlight'); \$j('.teilnehmerContainer').hide(); \$j('#containerSystem').show(); "); $BA = ""; if (Session::isPluginLoaded("mAnsprechpartner") and $Todo->A("TodoClass") == "WAdresse") { $BA = new Button("Ansprechpartner", "./ubiquitous/Ansprechpartner/Ansprechpartner.png", "icon"); $BA->style("padding:10px;"); $BA->onclick("\$j('#containerButtons .highlight').removeClass('highlight'); \$j(this).addClass('highlight'); \$j('.teilnehmerContainer').hide(); \$j('#containerAnsprech').show(); "); } echo "<div style=\"height:30px;\"></div><div id=\"containerButtons\">{$BN}{$BS}{$BA}</div>"; $F = new HTMLForm("neuerTeilnehmer", array("TodoID", "name", "email"), " Neuer Teilnehmer"); $F->getTable()->setColWidth(1, 120); $F->setValue("TodoID", $TodoID); $F->setLabel("email", "E-Mail"); $F->setType("TodoID", "hidden"); $F->setSaveRMEPCR("Hinzufügen", "", "mTodo", -1, "addInvitee", "function(t){ \$j('#eventSideContent').html(t.responseText); }"); echo "<div id=\"containerNew\" class=\"teilnehmerContainer\" style=\"padding-bottom:10px;\">" . $F . "</div>"; $S = new HTMLList(); $AC = Users::getUsers(); while ($U = $AC->n()) { $S->addItem("<a href=\"#\" onclick=\"" . OnEvent::rme(new mTodoGUI(-1), "addInvitee", array($TodoID, "'" . $U->A("name") . "'", "'" . $U->A("UserEmail") . "'"), "function(t){ \$j('#eventSideContent').html(t.responseText); }") . " return false;\">" . $U->A("name") . "</a>"); if ($U->getID() == Session::currentUser()->getID()) { $S->addItemClass("confirm"); $S->addItemStyle("padding-top:5px;padding-bottom:5px;"); } } echo "<div id=\"containerSystem\" class=\"teilnehmerContainer\" style=\"display:none;padding-bottom:10px;\">" . $S . "</div>"; $T = new HTMLTable(1); if ($Todo->A("TodoClass") == "WAdresse" and Session::isPluginLoaded("mAnsprechpartner")) { $S = new HTMLList(); $AC = Ansprechpartner::getAllAnsprechpartnerToAdresse($Todo->A("TodoClassID")); while ($U = $AC->n()) { $S->addItem("<a href=\"#\" onclick=\"" . OnEvent::rme(new mTodoGUI(-1), "addInvitee", array($TodoID, "'" . $U->A("AnsprechpartnerVorname") . " " . $U->A("AnsprechpartnerNachname") . "'", "'" . $U->A("AnsprechpartnerEmail") . "'"), "function(t){ \$j('#eventSideContent').html(t.responseText); }") . " return false;\">" . $U->A("AnsprechpartnerVorname") . " " . $U->A("AnsprechpartnerNachname") . "</a>"); } if ($AC->numLoaded() == 0) { $S->addItem("Keine Ansprechpartner"); } echo "<div id=\"containerAnsprech\" class=\"teilnehmerContainer\" style=\"display:none;padding-bottom:10px;\">{$S}</div>"; } }
public function getAuftrag($data) { if (!$this->loggedIn) { return "TIMEOUT"; } $html = ""; if ($data["GRLBMID"] == 0) { $html .= "<p class=\"highlight\" style=\"margin-top:10px;\">Bitte wählen Sie rechts einen Lieferschein.</p>"; return $html; } $Beleg = new GRLBM($data["GRLBMID"]); #$this->createAuftrag(new Adresse(1), "W"); $Auftrag = new Auftrag($Beleg->A("AuftragID")); $Adresse = new Adresse($Auftrag->A("AdresseID")); #$TAdresse = new HTMLTable(2, "Kundenadresse"); #$TAdresse->setColWidth(1, 26); #$TAdresse->setTableStyle("width:100%;"); #$TAdresse->addRow(array(new Button("Adresse", "home", "iconic"), $Adresse->getHTMLFormattedAddress())); #$TAdresse->setColStyle(1, "vertical-align:top;"); $TPosten = new HTMLTable(3, "Lieferung"); $TPosten->setTableStyle("width:100%;"); $TPosten->setColWidth(1, 26); $TPosten->setColWidth(2, 80); $TPosten->setColWidth(3, "100%"); $ACP = anyC::get("Posten", "GRLBMID", $Beleg->getID()); $ACP->addOrderV3("PostenID"); $ACP->addAssocV3("useForLieferung", "=", "1"); $i = 0; $O = new Button("Positionen", "list", "iconic"); /*while($P = $AC->getNextEntry()){ $I = new HTMLInput("mwst", "text", Util::CLNumberParser($P->A("menge"))); $I->style("text-align:right;width:80px;font-size:15px;padding:7px;padding-right:20px;"); #$I->onEnter("\$j(this).trigger('blur');"); $I->onblur("CustomerPage.rme('setMenge', {PostenID: '".$P->getID()."', menge: this.value}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: $data[GRLBMID]}, function(transport){ if(transport == 'TIMEOUT') { document.location.href='?CC=Lieferschein&page=login'; return; } $('#contentLeft .content').html(transport); noty({text: 'Menge gespeichert', type: 'success'}); }); });"); $I->onfocus("this.select();"); $TPosten->addRow(array( $i == 0 ? $O : "", $I, "<span style=\"font-size:15px;\">".$P->A("name")."</span>")); $i++; }*/ $AC = anyC::get("Artikel"); $AC->addOrderV3("name"); $AC->addAssocV3("useForLieferung", "=", "1"); while ($A = $AC->getNextEntry()) { $menge = 0; while ($P = $ACP->n()) { if ($P->A("oldArtikelID") == $A->getID()) { $menge = abs($P->A("menge")); } } $ACP->resetPointer(); $I = new HTMLInput("Artikel_" . $A->getID(), "text", Util::CLNumberParser($menge)); $I->style("text-align:right;width:80px;font-size:15px;padding:7px;padding-right:20px;"); #$I->onEnter("\$j(this).trigger('blur');"); #$I->onblur("CustomerPage.rme('setMenge', {PostenID: '".$P->getID()."', menge: this.value}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: $data[GRLBMID]}, function(transport){ if(transport == 'TIMEOUT') { document.location.href='?CC=Lieferschein&page=login'; return; } $('#contentLeft .content').html(transport); noty({text: 'Menge gespeichert', type: 'success'}); }); });"); $I->onfocus("this.select();"); $TPosten->addRow(array($i == 0 ? $O : "", $I, "<span style=\"font-size:15px;\">" . $A->A("name") . "</span>")); $i++; } if ($AC->numLoaded() == 0) { $TPosten->addRow(array($O, "Keine Artikel")); $TPosten->addRowColspan(2, 6); $TPosten->setColWidth(2, "100%"); $TPosten->setColStyle(2, "text-align:left;"); } $IOK = new Button("Speichern"); $IOK->className("submitFormButton"); $IOK->onclick("CustomerPage.rme('handleLieferung', \$('#posten').serialize(), function(transport){ \$('#contentLeft h1').html('Auftrag'); \$('.selected').removeClass('selected'); \$('#contentLeft .content').html(transport); })"); #$IOK->onclick("$('#contentLeft h1').html('Auftrag'); $('.selected').removeClass('selected'); CustomerPage.rme('getAuftrag', {GRLBMID: 0}, function(transport){ $('#contentLeft .content').html(transport); }, function(){}, 'POST');"); $IC = new Button("Abbrechen"); $IC->className("submitFormButton"); $IC->style("background-color:#DDD;color:grey;float:none;"); $IC->onclick("\$('#contentLeft h1').html('Auftrag'); \$('.selected').removeClass('selected'); CustomerPage.rme('getAuftrag', {GRLBMID: 0}, function(transport){ \$('#contentLeft .content').html(transport); }, function(){}, 'POST');"); #$TZahlungsart = new HTMLTable(2); #$TZahlungsart->setTableStyle("width:100%;margin-top:50px;"); #$TZahlungsart->setColWidth(1, 26); #$TZahlungsart->addRow(array("", $IOK)); $IA = new HTMLInput("action", "hidden", "handleLieferung"); $IA = new HTMLInput("GRLBMID", "hidden", $Beleg->getID()); $html .= "\n\t\t\t<form id=\"posten\" style=\"border:0px;padding:0px;width:100%;\" >\n\t\t\t\t{$TPosten}\n\t\t\t\t{$IOK}{$IC}\n\t\t\t\t{$IA}\n\t\t\t</form>"; return $html . OnEvent::script("\$('#contentLeft h1').html('Auftrag " . $Beleg->A("prefix") . $Beleg->A("nummer") . "');"); }