function __construct($ID) { if (strpos($ID, "loadBanner") !== false) { $image = "http://" . BPS::getProperty("NewSeriesGUI", "loadBanner"); $content = file_get_contents($image); $this->A = new stdClass(); $this->A->Banner = "image/jpg:::" . strlen($content) . ":::" . base64_encode(addslashes($content)); #echo $this->A->Banner; BPS::unsetProperty("NewSeriesGUI", "loadBanner"); return; } parent::__construct($ID); }
public function getEditTableHTML($cols = 2) { BPS::unsetProperty($this->className . "GUI", "edit"); if ($this->attributes == null) { $this->attributes = PMReflector::getAttributesArrayAnyObject($this->object->getA()); } if ($this->name == null) { $this->name = $this->className; } $BA = $this->getAbortButton(); if (isset($this->features["CRMEditAbove"])) { $BA->style("float:left;margin-left:10px;margin-top:10px;"); } $abort = "<div>{$BA}</div><div style=\"clear:left;height:10px;\"></div>"; $tab = new HTMLForm($this->className . "Form", $this->attributes, $this->name . " editieren:"); if ($cols != 2) { $tab->cols($cols); } foreach ($this->labels as $k => $v) { $tab->setLabel($k, $v); } foreach ($this->types as $k => $v) { $tab->setType($k, $v, null, isset($this->options[$k]) ? $this->options[$k] : null); } foreach ($this->spaces as $k => $v) { $tab->insertSpaceAbove($k, $v); } foreach ($this->autocomplete as $k => $a) { $tab->setAutoComplete($k, $a[0], $a[1]); } foreach ($this->fieldButtons as $k => $B) { $tab->addFieldButton($k, $B); } foreach ($this->parsers as $n => $l) { $tab->setType($n, "parser", null, array($l, $this->object)); } $tab->setValues($this->object); if ($this->object->getID() == -1) { $save = $this->functionSaveNew; } else { $save = $this->functionSave; } $tab->setSaveClass($this->className, $this->object->getID(), str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $save), $this->name); return $abort . $tab; }
function getForm() { if ($this->form != null) { return $this->form; } if ($this->formID == null) { $this->formID = "edit" . get_class($this->object); } $F = new HTMLForm($this->formID == null ? "edit" . get_class($this->object) : $this->formID, $this->attributes == null ? $this->object : $this->attributes, strpos($this->displayMode, "popup") === false ? $this->operationsButton() . $this->name : null); $F->getTable()->setColWidth(1, 120); $F->getTable()->addTableClass("contentEdit"); $ID = $this->object->getID(); if (BPS::getProperty("HTMLGUI", "insertAsNew", false)) { $ID = -1; BPS::unsetProperty("HTMLGUI", "insertAsNew"); } if ($this->showSave) { $F->setSaveClass(get_class($this->object), $ID, $this->functionEntrySave, $this->name); } $F->isEditable($this->showInputs); foreach ($this->object->getA() as $n => $v) { $F->setValue($n, $v); $F->setLabel($n, str_replace($this->object->getClearClass(), "", $n)); } foreach ($this->types as $n => $l) { $F->setType($n, $l, null, isset($this->options[$n]) ? $this->options[$n] : null); } foreach ($this->labels as $n => $l) { $F->setLabel($n, T::_($l)); } foreach ($this->placeholders as $n => $l) { $F->setPlaceholder($n, $l); } foreach ($this->descriptionsField as $n => $l) { $F->setDescriptionField($n, T::_($l)); } foreach ($this->parsers as $n => $l) { $F->setType($n, "parser", null, array($l, $this->object)); } foreach ($this->spaces as $n => $l) { $F->insertSpaceAbove($n, T::_($l)); } foreach ($this->fieldButtons as $n => $B) { $F->addFieldButton($n, $B); } foreach ($this->fieldEvents as $k => $v) { $F->addJSEvent($v[0], $v[1], $v[2]); } foreach ($this->hiddenLines as $n) { $F->inputLineStyle($n, "display:none;"); } foreach ($this->inputStyles as $k => $n) { $F->setInputStyle($k, $n); } foreach ($this->autocomplete as $k => $a) { $F->setAutoComplete($k, $a[0], $a[1], $a[2]); } $this->form = $F; return $F; }
function getHTML($id) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> $this->loadMeOrEmpty(); $bps = $this->getMyBPSData(); $allowed = array(); $ACS = anyC::get("Userdata", "name", "shareCalendarTo" . Session::currentUser()->getID()); $ACS->addAssocV3("name", "=", "shareCalendarTo0", "OR"); while ($Share = $ACS->getNextEntry()) { $allowed[$Share->A("UserID")] = $Share->A("wert"); } if ($id == -1) { $this->A->TodoTillDay = Util::CLDateParser(time() + 7 * 24 * 3600); $this->A->TodoTillTime = Util::CLTimeParser(10 * 3600); $this->A->TodoFromDay = Util::CLDateParser(time() + 7 * 24 * 3600); $this->A->TodoFromTime = Util::CLTimeParser(9 * 3600); $this->A->TodoType = "2"; if ($bps != -1 and isset($bps["TodoTillDay"])) { $this->A->TodoTillDay = $bps["TodoTillDay"]; $this->A->TodoFromDay = $bps["TodoTillDay"]; BPS::unsetProperty("TodoGUI", "TodoTillDay"); } if ($bps != -1 and isset($bps["TodoFromTime"])) { $this->A->TodoFromTime = Util::CLTimeParser($bps["TodoFromTime"] * 3600); $this->A->TodoTillTime = Util::CLTimeParser(($bps["TodoFromTime"] + 1) * 3600); BPS::unsetProperty("TodoGUI", "TodoFromTime"); } if ($bps != -1 and isset($bps["TodoDescription"])) { $this->A->TodoDescription = $bps["TodoDescription"]; BPS::unsetProperty("TodoGUI", "TodoDescription"); } if ($bps != -1 and isset($bps["TodoLocation"])) { $this->A->TodoLocation = $bps["TodoLocation"]; BPS::unsetProperty("TodoGUI", "TodoLocation"); } if ($bps != -1 and isset($bps["TodoName"])) { $this->A->TodoName = $bps["TodoName"]; BPS::unsetProperty("TodoGUI", "TodoName"); } $for = BPS::getProperty("mKalenderGUI", "KID", Session::currentUser()->getID()); if ($for != Session::currentUser()->getID() and strpos($allowed[$for], "create") === false) { $for = Session::currentUser()->getID(); } $this->A->TodoUserID = $for; $this->A->TodoClass = BPS::getProperty("mTodoGUI", "ownerClass"); $this->A->TodoClassID = BPS::getProperty("mTodoGUI", "ownerClassID"); } $gui = $this->GUI; $gui->name("Termin"); $gui->label("TodoDescription", "Details"); $gui->label("TodoTillDay", "Ende"); $gui->label("TodoTillTime", "Uhrzeit"); $gui->label("TodoFromDay", "Anfang"); $gui->label("TodoFromTime", "Uhrzeit"); $gui->label("TodoType", "Typ"); $gui->label("TodoUserID", "Zuständig"); $gui->label("TodoStatus", "Status"); $gui->label("TodoRemind", "Erinnerung"); $gui->label("TodoName", "Betreff"); $gui->label("TodoRepeat", "Wiederholen"); #$gui->label("TodoRepeatInterval","Intervall"); $gui->label("TodoClassID", "Kunde"); $gui->label("TodoLocation", "Ort"); $gui->label("TodoAllDay", "Ganzer Tag"); $gui->space("TodoRemind", "Optionen"); $gui->space("TodoFromDay", "Zeit"); if ($this->A("TodoFromDay") == "01.01.1970" and $this->A("TodoFromTime") == "00:00") { $this->changeA("TodoFromDay", $this->A("TodoTillDay")); $this->changeA("TodoFromTime", $this->A("TodoTillTime")); } $gui->attributes(array("TodoType", "TodoClass", "TodoClassID", "TodoDescription", "TodoLocation", "TodoFromDay", "TodoTillDay", "TodoAllDay", "TodoRemind", "TodoUserID")); $gui->type("TodoType", "select", TodoGUI::types()); $gui->type("TodoRemind", "select", array("-1" => "keine Erinnerung", "60" => "1 Minute vorher", "300" => "5 Minuten vorher", "600" => "10 Minuten vorher", "900" => "15 Minuten vorher", "1800" => "30 Minuten vorher", "2700" => "45 Minuten vorher", "3600" => "1 Stunde vorher")); $gui->type("TodoClass", "hidden"); $gui->type("TodoDescription", "textarea"); $gui->type("TodoAllDay", "checkbox"); $gui->addFieldEvent("TodoAllDay", "onchange", "\$j('#TodoFromTimeDisplay').css('display', this.checked ? 'none' : 'inline'); \$j('#TodoTillTimeDisplay').css('display', this.checked ? 'none' : 'inline');"); $gui->parser("TodoFromDay", "TodoGUI::dayFromParser"); $gui->parser("TodoTillDay", "TodoGUI::dayTillParser"); $ac = Users::getUsers(); $users = array(); while ($u = $ac->getNextEntry()) { if (!isset($allowed[$u->getID()]) and $u->getID() != Session::currentUser()->getID()) { continue; } if (isset($allowed[$u->getID()]) and strpos($allowed[$u->getID()], "create") === false) { continue; } $users[$u->getID()] = $u->A("name"); } $ac = Users::getUsers(1); while ($u = $ac->getNextEntry()) { if (!isset($allowed[$u->getID()]) and $u->getID() != Session::currentUser()->getID()) { continue; } if (isset($allowed[$u->getID()]) and strpos($allowed[$u->getID()], "create") === false) { continue; } $users[$u->getID()] = $u->A("name"); } $users["-1"] = "Alle"; if (Session::isPluginLoaded("mWAdresse") and ($this->A("TodoClass") == "WAdresse" or $this->A("TodoClass") == "Kalender")) { $gui->parser("TodoClassID", "TodoGUI::parserKunde"); } else { $gui->type("TodoClassID", "hidden"); } $gui->type("TodoUserID", "select", $users); $gui->type("TodoStatus", "select", $this->getStatus()); $gui->activateFeature("CRMEditAbove", $this); if ($gui instanceof CRMHTMLGUI) { return $gui->getEditTableHTML(4); } }
function editInPopup($id, $date = null, $targetClass = null, $targetClassID = null, $time = null, $description = null, $location = null) { if ($date != null) { BPS::setProperty("TodoGUI", "TodoTillDay", Util::CLDateParser($date)); } if ($time != null) { BPS::setProperty("TodoGUI", "TodoFromTime", $time); } if ($description != null) { BPS::setProperty("TodoGUI", "TodoDescription", $description); } if ($location != null) { BPS::setProperty("TodoGUI", "TodoLocation", $location); } $T = new TodoGUI($id); $T->GUI = new HTMLGUIX($T); $T->GUI->displayMode("popupS"); $T->GUI->requestFocus("TodoName"); #if($id == -1) $T->GUI->addToEvent("onSave", OnEvent::popup("Event", "mKalender", "-1", "getInfo", array("'mTodoGUI'", "transport.responseText", "'{$date}'"))); if ($targetClass != null) { BPS::setProperty("mTodoGUI", "ownerClass", $targetClass); BPS::setProperty("mTodoGUI", "ownerClassID", $targetClassID); } $T->getHTML($id); #if($T->A("TodoClass") == "Kalender" OR $T->A("TodoClass") == "DBMail") $T->GUI->insertAttribute("after", "TodoClassID", "TodoName"); if (BPS::getProperty("TodoGUI", "overview")) { $T->GUI->addFieldEvent("TodoUserID", "onChange", OnEvent::rme($this, "getBusyList", array("this.value", "1"), "function(t){ \$j('#busyList').html(t.responseText); }")); $gui = $T->GUI->getEditHTML(); $html = "<div id=\"busyList\" style=\"display:inline-block;width:400px;vertical-align:top;max-height:450px;overflow:auto;\">" . $this->getBusyList(Session::currentUser()->getID(), false) . "</div><div style=\"display:inline-block;width:400px;vertical-align:top;\">{$gui}</div>"; BPS::unsetProperty("TodoGUI", "overview"); die($html); } echo $T->GUI->getEditHTML(); #.OnEvent::script("\$j('#editTodoGUI input[name=TodoName]').trigger('focus');"); }