Пример #1
0
 public function replaceByAnsprechpartner($AnsprechpartnerID)
 {
     if ($AnsprechpartnerID == 0) {
         return;
     }
     $A = new Ansprechpartner($AnsprechpartnerID);
     $this->changeA("anrede", $A->A("AnsprechpartnerAnrede"));
     $this->changeA("email", $A->A("AnsprechpartnerEmail"));
     $this->changeA("vorname", $A->A("AnsprechpartnerVorname"));
     $this->changeA("nachname", $A->A("AnsprechpartnerNachname"));
 }
Пример #2
0
 function getHTML($id)
 {
     $forReload = "";
     $displayMode = null;
     $AuftragID = -1;
     $bps = $this->getMyBPSData();
     if ($bps != -1 and isset($bps["AuftragID"])) {
         $AuftragID = $bps["AuftragID"];
     }
     if ($bps != -1 and isset($bps["displayMode"])) {
         $displayMode = $bps["displayMode"];
     }
     $_SESSION["BPS"]->unsetACProperty("AuftragID");
     $_SESSION["BPS"]->unsetACProperty("displayMode");
     #if($this->A == null AND $id != -1) $this->loadMe();
     $this->loadMeOrEmpty();
     if ($id * 1 == -1) {
         $this->A = $this->newAttributes();
         $this->A->AuftragID = $AuftragID;
         if ($displayMode != null) {
             $this->A->type = $displayMode;
         }
         //Has to stay or lieferAdresse will also overwrite a normal Auftrags-Adresse
         if (Session::isPluginLoaded("mAdressBuch")) {
             $AB = BPS::getProperty("AdressenGUI", "AdressBuch", null);
             if ($AB) {
                 $this->A->type = "AB{$AB}";
             }
         }
         $id = $this->newMe(true, false);
         $this->forceReload();
         try {
             $K = new Kunden();
             if ($displayMode == null and $this->A("type") == "default") {
                 //Or else a lieferAdresse will get a Kundennummer
                 $K->createKundeToAdresse($id, false);
             }
         } catch (ClassNotFoundException $e) {
         }
         $forReload = "<script type=\"text/javascript\">lastLoadedLeft = {$id}; lastLoadedLeftPlugin = 'Adresse';</script>";
     }
     $OptTab = new HTMLSideTable("right");
     if (Session::isPluginLoaded("Kunden") and $this->A->AuftragID == -1) {
         $B = new Button("Kundendaten", "kunden");
         $B->loadFrame("contentLeft", "Kunde", "-1", "0", "KundeGUI;AdresseID:{$this->getID()};action:Kappendix");
         $OptTab->addRow($B);
     }
     if ($_SESSION["applications"]->getActiveApplication() == "open3A") {
         if ($displayMode != null) {
             $OptTab->setTableStyle("width:160px;margin:0px;margin-left:-170px;float:left;");
         }
         if (($id == -1 or $forReload != "") and Session::isPluginLoaded("mImport")) {
             $OTBV = new Button("Schnell-\nImport", "import");
             #$OTBV->rmePCR("importAdresse", "", "getFastImportWindow", "", "Popup.display('Adresse importieren:',transport);");
             $OTBV->onclick("Import.openSchnellImportAdresse('Adresse importieren:');");
             $OTBV->id("ButtonAdresseSchnellImport");
             $OptTab->addRow($OTBV);
         }
         if ($id != -1 and Session::isPluginLoaded("Kundenpreise") and $this->A->AuftragID == -1 and $this->A->type == "default") {
             $ButtonKundenpreise = new Button("Kundenpreise", "package");
             $ButtonKundenpreise->onclick("contentManager.loadFrame('contentLeft','Kunde', -1, 0, 'KundeGUI;AdresseID:{$this->ID};action:Kundenpreise');");
             $OptTab->addRow($ButtonKundenpreise);
         }
         if ($this->A->AuftragID == -1 and (Session::isPluginLoaded("mAnsprechpartner") or Session::isPluginLoaded("mOSM"))) {
             $OptTab->addRow("");
             $OptTab->addCellStyle(1, "height:30px;");
         }
         if ($id != -1 and Session::isPluginLoaded("mAnsprechpartner") and $this->A->AuftragID == -1) {
             $OptTab->addRow(Ansprechpartner::getButton("Adresse", $this->getID()));
         }
         if ($id != -1 and Session::isPluginLoaded("mOSM") and $this->A("AuftragID") == -1) {
             $OptTab->addRow(OpenLayers::getButton("Adresse", $this->getID()));
         }
     }
     if (Session::isPluginLoaded("mklickTel") and $this->A->AuftragID == -1) {
         $OptTab->addRow(klickTel::getButton($this->getID()));
     }
     $this->loadMeOrEmpty();
     $gui = $this->gui;
     $gui->insertSpaceAbove("tel", "Kontakt");
     $gui->insertSpaceAbove("strasse", "Adresse");
     $gui->insertSpaceAbove("homepage", "Sonstiges");
     $gui->setFormID("AdresseForm");
     $fields = array("firma", "position", "anrede", "vorname", "nachname", "AdresseSpracheID", "strasse", "bezirk", "zusatz1", "ort", "land", "tel", "fax", "mobil", "email", "homepage", "gebRem", "gebRemMail", "AuftragID", "KategorieID", "type", "geb", "bemerkung");
     if (Session::isPluginLoaded("mLDAP")) {
         $fields[] = "exportToLDAP";
     }
     $gui->setShowAttributes($fields);
     $gui->setLabel("bemerkung", "Notizen");
     if (Session::isPluginLoaded("mSprache")) {
         $gui->setLabel("AdresseSpracheID", "Sprache");
         $gui->setLabelDescription("AdresseSpracheID", "und Währung");
         #$ACS = anyC::get("Sprache");
         #$S = array();
         #while($SLW = $ACS->getNextEntry())
         #	$S[$SLW->getID()] = $SLW->A("SpracheSprache")." "." ".$SLW->A("SpracheWaehrung");
         $gui->selectWithCollection("AdresseSpracheID", new mSprache(), "SpracheName");
         #$gui->setType("AdresseSpracheID", "select");
         #$gui->setOptions("AdresseSpracheID", array_keys($S), array_values($S));
         #$gui->insertSpaceAbove("firma");
     } else {
         $gui->setType("AdresseSpracheID", "hidden");
     }
     #$gui->setAttributes($this->A);
     $gui->setObject($this);
     $gui->setName("Adresse");
     $gui->setOptions("anrede", array_keys(self::getAnreden()), array_values(self::getAnreden()));
     $gui->setType("anrede", "select");
     $gui->setType("geb", "hidden");
     $gui->setType("gebRemMail", "hidden");
     $gui->setType("gebRem", "hidden");
     $gui->setType("exportToLDAP", "checkbox");
     $gui->insertSpaceAbove("exportToLDAP");
     $gui->setFieldDescription("exportToLDAP", "Soll die Adresse auf einen LDAP-Server exportiert werden?");
     $gui->setType("AuftragID", "hidden");
     $gui->setType("type", "hidden");
     #$gui->setLabel("geb","Jahrestag");
     $gui->setLabel("ort", "PLZ/Ort");
     $gui->setLabel("strasse", "Straße/Hausnr.");
     $gui->setLabel("tel", "Telefon");
     $gui->setLabel("email", "E-Mail");
     $gui->setLabel("exportToLDAP", "LDAP-Export?");
     $gui->setParser("strasse", "AdresseGUI::parserStrasse", array($this->A("nr")));
     $gui->setParser("ort", "AdresseGUI::parserOrt", array($this->A("plz")));
     #$gui->useAutoCompletion("plz", (Session::isPluginLoaded("Postleitzahlen") ? "Postleitzahlen" : "Adressen"));
     if (Session::isPluginLoaded("mStammdaten") or Applications::activeApplication() == "MMDB") {
         /*if($this->A("land") == ""){
         			$S = Stammdaten::getActiveStammdaten();
         			if($S->A("land") == "D") $S->changeA("land","DE");
         			$this->changeA("land", ISO3166::getCountryToCode($S->A("land")));
         		}*/
         $gui->setType("land", "select");
         $countries = ISO3166::getCountries();
         $labels = array_merge(array("" => "keine Angabe"), $countries);
         $values = array_merge(array("" => ""), $countries);
         $gui->setOptions("land", array_values($values), array_values($labels));
         if ($this->A("land") != ISO3166::getCountryToCode("GB") and $this->A("land") != ISO3166::getCountryToCode("US") and $this->A("land") != ISO3166::getCountryToCode("CH")) {
             $gui->setLineStyle("zusatz1", "display:none;");
             $gui->setLineStyle("position", "display:none;");
         }
         if ($this->A("land") != ISO3166::getCountryToCode("DK") and $this->A("land") != ISO3166::getCountryToCode("ES")) {
             $gui->setLineStyle("bezirk", "display:none;");
         }
         $gui->setLabel("zusatz1", "Zusatz 1");
         $gui->setInputJSEvent("land", "onchange", "contentManager.toggleFormFields((this.value == '" . ISO3166::getCountryToCode("GB") . "' || this.value == '" . ISO3166::getCountryToCode("US") . "' || this.value == '" . ISO3166::getCountryToCode("CH") . "') ? 'show' : 'hide', ['zusatz1', 'position']); contentManager.toggleFormFields((this.value == '" . ISO3166::getCountryToCode("DK") . "' || this.value == '" . ISO3166::getCountryToCode("ES") . "') ? 'show' : 'hide', ['bezirk']);");
     }
     if (Session::isPluginLoaded("mGemeinschaft")) {
         $gui->activateFeature("addCustomButton", $this, "tel", Gemeinschaft::getCallButton($this->A("tel")));
         $gui->activateFeature("addCustomButton", $this, "mobil", Gemeinschaft::getCallButton($this->A("mobil"), "mobile"));
     }
     $kat = new Kategorien();
     $kat->addAssocV3("type", "=", $displayMode != "" ? $displayMode : "1");
     $keys = $kat->getArrayWithKeys();
     $keys[] = "0";
     $values = $kat->getArrayWithValues();
     $values[] = "bitte auswählen";
     $gui->setOptions("KategorieID", $keys, $values);
     $gui->setType("bemerkung", "textarea");
     $gui->setLabel("KategorieID", "Kategorie");
     if ($AuftragID == -1) {
         $gui->setType("KategorieID", "select");
     } else {
         $gui->setType("KategorieID", "hidden");
         $gui->setType("bemerkung", "hidden");
         $gui->setType("tel", "hidden");
         $gui->setType("fax", "hidden");
         $gui->insertSpaceAbove("email");
         $gui->setType("homepage", "hidden");
         $gui->setType("exportToLDAP", "hidden");
         $gui->setType("mobil", "hidden");
     }
     switch ($displayMode) {
         case "auftragsAdresse":
             $gui->setJSEvent("onSave", "function() {\n\t\t\t\t\tcontentManager.loadFrame('contentLeft','Auftrag',{$this->A->AuftragID});\n\t\t\t\t\tcontentManager.loadFrame('contentRight','Auftraege');\n\t\t\t\t}");
             break;
         case "lieferAdresse":
             $this->A->type = "lieferAdresse";
             $gui->setJSEvent("onSave", "function() {\n\t\t\t\t\tcontentManager.loadFrame('contentRight','Auftraege');\n\t\t\t\t\tcontentManager.loadFrame('subframe','GRLBM',{$this->A->AuftragID});\n\t\t\t\t}");
             break;
     }
     Aspect::joinPoint("buttons", $this, __METHOD__, $OptTab);
     $gui->setStandardSaveButton($this, "Adressen");
     $gui->customize($this->customizer);
     return $forReload . $OptTab . $gui->getEditHTML();
 }
Пример #3
0
 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;\">&lt;" . $I->A("TodoInvitationUserEmail") . "&gt;</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>";
     }
 }
Пример #4
0
 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;
 }