Exemplo n.º 1
0
 /**
  * Popup zur Konfiguration eines Servers.
  */
 public function getConfigPopup($echo = true)
 {
     // Button
     $BCreate = new Button("Server\nhinzufügen", "new");
     $BCreate->rmePCR("mxCal", "-1", "createNewServer", array(), OnEvent::reloadPopup("mxCal"));
     $htmlTableButton = new HTMLTable(1);
     $htmlTableButton->addRow($BCreate);
     // Liste der konfigurierten Server
     $userId = $_SESSION["S"]->getCurrentUser()->getID();
     $T = new HTMLTable(1, "xCal Server");
     $BDeleteRaw = new Button("Eintrag löschen", "./images/i2/delete.gif", "icon");
     $BDeleteRaw->style("float: right;");
     $serverList = anyC::get("xCal", "xCalUserID", $userId);
     $counter = 0;
     while ($S = $serverList->getNextEntry()) {
         $BDelete = clone $BDeleteRaw;
         $BDelete->onclick("deleteClass('xCal','" . $S->getID() . "', function() { Popup.refresh('mxCal'); }, 'Eintrag wirklich löschen?');");
         $F = new HTMLForm("xCal_" . $S->A("xCalID"), array("xCalName", "xCalUrl", "xCalServerActive"));
         $F->getTable()->setColWidth(1, 120);
         $F->setValues($S);
         $F->setLabel("xCalName", "Bezeichnung");
         $F->setLabel("xCalUrl", "URL");
         $F->setLabel("xCalServerActive", "Für den Import verwenden");
         $F->setType("xCalServerActive", "checkbox");
         $F->useRecentlyChanged();
         $F->setSaveClass("xCal", $S->getID(), "''");
         $display = "none";
         if ($S->A("xCalName") == "" && $S->A("xCalUrl") == "") {
             $display = "";
         }
         $div = "<div\n\t\t\t\t\tonmouseover=\"this.className = 'backgroundColor3';\" \n\t\t\t\t\tonmouseout=\"this.className = '';\" \n\t\t\t\t\tstyle=\"padding:3px;cursor:pointer;\" \n\t\t\t\t\tonclick=\"if(\$('APDetails" . $S->getID() . "').style.display == 'none') new Effect.BlindDown('APDetails" . $S->getID() . "'); else new Effect.BlindUp('APDetails" . $S->getID() . "');\">\n\t\t\t\t\t{$BDelete}<span id=\"APPosition" . $S->getID() . "\">" . ($S->A("xCalName") != "" ? $S->A("xCalName") : "Neuer Server") . "</span>&nbsp;<br />\n\t\t\t\t\t<small style=\"color:grey;\" id=\"APName" . $S->getID() . "\">" . ($S->A("xCalServerActive") == "1" ? "Import aktiviert" : "Import deaktiviert") . "&nbsp;</small>\n\t\t\t\t</div>";
         $T->addRow(array($div . "<div id=\"APDetails" . $S->getID() . "\" style=\"display:" . $display . ";\">" . $F . "</div>"));
         $T->addRowClass("backgroundColor0");
         $T->addCellClass(1, "borderColor1");
         $counter++;
     }
     if ($counter == 0) {
         $T->addRow("Keine Server eingetragen!");
     }
     if ($echo == "" || $echo === true) {
         echo $htmlTableButton . $T;
     } else {
         return $htmlTableButton . $T;
     }
 }
Exemplo n.º 2
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;");
     }
     $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;
 }
Exemplo n.º 3
0
 public function alterAddress($data)
 {
     $Adresse = new Adresse($data["AdresseID"]);
     $F = new HTMLForm("alterAddress", array("firma", "vorname", "nachname", "strasse", "nr", "plz", "ort", "action", "AdresseID"));
     $F->setValues($Adresse);
     $F->setValue("action", "alterAddress");
     $F->setValue("AdresseID", $data["AdresseID"]);
     $F->setType("action", "hidden");
     $F->setType("AdresseID", "hidden");
     $F->setLabel("strasse", "Straße");
     $F->setSaveCustomerPage("Speichern", "", false, "function(){ CustomerPage.closePopup(); CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); }); }");
     echo $F;
 }
Exemplo n.º 4
0
 public function editRepeatable($todoID)
 {
     $F = new HTMLForm("RepeatableForm", array("TodoRepeat", "TodoRepeatWeekOfMonth", "TodoRepeatDayOfWeek", "TodoRepeatInterval", "TodoRepeatUntil"), "Wiederholungen");
     $F->getTable()->setColWidth(1, 120);
     $T = new Todo($todoID);
     $F->setValues($T);
     $F->setValue("TodoRepeatUntil", Util::CLDateParserE($T->A("TodoRepeatUntil")));
     $F->setLabel("TodoRepeat", "Wiederholen");
     $F->setLabel("TodoRepeatWeekOfMonth", "Tag");
     $F->setLabel("TodoRepeatDayOfWeek", "Tage");
     $F->setLabel("TodoRepeatInterval", "Intervall");
     $F->setLabel("TodoRepeatDayOfWeek", "Tage");
     $F->setLabel("TodoRepeatUntil", "Bis");
     $F->setType("TodoRepeatInterval", "select", null, array("Wöchentlich", "Jede 2. Woche", "Jede 3. Woche", "Jede 4. Woche"));
     $F->setType("TodoRepeatUntil", "date");
     #$currentWeek = ceil((date("d", $T->A("TodoFromDay")) - date("w", $T->A("TodoFromDay")) - 1) / 7) + 1;
     #echo $currentWeek;
     $D = new Datum($T->A("TodoFromDay"));
     $nthDay = $D->getNthDayOfMonth();
     if ($nthDay > 4) {
         $nthDay = 4;
     }
     $weeks = array(0 => "am " . date("d", $T->A("TodoFromDay")) . ". jeden Monats");
     $weeks[$nthDay] = "jeden {$nthDay}. " . Util::CLWeekdayName(date("w", $T->A("TodoFromDay"))) . " des Monats";
     $weeks[127] = "am letzten Tag des Monats";
     $F->setType("TodoRepeat", "select", "", Todo::$repeatTypes);
     $F->setType("TodoRepeatWeekOfMonth", "select", "", $weeks);
     #$F->setType("TodoRepeatDayOfWeek", "checkbox");
     $F->setType("TodoRepeatDayOfWeek", "parser", $T->A("TodoRepeatDayOfWeek"), array("mTodoGUI::parserDayOfWeek"));
     $F->hideIf("TodoRepeat", "!=", "monthly", "onchange", array("TodoRepeatWeekOfMonth"));
     $F->hideIf("TodoRepeat", "!=", "daily", "onchange", array("TodoRepeatDayOfWeek"));
     $F->hideIf("TodoRepeat", "!=", "weekly", "onchange", array("TodoRepeatInterval", "TodoRepeatUntil"));
     $F->setSaveClass("Todo", $todoID, "function(){ /*\$j('#eventAdditionalContent').slideUp();*/ contentManager.reloadFrame('contentScreen'); Kalender.refreshInfoPopup(); }", "Aktivität");
     return $F;
 }