SPIN PDF can now have custom netowner data
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
$this->setReturnValue([
|
||||
'filename' => "Wichtige Kundeninformation ".$owner->customer_number.".pdf"
|
||||
]);
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Wichtige Kundeninformation zu Ihrem Glasfaseranschluss</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="<?=$ressourcePathPrefix?>fontawesome/css/all.min.css" rel="stylesheet" type="text/css" />
|
||||
<!--<link href="<?=$ressourcePathPrefix?>assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />-->
|
||||
<link href="<?=$ressourcePathPrefix?>assets/css/print.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body styl="font-size: 36pt;">
|
||||
|
||||
<!--div style="border-top: 1pt solid #000">
|
||||
|
||||
</div-->
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width:50%">
|
||||
<img src="<?=$ressourcePathPrefix?>assets/pdf/logo-address-<?=$netowner->id?>.png" style="max-width: 100%"/>
|
||||
</td>
|
||||
<td style="width:50%; text-align: right;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<div style="height:24pt;"></div>
|
||||
|
||||
<div>
|
||||
<?php if($owner->company): ?>
|
||||
<?=nl2br($owner->company)?><br />
|
||||
<?php endif; ?>
|
||||
<?php if($owner->getFullName()): ?>
|
||||
<?=$owner->getFullName()?><br />
|
||||
<?php endif; ?>
|
||||
<?=$owner->street?><br />
|
||||
<?=$owner->zip?> <?=$owner->city?>
|
||||
</div>
|
||||
|
||||
<div style="height:24pt;"></div>
|
||||
|
||||
<div class="center">
|
||||
<h2>Wichtige Kundeninformation zu Ihrem Glasfaseranschluss</h2>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>Sehr geehrte Damen und Herren,</p>
|
||||
<p>wir freuen uns sehr, dass Sie sich für einen Glasfaseranschluss im Netz der <?=$netowner->company?> entschieden haben. Hiermit möchten wir Ihnen gerne den Eingang Ihrer Bestellung bestätigen.</p>
|
||||
<p>Bezüglich der gegebenenfalls erforderlichen Termine für die Installation melden wir uns (bzw. unsere Partner vom Leitungsbau) sobald die Herstellung möglich ist.</p>
|
||||
<p>Ihr persönlicher Service-PIN lautet: <?=$owner->spin?></p>
|
||||
<p>Gemäß der EU-Datenschutzverordnung sind wir dazu verpflichtet, mit den uns anvertrauten Kundendaten sorgsam umzugehen. Dazu gehört die Abfrage eines Service-PINs mit welchem Sie bei uns auch
|
||||
telefonische Auskünfte (z.B. vergessene Passwörter, Rechnungsauskünfte, etc.) erhalten können. Unsere Mitarbeiter werden Sie vor Beantwortung Ihrer Fragen um die Nennung des Service-PINs bitte.
|
||||
Bitte haben Sie Verständnis, dass wir <strong>ohne</strong> korrekte Nennung Ihres <strong>PIN</strong>s keine Auskünfte erteilen können.</p>
|
||||
</div>
|
||||
|
||||
<div style="height:1.5pt;"></div>
|
||||
|
||||
<div>
|
||||
<p class="bold">Sollten Sie noch Fragen haben, erreichen Sie uns per Mail an <span style="white-space: nowrap"><?=$netowner->email?></span> oder telefonisch unter der Rufnummer <span style="white-space: nowrap"><?=$netowner->phone?>.</span></p>
|
||||
</div>
|
||||
|
||||
<div style="height:1.5pt;"></div>
|
||||
|
||||
<div>
|
||||
<p>Mit freundlichen Grüßen,</p>
|
||||
</div>
|
||||
|
||||
<div style="height:1.5pt;"></div>
|
||||
|
||||
<div>
|
||||
<p>Ihr Team der <?=$netowner->company?></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
15
Layout/andom-tec/Emailtemplates/customer/new_order.php
Normal file
15
Layout/andom-tec/Emailtemplates/customer/new_order.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$this->setReturnValue([
|
||||
'subject' => "Ihre Bestellung wurde erfasst",
|
||||
'from_email' => $netowner->email,
|
||||
'from_email_name' => $netowner->company." Kundenservice"
|
||||
]);
|
||||
?>
|
||||
|
||||
Sehr geehrte Damen und Herren,
|
||||
|
||||
im Anhang finden Sie weitere Informationen zur Ihrer Glasfaserbestellung, sowie Ihren persönlichen Service-PIN.
|
||||
|
||||
Mit freundlichen Grüßen,
|
||||
|
||||
Ihr Team der <?=$netowner->company?>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
$term_id = $order->terminations[0]->id;
|
||||
$op = OrderProductModel::getFirst(['order_id' => $order->id, 'termination_id' => $term_id]);
|
||||
|
||||
$billing_start = date('U');
|
||||
if($op->billing_delay) {
|
||||
$billing_start = strtotime("+".$op->billing_delay." months");
|
||||
}
|
||||
|
||||
$subject = "";
|
||||
if($order->upgrade) {
|
||||
$subject .= "[UPGRADE] ";
|
||||
}
|
||||
$subject .= $order->partner_number." - "
|
||||
."hergestellt am ".date("d.m.Y", $order->finish_date) . " - "
|
||||
."Verrechnung ab ".date("m", $billing_start)."/".date("Y", $billing_start)." - "
|
||||
.str_replace("\n", " ", str_replace("\r", "", $order->owner->getCompanyOrName()));
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
|
||||
'from_email' => TT_OUTGOING_EMAIL,
|
||||
'from_email_name' => "XINON Partnerservice"
|
||||
]);
|
||||
|
||||
?>
|
||||
<?php if($order->upgrade): ?>
|
||||
Achtung: UPGRADE
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Rechnungspositionen
|
||||
====================
|
||||
|
||||
Anzahl | Produktname | Verrechungsperiode | Preis periodisch | Preis Herstellung
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
<?php foreach($order->products as $op): ?>
|
||||
<?=sprintf("%-12s", substr($op->amount,0,12))?> | <?=utf8_encode(sprintf("%-42s", utf8_decode(substr($op->product->name,0,42))))?> | <?=utf8_encode(sprintf("%-18s", utf8_decode(($op->billing_period == 12) ? "Jährlich " : (($op->billing_period == 1) ? "Monatlich" : $op->billing_period."-monatlich")) ))?> | <?=sprintf("EUR %-12s", substr($op->price,0,12))?> | EUR <?=$op->price_setup?>
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if(is_array($order->terminations) && count($order->terminations)): ?>
|
||||
Anschluss
|
||||
==========
|
||||
<?php foreach($order->terminations as $term): ?>
|
||||
<?=$term->getAddress()?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Bestelldetails
|
||||
===============
|
||||
Bestelldatum: <?=date("d.m.Y", $order->order_date)?>
|
||||
|
||||
Bestellung abgeschlossen: <?=date("d.m.Y", $order->finish_date)?>
|
||||
|
||||
Einwilligung Datenschutz: <?=($order->allow_contact)? "Ja" : "Nein"?>
|
||||
|
||||
|
||||
|
||||
Vertragsinhaber
|
||||
================
|
||||
Firma: <?=$order->owner->company?>
|
||||
|
||||
Vorname: <?=$order->owner->firstname?>
|
||||
|
||||
Nachname: <?=$order->owner->lastname?>
|
||||
|
||||
Straße: <?=$order->owner->street?>
|
||||
|
||||
PLZ: <?=$order->owner->zip?>
|
||||
|
||||
Ort: <?=$order->owner->city?>
|
||||
|
||||
Land: <?=$order->owner->country?>
|
||||
|
||||
Telefon: <?=$order->owner->phone?>
|
||||
|
||||
Fax: <?=$order->owner->fax?>
|
||||
|
||||
Mobiltelefon: <?=$order->owner->mobile?>
|
||||
|
||||
Email: <?=$order->owner->email?>
|
||||
|
||||
<?php if($order->billingaddress_id > 0 && $order->billingaddress_id != $order->owner_id): ?>
|
||||
|
||||
|
||||
Rechnungsempfänger
|
||||
===================
|
||||
Firma: <?=$order->billingaddress->company?>
|
||||
|
||||
Vorname: <?=$order->billingaddress->firstname?>
|
||||
|
||||
Nachname: <?=$order->billingaddress->lastname?>
|
||||
|
||||
Straße: <?=$order->billingaddress->street?>
|
||||
|
||||
PLZ: <?=$order->billingaddress->zip?>
|
||||
|
||||
Ort: <?=$order->billingaddress->city?>
|
||||
|
||||
Land: <?=$order->billingaddress->country?>
|
||||
|
||||
Telefon: <?=$order->billingaddress->phone?>
|
||||
|
||||
Fax: <?=$order->billingaddress->fax?>
|
||||
|
||||
Mobiltelefon: <?=$order->billingaddress->mobile?>
|
||||
|
||||
Email: <?=$order->billingaddress->email?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Verrechnung
|
||||
============
|
||||
<?php if($order->billing_type == "invoice"): ?>
|
||||
Verrechnungsart: Rechnung
|
||||
<?php else: ?>
|
||||
Verrechnungsart: SEPA Bankeinzug
|
||||
Bank: <?=$order->bank_account_bank?>
|
||||
|
||||
Kontoinhaber: <?=$order->bank_account_owner?>
|
||||
|
||||
IBAN: <?=$order->bank_account_iban?>
|
||||
|
||||
BIC: <?=$order->bank_account_bic?>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
$contacts = $order->owner->getChildrenByType("techcontact");
|
||||
if(!is_array($contacts) || !count($contacts)) {
|
||||
$contacts = [$order->owner];
|
||||
}
|
||||
|
||||
$tos = [];
|
||||
foreach($contacts as $contact) {
|
||||
if($contact->email) {
|
||||
$tos[] = $contact->email;
|
||||
}
|
||||
}
|
||||
|
||||
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName());
|
||||
|
||||
$subject = "Ihr Übergabeprotokoll / Technikerstammblatt";
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
'to' => $tos,
|
||||
'from_email' => "support@xinon.at",
|
||||
'from_email_name' => "XINON Kundenservice"
|
||||
]);
|
||||
|
||||
?>
|
||||
Sehr geehrte Damen und Herren,
|
||||
|
||||
im Anhang erhalten Sie das technische Übergabeprotokoll zum Anschluss des Kunden <?=$customer_string?> zur weiteren Verwendung.
|
||||
|
||||
Ihr XINON Team
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
|
||||
|
||||
$subject = "Neue PBX-Bestellung eingelangt ($customer_string)";
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
'to' => "einkauf@xinon.at",
|
||||
'from_email' => TT_OUTGOING_EMAIL,
|
||||
'from_email_name' => TT_OUTGOING_EMAIL_NAME
|
||||
]);
|
||||
|
||||
?>
|
||||
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat die Bestellung einer Telefonanlage für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um technische Prüfung und Materialabklärung bzw. Herstellungsfreigabe.
|
||||
|
||||
TheTool OrderROBOT (-;
|
||||
|
||||
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
|
||||
|
||||
$subject = "Neue Projektbestellung eingelangt ($customer_string)";
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
'to' => "einkauf@xinon.at",
|
||||
'from_email' => TT_OUTGOING_EMAIL,
|
||||
'from_email_name' => TT_OUTGOING_EMAIL_NAME
|
||||
]);
|
||||
|
||||
?>
|
||||
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat eine Projektbestellung für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um technische Prüfung und Materialabklärung bzw. Herstellungsfreigabe.
|
||||
|
||||
TheTool OrderROBOT (-;
|
||||
|
||||
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
|
||||
|
||||
$subject = "Neue Einzugsermächtigung eingelangt ($customer_string)";
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
'to' => "billing@xinon.at",
|
||||
'from_email' => TT_OUTGOING_EMAIL,
|
||||
'from_email_name' => TT_OUTGOING_EMAIL_NAME
|
||||
]);
|
||||
|
||||
?>
|
||||
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat soeben eine Einzugsermächtigung für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um Prüfung und Aktualisierung der Bankdaten des Kunden.
|
||||
|
||||
TheTool OrderROBOT (-;
|
||||
|
||||
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
|
||||
|
||||
$subject = "Neue Rufnummerportierung ($customer_string)";
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
'to' => "portierung@xinon.at",
|
||||
'from_email' => TT_OUTGOING_EMAIL,
|
||||
'from_email_name' => TT_OUTGOING_EMAIL_NAME
|
||||
]);
|
||||
|
||||
?>
|
||||
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat soeben eine Rufnummerportierung für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um Prüfung des Herstellungstermins und Einreichung.
|
||||
|
||||
TheTool OrderROBOT (-;
|
||||
|
||||
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>
|
||||
79
Layout/andom-tec/Emailtemplates/order/int_billing_info.php
Normal file
79
Layout/andom-tec/Emailtemplates/order/int_billing_info.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
$term_id = $order->terminations[0]->id;
|
||||
$op = OrderProductModel::getFirst(['order_id' => $order->id, 'termination_id' => $term_id]);
|
||||
|
||||
if($order->finish_date) {
|
||||
$billing_start = $order->finish_date;
|
||||
} else {
|
||||
$billing_start = date('U');
|
||||
}
|
||||
|
||||
if($op->billing_delay) {
|
||||
$billing_start = strtotime("+".$op->billing_delay." months");
|
||||
}
|
||||
|
||||
$subject = "";
|
||||
if($order->upgrade) {
|
||||
$subject .= "[UPGRADE] ";
|
||||
}
|
||||
$subject .= $order->terminations[0]->building->network->name." - "
|
||||
."Verr. ab ".date("m", $billing_start)."/".date("Y", $billing_start)." - "
|
||||
.$order->owner->customer_number." - "
|
||||
.str_replace("\n", "", str_replace("\r\n", " ", $order->owner->getCompanyOrName()));
|
||||
|
||||
$this->setReturnValue([
|
||||
'subject' => $subject,
|
||||
|
||||
'from_email' => TT_OUTGOING_EMAIL,
|
||||
'from_email_name' => TT_OUTGOING_EMAIL_NAME
|
||||
]);
|
||||
|
||||
$nne_products = [];
|
||||
?>
|
||||
<?php if($order->upgrade): ?>
|
||||
Achtung: UPGRADE
|
||||
<?php endif; ?>
|
||||
|
||||
Netzgebiet: <?=$order->terminations[0]->building->network->name?>
|
||||
|
||||
Bauabschnitt: <?=(($order->terminations[0]->building->networksection_id) ? $order->terminations[0]->building->networksection->name : "<kein Bauabschnitt>")?>
|
||||
|
||||
Kundennummer: <?=$order->owner->customer_number?>
|
||||
|
||||
Kunde: <?=str_replace("\n", "", str_replace("\r\n", " ", $order->owner->getCompanyOrName()))?>
|
||||
|
||||
Verrechungsstart: <?=date("m", $billing_start)?>/<?=date("Y", $billing_start)?>
|
||||
|
||||
|
||||
Rechnungspositionen
|
||||
====================
|
||||
|
||||
Anzahl | Produktname | Verrechungsperiode | Preis periodisch | Preis Herstellung
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
<?php foreach($order->products as $op): ?>
|
||||
<?php if($op->price_nne > 0.0) $nne_products[] = $op; ?>
|
||||
<?=sprintf("%-12s", substr($op->amount,0,12))?> | <?=utf8_encode(sprintf("%-42s", utf8_decode(substr($op->product->name,0,42))))?> | <?=utf8_encode(sprintf("%-18s", utf8_decode(($op->billing_period == 12) ? "Jährlich " : (($op->billing_period == 1) ? "Monatlich" : $op->billing_period."-monatlich")) ))?> | <?=sprintf("EUR %-12s", substr($op->price,0,12))?> | EUR <?=$op->price_setup?>
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if(count($nne_products)): ?>
|
||||
|
||||
Gutschriften
|
||||
=============
|
||||
|
||||
<?php if($order->terminations[0]->building->network->owner): ?>
|
||||
Netzeigentümer: <?=$order->terminations[0]->building->network->owner->getCompanyOrName()?>
|
||||
<?php endif; ?>
|
||||
|
||||
Anzahl | Produktname | Verrechungsperiode | Bauabschnitt | NNE
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
<?php foreach($nne_products as $op): ?>
|
||||
<?=sprintf("%-12s", substr($op->amount,0,12))?> | <?=utf8_encode(sprintf("%-42s", utf8_decode(substr($op->product->name,0,42))))?> | <?=utf8_encode(sprintf("%-18s", utf8_decode(($op->billing_period == 12) ? "Jährlich " : (($op->billing_period == 1) ? "Monatlich" : $op->billing_period."-monatlich")) ))?> | <?=sprintf("%-24s", substr(($op->termination->building->networksection_id) ? $op->termination->building->networksection->name : "<Kein Bauabschnitt>",0,24))?> | EUR <?=$op->price_nne?>
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php endif; // (count($nne_products))?>
|
||||
|
||||
|
||||
@@ -23,19 +23,19 @@
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width:50%">
|
||||
<img src="<?=$ressourcePathPrefix?>assets/pdf/logo.png" />
|
||||
<img src="<?=$ressourcePathPrefix?>assets/pdf/logo-xinon.png" />
|
||||
</td>
|
||||
<td style="width:50%; text-align: right;">
|
||||
<table style="text-align: left; width:100%">
|
||||
<tr>
|
||||
<td style="text-align: right;">Kundennummer:</td>
|
||||
<td><?=$owner->customer_number?></td>
|
||||
<td style="padding-left: 4pt;"><?=$owner->customer_number?></td>
|
||||
</tr><tr>
|
||||
<td style="text-align: right;">Vertrag erfasst am:</td>
|
||||
<td><?=date('d.m.Y', $order->create)?></td>
|
||||
<td style="padding-left: 4pt;"><?=date('d.m.Y', $order->create)?></td>
|
||||
</tr><tr>
|
||||
<td style="text-align: right;">Bestelldatum:</td>
|
||||
<td><?=date('d.m.Y', $order->order_date)?></td>
|
||||
<td style="padding-left: 4pt;"><?=date('d.m.Y', $order->order_date)?></td>
|
||||
</tr><tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -85,14 +85,14 @@
|
||||
Rechnungsauskünfte, etc) nach Ihrem <strong>persönlichen Service-PIN</strong> fragen.</p>
|
||||
</div>
|
||||
|
||||
<div style="height:48pt;"></div>
|
||||
<div style="height:32pt;"></div>
|
||||
|
||||
<div>
|
||||
<p><strong>Sollten Sie noch Fragen haben erreichen Sie uns per Mail (office@xinon.at) oder
|
||||
telefonisch unter der Rufnummer 03115 40800.</strong></p>
|
||||
telefonisch unter der Rufnummer <span style="white-space: nowrap">03115 40800.</span></strong></p>
|
||||
</div>
|
||||
|
||||
<div style="height:48pt;"></div>
|
||||
<div style="height:32pt;"></div>
|
||||
|
||||
<div>
|
||||
<p>Mit besten Grüßen,</p>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<select name="filter[network_id]" id="filter_network_id" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach($sorted_networks as $fnet => $nid): ?>
|
||||
<option value="<?=$nid?>" <?=($filter['network_id'] == $nid) ? "selected='selected'" : ""?>><?=$fnet?></option>
|
||||
<option value="<?=$nid?>" <?=(is_array($filter) && array_key_exists("network_id", $filter) && $filter['network_id'] == $nid) ? "selected='selected'" : ""?>><?=$fnet?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -94,8 +94,8 @@ class DashboardController extends mfBaseController {
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-xinon-oid", $order->id);
|
||||
$email->setHeader("X-xinon-pid", $product->id);
|
||||
$email->setHeader("X-".MFAPPNAME."-oid", $order->id);
|
||||
$email->setHeader("X-".MFAPPNAME."-pid", $product->id);
|
||||
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
|
||||
$email->send();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class Emailnotification {
|
||||
|
||||
public function __construct() {
|
||||
$this->headers = [
|
||||
'X-Mailer' => 'XINON Mailer',
|
||||
'X-Mailer' => MFAPPNAME.' Mailer',
|
||||
];
|
||||
|
||||
$this->email_from = TT_OUTGOING_EMAIL;
|
||||
@@ -79,10 +79,11 @@ class Emailnotification {
|
||||
$this->setHeader("Subject", $this->subject);
|
||||
}
|
||||
|
||||
if(!$this->headers['From'] && $this->from_name) {
|
||||
if((!array_key_exists("From", $this->headers) || !$this->headers['From']) && $this->from_name) {
|
||||
$this->headers['From'] = '"'.$this->from_name.'" <'.$this->email_from.'>';
|
||||
}
|
||||
|
||||
$log = mfLoghandler::singleton();
|
||||
|
||||
//var_dump($this);exit;
|
||||
|
||||
@@ -108,6 +109,7 @@ class Emailnotification {
|
||||
|
||||
$body = $mime->get($mimeparams);
|
||||
$headers = $mime->headers($this->headers);
|
||||
//$log->debug(print_r($headers, true));
|
||||
|
||||
$mail =& Mail::factory('mail', ["-f ".$this->email_from]);
|
||||
$mail->send($this->email_to, $headers, $body);
|
||||
|
||||
@@ -93,6 +93,68 @@ class Order extends mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
public function sendSpinEmail() {
|
||||
$owner = $this->getProperty("owner");
|
||||
|
||||
$spin_pdf_template = "Emailtemplates/attachments/new_order_spin.pdf";
|
||||
$new_order_template = "Emailtemplates/customer/new_order";
|
||||
|
||||
$pdf_vars = [
|
||||
'order' => $this,
|
||||
'owner' => $owner
|
||||
];
|
||||
|
||||
|
||||
if(TT_CUSTOM_ORDER_PDF_PER_NETOWNER) {
|
||||
$terms = $this->getTerminations();
|
||||
if(is_array($terms) && count($terms) && $terms[0]->id) {
|
||||
$netowner = $terms[0]->building->network->owner;
|
||||
} else {
|
||||
$netowner = new Address(TT_CUSTOM_ORDER_PDF_DEFAULT_OWNER_ID);
|
||||
}
|
||||
$pdf_vars['netowner'] = $netowner;
|
||||
}
|
||||
|
||||
// render service pin PDF
|
||||
$pdf = new PdfForm($spin_pdf_template, $pdf_vars);
|
||||
$pdfpath = $pdf->render();
|
||||
$tvalue = $pdf->getReturnedValues();
|
||||
$pdfname = $tvalue['filename'];
|
||||
|
||||
// send email to customer
|
||||
// TODO template rendern auslagern nach Emailtempate klasse
|
||||
$tpl = new Layout();
|
||||
$tpl->setTemplate($new_order_template);
|
||||
|
||||
foreach($pdf_vars as $name => $val) {
|
||||
$tpl->set($name, $val);
|
||||
}
|
||||
|
||||
$body = $tpl->render();
|
||||
$values = $tpl->getReturnedValue();
|
||||
|
||||
$subject = $values['subject'];
|
||||
$from = $values['from_email'];
|
||||
$from_name = $values['from_email_name'];
|
||||
$to = $owner->email;
|
||||
|
||||
if(!$subject || !$from || !$from_name || !$to) {
|
||||
$this->log->warn("Service PIN Email not sent. (subject: '$subject', from: '$from', from_email: '$from_email', to: '$to')");
|
||||
} else {
|
||||
$email = new Emailnotification();
|
||||
$email->setSubject($subject);
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-".MFAPPNAME."-Oid", $this->id);
|
||||
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
|
||||
$email->send();
|
||||
$this->log->info(__CLASS__."::sendSpinEmail(): Sending new SPIN for ".$owner->getCompanyOrName()." (".$owner->id.")");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function sendIntBillinfoEmail() {
|
||||
// TODO template rendern auslagern nach Emailtempate klasse
|
||||
$tpl = new Layout();
|
||||
@@ -119,7 +181,7 @@ class Order extends mfBaseModel {
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-xinon-oid", $this->id);
|
||||
$email->setHeader("X-".MFAPPNAME."-oid", $this->id);
|
||||
$email->send();
|
||||
|
||||
return true;
|
||||
@@ -158,7 +220,7 @@ class Order extends mfBaseModel {
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-Xinon-Oid", $this->id);
|
||||
$email->setHeader("X-".MFAPPNAME."-Oid", $this->id);
|
||||
$email->send();
|
||||
|
||||
return true;
|
||||
@@ -213,8 +275,8 @@ class Order extends mfBaseModel {
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-Xinon-Oid", $this->id);
|
||||
$email->setHeader("X-Xinon-OFid", $file->id);
|
||||
$email->setHeader("X-".MFAPPNAME."-Oid", $this->id);
|
||||
$email->setHeader("X-".MFAPPNAME."-OFid", $file->id);
|
||||
$email->addAttachment($filepath, null, $file->file->filename, $mimetype);
|
||||
$email->send();
|
||||
$this->log->info(__CLASS__."::save(): Sending Order Fileupload Email to '$to'");
|
||||
|
||||
@@ -67,9 +67,12 @@ class OrderController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
$filter = [];
|
||||
$rfilter = $this->request->filter;
|
||||
if(!$rfilter) {
|
||||
$rfilter = [];
|
||||
}
|
||||
|
||||
$this->layout->set("filter", $this->request->filter);
|
||||
$this->layout->set("filter", $rfilter);
|
||||
$filter = $this->getPreparedFilter($this->request->filter);
|
||||
|
||||
// pagination defaults
|
||||
@@ -870,6 +873,7 @@ class OrderController extends mfBaseController {
|
||||
continue;
|
||||
}
|
||||
$product_data['termination_id'] = $p['termination_id'];
|
||||
$order_termination_id = $p['termination_id'];
|
||||
} else {
|
||||
$product_data['termination_id'] = null;
|
||||
}
|
||||
@@ -922,44 +926,8 @@ class OrderController extends mfBaseController {
|
||||
if($spin && !AddressModel::search(['spin' => $spin])) {
|
||||
$owner->spin = $spin;
|
||||
if($owner->save()) {
|
||||
|
||||
// render service pin PDF
|
||||
$pdf = new PdfForm("Emailtemplates/attachments/new_order_spin.pdf", ["owner" => $owner, "order" => $order]);
|
||||
$pdfpath = $pdf->render();
|
||||
$tvalue = $pdf->getReturnedValues();
|
||||
$pdfname = $tvalue['filename'];
|
||||
|
||||
// send email to customer
|
||||
// TODO template rendern auslagern nach Emailtempate klasse
|
||||
$tpl = new Layout();
|
||||
$tpl->setTemplate("Emailtemplates/customer/new_order");
|
||||
$tpl->set("owner", $owner);
|
||||
$body = $tpl->render();
|
||||
|
||||
$values = $tpl->getReturnedValue();
|
||||
|
||||
$subject = $values['subject'];
|
||||
$from = $values['from_email'];
|
||||
$from_name = $values['from_email_name'];
|
||||
$to = $owner->email;
|
||||
|
||||
if(!$subject || !$from || !$from_name || !$to) {
|
||||
$this->log->warn("Service PIN Email not sent. (subject: '$subject', from: '$from', from_email: '$from_email', to: '$to')");
|
||||
} else {
|
||||
$email = new Emailnotification();
|
||||
$email->setSubject($subject);
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-Xinon-Oid", $order->id);
|
||||
$email->setHeader("X-Xinon-Pid", $product->id);
|
||||
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
|
||||
$email->send();
|
||||
$this->log->info(__CLASS__."::save(): Sending new SPIN for ".$owner->getCompanyOrName()." (".$owner->id.")");
|
||||
}
|
||||
|
||||
$order->sendSpinEmail();
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$this->log->debug(__CLASS__."::save(): NOT creating new SPIN for ".$owner->getCompanyOrName()." (".$owner->id."): SPIN exists or owner of Order was changed or external products");
|
||||
@@ -1217,8 +1185,24 @@ class OrderController extends mfBaseController {
|
||||
$this->redirect("Order");
|
||||
}
|
||||
|
||||
$pdf_vars = [
|
||||
'order' => $order,
|
||||
'owner' => $owner
|
||||
];
|
||||
|
||||
|
||||
if(TT_CUSTOM_ORDER_PDF_PER_NETOWNER) {
|
||||
$terms = $order->terminations;
|
||||
if(is_array($terms) && count($terms) && $terms[0]->id) {
|
||||
$netowner = $terms[0]->building->network->owner;
|
||||
} else {
|
||||
$netowner = new Address(TT_CUSTOM_ORDER_PDF_DEFAULT_OWNER_ID);
|
||||
}
|
||||
$pdf_vars['netowner'] = $netowner;
|
||||
}
|
||||
|
||||
// render service pin PDF
|
||||
$pdf = new PdfForm("Emailtemplates/attachments/new_order_spin.pdf", ["owner" => $owner, "order" => $order]);
|
||||
$pdf = new PdfForm("Emailtemplates/attachments/new_order_spin.pdf", $pdf_vars);
|
||||
$pdfpath = $pdf->render();
|
||||
$tvalue = $pdf->getReturnedValues();
|
||||
$pdfname = $tvalue['filename'];
|
||||
@@ -1246,45 +1230,13 @@ class OrderController extends mfBaseController {
|
||||
$this->redirect("Order");
|
||||
}
|
||||
|
||||
// render service pin PDF
|
||||
$pdf = new PdfForm("Emailtemplates/attachments/new_order_spin.pdf", ["owner" => $owner, "order" => $order]);
|
||||
$pdfpath = $pdf->render();
|
||||
$tvalue = $pdf->getReturnedValues();
|
||||
$pdfname = $tvalue['filename'];
|
||||
|
||||
// TODO template rendern auslagern nach Emailtempate klasse
|
||||
$tpl = new Layout();
|
||||
$tpl->setTemplate("Emailtemplates/customer/new_order");
|
||||
$tpl->set("owner", $owner);
|
||||
$body = $tpl->render();
|
||||
|
||||
$values = $tpl->getReturnedValue();
|
||||
|
||||
//var_dump($values);exit;
|
||||
|
||||
$subject = $values['subject'];
|
||||
$from = $values['from_email'];
|
||||
$from_name = $values['from_email_name'];
|
||||
$to = $owner->email;
|
||||
|
||||
if(!$subject || !$from || !$from_name || !$to) {
|
||||
$this->log->warn("Service PIN Email not sent. (subject: '$subject', from: '$from', from_email: '$from_name', to: '$to')");
|
||||
$this->layout()->setFlash("Beim Email versenden ist ein Fehler aufgetreten.", "error");
|
||||
$this->redirect("Order");
|
||||
} else {
|
||||
$email = new Emailnotification();
|
||||
$email->setSubject($subject);
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-Xinon-Oid", $order->id);
|
||||
$email->setHeader("X-Xinon-Pid", $product->id);
|
||||
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
|
||||
$email->send();
|
||||
|
||||
if($order->sendSpinEmail()) {
|
||||
$this->layout()->setFlash("Service PIN wurde erfolgreich versendet.", "success");
|
||||
$this->redirect("Order");
|
||||
} else {
|
||||
$this->layout()->setFlash("Fehler beim SPIN Versand!", "success");
|
||||
}
|
||||
|
||||
$this->redirect("Order");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class Layout extends mfLayout {
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets mfBaseModel object from Cache or gets in from DB and saves it in Cache
|
||||
* Gets mfBaseModel object from Cache or gets in from DB and saves it to Cache
|
||||
*/
|
||||
public static function getMfValuecacheObject($objectname, $id) {
|
||||
$object = mfValuecache::singleton()->get("mfObjectmodel-$objectname-".$id);
|
||||
|
||||
@@ -15,8 +15,16 @@ html {
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Dejavu Sans", dejavusans;
|
||||
font-size:13px;
|
||||
font-family: "Open Sans", "Dejavu Sans", dejavusans;
|
||||
font-size:16pt;
|
||||
height:100%;
|
||||
margin-top: 20pt;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
1
public/assets/pdf/.gitignore
vendored
Normal file
1
public/assets/pdf/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
logo-address-*.png
|
||||
BIN
public/assets/pdf/logo-andom.png
Normal file
BIN
public/assets/pdf/logo-andom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
BIN
public/assets/pdf/logo-bbaustria.png
Normal file
BIN
public/assets/pdf/logo-bbaustria.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
BIN
public/assets/pdf/logo-sknetworx.png
Normal file
BIN
public/assets/pdf/logo-sknetworx.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Reference in New Issue
Block a user