Added termination select to Product/Form

This commit is contained in:
Frank Schubert
2021-07-30 20:03:24 +02:00
parent ec0abff225
commit 0a5e447587
11 changed files with 249 additions and 28 deletions

View File

@@ -63,10 +63,10 @@ class ProductController extends mfBaseController {
$data['description'] = $r->description;
$data['sla_id'] = $r->sla_id;
$data['external'] = ($r->external == 1) ? "1" : "0";
$data['price_nne'] = Layout::commaToDot($r->price_nne);
$data['price_nbe'] = Layout::commaToDot($r->price_nbe);
$data['price'] = Layout::commaToDot($r->price);
$data['price_setup'] = Layout::commaToDot($r->price_setup);
$data['price_nne'] = ($data['price_nne']) ? Layout::commaToDot($r->price_nne) : 0;
$data['price_nbe'] = ($data['price_nbe']) ? Layout::commaToDot($r->price_nbe) : 0;
$data['price'] = ($data['price']) ? Layout::commaToDot($r->price) : 0;
$data['price_setup'] = ($data['price_setup']) ? Layout::commaToDot($r->price_setup) : 0;
$data['billing_period'] = $r->billing_period;
$data['billing_delay'] = $r->billing_delay;
$data['ivt_id'] = ($r->ivt_id) ? $r->ivt_id : null;
@@ -215,6 +215,15 @@ class ProductController extends mfBaseController {
if(!$product->id) {
return false;
}
if(is_array($product->attributes) && count($product->attributes)) {
$attributes = $product->attributes;
$product->data->attributes = [];
foreach($attributes as $attrib) {
$product->data->attributes[$attrib->name] = $attrib->value;
}
}
return ["product" => $product->data, "form_id" => $form_id];
}