From 3d7bc55302ea965299fa090122f8b32ee5212791 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Wed, 9 Apr 2025 21:35:02 +0200 Subject: [PATCH] improved patching --- Layout/default/Patching/Index.php | 623 ++++++++++++++------ Layout/default/header.php | 5 + application/Patching/PatchingController.php | 10 +- public/assets/pwa/patching-manifest.json | 16 + public/assets/pwa/patching-sw.js | 9 + 5 files changed, 477 insertions(+), 186 deletions(-) create mode 100644 public/assets/pwa/patching-manifest.json create mode 100644 public/assets/pwa/patching-sw.js diff --git a/Layout/default/Patching/Index.php b/Layout/default/Patching/Index.php index 168dfbf56..981a0e3d1 100644 --- a/Layout/default/Patching/Index.php +++ b/Layout/default/Patching/Index.php @@ -1,198 +1,451 @@ getUrl($Mod,"Index"); - $pagination_baseurl_params = ["filter" => $filter]; - $pagination_entity_name = "Patchungen"; - - if(!is_array($filter)) $filter = []; +// --- Configuration --- +$pagination_baseurl = $this->getUrl($Mod,"Index"); +$pagination_baseurl_params = ["filter" => $filter]; // Filters passed via GET +$pagination_entity_name = "Patchungen"; + +// Ensure $filter is always an array +if(!is_array($filter)) { + $filter = []; +} + +// Helper function for safe output (assuming not already handled by framework/template engine) +function e($string) { + return htmlspecialchars($string ?? '', ENT_QUOTES, 'UTF-8'); +} + +$additionalHead = [ + '' +]; + ?> -
-
-
-
- -
-

Patchungen

+
+
+
+ +
+

Patchungen

+
-
- -
-
- -
-
-

Filter

- -
"> -
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- - - - -
-
-
- - ">Filter zurücksetzen -
-
-
- -
-
- - -
-
-

Patchungen

+
- - +
+
+

Filter

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StandortODFAbschluss/Device
NetzgebietPOPKundeStandortPatchposition ODFODF PortTypSplitter / GerätPortGepatchedVon
building->network->name?> - getPop()): ?> - getPop()->name?> - - building->pop->name?> - - order->owner) ? $term->order->owner->customer_number : ""?>
order->owner) ? $term->order->owner->getCompanyOrName() : ""?>
- building->street?>
- building->zip?> building->city?> -
value->id) ? $term->workflowitems["ist_schrank"]->value->value_string : $term->workflowitems["schrank"]->value->value_string?> / Einschub: workflowitems["ist_baugruppe"]->value->id) ? $term->workflowitems["ist_baugruppe"]->value->value_string : $term->workflowitems["baugruppe"]->value->value_string?> / Modul: workflowitems["ist_modul"]->value->id) ? $term->workflowitems["ist_modul"]->value->value_string : $term->workflowitems["modul"]->value->value_string?> / Port: workflowitems["ist_ports"]->value->id) ? $term->workflowitems["ist_ports"]->value->value_string : $term->workflowitems["ports"]->value->value_string?>"> - workflowitems["ist_schrank"]->value->id) ? $term->workflowitems["ist_schrank"]->value->value_string : $term->workflowitems["schrank"]->value->value_string?> / - workflowitems["ist_baugruppe"]->value->id) ? $term->workflowitems["ist_baugruppe"]->value->value_string : $term->workflowitems["baugruppe"]->value->value_string?> / - workflowitems["ist_modul"]->value->id) ? $term->workflowitems["ist_modul"]->value->value_string : $term->workflowitems["modul"]->value->value_string?> / - workflowitems["ist_ports"]->value->id) ? $term->workflowitems["ist_ports"]->value->value_string : $term->workflowitems["ports"]->value->value_string?> - - - - - patching->patched == 1) ? "checked='checked'" : ""?> />patching->patched == 1 && $term->patching->patched_by) ? "title='Gepatched: ".date("d.m.Y H:i",$term->patching->patched_date)." von ".$term->patching->patcher->name." (".$term->patching->patcher->address->getCompanyOrName(true).")'" : ""?>> - - patching->patched == 1 && $term->patching->patched_by): ?> - patching->patcher) ? $term->patching->patcher->getAbbrName() : ""?> - - -
$pagination['start'], "filter" => $filter])?>"> - - -
-
- - - -
+
"> +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + ">Filter zurücksetzen +
+
+
+ +
+
+
+
+

