public function PFMailSend($sender, $param) { $Aufgabe = ProtokollDetailAufgabeView::finder()->findByidtm_protokoll_detail($param->CallbackParameter); $MailEmpfaenger = OrganisationRecord::finder()->findByPk($Aufgabe->idtm_organisation); $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->FromName = "planlogIQ"; $mail->Host = "smtp.1und1.de"; $mail->Mailer = "smtp"; $mail->SMTPAuth = true; $mail->IsSendmail(); //nur bei 1und1 $mail->Username = "******"; $mail->Password = ""; $mail->AddAddress(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $Aufgabe->idtm_organisation)->kom_information, $MailEmpfaenger->org_name); $mail->Subject = $Aufgabe->prtdet_topic; $HTMLMessage = "Sehr geehrte(r) Frau/Herr " . $MailEmpfaenger->org_name . ",<br/><br/>"; $HTMLMessage .= "die folgende Aufgabe wurde Ihnen zugeordnet:<br/>"; $HTMLMessage .= "<p><table><tr><td bgcolor='#efefef'>TOP Nr.:</td><td>" . $Aufgabe->idtm_protokoll_detail_group . " </td><td bgcolor='#efefef'>Thema: </td><td>" . utf8_decode($Aufgabe->prtdet_topic) . "</td></tr>"; $HTMLMessage .= "<tr><td bgcolor='#efefef'>Bis:</td><td colspan='3'><b>" . $Aufgabe->auf_tdate . "</b></td></tr></table>"; $HTMLMessage .= "<p style='background-color:#efefef'><hr/>" . utf8_decode($Aufgabe->prtdet_descr) . "</p>"; $HTMLMessage .= "<p style='background-color:#efefef'><hr/>" . utf8_decode($Aufgabe->auf_beschreibung) . "<hr/></p>"; $HTMLMessage .= "Bitte nicht Antworten! Diese Mail wurde automatisch generiert..."; $mail->MsgHTML($HTMLMessage); if (!$mail->Send()) { $this->PFMAILER->TEXT = "error sending the message"; } else { $this->PFMAILER->TEXT = "..done.."; } }
public function bindListKommunikation($sender, $param) { $item = $param->Item; if ($item->ItemType === 'Item' || $item->ItemType === 'AlternatingItem') { $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_organisation = :suchtext1 AND kom_information <> ''"; $criteria->Parameters[':suchtext1'] = $this->idtm_organisation; $item->KomListe->DataSource = KommunikationRecord::finder()->findAll($criteria); $item->KomListe->dataBind(); $sql = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN tm_organisation_has_ta_adresse ON ta_adresse.idta_adresse = tm_organisation_has_ta_adresse.idta_adresse WHERE tm_organisation_has_ta_adresse.idtm_organisation = " . $this->idtm_organisation . " AND adresse_street <> ''"; $item->AdressListe->DataSource = AdresseRecord::finder()->findAllBySQL($sql); $item->AdressListe->dataBind(); $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_organisation = :suchtext1"; $criteria->Parameters[':suchtext1'] = $this->idtm_organisation; $item->BankListe->DataSource = BankkontoRecord::finder()->findAll($criteria); $item->BankListe->dataBind(); } }
public function PFMailSend($sender, $param) { $Aufgabe = AufgabenRecord::finder()->findByPK($sender->CommandParameter); $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->FromName = "planlogIQ"; $mail->Host = "smtp.1und1.de"; $mail->Mailer = "smtp"; $mail->SMTPAuth = true; $mail->IsSendmail(); //nur bei 1und1 $mail->Username = "******"; $mail->Password = ""; $mail->AddAddress(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $Aufgabe->auf_idtm_organisation)->kom_information, OrganisationRecord::finder()->findByPK($Aufgabe->auf_idtm_organisation)->org_name); $mail->Subject = $Aufgabe->auf_name; $mail->MsgHTML($Aufgabe->auf_beschreibung); if (!$mail->Send()) { $this->PFMAILER->TEXT = "There was an error sending the message"; } else { $this->PFMAILER->TEXT = "..done.."; } }
public function lstKomSave($sender, $param) { $item = $param->Item; $Record = KommunikationRecord::finder()->findByPK($this->lstKom->DataKeys[$item->ItemIndex]); $Record->kom_type = $item->ATB_lst_kom_type->Text; $Record->kom_information = $item->ATB_lst_kom_information->Text; $Record->kom_ismain = $item->ATB_lst_kom_ismain->Checked ? 1 : 0; $Record->save(); $this->lstKom->EditItemIndex = -1; $this->bindListKom(); }
public function editPrtAufgabe($sender, $param) { if ($param->CommandName == "edit") { $this->prtAufgabenDialog->setDisplay("Dynamic"); $this->initPullDowns(); $AufgabeRecord = AufgabenRecord::finder()->findByPK($param->CommandParameter); $this->Tedidtm_aufgaben->Text = $AufgabeRecord->idtm_aufgaben; $this->Tedauf_tabelle->Text = $AufgabeRecord->auf_tabelle; $this->Tedauf_id->Text = $AufgabeRecord->auf_id; $this->idtm_organisation->Text = $AufgabeRecord->idtm_organisation; $this->auf_idtm_organisation->Text = $AufgabeRecord->auf_idtm_organisation; $this->auf_priority->Text = $AufgabeRecord->auf_priority; $this->auf_dauer->Text = $AufgabeRecord->auf_dauer; //$AEditRecord->auf_name = $this->prtdet_topic->Text; $this->auf_beschreibung->Text = $AufgabeRecord->auf_beschreibung; $this->auf_tdate->setDate($AufgabeRecord->auf_tdate); $this->auf_ddate->setDate($AufgabeRecord->auf_ddate); $this->auf_done->setChecked($AufgabeRecord->auf_done); $this->Tedauf_edit_status->Text = 1; $this->AddOrSaveButtonPRTAUF->Text = "speichern"; $this->getPage()->getClientScript()->registerEndScript('XCOL', "constructCollapsableFieldsets();"); } if ($param->CommandName == "taskdone") { $tmpstartdate = new DateTime(); $AufgabenRecord = AufgabenRecord::finder()->findByPK($param->CommandParameter); $AufgabenRecord->auf_done = 1; $AufgabenRecord->auf_ddate = $tmpstartdate->format("Y-m-d"); $AufgabenRecord->save(); $this->bindListPrtAufgaben(); } if ($param->CommandName == "mail") { $Aufgabe = AufgabenRecord::finder()->findByPK($param->CommandParameter); $MailEmpfaenger = OrganisationRecord::finder()->findByPk($Aufgabe->idtm_organisation); $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->FromName = "planlogIQ"; $mail->Host = "smtp.1und1.de"; $mail->Mailer = "smtp"; $mail->SMTPAuth = true; $mail->IsSendmail(); //nur bei 1und1 $mail->Username = "******"; $mail->Password = ""; $mail->AddAddress(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $Aufgabe->idtm_organisation)->kom_information, $MailEmpfaenger->org_name); $mail->Subject = $Aufgabe->auf_name; $HTMLMessage = "Sehr geehrte(r) Frau/Herr " . $MailEmpfaenger->org_name . ",<br/><br/>"; $HTMLMessage .= "die folgende Aufgabe wurde Ihnen zugeordnet:<br/>"; $HTMLMessage .= "<p><table><tr><td bgcolor='#efefef'>Task Nr.:</td><td>" . $Aufgabe->idtm_aufgaben . " </td><td bgcolor='#efefef'>Thema: </td><td>" . utf8_decode($Aufgabe->auf_name) . "</td></tr>"; $HTMLMessage .= "<tr><td bgcolor='#efefef'>Bis:</td><td colspan='3'><b>" . $Aufgabe->auf_tdate . "</b></td></tr></table>"; //$HTMLMessage.="<p style='background-color:#efefef'><hr/>".utf8_decode($Aufgabe->prtdet_descr)."</p>"; $HTMLMessage .= "<p style='background-color:#efefef'><hr/>" . utf8_decode($Aufgabe->auf_beschreibung) . "<hr/></p>"; $HTMLMessage .= "Bitte nicht Antworten! Diese Mail wurde automatisch generiert..."; $mail->MsgHTML($HTMLMessage); if (!$mail->Send()) { $this->getPage()->getClientScript()->registerEndScript('XER', "alert('Fehler!');"); } else { $this->getPage()->getClientScript()->registerEndScript('XER', "alert('Done')"); } } }
public function onPreInit($param) { parent::onPreInit($param); $docname = "tempXML"; $ext = "xml"; $header = "application/xml"; $target_encoding = "UTF-8"; if (!isset($_GET['idta_berichte'])) { $this->idta_berichte = 0; } else { $this->idta_berichte = $_GET['idta_berichte']; } if ($this->idta_berichte == 0) { $myRecords = BerichteRecord::finder()->findAll(); $doc = new TXmlDocument('1.0', $target_encoding); $doc->TagName = 'Reporting'; foreach ($myRecords as $SingleReport) { $Report = new TXmlElement('Reports'); $QVFile = new TXmlElement('QlikViewFile'); $QVFile->Value = mb_convert_encoding($SingleReport->ber_local_path, $target_encoding); $Report->Elements[] = $QVFile; $BerName = new TXmlElement('ReportName'); $BerName->Value = mb_convert_encoding($SingleReport->ber_name, $target_encoding); $Report->Elements[] = $BerName; $BerID = new TXmlElement('ReportId'); $BerID->Value = mb_convert_encoding($SingleReport->ber_id, $target_encoding); $Report->Elements[] = $BerID; $BerMailSub = new TXmlElement('MailSubject'); $BerMailSub->Value = mb_convert_encoding($SingleReport->ber_mail_subject, $target_encoding); $Report->Elements[] = $BerMailSub; $BerMailBody = new TXmlElement('MailBody'); $BerMailBody->Value = mb_convert_encoding(htmlspecialchars_decode($SingleReport->ber_mail_body), $target_encoding); $Report->Elements[] = $BerMailBody; $Recipients = new TXmlElement('Recipients'); $RCPS = BerichteOrganisationRecord::finder()->findAllByidta_berichte($SingleReport->idta_berichte); //schleife für alle empfänger foreach ($RCPS as $RCP) { $USER = OrganisationRecord::finder()->findByPK($RCP->idtm_organisation); $Mailer = new TXmlElement('Recipient'); $Mailer->setAttribute('ID', $RCP->bho_id); $Mailer->setAttribute('TABLE', $RCP->bho_modul); $Mailer->setAttribute('NTNAME', $USER->org_ntuser); $Mailer->Value = mb_convert_encoding(htmlspecialchars_decode(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $RCP->idtm_organisation)->kom_information), $target_encoding); $Recipients->Elements[] = $Mailer; unset($Mailer); } $Report->Elements[] = $Recipients; $doc->Elements[] = $Report; } } else { $doc = new TXmlDocument('1.0', 'utf-8'); $SingleReport = BerichteRecord::finder()->findByidta_berichte($this->idta_berichte); $doc->TagName = 'Reporting'; $Report = new TXmlElement('Reports'); $QVFile = new TXmlElement('QlikViewFile'); $QVFile->Value = mb_convert_encoding($SingleReport->ber_local_path, $target_encoding); $Report->Elements[] = $QVFile; $BerName = new TXmlElement('ReportName'); $BerName->Value = mb_convert_encoding($SingleReport->ber_name, $target_encoding); $Report->Elements[] = $BerName; $BerID = new TXmlElement('ReportId'); $BerID->Value = mb_convert_encoding($SingleReport->ber_id, $target_encoding); $Report->Elements[] = $BerID; $BerMailSub = new TXmlElement('MailSubject'); $BerMailSub->Value = mb_convert_encoding($SingleReport->ber_mail_subject, $target_encoding); $Report->Elements[] = $BerMailSub; $BerMailBody = new TXmlElement('MailBody'); $BerMailBody->Value = mb_convert_encoding(htmlspecialchars_decode($SingleReport->ber_mail_body), $target_encoding); $Report->Elements[] = $BerMailBody; $Recipients = new TXmlElement('Recipients'); $RCPS = BerichteOrganisationRecord::finder()->findAllByidta_berichte($SingleReport->idta_berichte); //schleife für alle empfänger foreach ($RCPS as $RCP) { $USER = OrganisationRecord::finder()->findByPK($RCP->idtm_organisation); $Mailer = new TXmlElement('Recipient'); $Mailer->setAttribute('ID', $RCP->bho_id); $Mailer->setAttribute('TABLE', $RCP->bho_modul); $Mailer->setAttribute('NTNAME', $USER->org_ntuser); $Mailer->Value = mb_convert_encoding(htmlspecialchars_decode(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $RCP->idtm_organisation)->kom_information), $target_encoding); $Recipients->Elements[] = $Mailer; unset($Mailer); } $Report->Elements[] = $Recipients; $doc->Elements[] = $Report; } # $query=new TXmlElement('Query'); # $query->setAttribute('ID','xxxx'); # $proc->Elements[]=$query; # # $attr=new TXmlElement('Attr'); # $attr->setAttribute('Name','aaa'); # $attr->Value='1'; # $query->Elements[]=$attr; $this->getResponse()->appendHeader("Content-Type:" . $header); $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $docName . '.' . $ext); $doc->saveToFile('php://output'); exit; }
private function importPARTEI($data) { $Organisation = OrganisationRecord::finder()->findorg_fk_internal("HTC" . trim($data[0])); if (count($Organisation) != 1) { $Organisation = new OrganisationRecord(); } $Organisation->org_fk_internal = trim("HTC" . trim($data[0])); $Organisation->parent_idtm_organisation = OrganisationRecord::finder()->findByorg_fk_internal('08500')->idtm_organisation; $Organisation->idta_organisation_type = 8; $Organisation->idtm_ressource = 1; $Organisation->org_anrede = utf8_encode($data[3]); $Organisation->org_briefanrede = utf8_encode(""); $Organisation->org_name = utf8_encode($data[1]); $Organisation->org_vorname = utf8_encode($data[2]); $Organisation->org_name1 = utf8_encode(""); $Organisation->org_matchkey = utf8_encode($data[1] . " " . $data[2]); $Organisation->org_uid = ""; $Organisation->org_aktiv = $data[19] == "ja" ? 1 : 0; $Organisation->save(); //Bankkonto laden $Bankkonto = BankkontoRecord::finder()->findByidtm_organisation($Organisation->idtm_organisation); if (count($Bankkonto) != 1) { $Bankkonto = new BankkontoRecord(); } $Bankkonto->idtm_organisation = $Organisation->idtm_organisation; //$Bankkonto->bak_kontowortlaut = utf8_encode($data["38"]); $Bankkonto->bak_geldinstitut = utf8_encode(""); $Bankkonto->bak_blz = ""; $Bankkonto->bak_konto = ""; $Bankkonto->bak_bic = ""; $Bankkonto->bak_iban = ""; $Bankkonto->save(); //Kommunikation 1 Telefon $Kommunikation = KommunikationRecord::finder()->find("kom_type = 1 AND kom_ismain = 1 AND idtm_organisation = ?", $Organisation->idtm_organisation); if (count($Kommunikation) != 1) { $Kommunikation = new KommunikationRecord(); } $Kommunikation->kom_type = 1; $Kommunikation->kom_information = $data[9]; $Kommunikation->kom_ismain = 1; $Kommunikation->idtm_organisation = $Organisation->idtm_organisation; $Kommunikation->save(); //Kommunikation 1 Fax2 $Kommunikation = KommunikationRecord::finder()->find("kom_type = 2 AND kom_ismain = 1 AND idtm_organisation = ?", $Organisation->idtm_organisation); if (count($Kommunikation) != 1) { $Kommunikation = new KommunikationRecord(); } $Kommunikation->kom_type = 2; $Kommunikation->kom_information = $data[10]; $Kommunikation->kom_ismain = 1; $Kommunikation->idtm_organisation = $Organisation->idtm_organisation; $Kommunikation->save(); //Kommunikation 1 Mail $Kommunikation = KommunikationRecord::finder()->find("kom_type = 3 AND kom_ismain = 1 AND idtm_organisation = ?", $Organisation->idtm_organisation); if (count($Kommunikation) != 1) { $Kommunikation = new KommunikationRecord(); } $Kommunikation->kom_type = 3; $Kommunikation->kom_information = $data[11]; $Kommunikation->kom_ismain = 1; $Kommunikation->idtm_organisation = $Organisation->idtm_organisation; $Kommunikation->save(); //adresse 1 $sql = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN tm_organisation_has_ta_adresse ON ta_adresse.idta_adresse = tm_organisation_has_ta_adresse.idta_adresse WHERE tm_organisation_has_ta_adresse.idtm_organisation = " . $Organisation->idtm_organisation . " AND ta_adresse.adresse_ismain = 1"; $Adresse = AdresseRecord::finder()->findBySQL($sql); if (count($Adresse) != 1) { $Adresse = new AdresseRecord(); } $Adresse->adresse_street = utf8_encode($data[6]); $Adresse->adresse_zip = $data[7]; $Adresse->adresse_town = $data[8]; $Adresse->adresse_ismain = 1; $Adresse->idtm_country = 1; $Adresse->save(); $OrganisationAdresse = OrganisationAdresseRecord::finder()->find('idtm_organisation = ? AND idta_adresse = ?', $Organisation->idtm_organisation, $Adresse->idta_adresse); if (count($OrganisationAdresse) != 1) { $OrganisationAdresse = new OrganisationAdresseRecord(); } $OrganisationAdresse->idta_adresse = $Adresse->idta_adresse; $OrganisationAdresse->idtm_organisation = $Organisation->idtm_organisation; $OrganisationAdresse->save(); unset($Organisation, $Bankkonto, $Kommunikation, $Adresse, $OrganisationAdresse, $sql); }
public function buildParameterXML($idta_berichte = 0) { $doc = new TXmlDocument('1.0', 'UTF-8'); $SingleReport = BerichteRecord::finder()->findByidta_berichte($idta_berichte); $doc->TagName = 'Reports'; $doc->setAttribute('xmlns:d4p1', "http://schemas.datacontract.org/2004/07/QVMailerExecutionService"); $doc->setAttribute('xmlns:i', "http://www.w3.org/2001/XMLSchema-instance"); $QVFile = new TXmlElement('QlikViewFile'); $QVFile->Value = mb_convert_encoding($SingleReport->ber_local_path, $target_encoding); $doc->Elements[] = $QVFile; $BerName = new TXmlElement('ReportName'); $BerName->Value = mb_convert_encoding($SingleReport->ber_name, $target_encoding); $doc->Elements[] = $BerName; $BerID = new TXmlElement('ReportId'); $BerID->Value = mb_convert_encoding($SingleReport->ber_id, $target_encoding); $doc->Elements[] = $BerID; $BerMailSub = new TXmlElement('MailSubject'); $BerMailSub->Value = mb_convert_encoding($SingleReport->ber_mail_subject, $target_encoding); $doc->Elements[] = $BerMailSub; $BerMailBody = new TXmlElement('MailBody'); $BerMailBody->Value = mb_convert_encoding(htmlspecialchars_decode($SingleReport->ber_mail_body), $target_encoding); $doc->Elements[] = $BerMailBody; $Recipients = new TXmlElement('Recipients'); $RCPS = BerichteOrganisationRecord::finder()->findAllByidta_berichte($SingleReport->idta_berichte); //schleife für alle empfänger foreach ($RCPS as $RCP) { $USER = OrganisationRecord::finder()->findByPK($RCP->idtm_organisation); $Mailer = new TXmlElement('Recipient'); $Mailer->setAttribute('ID', $this->ConditionCleaner($RCP->bho_id)); $Mailer->setAttribute('TABLE', $RCP->bho_modul); $Mailer->setAttribute('NTNAME', $USER->org_ntuser); $Mailer->Value = mb_convert_encoding(htmlspecialchars_decode(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $RCP->idtm_organisation)->kom_information), $target_encoding); $Recipients->Elements[] = $Mailer; unset($Mailer); } $doc->Elements[] = $Recipients; return $doc; }
private function ProtokollHeader($idtm_organisation) { $komType = array(1 => 'Telefon', 'Fax', 'Mail'); $Organisation = OrganisationRecord::finder()->findBy_idtm_organisation($idtm_organisation); //Criteria for selection in joins $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_organisation = :suchtext"; $criteria->Parameters[':suchtext'] = $idtm_organisation; $this->pdf->SetY(38); //$this->pdf->SetX(20); $this->pdf->SetFillColor(234, 242, 220); $this->pdf->SetDrawColor(234, 242, 220); $this->pdf->SetFont('Helvetica', 'B', 12); $this->pdf->Cell(185, 6, utf8_decode($Organisation->org_name) . ' ' . utf8_decode($Organisation->org_vorname), 1, 0, 'B', 1); $this->pdf->Ln(7); //$this->pdf->SetX(28); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'Matchcode: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode($Organisation->org_matchkey), 0); $this->pdf->Ln(); //$this->pdf->SetX(20); $this->pdf->SetFillColor(234, 242, 220); $this->pdf->SetDrawColor(234, 242, 220); $this->pdf->SetFont('Arial', 'B', 12); $this->pdf->Cell(185, 6, 'Adressen ', 1, 0, 'B', 1); $this->pdf->Ln(7); $Adressen = OrganisationAdresseRecord::finder()->findAll($criteria); foreach ($Adressen as $Adresse) { $Adr = AdresseRecord::finder()->findByidta_adresse($Adresse->idta_adresse); $this->pdf->SetX(20); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(20, 5, utf8_decode($Adr->adresse_zip), 0); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(60, 5, utf8_decode($Adr->adresse_town), 0); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(60, 5, utf8_decode($Adr->adresse_street), 0); $this->pdf->Ln(); unset($Adr); } //$this->pdf->SetX(20); $this->pdf->SetFillColor(234, 242, 220); $this->pdf->SetDrawColor(234, 242, 220); $this->pdf->SetFont('Arial', 'B', 12); $this->pdf->Cell(185, 6, 'Kommunikation ', 1, 0, 'B', 1); $this->pdf->Ln(7); $criteria->OrdersBy["idtm_organisation"] = 'asc'; $Kommunikation = KommunikationRecord::finder()->findAll($criteria); foreach ($Kommunikation as $Komm) { $this->pdf->SetX(20); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, utf8_decode($komType[$Komm->kom_type]), 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode($Komm->kom_information), 0); $this->pdf->Ln(); } }