Added Contractconfig Edit

This commit is contained in:
Frank Schubert
2022-12-15 20:48:48 +01:00
parent fc67cd133f
commit 9149a0f2cd
16 changed files with 374 additions and 103 deletions

View File

@@ -77,9 +77,6 @@ class ProductgroupController extends mfBaseController {
$this->layout()->setFlash("Produktgruppe nicht gefunden", "error");
$this->redirect("Productgroup");
}
} else {
$mode = "add";
$group = new Productgroup();
}
$name = trim($r->name);
@@ -88,7 +85,14 @@ class ProductgroupController extends mfBaseController {
$this->redirect("Productgroup");
}
$group->name = $r->name;
$group_data = [];
$group_data['name'] = $name;
if($mode == "edit") {
$group->update($group_data);
} else {
$group = ProductgroupModel::create(['name' => $name]);
}
$id = $group->save();
if(!$id) {