Merge branch 'ConstructionConsent/added-skipped-additional-info' into 'master'

added new debugging

See merge request fronk/thetool!1342
This commit is contained in:
Luca Haid
2025-05-15 13:13:12 +00:00

View File

@@ -1083,11 +1083,12 @@ class ConstructionConsentController extends mfBaseController {
if (!is_numeric($projectId) || $projectId < 1) { $this->layout()->setFlash("Projekt nicht gefunden", "error"); return $this->redirect("ConstructionConsent"); }
if (!($consentProject = new ConstructionConsentProject($projectId))->id) { $this->layout()->setFlash("Projekt nicht gefunden", "error"); return $this->redirect("ConstructionConsent"); }
$counts = ["created" => 0, "updated" => 0, "skipped" => 0];
$counts = ["created" => 0, "updated" => 0, "skipped" => 0, "skippedBecauseNoConsent" => 0, "skippedBecauseAlreadyExists" => 0, "skippedBecauseFirstnameAndLastname" => 0];
foreach ($importData as $ownerData) {
$consentFilter = ["constructionconsentproject_id" => $consentProject->id, "kg" => $ownerData["KG-EZ"] ?? null, "ez" => $ownerData["EZ"] ?? null, "lnr" => $ownerData["LNR"] ?? null];
if (!($consentRecords = ConstructionConsent::search(array_filter($consentFilter)))) {
$counts["skippedBecauseNoConsent"]++;
$counts["skipped"]++; continue;
}
@@ -1102,6 +1103,7 @@ class ConstructionConsentController extends mfBaseController {
$ownerRecord->constructionconsent_id = $consentRecord->id;
$ownerRecord->create_by = $this->me->id;
} else {
$counts["skippedBecauseAlreadyExists"]++;
$counts["skipped"]++;
continue;
}
@@ -1125,6 +1127,7 @@ class ConstructionConsentController extends mfBaseController {
$ownerRecord->edit_by = $this->me->id;
if (empty($ownerRecord->firstname) && empty($ownerRecord->lastname)) {
$counts["skippedBecauseFirstnameAndLastname"]++;
$counts["skipped"]++;
continue;
}