Fixed saving ConstructionConsentOwner in History
This commit is contained in:
@@ -43,7 +43,7 @@ class ConstructionConsentOwner extends mfBaseModel {
|
||||
foreach($changed as $field) {
|
||||
$this->log->debug(__METHOD__ . ": $field changed from '" . $this->_old_data->$field . "' to '" . $this->data->$field . "'");
|
||||
$history = ConstructionConsentHistory::create([
|
||||
"constructionconsent_id" => $this->id,
|
||||
"constructionconsent_id" => $this->constructionconsent_id,
|
||||
"key" => "owner-".$this->id."-$field",
|
||||
"old_value" => $this->_old_data->$field,
|
||||
"new_value" => $this->data->$field
|
||||
|
||||
@@ -122,11 +122,13 @@ class ConstructionConsentOwnerController extends mfBaseController
|
||||
if(!$item->save()) {
|
||||
$this->layout()->setFlash("Beim Speichern ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.", "error");
|
||||
} else {
|
||||
if($mode == "add") {
|
||||
$journal = ConstructionConsentJournal::create([
|
||||
"constructionconsent_id" => $cc->id,
|
||||
"text" => "Eigentümer " . ($item->company ? $item->company : $item->firstname . " " . $item->lastname) . " wurde hinzugefügt"
|
||||
]);
|
||||
$journal->save();
|
||||
}
|
||||
|
||||
$this->layout()->setFlash("Besitzer wurde erfolgreich gespeichert.", "success");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user