function handleOrder()
 {
     $values = $_SESSION["ticketDataAddress"];
     $F = new Factory("Adresse");
     $values["land"] = ISO3166::getCountryToCode($values["land"]);
     $F->fill($values);
     $exists = $F->exists(true);
     if (!$exists) {
         $AdresseID = $F->store(false, false);
         $K = new Kunden();
         $Kappendix = $K->createKundeToAdresse($AdresseID, false, true);
     } else {
         $AdresseID = $exists->getID();
         $Kappendix = Kappendix::getKappendixToAdresse($AdresseID);
     }
     if ($_SESSION["ticketDataPayment"]["via"] == "debit") {
         $Kappendix->changeA("KappendixKontonummer", $_SESSION["ticketDataPayment"]["debitKontonummer"]);
         $Kappendix->changeA("KappendixBLZ", $_SESSION["ticketDataPayment"]["debitBlz"]);
         $Kappendix->changeA("KappendixKontoinhaber", $_SESSION["ticketDataPayment"]["debitInhaber"]);
         $Kappendix->changeA("KappendixEinzugsermaechtigung", "1");
         $Kappendix->changeA("KappendixEinzugsermaechtigungAltZBTB", "5");
         $Kappendix->changeA("KappendixSameKontoinhaber", "0");
     }
     if (!$exists) {
         $Kappendix->newMe(false);
     } else {
         $Kappendix->saveMe();
     }
     $zahlungsart = 6;
     if ($_SESSION["ticketDataPayment"]["via"] == "debit") {
         $zahlungsart = 1;
     }
     if ($_SESSION["ticketDataPayment"]["via"] == "transfer") {
         $zahlungsart = 5;
     }
     if ($_SESSION["ticketDataPayment"]["via"] == "paypal") {
         $zahlungsart = 7;
     }
     $orderIDs = array();
     foreach ($_SESSION["ticketDataSelection"] as $SeminarID => $anzahl) {
         if ($anzahl == 0) {
             continue;
         }
         $F = new Factory("STeilnehmer");
         $F->sA("STeilnehmerSeminarID", $SeminarID);
         $F->sA("STeilnehmerAdresseID", $AdresseID);
         $F->sA("STeilnehmerAngemeldetAm", time());
         $F->sA("STeilnehmerErwachsene", $anzahl);
         $F->sA("STeilnehmerZahlungsart", $zahlungsart);
         $STeilnehmerID = $F->store();
         $Tickets = array();
         foreach ($_SESSION["ticketDataTickets"] as $k => $v) {
             $ex = explode("_", $k);
             if (count($ex) != 3) {
                 continue;
             }
             if ($ex[1] != $SeminarID) {
                 continue;
             }
             if (!isset($Tickets[$ex[2]])) {
                 $Tickets[$ex[2]] = array();
             }
             $Tickets[$ex[2]][$ex[0]] = $v;
         }
         foreach ($Tickets as $ticket) {
             $F = new Factory("STeilnehmerTicket");
             $F->sA("STeilnehmerTicketSeminarID", $SeminarID);
             $F->sA("STeilnehmerTicketSTeilnehmerID", $STeilnehmerID);
             $F->sA("STeilnehmerTicketVorname", $ticket["Vorname"]);
             $F->sA("STeilnehmerTicketNachname", $ticket["Nachname"]);
             $F->sA("STeilnehmerTicketPosition", $ticket["Position"]);
             $F->sA("STeilnehmerTicketUnternehmen", $ticket["Unternehmen"]);
             $F->sA("STeilnehmerTicketEMail", $ticket["Email"]);
             if ($this->fromPOS) {
                 $F->sA("STeilnehmerTicketFirstSeen", time());
             }
             $F->store();
         }
         $S = new Seminar($SeminarID);
         $S->createRechnungen($STeilnehmerID);
         foreach ($S->createdGRLBMs as $GRLBM) {
             $Auftrag = new Auftrag($GRLBM->A("AuftragID"));
             $Auftrag->sendViaEmail($GRLBM->getID(), "", "", "", false);
             $B = new Bestellung(-1);
             $orderIDs[] = $B->createFromInvoice($GRLBM->A("AuftragID"), $GRLBM, "MMDB/Seminare/STeilnehmer", $STeilnehmerID);
         }
     }
     $_SESSION["ticketStep"] = 6;
     $_SESSION["ticketDataOrderIDs"] = $orderIDs;
 }
