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