wip
This commit is contained in:
1 parent
bf8deeadde
commit
1963d6fcce
3 files changed
+17
-2
No files matched your search
@@ -11,11 +11,17 @@ class ImportAllgemeinDirect
|
|||||||
{
|
{
|
||||||
$data = explode(PHP_EOL, $data['upload_data']);
|
$data = explode(PHP_EOL, $data['upload_data']);
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
$new = 0;
|
$new = 0;
|
||||||
foreach ($data as $row) {
|
foreach ($data as $row) {
|
||||||
$row = str_replace(';', '|', $row);
|
$row = str_replace(';', '|', $row);
|
||||||
$cells = explode('|', $row);
|
$cells = explode('|', $row);
|
||||||
|
|
||||||
|
if (\count($cells) != 4) {
|
||||||
|
$error = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$geschoss = trim($cells[1]);
|
$geschoss = trim($cells[1]);
|
||||||
$raumart = trim($cells[2]);
|
$raumart = trim($cells[2]);
|
||||||
$flaeche = (float) str_replace(',', '.', trim($cells[3]));
|
$flaeche = (float) str_replace(',', '.', trim($cells[3]));
|
||||||
@@ -31,6 +37,14 @@ class ImportAllgemeinDirect
|
|||||||
$new++;
|
$new++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($error) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Fehlerbeim Import')
|
||||||
|
->body('Daten konnten nicht in vier Spalten aufgeteilt werden. Falscher Separator?')
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
} else {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Allgemeinflächen wurden erfolgreich importiert')
|
->title('Allgemeinflächen wurden erfolgreich importiert')
|
||||||
->body($new.' wurden Flächen hinzugefügt')
|
->body($new.' wurden Flächen hinzugefügt')
|
||||||
@@ -45,3 +59,4 @@ class ImportAllgemeinDirect
|
|||||||
->sendToDatabase($recipient);
|
->sendToDatabase($recipient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -87,7 +87,7 @@ class ProjektAllgemeinflaechensRelationManager extends RelationManager
|
|||||||
->color('info')
|
->color('info')
|
||||||
->label('Hochladen')
|
->label('Hochladen')
|
||||||
->modalHeading('Allgemeinflächen hochladen')
|
->modalHeading('Allgemeinflächen hochladen')
|
||||||
->modalDescription(new HtmlString('<b>Objekte werden immer hinzugefügt!</b><br/>Spalten-Separator ist der Strichpunkt ";" oder die Pfeife "|"'))
|
->modalDescription(new HtmlString('<b>Objekte werden immer hinzugefügt!</b><br/>Spalten Separator:<br/>Strichpunkt ";" oder Pfeife "|"<br/>Immer vier Spalten verwenden, erste Spalte wird ignoriert.<br/><br/>Beispiel:<br/>Allgemein | EG | Eingang | 15,35<br/>Allgemein | EG | Eingang/ Stiegenhaus | 27,16'))
|
||||||
->schema([
|
->schema([
|
||||||
Textarea::make('upload_data')
|
Textarea::make('upload_data')
|
||||||
->required()
|
->required()
|
||||||
|
|||||||
+1
-1
@@ -148,7 +148,7 @@ class ProjektObjekteImDetailRelationManager extends RelationManager
|
|||||||
->color('info')
|
->color('info')
|
||||||
->label('Hochladen')
|
->label('Hochladen')
|
||||||
->modalHeading('Objekte im Detail hochladen')
|
->modalHeading('Objekte im Detail hochladen')
|
||||||
->modalDescription(new HtmlString('<b>Objekte werden immer hinzugefügt!</b><br/>Spalten-Separator ist der Strichpunkt ";" oder die Pfeife "|"'))
|
->modalDescription(new HtmlString('<b>Objekte werden immer hinzugefügt!</b><br/>Spalten Separator:<br/>Strichpunkt ";" oder Pfeife "|"<br/>Immer vier Spalten verwenden.<br/><br/>Beispiel:<br/>"APG 01";"UG ";"Stellplatz+ ";"14,25"<br/>"APG 02";"UG ";"Stellplatz";"12,94"'))
|
||||||
->schema([
|
->schema([
|
||||||
Textarea::make('upload_data')
|
Textarea::make('upload_data')
|
||||||
->required()
|
->required()
|
||||||
|
|||||||
Reference in new issue
Block a user