Added product active flag, saving filter in Product/Index

This commit is contained in:
Frank Schubert
2023-02-27 19:02:23 +01:00
parent 388e8ea164
commit 4be8e91508
7 changed files with 86 additions and 15 deletions

View File

@@ -366,7 +366,7 @@ class OrderController extends mfBaseController {
$this->layout()->setTemplate("Order/Form");
if($this->me->is("Admin")) {
//$this->layout()->set("addresses", AddressModel::search(['parents_only' => 1]));
$this->layout()->set("products", ProductModel::getAll());
$this->layout()->set("products", ProductModel::getActive());
$this->layout()->set("terminations", TerminationModel::getAll());
} else {
// get all salespartner addresses of my networks
@@ -396,6 +396,7 @@ class OrderController extends mfBaseController {
// get products assigned to my networks
$products = [];
foreach(ProductNetworkModel::search(["network_id" => $network_ids]) as $pn) {
if(!$pn->product->active) continue;
if(!array_key_exists($pn->product_id, $products))
$products[$pn->product_id] = $pn->product;
}