Added Contractconfig Edit
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user