From 3b4200de52ef8b342a8fc6e7c53d104cd3169b94 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 14 Apr 2025 11:12:44 +0200 Subject: [PATCH] added pipework history job --- application/Building/BuildingModel.php | 3 ++- scripts/pipework/run-weekly-email.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/Building/BuildingModel.php b/application/Building/BuildingModel.php index 4c3cf5186..a408f8a93 100644 --- a/application/Building/BuildingModel.php +++ b/application/Building/BuildingModel.php @@ -282,6 +282,7 @@ class BuildingModel { b.city AS building_city, wi.id AS item_id, wi.name AS item_name, + wi.num AS item_num, wi.label AS item_label, wi.type AS item_type, wv.id AS value_id, @@ -293,7 +294,7 @@ class BuildingModel { FROM Workflowvalue wv JOIN Workflowitem wi ON wv.item_id = wi.id JOIN Building b ON wv.object_id = b.id"; - $where = ["wi.object_type = 'Building'", "wi.num < 150"]; + $where = ["wi.object_type = 'Building'", "wi.name NOT LIKE '%delimiter%'"]; if ($from !== null && $to !== null) { $where[] = "(wv.changed >= " . intval($from) . " AND wv.changed <= " . intval($to) . ")"; diff --git a/scripts/pipework/run-weekly-email.php b/scripts/pipework/run-weekly-email.php index 9be27cc6f..d48c21052 100644 --- a/scripts/pipework/run-weekly-email.php +++ b/scripts/pipework/run-weekly-email.php @@ -143,6 +143,7 @@ HTML; Ort Feld Wert + Doku Editiert Von @@ -185,6 +186,7 @@ HTML; $city = htmlspecialchars($item->building_city ?? 'N/A'); $label = htmlspecialchars($item->item_label ?? 'N/A'); $editedAt = date("d.m.Y H:i", $item->last_edited_at); // Shortened format for space + $type = intval($item->item_num) > 150 ? 'Ist-Zustand' : 'Planung'; $html .= << @@ -192,6 +194,7 @@ HTML; {$city} {$label} {$valueDisplay} + {$type} {$editedAt} {$userName} @@ -253,7 +256,7 @@ try { // Recipients $mail->setFrom('thetool@xinon.at', 'XINON TheTool'); // Use sender address from config if available - $mail->addAddress('mark.zaff@xinon.eu', 'Mark Zaff'); + $mail->addAddress('mark.zaff@xinon.eu', 'Mark Zaff'); $mail->addAddress('luca.haid@xinon.eu', 'Luca Haid'); // Content