Patchungen

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + workflowitems ?? []; + $istSchrankValue = $wfItems["ist_schrank"]->value ?? null; + $schrankValue = $wfItems["schrank"]->value ?? null; + $istBaugruppeValue = $wfItems["ist_baugruppe"]->value ?? null; + $baugruppeValue = $wfItems["baugruppe"]->value ?? null; + $istModulValue = $wfItems["ist_modul"]->value ?? null; + $modulValue = $wfItems["modul"]->value ?? null; + $istPortsValue = $wfItems["ist_ports"]->value ?? null; + $portsValue = $wfItems["ports"]->value ?? null; + + $schrank = ($istSchrankValue && $istSchrankValue->id) ? $istSchrankValue->value_string : ($schrankValue ? $schrankValue->value_string : ''); + $baugruppe = ($istBaugruppeValue && $istBaugruppeValue->id) ? $istBaugruppeValue->value_string : ($baugruppeValue ? $baugruppeValue->value_string : ''); + $modul = ($istModulValue && $istModulValue->id) ? $istModulValue->value_string : ($modulValue ? $modulValue->value_string : ''); + $ports = ($istPortsValue && $istPortsValue->id) ? $istPortsValue->value_string : ($portsValue ? $portsValue->value_string : ''); + + $odfPositionTitle = "Schrank: " . e($schrank) . " / Einschub: " . e($baugruppe) . " / Modul: " . e($modul) . " / Port: " . e($ports); + $odfPositionDisplay = e($schrank) . " / " . e($baugruppe) . " / " . e($modul) . " / " . e($ports); + + // Patched By Info + $patching = $term->patching ?? null; + $patcher = $patching ? ($patching->patcher ?? null) : null; + $patchedByTitle = ''; + $patchedByDisplay = ''; + if ($patching && $patching->patched == 1 && $patching->patched_by && $patcher) { + $patcherName = $patcher->name ?? 'Unbekannt'; + $patcherCompany = $patcher->address ? $patcher->address->getCompanyOrName(true) : 'N/A'; + $patchedDate = date("d.m.Y H:i", $patching->patched_date); + $patchedByTitle = "Gepatched: {$patchedDate} von " . e($patcherName) . " (" . e($patcherCompany) . ")"; + $patchedByDisplay = $patcher->getAbbrName() ?? ''; + } + + // Customer Info + $customer = $term->order->owner ?? null; + $customerNumber = $customer ? $customer->customer_number : ''; + $customerName = $customer ? $customer->getCompanyOrName() : ''; + + // Location Info + $building = $term->building ?? null; + $networkName = $building ? ($building->network->name ?? '') : ''; + $popName = ''; + $termPop = $term->getPop(); // Call potentially expensive method once + if ($termPop) { + $popName = $termPop->name ?? ''; + } elseif ($building && $building->pop) { + $popName = $building->pop->name ?? ''; + } + $street = $building->street ?? ''; + $zip = $building->zip ?? ''; + $city = $building->city ?? ''; + + // Linework Ports + $lineworkPorts = $term->getLineworkportPairs() ?? []; + $currentLineworkPort = $patching ? $patching->linework_ports : null; + + // Device Info + $deviceType = $patching ? $patching->device_type : ''; + $deviceName = $patching ? $patching->device_name : ''; + $devicePort = $patching ? $patching->device_port : ''; + $isPatched = $patching ? ($patching->patched == 1) : false; + ?> + + + + + + + + + + + + + + + + +
StandortODFAbschluss/DeviceAktion
NetzgebietPOP Kunde Standort Patchposition ODF ODF Port Typ Splitter / Gerät Port GepatchedVon Speichern

+
+ +
+ + + + + + + + /> + > + + +
$pagination['start'] ?? 0, "filter" => $filter]))?>"> + + +
+
+
+ + + + + +
+
- -
- + + + + + + + + \ No newline at end of file diff --git a/Layout/default/header.php b/Layout/default/header.php index 069de122c..45dc81f9b 100644 --- a/Layout/default/header.php +++ b/Layout/default/header.php @@ -75,6 +75,11 @@ + + + +