mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 17:07:01 +01:00
Fix eliminazione Sedi
This commit is contained in:
parent
bea56fb585
commit
d1817d8e29
@ -185,6 +185,17 @@ function setContrast(backgroundcolor) {
|
||||
}
|
||||
}
|
||||
|
||||
function confirmDelete(button, title, message) {
|
||||
return swal({
|
||||
title: title ? title : globals.translations.deleteTitle,
|
||||
html: message ? message : globals.translations.deleteMessage,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: globals.translations.delete,
|
||||
confirmButtonClass: "btn btn-lg btn-danger",
|
||||
})
|
||||
}
|
||||
|
||||
function message(element) {
|
||||
data = $.extend({}, $(element).data());
|
||||
|
||||
|
@ -151,9 +151,9 @@ echo '
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-danger ask '.$disabled.'" data-backto="record-edit" data-op="deletesede" data-id="'.$record['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'" '.$disabled.'>
|
||||
<button type="button" class="btn btn-danger '.$disabled.'" onclick="rimuoviSede(this)">
|
||||
<i class="fa fa-trash"></i> '.tr('Elimina').'
|
||||
</a>
|
||||
</button>
|
||||
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fa fa-edit"></i> '.tr('Modifica').'</button>
|
||||
</div>
|
||||
@ -162,6 +162,22 @@ echo '
|
||||
|
||||
echo '
|
||||
<script>
|
||||
function rimuoviSede(button) {
|
||||
let href = window.location.href.split("#")[0];
|
||||
|
||||
confirmDelete(button).then(function () {
|
||||
redirect(globals.rootdir + "/editor.php", {
|
||||
backto: "record-edit",
|
||||
href: href,
|
||||
op: "deletesede",
|
||||
id: "'.$record['id'].'",
|
||||
id_plugin: "'.$id_plugin.'",
|
||||
id_module: "'.$id_module.'",
|
||||
id_parent: "'.$id_parent.'",
|
||||
});
|
||||
}).catch(swal.noop);
|
||||
}
|
||||
|
||||
$(document).ready( function(){
|
||||
$("#form_sedi #geocomplete input").geocomplete({
|
||||
map: $("#form_sedi #map").length ? "#form_sedi #map" : false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user