This commit is contained in:
Frank Schubert
2024-11-07 16:28:05 +01:00
parent bb02b67696
commit 6c0d334bbc
33 changed files with 172284 additions and 30 deletions
+38 -2
View File
@@ -725,14 +725,16 @@
if(trenches) {
trenches.forEach((trench) => {
var trench_line = L.polyline(trench, {
color: "limegreen"
color: "maroon",
weight: 7
}).addTo(map);
});
}
if(home_trench) {
var home_line = L.polyline(home_trench, {
color: "aqua"
color: "blue",
weight: 7
}).addTo(map);
}
@@ -936,5 +938,39 @@
return false;
}
function downloadWorkorderAh(workorder_id) {
if(!workorder_id) return false;
var filename;
fetch('<?=self::getUrl("RimoWorkorder", "downloadAh")?>')
.then(resp => {
const header = resp.headers.get("Content-disposition");
let matches = header.match(/filename=['"]?([^'"]+)/i);
filename = matches[1];
if(!filename) {
window.notify("error", "Fehler beim Download des AH-Blatts");
return false;
}
resp.blob()
})
.then(blob => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
// the filename you want
a.download = filename;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
window.notify("success", "Download gestartet...");
//alert('your file has downloaded!'); // or you know, something with better UX...
})
.catch(() => window.notify("Fehler beim Download des AH-Blatts"));
}
</script>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>