Fixed saving edit_by in some Controllers

This commit is contained in:
Frank Schubert
2025-01-24 15:04:24 +01:00
parent 22bd84663a
commit 39cf386638
53 changed files with 556 additions and 61 deletions

View File

@@ -28,8 +28,18 @@ class Building extends mfBaseModel {
return $address;
}
protected function afterSave() {
protected function beforeUpdate($data) {
if(!array_key_exists("edit_by", $data)) {
$me = new User();
$me->loadMe();
$data["edit_by"] = $me->id;
}
return $data;
}
protected function afterSave() {
if($this->in_after_save) return true;
$this->in_after_save++;

View File

@@ -216,8 +216,6 @@ class BuildingController extends mfBaseController {
$data['description'] = trim($r->description);
$data['note'] = trim($r->note);
$data['edit_by'] = 1;
if($this->me->is(["Admin", "netowner"])) {
if($r->gps_lat) $data['gps_lat'] = trim($r->gps_lat);
if($r->gps_long) $data['gps_long'] = trim($r->gps_long);