Beispiel #1
0
 public function testDownloadPopup()
 {
     $F = new HTMLForm("tdl", array("link"));
     $F->setType("link", "textarea");
     $F->getTable()->setColWidth(1, 60);
     $F->setSaveRMEPCR("test download", "", "JD", $this->getID(), "testDownload", "function(t){ \$j('#downloadResult').html(t.responseText); }");
     $F->setInputStyle("link", "font-size:10px;height:200px;");
     echo $F . "<pre style=\"padding:5px;\" id=\"downloadResult\"></pre>";
 }
Beispiel #2
0
 public function getClose($TodoID)
 {
     $T = new Todo($TodoID);
     if ($T->A("TodoDoneTime")) {
         die("<p>Dieser Termin wurde abgeschlossen am " . Util::CLDateParser($T->A("TodoDoneTime")) . "</p><p>" . nl2br($T->A("TodoReport")) . "</p>");
     }
     $F = new HTMLForm("todoClose", array("TodoReport"));
     $F->getTable()->setColWidth(1, 120);
     $F->setLabel("TodoReport", "Bericht");
     $F->setType("TodoReport", "textarea");
     $F->setInputStyle("TodoReport", "height:200px;");
     $F->setSaveRMEPCR("Termin abschließen", "", "Todo", $TodoID, "close", OnEvent::closePopup("mKalender") . OnEvent::closePopup("mTodo") . "contentManager.updateLine('TodoForm', {$TodoID}, 'mTodo'); if(lastLoadedScreenPlugin == 'mAufgabe') " . OnEvent::reload("Screen"));
     echo $F;
 }
Beispiel #3
0
 public function downloadPopup()
 {
     $J = array();
     $AC = anyC::get("JD");
     while ($D = $AC->getNextEntry()) {
         $J[$D->getID()] = $D->A("JDName");
     }
     $F = new HTMLForm("tdl", array("link", "JD"));
     $F->setType("link", "textarea");
     $F->setType("JD", "select", null, $J);
     $F->getTable()->setColWidth(1, 60);
     $F->setSaveRMEPCR("Download", "", "mJD", -1, "download", "function(t){ \$j('#downloadResult').html(t.responseText); }");
     $F->setInputStyle("link", "font-size:10px;height:200px;");
     echo $F . "<pre style=\"padding:5px;\" id=\"downloadResult\"></pre>";
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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;");
     }
     $Buttons = "";
     foreach ($this->sideButtons as $B) {
         if (isset($this->features["CRMEditAbove"])) {
             $B->style("float:left;margin-left:10px;margin-top:10px;");
         }
         $Buttons .= $B;
     }
     $abort = "<div>{$BA}{$Buttons}</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));
     }
     foreach ($this->inputStyles as $k => $n) {
         $tab->setInputStyle($k, $n);
     }
     foreach ($this->descriptionsField as $n => $l) {
         $tab->setDescriptionField($n, T::_($l));
     }
     $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);
     $tab->useRecentlyChanged();
     return $abort . $tab;
 }
 function getEditHTML()
 {
     $this->object->loadMeOrEmpty();
     if ($this->object->getID() == -1) {
         $this->addToEvent("onSave", "\$('contentLeft').update('');");
     }
     $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);
     if ($this->showSave) {
         $F->setSaveClass(get_class($this->object), $this->object->getID(), $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, $l);
     }
     foreach ($this->descriptionsField as $n => $l) {
         $F->setDescriptionField($n, $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, $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]);
     }
     return $this->topButtons() . $this->sideButtons() . $F;
 }