added home trench to Borderpoint image in ConstructionConsent

This commit is contained in:
Frank Schubert
2025-02-26 15:29:00 +01:00
parent f8d8ef3364
commit a7a4f05f1f
3 changed files with 22 additions and 4 deletions

View File

@@ -331,10 +331,16 @@
if(!$("#plan_adb_hausnummer_id").val()) return;
var building_id = $('#plan_adb_hausnummer_id').val();
var type = $("#object_type").val();
// get plan image preview
try {
var response = await fetch('<?=self::getUrl("ConstructionConsent", "Api", ["do" => "getRimoPlanPreview"])?>&building_id=' + building_id);
var response;
if(type == "building" ) {
response = await fetch('<?=self::getUrl("ConstructionConsent", "Api", ["do" => "getRimoPlanPreview"])?>&building_id=' + building_id + '&include_home_trench=1');
} else {
response = await fetch('<?=self::getUrl("ConstructionConsent", "Api", ["do" => "getRimoPlanPreview"])?>&building_id=' + building_id);
}
if (!response.ok) {
return false;
}

View File

@@ -411,8 +411,8 @@ class ConstructionConsent extends mfBaseModel {
END AS status_light
FROM ConstructionConsent
LEFT JOIN ConstructionConsentOwner cwo ON ConstructionConsent.id = cwo.constructionconsent_id
LEFT JOIN addressdb.view_hausnummer vh ON ConstructionConsent.adb_hausnummer_id = vh.hausnummer_id
LEFT JOIN addressdb.Strasse vs ON ConstructionConsent.adb_strasse_id = vs.id
LEFT JOIN `".ADDRESSDB_DBNAME."`.view_hausnummer vh ON ConstructionConsent.adb_hausnummer_id = vh.hausnummer_id
LEFT JOIN `".ADDRESSDB_DBNAME."`.Strasse vs ON ConstructionConsent.adb_strasse_id = vs.id
WHERE $where
GROUP BY ConstructionConsent.id
$having

View File

@@ -766,6 +766,7 @@ class ConstructionConsentController extends mfBaseController {
private function getRimoPlanPreviewApi() {
$adb_hausnummer_id = $this->request->building_id;
$include_home_trench = $this->request->include_home_trench ? true : false;
$hausnummer = new ADBHausnummer($adb_hausnummer_id);
if(!$hausnummer->id) {
@@ -849,7 +850,18 @@ class ConstructionConsentController extends mfBaseController {
];
if($hausnummer->trenches) {
$trenches = json_decode($hausnummer->trenches);
$trenches = [];
if($include_home_trench && $hausnummer->home_trench) {
$trenches = [json_decode($hausnummer->home_trench)];
}
$street_trenches = json_decode($hausnummer->trenches);
foreach($street_trenches as $t) {
if(is_array($t) && count($t)) {
$trenches[] = $t;
}
}
$this->log->debug(print_r($trenches, true));
$params["paths"] = [
"line_width" => 5,