added home trench to Borderpoint image in ConstructionConsent
This commit is contained in:
@@ -331,10 +331,16 @@
|
|||||||
if(!$("#plan_adb_hausnummer_id").val()) return;
|
if(!$("#plan_adb_hausnummer_id").val()) return;
|
||||||
|
|
||||||
var building_id = $('#plan_adb_hausnummer_id').val();
|
var building_id = $('#plan_adb_hausnummer_id').val();
|
||||||
|
var type = $("#object_type").val();
|
||||||
// get plan image preview
|
// get plan image preview
|
||||||
|
|
||||||
try {
|
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) {
|
if (!response.ok) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,8 +411,8 @@ class ConstructionConsent extends mfBaseModel {
|
|||||||
END AS status_light
|
END AS status_light
|
||||||
FROM ConstructionConsent
|
FROM ConstructionConsent
|
||||||
LEFT JOIN ConstructionConsentOwner cwo ON ConstructionConsent.id = cwo.constructionconsent_id
|
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_DBNAME."`.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."`.Strasse vs ON ConstructionConsent.adb_strasse_id = vs.id
|
||||||
WHERE $where
|
WHERE $where
|
||||||
GROUP BY ConstructionConsent.id
|
GROUP BY ConstructionConsent.id
|
||||||
$having
|
$having
|
||||||
|
|||||||
@@ -766,6 +766,7 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
|
|
||||||
private function getRimoPlanPreviewApi() {
|
private function getRimoPlanPreviewApi() {
|
||||||
$adb_hausnummer_id = $this->request->building_id;
|
$adb_hausnummer_id = $this->request->building_id;
|
||||||
|
$include_home_trench = $this->request->include_home_trench ? true : false;
|
||||||
|
|
||||||
$hausnummer = new ADBHausnummer($adb_hausnummer_id);
|
$hausnummer = new ADBHausnummer($adb_hausnummer_id);
|
||||||
if(!$hausnummer->id) {
|
if(!$hausnummer->id) {
|
||||||
@@ -849,7 +850,18 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
];
|
];
|
||||||
|
|
||||||
if($hausnummer->trenches) {
|
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"] = [
|
$params["paths"] = [
|
||||||
"line_width" => 5,
|
"line_width" => 5,
|
||||||
|
|||||||
Reference in New Issue
Block a user