Added internal billing NBE email for external products
This commit is contained in:
@@ -227,6 +227,38 @@ class Order extends mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
public function sendExtBillNbeInfoEmail() {
|
||||
// TODO template rendern auslagern nach Emailtempate klasse
|
||||
$tpl = new Layout();
|
||||
$tpl->setTemplate("Emailtemplates/order/exernal_product_nbe_billing");
|
||||
$tpl->set("order", $this);
|
||||
$body = $tpl->render();
|
||||
|
||||
$values = $tpl->getReturnedValue();
|
||||
|
||||
//var_dump($values); echo "<pre class='text-monospace'>".$body."</pre>"; exit;
|
||||
|
||||
$subject = $values['subject'];
|
||||
$from = $values['from_email'];
|
||||
$from_name = $values['from_email_name'];
|
||||
$to = TT_INTERNAL_BILLING_EMAIL_TO;
|
||||
|
||||
if(!$subject || !$from || !$from_name || !$to) {
|
||||
$this->log->warn("Billing NBE Email not sent. (subject: '$subject', from: '$from', from_email: '$from_name', to: '$to')");
|
||||
return false;
|
||||
} 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->send();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function sendFileuploadEmail(OrderFile $file) {
|
||||
$filetype = $file->name;
|
||||
|
||||
|
||||
@@ -1020,6 +1020,9 @@ class OrderController extends mfBaseController {
|
||||
if(!$order->sendExtBillinfoEmail(new Address($ext_product_owner_id))) {
|
||||
$this->layout()->setFlash("Beim Senden der externen Billing Benachrichtigung ist ein Fehler aufgetreten.", "warning");
|
||||
}
|
||||
if(!$order->sendExtBillNbeInfoEmail(new Address($ext_product_owner_id))) {
|
||||
$this->layout()->setFlash("Beim Senden der internen Billing NBE Benachrichtigung ist ein Fehler aufgetreten.", "warning");
|
||||
}
|
||||
}
|
||||
|
||||
if($int_products) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
class Product extends mfBaseModel {
|
||||
private $owner;
|
||||
private $productgroup;
|
||||
private $producttech;
|
||||
private $sla;
|
||||
@@ -45,6 +46,12 @@ class Product extends mfBaseModel {
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "owner") {
|
||||
if(!$this->external_id) return null;
|
||||
$this->owner = new Address($this->external_id);
|
||||
return $this->owner;
|
||||
}
|
||||
|
||||
if($name == "networks") {
|
||||
$this->networks = [];
|
||||
$productNetworks = ProductNetworkModel::search(['product_id' => $this->id]);
|
||||
|
||||
@@ -32,7 +32,7 @@ class ProductController extends mfBaseController {
|
||||
$filter = $_SESSION[MFAPPNAME.'-Product-filter'];
|
||||
}
|
||||
}
|
||||
//var_dump($filter);
|
||||
|
||||
$this->layout->set("filter", $filter);
|
||||
$filter = $this->getPreparedFilter($filter);
|
||||
|
||||
@@ -46,7 +46,7 @@ class ProductController extends mfBaseController {
|
||||
if(is_numeric($this->request->s)) {
|
||||
$pagination['start'] = intval($this->request->s);
|
||||
}
|
||||
//var_dump($filter);exit;
|
||||
|
||||
$pagination['maxItems'] = ProductModel::count($filter);
|
||||
$this->layout()->set("pagination", $pagination);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user