can delete Consent plan file / added empty page in Consentform.pdf
This commit is contained in:
@@ -269,6 +269,8 @@
|
||||
<p>Energie Steiermark Breitband GmbH</p>
|
||||
</div>
|
||||
|
||||
<div class="page"> </div>
|
||||
|
||||
<div class="page">
|
||||
|
||||
<p class="text-right">
|
||||
@@ -410,7 +412,7 @@
|
||||
<div class="borderpoint">
|
||||
<h3>Übersichtsplan / Planskizze</h3>
|
||||
|
||||
<?php if($consent->file): ?>
|
||||
<?php if($consent->file && $consent->file->file_id && $consent->file->file->fileExists()): ?>
|
||||
<img src="<?=$consent->file->file->asDataUrl()?>" style="max-width: 640px; max-height: 640px; border: 1px solid #000" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -201,18 +201,10 @@
|
||||
|
||||
|
||||
<div class="card">
|
||||
<h5 class="card-header">Plan Vorschau</h5>
|
||||
<h5 class="card-header">Plan Vorschau <button type='button' id="delete-rimo-plan" class='ml-2 btn btn-sm btn-outline-danger pointer <?=($item->file && $item->file->file && $item->file->file->fileExists()) ? "" : "hidden" ?>' onclick='deletePlan()'><i class='fas fa-fw fa-trash'></i> Plan löschen</button></h5>
|
||||
<div class="card-body" id="rimo-plan-container">
|
||||
<input type="hidden" name="submit_plan_file_id" id="submit_plan_file_id" value="" />
|
||||
<img id="plan_preview" style="max-width: 1200px;" <?=($item->file) ? "src=".$item->file->file->asDataUrl()."" : "" ?> />
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<button type="button" class="btn btn-outline-danger hidden" id="delete-rimo-plan" onclick="deleteRimoPlan()">
|
||||
<i class="far fa-fw fa-trash-alt"></i> Plan löschen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img id="plan_preview" style="max-width: 1200px;" <?=($item->file && $item->file->file && $item->file->file->fileExists()) ? "src=".$item->file->file->asDataUrl()."" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -369,6 +361,7 @@
|
||||
var [file] = $("#consent_plan_image").prop("files");
|
||||
if(file) {
|
||||
$("#plan_preview").attr("src", URL.createObjectURL(file));
|
||||
$("#delete-rimo-plan").show();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -377,11 +370,19 @@
|
||||
$("#adb_strasse_id").val("").change();
|
||||
});
|
||||
|
||||
function deleteRimoPlan() {
|
||||
$('#plan_adb_hausnummer_id').val("");
|
||||
$("#submit_plan_file_id").val();
|
||||
function deletePlan() {
|
||||
$('#plan_adb_hausnummer_id').val("").change();
|
||||
$("#submit_plan_file_id").val("");
|
||||
$("#plan_preview").attr("src", "");
|
||||
$("#delete-rimo-plan").hide();
|
||||
$("#consent_plan_image").val("");
|
||||
|
||||
<?php if(isset($item) && $item->id): ?>
|
||||
$.post("<?=self::getUrl("ConstructionConsent", "api")?>", {
|
||||
do: "deleteRimoPlan",
|
||||
id: <?=$item->id?>
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -489,6 +489,9 @@ class ConstructionConsentController extends mfBaseController {
|
||||
case "saveCheckbox":
|
||||
$return = $this->saveCheckboxApi();
|
||||
break;
|
||||
case "deleteRimoPlan":
|
||||
$return = $this->deleteRimoPlanApi();
|
||||
break;
|
||||
default:
|
||||
$this->log->warn(__METHOD__ . ": Called API function '$do' does not exist");
|
||||
$return = false;
|
||||
@@ -889,9 +892,17 @@ class ConstructionConsentController extends mfBaseController {
|
||||
|
||||
}
|
||||
|
||||
private function saveRimoPlanPreviewApi() {
|
||||
$adb_hausnummer_id = $this->request->building_id;
|
||||
$consent_id = $this->request->constructionconsent_id;
|
||||
private function deleteRimoPlanApi() {
|
||||
$consent_id = $this->request->id;
|
||||
|
||||
$consent = new ConstructionConsent($consent_id);
|
||||
if(!$consent->id) return false;
|
||||
|
||||
if($consent->file && $consent->file->file_id) {
|
||||
$consent->file->delete();
|
||||
}
|
||||
|
||||
return ["message" => "Plan deleted successfully"];
|
||||
}
|
||||
|
||||
private function saveCheckboxApi() {
|
||||
|
||||
@@ -29,6 +29,8 @@ class Mapbox_StaticImageApi {
|
||||
$pin_part .= "+$pin_color($pin_gps_long,$pin_gps_lat)";
|
||||
}
|
||||
|
||||
$initial_path_count = 0;
|
||||
$path_count = 0;
|
||||
$path_parts = [];
|
||||
if(is_array($paths) && count($paths)) {
|
||||
$path_stroke_width = $paths["line_width"];
|
||||
@@ -37,8 +39,8 @@ class Mapbox_StaticImageApi {
|
||||
$path_fill_color = $paths["line_fill_color"];
|
||||
$path_fill_opacity = $paths["line_fill_opacity"];
|
||||
|
||||
$path_count = 0;
|
||||
$initial_path_count = 0;
|
||||
|
||||
|
||||
foreach($paths["coords"] as $path) {
|
||||
$initial_path_count++;
|
||||
//mfLoghandler::singleton()->debug(print_r($paths, true));
|
||||
@@ -101,7 +103,7 @@ class Mapbox_StaticImageApi {
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($url_opt_parts)) {
|
||||
if(is_array($url_opt_parts) && count($url_opt_parts)) {
|
||||
$url .= "/".implode(",", $url_opt_parts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user