	Standortinformationen hinzugefügt (Wenn keine Pop ausgewählt)
	Umschaltbar Adresse/Koordinaten
	Adresse: Straße/Hausnummer/PLZ/Ort
	Huawei Backups Implementation
This commit is contained in:
Spitzer_Daniel
2023-04-06 15:53:33 +02:00
parent 214c0683e6
commit 73291d8ee0
6 changed files with 232 additions and 36 deletions

View File

@@ -100,6 +100,26 @@ class DeviceController extends mfBaseController
} else {
$data['pop_id'] = $r->pop_id;
}
if (!(trim($r->addr_street))) {
$data['addr_street'] = NULL;
$data['addr_number'] = NULL;
$data['addr_extended'] = NULL;
$data['addr_zip'] = NULL;
$data['addr_city'] = NULL;
} else {
$data['addr_street'] = $r->addr_street;
$data['addr_number'] = $r->addr_number;
$data['addr_extended'] = $r->addr_extended;
$data['addr_zip'] = $r->addr_zip;
$data['addr_city'] = $r->addr_city;
}
if (!trim($r->gps_lat) || !trim($r->gps_long)) {
$data['gps_lat'] = NULL;
$data['gps_long'] = NULL;
} else {
$data['gps_lat'] = $r->gps_lat;
$data['gps_long'] = $r->gps_long;
}
$data['ip'] = $r->ip;
$data['mac'] = $r->mac;
$data['serial'] = $r->serial;
@@ -216,6 +236,19 @@ class DeviceController extends mfBaseController
}
protected function deleteAction()
{
$id = $this->request->id;
$device = new Device($id);
if (!$device->id || $device->id != $id) {
$this->layout()->setFlash("Gerätetyp nicht gefunden.", "error");
$this->redirect("Device");
}
$device->delete();
$this->redirect("Device");
}
private function getConfig($id, $format, $filename)
{
$configDownload = DeviceModel::getconifgdownload($id, $format);
@@ -234,13 +267,10 @@ class DeviceController extends mfBaseController
$r = $this->request;
$id = $r->id;
$createConfig = DeviceModel::configcreate($ip);
if ($createConfig->success==="true")
{
if ($createConfig->success === "true") {
$this->layout()->setFlash("Backup wurde erfolgreich erstellt", "success");
}
else
{
$this->layout()->setFlash("Backup konnte nicht erstellt werden. <b>Fehler</b>: ".$createConfig->error, "error");
} else {
$this->layout()->setFlash("Backup konnte nicht erstellt werden. <b>Fehler</b>: " . $createConfig->error, "error");
}
$returnUrl = "Device";
$returnAction = "Detail";