Exemple #2
0
 private function checkAdresse()
 {
     if (!isset($_POST["lead_id"])) {
         die("Keine Lead-ID übergeben!");
     }
     $S = anyC::get("Sync", "SyncGUID", $_POST["lead_id"]);
     $S->addAssocV3("SyncOwnerClass", "=", "Adresse");
     $Sync = $S->getNextEntry();
     #if($Sync == null){
     $Adresse = new Adresse(-1);
     $A = $Adresse->newAttributes();
     $F = new Factory("Adresse", $Sync == null ? -1 : $Sync->A("SyncOwnerClassID"));
     foreach ($_POST as $k => $v) {
         if (!isset($A->{$k})) {
             continue;
         }
         $F->sA($k, $v);
     }
     $F->store();
     $Adresse = $F->gO();
     if ($Sync == null) {
         $K = new Kunden();
         $K->createKundeToAdresse($Adresse->getID());
         mSync::updateGUID("Adresse", $Adresse->getID(), $_POST["lead_id"]);
     }
     return $Adresse;
 }
 function handleForm($valuesAssocArray)
 {
     $this->classes();
     switch ($valuesAssocArray["action"]) {
         case "register":
             $F = new Factory("Adresse");
             $F->sA("firma", $valuesAssocArray["firma"]);
             $F->sA("strasse", $valuesAssocArray["strasse"]);
             $F->sA("nr", $valuesAssocArray["nr"]);
             $F->sA("plz", $valuesAssocArray["plz"]);
             $F->sA("ort", $valuesAssocArray["ort"]);
             $F->sA("email", $valuesAssocArray["userEmail"]);
             //from email
             $F->sA("tel", $valuesAssocArray["tel"]);
             $AdresseID = $F->store(false, false);
             $K = new Kunden();
             $Kappendix = $K->createKundeToAdresse($AdresseID, false, true);
             $Kappendix->changeA("KappendixKontonummer", $valuesAssocArray["kontonummer"]);
             $Kappendix->changeA("KappendixBLZ", $valuesAssocArray["blz"]);
             $Kappendix->changeA("KappendixSameKontoinhaber", "1");
             $KappendixID = $Kappendix->newMe(false);
             $token = sha1($AdresseID . $KappendixID . microtime());
             $F = new Factory("PDFixUser");
             $F->sA("PDFixUserAdresseID", $AdresseID);
             $F->sA("PDFixUserKappendixID", $KappendixID);
             $F->sA("PDFixUserPDFixUserDBID", "0");
             $F->sA("PDFixUserIsActive", "0");
             $F->sA("PDFixUserVorNachname", $valuesAssocArray["userVorNachname"]);
             $F->sA("PDFixUserUsername", $valuesAssocArray["userUsername"]);
             $F->sA("PDFixUserPassword", $valuesAssocArray["userPassword"]);
             $F->sA("PDFixUserEmail", $valuesAssocArray["userEmail"]);
             $F->sA("PDFixUserRate", $valuesAssocArray["zahlungsweise"]);
             $F->sA("PDFixUserRegisteredDate", time());
             $F->sA("PDFixUserToken", $token);
             $F->store(false, false);
             $mail = new htmlMimeMail5();
             $mail->setFrom("*****@*****.**");
             $mail->setSubject(utf8_decode("PDFix Registrierung ihres Mitarbeiters " . $valuesAssocArray["userVorNachname"]));
             $mail->setText(utf8_decode("Sehr geehrte Damen und Herren,\n \nSie selbst oder Ihr Mitarbeiter/Ihre Mitarbeiterin \n" . $valuesAssocArray["userVorNachname"] . " hat sich soeben bei www.pdfix.de angemeldet. \n \nDer Account wurde angelegt.\n \nIm Anhang finden Sie unsere AGB und den Softwarelizenzvertrag.\nMit der Aktivierung des Accounts werden die AGB und Nutzungsbedingungen\nannerkannt.\n\nSobald die Abbuchungserklärung bei uns eingegangen ist,\nwird der Account innerhalb 24 Std. freigeschalten und\n\"pdfix\" kann dann genutzt werden.\n \nWenn Sie die Kosten übernehmen, dann klicken Sie auf\n\n\nnachstehenden Aktivierungslink.\n\nhttp://" . $_SERVER["HTTP_HOST"] . "" . str_replace("/ubiquitous/CustomerPage/index.php", "/ubiquitous/CustomerPage/?CC=RegistrationPDFix&activate={$token}", $_SERVER["SCRIPT_NAME"]) . "\n \n\nAnsonsten klären Sie bitte die Kostenübernahme mit Ihrem Mitarbeiter ab.\n\n \nMit freundlichen Grüßen\n \nM. Tischler\nGeschäftsführer\nETS-SÜD UG (haftungsbeschränkt)\nDR. Michael Samer Ring 2a\n86609 Donauwörth\nAG Augsburg\nHRB 26204\ninfo@pdfix.de"));
             /*
             Zum Download von pdfix besuchen Sie bitte
             http://www.meine-smn.de und klicken auf \"Login\"
             
             melden Sie sich an mit:
             
             Benutzername: ".$valuesAssocArray["userUsername"]."
             Passwort: ".$valuesAssocArray["userPassword"]."
             
             Bestätigen Sie jeweils am Ende der Seiten die AGB´s und Lizenzbedingungen und
             laden \"pdfix\" down.
             
             Sobald die Abbuchungserklärung bei uns eingegangen ist,
             wird der Account innerhalb 24 Std. freigeschalten,und
             \"pdfix\" kann dann genutzt werden.
             */
             #$mail->setTextCharset("UTF-8");
             #$mail->addAttachment(new fileAttachment(Util::getRootPath()."open3A/PDFix/abbuchungserkl.pdf", "application/pdf"));
             $mail->addAttachment(new fileAttachment(Util::getRootPath() . "../download/Agbs.pdf", "application/pdf"));
             $mail->addAttachment(new fileAttachment(Util::getRootPath() . "../download/Softwarelizenzvertrag.pdf", "application/pdf"));
             if (!$mail->send(array($valuesAssocArray["userEmail"]))) {
                 //from email
                 Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!");
             }
             break;
         case "activate":
             $PU = anyC::getFirst("PDFixUser", "PDFixUserToken", $valuesAssocArray["token"]);
             $PU->changeA("PDFixUserActivatedDate", time());
             $PU->changeA("PDFixUserIsActive", "1");
             $PU->changeA("PDFixUserRate", $valuesAssocArray["zahlungsweise"]);
             $PU->saveMe();
             $mail = new htmlMimeMail5();
             $mail->setFrom("*****@*****.**");
             $mail->setSubject(utf8_decode("PDFix Registrierung ihres Mitarbeiters " . $valuesAssocArray["userVorNachname"]));
             $mail->setText(utf8_decode("Sehr geehrte Damen und Herren,\n \nIhr Account wurde soeben angelegt.\n \nBenutzername: " . $PU->A("PDFixUserUsername") . "\nPasswort: " . $PU->A("PDFixUserPassword") . "\n \nSobald die Abbuchungserklärung bei uns eingegangen ist,\nwird der Account innerhalb 24 Std. freigeschalten und\n\"pdfix\" kann dann genutzt werden.\n\t\n\nMit freundlichen Grüßen\n \nM. Tischler\nGeschäftsführer\nETS-SÜD UG (haftungsbeschränkt)\nDR. Michael Samer Ring 2a\n86609 Donauwörth\nAG Augsburg\nHRB 26204\ninfo@pdfix.de"));
             /*
             Zum Download von pdfix besuchen Sie bitte
             http://www.meine-smn.de und klicken auf \"Login\"
             
             melden Sie sich an mit:
             
             Bestätigen Sie jeweils am Ende der Seiten die AGB´s und Lizenzbedingungen und
             laden \"pdfix\" down.
             */
             #$mail->setTextCharset("UTF-8");
             if (!$mail->send(array($PU->A("PDFixUserEmail")))) {
                 Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!");
             }
             $Adresse = new Adresse($PU->A("PDFixUserAdresseID"));
             $mail = new htmlMimeMail5();
             $mail->setFrom("*****@*****.**");
             $mail->setSubject("PDFix Aktivierung");
             $mail->setText(utf8_decode("\nFirma: " . $Adresse->A("firma") . "\nBenutzername: " . $PU->A("PDFixUserUsername") . ""));
             #$mail->setTextCharset("UTF-8");
             if (!$mail->send(array("*****@*****.**"))) {
                 Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!");
             }
             break;
     }
 }
Exemple #4
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();
 }