Various Bugfixes
This commit is contained in:
@@ -198,25 +198,25 @@ class BuildingController extends mfBaseController {
|
||||
$data['lineworker_id'] = ($r->lineworker_id) ? $r->lineworker_id : null;
|
||||
$data['networksection_id'] = ($r->networksection_id) ? $r->networksection_id : null;
|
||||
|
||||
$data['oan_id'] = $r->oan_id;
|
||||
$data['street'] = $r->street;
|
||||
$data['zip'] = $r->zip;
|
||||
$data['city'] = $r->city;
|
||||
$data['oan_id'] = trim($r->oan_id);
|
||||
$data['street'] = trim($r->street);
|
||||
$data['zip'] = trim($r->zip);
|
||||
$data['city'] = trim($r->city);
|
||||
|
||||
$data['contact'] = $r->contact;
|
||||
$data['phone'] = $r->phone;
|
||||
$data['email'] = $r->email;
|
||||
$data['units'] = $r->units;
|
||||
$data['description'] = $r->description;
|
||||
$data['note'] = $r->note;
|
||||
$data['contact'] = trim($r->contact);
|
||||
$data['phone'] = trim($r->phone);
|
||||
$data['email'] = trim($r->email);
|
||||
$data['units'] = trim($r->units);
|
||||
$data['description'] = trim($r->description);
|
||||
$data['note'] = trim($r->note);
|
||||
|
||||
$data['edit_by'] = 1;
|
||||
|
||||
if($this->me->is("Admin")) {
|
||||
if($r->gps_lat) $data['gps_lat'] = $r->gps_lat;
|
||||
if($r->gps_long) $data['gps_long'] = $r->gps_long;
|
||||
if($r->code) $data['code'] = $r->code;
|
||||
if($r->laea) $data['laea'] = $r->laea;
|
||||
if($r->gps_lat) $data['gps_lat'] = trim($r->gps_lat);
|
||||
if($r->gps_long) $data['gps_long'] = trim($r->gps_long);
|
||||
if($r->code) $data['code'] = trim($r->code);
|
||||
if($r->laea) $data['laea'] = trim($r->laea);
|
||||
}
|
||||
|
||||
if($mode == "add") {
|
||||
@@ -224,13 +224,13 @@ class BuildingController extends mfBaseController {
|
||||
$building = BuildingModel::create($data);
|
||||
|
||||
// check if building exists already
|
||||
$checkBuilding = BuildingModel::search(['street' => $data['street'], 'city' => $data['city'], 'zip' => $data['zip']]);
|
||||
$checkBuilding = BuildingModel::search(['=street' => $data['street'], '=city' => $data['city'], '=zip' => $data['zip']]);
|
||||
|
||||
if($checkBuilding) {
|
||||
$this->layout()->setFlash("Objekt ist <a target='_blank' href='".self::getUrl("Building")."#building=".$checkBuilding[0]->id."'>bereits vorhanden</a>!", "error");
|
||||
$this->layout()->set("building", $building);
|
||||
return $this->add();
|
||||
}
|
||||
|
||||
} else {
|
||||
$building->update($data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user