ont sn can now be saved in cpeprovisioning

This commit is contained in:
Frank Schubert
2021-11-16 20:33:31 +01:00
parent c63a455994
commit 8ba9dd818b
2 changed files with 16 additions and 1 deletions

View File

@@ -135,6 +135,12 @@ class CpeprovisioningController extends mfBaseController {
$this->redirect("Cpeprovisioning");
}
$orderproduct = OrderProductModel::getFirst(["order_id" => $order_id, "termination_id" => $termination_id]);
if(!$orderproduct) {
$this->layout()->setFlash("Anschluss gehört nicht zur Bestellung", "error");
$this->redirect("Cpeprovisioning");
}
$prov_data = [];
$prov_data["termination_id"] = ($r->termination_id) ? $r->termination_id : null;
$prov_data["order_id"] = $r->order_id;
@@ -207,6 +213,15 @@ class CpeprovisioningController extends mfBaseController {
}
}
// save ONT sn
if($r->ont_sn) {
$termination = new Termination($termination_id);
$orig_sn = $termination->getWorkflowvalue("ont_sn", "string");
if($r->ont_sn != $orig_sn) {
$termination->workflowitems["ont_sn"]->value->setValue($r->ont_sn);
$termination->workflowitems["ont_sn"]->value->save();
}
}