Fix eliminazione sede

This commit is contained in:
Luca 2020-09-30 12:40:57 +02:00
parent c5a55993e7
commit a575e3f3ba
1 changed files with 17 additions and 1 deletions

View File

@ -170,7 +170,7 @@ echo '
<!-- PULSANTI --> <!-- PULSANTI -->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<button type="button" class="btn btn-danger ask '.$disabled.'" data-backto="record-edit" data-op="deletesede" data-id="'.$record['id'].'" data-id_record="'.$record['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'" > <button type="button" class="btn btn-danger '.$disabled.'" onclick="rimuoviSede(this)">
<i class="fa fa-trash"></i> '.tr('Elimina').' <i class="fa fa-trash"></i> '.tr('Elimina').'
</button> </button>
@ -181,6 +181,22 @@ echo '
echo ' echo '
<script> <script>
function rimuoviSede(button) {
let hash = window.location.href.split("#")[1];
confirmDelete(button).then(function () {
redirect(globals.rootdir + "/editor.php", {
backto: "record-edit",
hash: hash,
op: "deletesede",
id: "'.$record['id'].'",
id_plugin: "'.$id_plugin.'",
id_module: "'.$id_module.'",
id_parent: "'.$id_parent.'",
});
}).catch(swal.noop);
}
$(document).ready( function(){ $(document).ready( function(){
$("#form_sedi #geocomplete input").geocomplete({ $("#form_sedi #geocomplete input").geocomplete({
map: $("#form_sedi #map").length ? "#form_sedi #map" : false, map: $("#form_sedi #map").length ? "#form_sedi #map" : false,