Merge branch 'ConstructionConsent/add-faulty-owner-view' into 'master'

added faulty owner view

See merge request fronk/thetool!1373
This commit is contained in:
Luca Haid
2025-05-20 11:45:37 +00:00
9 changed files with 506 additions and 4 deletions

View File

@@ -247,7 +247,7 @@ foreach ($owners as $owner):
<p style="margin-top: 50pt;">
<?= ($owner->title) ? $owner->title . "<br />" : "" ?>
<?= $owner->firstname ?> <?= $owner->lastname ?><br/>
<?= $owner->company ? $owner->company : $owner->firstname . ' ' . $owner->lastname ?><br/>
<?= $owner->street ?><br/>
<?php if ($owner->country): ?>
<?= $owner->zip ?> <?= $owner->city ?>

View File

@@ -2,6 +2,7 @@
$pagination_baseurl = $this->getUrl($Mod,"Index");
$pagination_baseurl_params = ["filter" => $filter];
$pagination_entity_name = "Zustimmungserklärungen";
?>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
@@ -184,6 +185,20 @@ $pagination_entity_name = "Zustimmungserklärungen";
</div>
</div>
<!-- display card if $hasFaultyEntries is true with danger class and text
"ACHTUNG: Dieses Zustimmungserklärungsprojekt enthält fehlerhafte Besitzerdaten. (BUTTON) Hier klicken um fehlerhafte Einträge zu sehen"
-->
<?php if ($hasFaultyEntries): ?>
<div class="card text-center mb-3">
<div class="card-body">
<h5 class="card-title text-danger">ACHTUNG: Dieses Zustimmungserklärungsprojekt enthält fehlerhafte Besitzerdaten.</h5>
<p class="card-text">
<a href="<?=self::getUrl("ConstructionConsent", "FaultyEntries", ["project_id" => $filter["project_id"] ?? ""])?>" class="btn btn-danger mt-2">Hier klicken, um fehlerhafte Einträge zu sehen</a>
</p>
</div>
</div>
<?php endif; ?>
<?php
// if results are more than 0
if (count($items) > 0) : ?>

View File

@@ -343,7 +343,11 @@ $pagination_entity_name = "Adressen";
</td>
<td>
<?php if($owner->company): ?>
<strong><?=$owner->company?></strong><br />
<?php else: ?>
<strong><?=($owner->title) ? $owner->title." " : ""?><?=$owner->firstname?> <?=$owner->lastname?></strong><br />
<?php endif; ?>
<?=$owner->street?><br />
<?=$owner->zip?> <?=$owner->city?><br />
<?=$owner->country?>
@@ -514,6 +518,11 @@ $pagination_entity_name = "Adressen";
<label for="title" class="col-form-label">Titel:</label>
<input type="text" class="form-control" name="title" id="title" />
</div>
<div class="form-group">
<label for="company" class="col-form-label">Firma:</label>
<input type="text" required class="form-control" name="company" id="company" />
</div>
<div class="form-group">
<label for="firnstname" class="col-form-label">Vorname:</label>
@@ -1168,10 +1177,49 @@ $pagination_entity_name = "Adressen";
}
});
});
$(document).ready(function() {
$('#company').on('input', function() {
if ($(this).val().length > 0) {
$('#firstname').prop('required', false);
$('#lastname').prop('required', false);
} else {
$('#firstname').prop('required', true);
$('#lastname').prop('required', true);
}
});
$('#firstname, #lastname').on('input', function() {
if ($('#firstname').val().length > 0 && $('#lastname').val().length > 0) {
$('#company').prop('required', false);
} else {
$('#company').prop('required', true);
}
});
const urlParams = new URLSearchParams(window.location.search);
const highlightOwnerId = urlParams.get('highlight_owner_id');
if (highlightOwnerId) {
const targetRow = document.querySelector(`#owner-data-${highlightOwnerId}`);
if (targetRow) {
targetRow.scrollIntoView({ behavior: 'smooth', block: 'center' });
targetRow.classList.add('highlight');
setTimeout(() => {
targetRow.classList.remove('highlight');
}, 1500);
}
}
})
</script>
<style>
.highlight {
background-color: #ffeb3b !important;
transition: background-color 0.5s ease;
}
/* Styles for the status circle */
.status-circle {
width: 14px;