Merge branch 'fronkdev2' into 'master'
Preorder AHA Report Download See merge request fronk/thetool!703
This commit is contained in:
@@ -830,14 +830,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);
|
||||
}
|
||||
|
||||
@@ -1041,5 +1043,38 @@
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
async function downloadWorkorderAha(workorder_id) {
|
||||
if(!workorder_id) return false;
|
||||
|
||||
var filename;
|
||||
|
||||
await fetch('<?=self::getUrl("RimoWorkorder", "downloadAha")?>?id=' + workorder_id)
|
||||
.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;
|
||||
}
|
||||
return resp.blob();
|
||||
})
|
||||
.then(blob => {
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.style.display = 'none';
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
window.notify("success", "Download gestartet...");
|
||||
})
|
||||
.catch(() => {
|
||||
window.notify("error", "Fehler beim Download des AH-Blatts");
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user