Initial Commit

This commit is contained in:
GiacomoHome
2021-09-17 12:41:45 +02:00
commit 9001e4656e
570 changed files with 31013 additions and 0 deletions
@@ -0,0 +1,3 @@
$('document').ready(function () {
});
@@ -0,0 +1,177 @@
'use strict';
function beforeSubmit() {
modalLoader.removeClass('d-none').addClass('d-flex');
}
function errorOnSubmit() {
modalLoader.removeClass('d-flex').addClass('d-none');
}
function afterSubmit(resp) {
if (resp.success === 'invalid') {
showErrors(form_id, resp);
} else if (resp.success === true) {
let id;
let mex = '';
if (resp.op === 'insert') {
$('#tablebody').prepend(resp.text);
$('input#id').val(resp.data.id);
mex = 'Inserimento effettuato con successo';
id = resp.data.id;
} else {
$('tr[data-id=' + resp.id + ']').replaceWith(resp.text);
mex = 'Modifca effettuata con successo';
id = resp.id;
}
refreshFormComponents();
$('#norows').remove();
$(modal_id).modal('hide');
$('#save').attr('op', 'insert');
myResetForm('', form_id);
toastr.success(mex);
} else {
toastr.error(resp.shortMessage);
console.error(resp.message);
}
modalLoader.removeClass('d-flex').addClass('d-none');
}
//Specializzo la funzione resetForm nel caso ci sia bisogno di campi TEXTAREA o immagini da resettare
function myResetForm(tipo, formid) {
resetForm(tipo, formid);
}
function edit(id) {
$('#save').attr('op', 'edit');
var dati = 'id=' + id;
var url = $(form_id).attr('data-get');
myResetForm('all', form_id);
$.getJSON(url, dati, function (resp) {
if (resp.success) {
populateForm(resp, form);
$(modal_id).modal('show');
} else {
toastr.error(resp.message);
}
});
}
$(document).ready(function () {
initFormComponents();
initTableFlotHeader();
})
.delegate('#new', 'click', function (link) {
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
$(modal_id).modal('show');
})
.delegate('#save', 'click', function (link) {
link.preventDefault();
var operation = $(this).attr('op');
var options = {
target: '#ErrorDescription',
beforeSubmit: beforeSubmit,
success: afterSubmit,
error: errorOnSubmit,
data: {
op: operation
},
dataType: 'json',
resetForm: false
};
$(form_id).ajaxSubmit(options);
})
.delegate('#edit,#editLink', 'click', function (link) {
link.preventDefault();
const id = $(this).parents('tr').attr('data-id');
edit(id);
})
.delegate('#delete', 'click', function (link) {
link.preventDefault();
const url = $(form_id).attr('data-delete');
let tr = $(this).parents('tr');
const cod = tr.attr('data-cod');
let id = tr.attr('data-id');
let message = 'Sei sicuro di voler eliminare definitivamente l\'elemento?';
if (confirm(message)) {
$.ajax({
type: 'POST',
url: url,
data: 'id=' + id + "&cod=" + cod,
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
toastr.success('Eliminazione effettuata con successo');
} else {
toastr.error(resp.message);
}
}
});
}
})
.delegate('#delete_select', 'click', function (link) {
link.preventDefault();
let message = 'Sei sicuro di voler eliminare definitivamente gli elementi selezionati?';
if (confirm(message)) {
let data = [];
$('#tablebody').find(':checkbox').each(function () {
if (this.checked) {
data.push($(this).val());
}
});
let url = $(this).attr('href');
$.ajax({
type: 'POST',
url: url,
data: {
data: data
},
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
var ids = resp.id;
for (var i = 0; i < ids.length; i++) {
var tr = $('#tablebody tr[data-id=' + ids[i] + ']');
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
}
} else {
toastr.error(resp.message);
}
$('#tablebody').find(':checkbox').iCheck('uncheck');
}
});
}
})
.delegate(modal_id,'hidden.bs.modal',function(link){
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
});
@@ -0,0 +1,181 @@
'use strict';
function beforeSubmit() {
modalLoader.removeClass('d-none').addClass('d-flex');
}
function errorOnSubmit() {
modalLoader.removeClass('d-flex').addClass('d-none');
}
function afterSubmit(resp) {
if (resp.success === 'invalid') {
showErrors(form_id, resp);
} else if (resp.success === true) {
let id;
let mex = '';
if (resp.op === 'insert') {
$('#tablebody').prepend(resp.text);
$('input#id').val(resp.data.id);
mex = 'Inserimento effettuato con successo';
id = resp.data.id;
} else {
$('tr[data-id=' + resp.id + ']').replaceWith(resp.text);
mex = 'Modifca effettuata con successo';
id = resp.id;
}
refreshFormComponents();
$('#norows').remove();
$(modal_id).modal('hide');
$('#save').attr('op', 'insert');
myResetForm('', form_id);
toastr.success(mex);
} else {
toastr.error(resp.shortMessage);
console.error(resp.message);
}
modalLoader.removeClass('d-flex').addClass('d-none');
}
//Specializzo la funzione resetForm nel caso ci sia bisogno di campi TEXTAREA o immagini da resettare
function myResetForm(tipo, formid) {
resetForm(tipo, formid);
$('textarea#Testo').summernote('code', '');
}
function edit(id) {
$('#save').attr('op', 'edit');
var dati = 'id=' + id;
var url = $(form_id).attr('data-get');
myResetForm('all', form_id);
$.getJSON(url, dati, function (resp) {
if (resp.success) {
populateForm(resp, form);
$('textarea#Testo').summernote('code', resp.Testo);
$(modal_id).modal('show');
} else {
toastr.error(resp.message);
}
});
}
$(document).ready(function () {
initFormComponents();
initTableFlotHeader();
initSummernote();
})
.delegate('#new', 'click', function (link) {
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
$(modal_id).modal('show');
})
.delegate('#save', 'click', function (link) {
link.preventDefault();
var operation = $(this).attr('op');
var options = {
target: '#ErrorDescription',
beforeSubmit: beforeSubmit,
success: afterSubmit,
error: errorOnSubmit,
data: {
op: operation
},
dataType: 'json',
resetForm: false
};
$(form_id).ajaxSubmit(options);
})
.delegate('#edit,#editLink', 'click', function (link) {
link.preventDefault();
const id = $(this).parents('tr').attr('data-id');
edit(id);
})
.delegate('#delete', 'click', function (link) {
link.preventDefault();
const url = $(form_id).attr('data-delete');
let tr = $(this).parents('tr');
const cod = tr.attr('data-cod');
let id = tr.attr('data-id');
let message = 'Sei sicuro di voler eliminare definitivamente l\'elemento?';
if (confirm(message)) {
$.ajax({
type: 'POST',
url: url,
data: 'id=' + id + "&cod=" + cod,
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
toastr.success('Eliminazione effettuata con successo');
} else {
toastr.error(resp.message);
}
}
});
}
})
.delegate('#delete_select', 'click', function (link) {
link.preventDefault();
let message = 'Sei sicuro di voler eliminare definitivamente gli elementi selezionati?';
if (confirm(message)) {
let data = [];
$('#tablebody').find(':checkbox').each(function () {
if (this.checked) {
data.push($(this).val());
}
});
let url = $(this).attr('href');
$.ajax({
type: 'POST',
url: url,
data: {
data: data
},
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
var ids = resp.id;
for (var i = 0; i < ids.length; i++) {
var tr = $('#tablebody tr[data-id=' + ids[i] + ']');
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
}
} else {
toastr.error(resp.message);
}
$('#tablebody').find(':checkbox').iCheck('uncheck');
}
});
}
})
.delegate(modal_id,'hidden.bs.modal',function(link){
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
});
@@ -0,0 +1,97 @@
'use strict';
function resetForm(tipo) {
$('#Error_Description').html('').addClass('hidden');
$('.input-group').removeClass('has-error');
$('.form-control').removeClass('no-border');
$('.error-icon').addClass('hidden');
$('.label-error').addClass('hidden').html('');
if (tipo != 'errors') {
$('.form-control').val('');
}
}
function beforeSubmit() {
}
function errorOnSubmit() {
$('#modal-loader').addClass('hidden');
}
function afterSubmit(resp) {
$('.has-error').removeClass('has-error');
$.each(resp, function (index, val) {
if (val == 'OK') $('#' + index).addClass('has-success');
else $('#' + index).addClass('has-error');
});
toastr.success('Parametri di configurazione aggiornati con successo.');
}
$(document).ready(function () {
initDatePicker();
initTooltip();
initPopover();
initSwitchButton();
var options = {
target: '#Error_Description',
beforeSubmit: beforeSubmit,
error: errorOnSubmit,
success: afterSubmit,
dataType: 'json',
resetForm: false
};
$('a.setting-tab').click(function () {
var tabname = $(this).attr('href');
tabname = tabname.replace('#', '');
$.cookie('settings_tabname', tabname);
});
$(".btn-save").click(function (link) {
link.preventDefault();
const formID = $('.tab-pane.active').attr('id').capitalize();
const form = $('form#settings' + formID);
form.ajaxSubmit(options);
return false;
});
$('#btn-new-passoword').click(function (e) {
e.preventDefault();
var form = $('#password_form');
form.ajaxSubmit({
target: '#Error_Description',
success: function (resp) {
if (!resp.status) {
toastr.warning(" " + resp.message);
if (resp.resetForm) {
$('[form="password_form"]').val('');
}
} else {
$('[form="password_form"]').val('');
toastr.warning(" La password è stata reimpostata correttamente");
}
},
dataType: 'json',
resetForm: false
});
return false;
});
$("#BtnGeneraPassword").click(function (event) {
event.preventDefault();
$("#superPwd").val(password_generator(20));
});
$("#BtnCopyToClipboard").click(function (event) {
event.preventDefault();
$('#superPwd').attr('type', 'text');
copyToClipboard($('#superPwd')[0]);
$('#superPwd').attr('type', 'password');
});
});
@@ -0,0 +1,7 @@
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
@@ -0,0 +1,177 @@
'use strict';
function beforeSubmit() {
modalLoader.removeClass('d-none').addClass('d-flex');
}
function errorOnSubmit() {
modalLoader.removeClass('d-flex').addClass('d-none');
}
function afterSubmit(resp) {
if (resp.success === 'invalid') {
showErrors(form_id, resp);
} else if (resp.success === true) {
let id;
let mex = '';
if (resp.op === 'insert') {
$('#tablebody').prepend(resp.text);
$('input#id').val(resp.data.id);
mex = 'Inserimento effettuato con successo';
id = resp.data.id;
} else {
$('tr[data-id=' + resp.id + ']').replaceWith(resp.text);
mex = 'Modifca effettuata con successo';
id = resp.id;
}
refreshFormComponents();
$('#norows').remove();
$(modal_id).modal('hide');
$('#save').attr('op', 'insert');
myResetForm('', form_id);
toastr.success(mex);
} else {
toastr.error(resp.shortMessage);
console.error(resp.message);
}
modalLoader.removeClass('d-flex').addClass('d-none');
}
//Specializzo la funzione resetForm nel caso ci sia bisogno di campi TEXTAREA o immagini da resettare
function myResetForm(tipo, formid) {
resetForm(tipo, formid);
}
function edit(id) {
$('#save').attr('op', 'edit');
let dati = 'id=' + id;
let url = $(form_id).attr('data-get');
myResetForm('all', form_id);
$.getJSON(url, dati, function (resp) {
if (resp.success) {
populateForm(resp, form);
$(modal_id).modal('show');
} else {
toastr.error(resp.message);
}
});
}
$(document).ready(function () {
initFormComponents();
initTableFlotHeader();
})
.delegate('#new', 'click', function (link) {
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
$(modal_id).modal('show');
})
.delegate('#save', 'click', function (link) {
link.preventDefault();
let operation = $(this).attr('op');
let options = {
target: '#ErrorDescription',
beforeSubmit: beforeSubmit,
success: afterSubmit,
error: errorOnSubmit,
data: {
op: operation
},
dataType: 'json',
resetForm: false
};
$(form_id).ajaxSubmit(options);
})
.delegate('#edit,#editLink', 'click', function (link) {
link.preventDefault();
const id = $(this).parents('tr').attr('data-id');
edit(id);
})
.delegate('#delete', 'click', function (link) {
link.preventDefault();
const url = $(form_id).attr('data-delete');
let tr = $(this).parents('tr');
const cod = tr.attr('data-cod');
let id = tr.attr('data-id');
let message = 'Sei sicuro di voler eliminare definitivamente l\'elemento?';
if (confirm(message)) {
$.ajax({
type: 'POST',
url: url,
data: 'id=' + id + "&cod=" + cod,
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
toastr.success('Eliminazione effettuata con successo');
} else {
toastr.error(resp.message);
}
}
});
}
})
.delegate('#delete_select', 'click', function (link) {
link.preventDefault();
let message = 'Sei sicuro di voler eliminare definitivamente gli elementi selezionati?';
if (confirm(message)) {
let data = [];
$('#tablebody').find(':checkbox').each(function () {
if (this.checked) {
data.push($(this).val());
}
});
let url = $(this).attr('href');
$.ajax({
type: 'POST',
url: url,
data: {
data: data
},
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
var ids = resp.id;
for (var i = 0; i < ids.length; i++) {
var tr = $('#tablebody tr[data-id=' + ids[i] + ']');
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
}
} else {
toastr.error(resp.message);
}
$('#tablebody').find(':checkbox').iCheck('uncheck');
}
});
}
})
.delegate(modal_id,'hidden.bs.modal',function(link){
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
});
@@ -0,0 +1,316 @@
'use strict';
function beforeSubmit() {
modalLoader.removeClass('d-none').addClass('d-flex');
}
function errorOnSubmit() {
modalLoader.removeClass('d-flex').addClass('d-none');
}
function afterSubmit(resp) {
if (resp.success === 'invalid') {
showErrors(form_id, resp);
} else if (resp.success === true) {
let id;
let mex = '';
if (resp.op === 'insert') {
$('#tablebody').prepend(resp.text);
$('input#id').val(resp.data.id);
mex = 'Inserimento effettuato con successo';
id = resp.data.id;
} else {
$('tr[data-id=' + resp.id + ']').replaceWith(resp.text);
mex = 'Modifca effettuata con successo';
id = resp.id;
}
refreshFormComponents();
$('#norows').remove();
$(modal_id).modal('hide');
$('#save').attr('op', 'insert');
myResetForm('', form_id);
toastr.success(mex);
} else {
toastr.error(resp.shortMessage);
console.error(resp.message);
}
modalLoader.removeClass('d-flex').addClass('d-none');
}
//Specializzo la funzione resetForm nel caso ci sia bisogno di campi TEXTAREA o immagini da resettare
function myResetForm(tipo, formid) {
resetForm(tipo, formid);
}
function edit(id) {
$('#save').attr('op', 'edit');
let dati = 'id=' + id;
let url = $(form_id).attr('data-get');
myResetForm('all', form_id);
$.getJSON(url, dati, function (resp) {
if (resp.success) {
$('#main_contenitor').html(resp.text);
$(modal_id).modal('show');
} else {
toastr.error(resp.message);
}
});
}
$(document).ready(function () {
initFormComponents();
initTableFlotHeader();
})
.delegate('#new', 'click', function (link) {
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
$(modal_id).modal('show');
})
.delegate('#save', 'click', function (link) {
link.preventDefault();
var operation = $(this).attr('op');
var options = {
target: '#ErrorDescription',
beforeSubmit: beforeSubmit,
success: afterSubmit,
error: errorOnSubmit,
data: {
op: operation
},
dataType: 'json',
resetForm: false
};
$(form_id).ajaxSubmit(options);
})
.delegate('#edit,#editLink', 'click', function (link) {
link.preventDefault();
const id = $(this).parents('tr').attr('data-id');
edit(id);
})
.delegate('#delete', 'click', function (link) {
link.preventDefault();
const url = $(form_id).attr('data-delete');
let tr = $(this).parents('tr');
const cod = tr.attr('data-cod');
let id = tr.attr('data-id');
let message = 'Sei sicuro di voler eliminare definitivamente l\'elemento?';
if (confirm(message)) {
$.ajax({
type: 'POST',
url: url,
data: 'id=' + id + "&cod=" + cod,
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
toastr.success('Eliminazione effettuata con successo');
} else {
toastr.error(resp.message);
}
}
});
}
})
.delegate('#delete_select', 'click', function (link) {
link.preventDefault();
let message = 'Sei sicuro di voler eliminare definitivamente gli elementi selezionati?';
if (confirm(message)) {
let data = [];
$('#tablebody').find(':checkbox').each(function () {
if (this.checked) {
data.push($(this).val());
}
});
let url = $(this).attr('href');
$.ajax({
type: 'POST',
url: url,
data: {
data: data
},
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
var ids = resp.id;
for (var i = 0; i < ids.length; i++) {
var tr = $('#tablebody tr[data-id=' + ids[i] + ']');
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
}
} else {
toastr.error(resp.message);
}
$('#tablebody').find(':checkbox').iCheck('uncheck');
}
});
}
})
.delegate('select#state', 'change', function (link) {
link.preventDefault();
$('select#state').val($(this).val());
$('#searchForm').submit();
})
.delegate('#set-state','click',function (link) {
link.preventDefault();
var url = $(this).attr('data-url');
var tr = $(this).parents('tr');
var state = $(this).attr('data-state');
var id = tr.attr('data-id');
var message = 'Sei sicuro di voler modificare lo stato dell\'elemento?';
if (confirm(message)) {
$.ajax({
type: 'POST',
url: url,
data: 'id=' + id +'&state=' + state,
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
tr.replaceWith(resp.text);
refreshFormComponents();
} else {
alert(resp.message);
}
}
});
} else {
return;
}
})
.delegate('#setstate_select', 'click', function (link) {
link.preventDefault();
var url = $(this).attr('href');
var stateNum = null;
var data = [];
$('#tablebody').find(':checkbox').each(function () {
if (this.checked) {
data.push($(this).val());
}
});
if(data.length <= 0){
alert("Nessun elemento selezioanto");
return;
}
function confirmChoice() {
var val = $('select#selectState').val();
if(!val){
alert("E' necessario scegliere uno stato");
return;
}
stateNum = val;
dialog.dialog( "close" );
if (confirm("Sei sicuro di voler modificare lo stato degli elementi selezionati?")) {
$.ajax({
type: 'POST',
url: url,
data: {
data: data,
state:stateNum
},
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
var rows = resp.rows;
for (var i = 0; i < rows.length; i++) {
var tr = $('#tablebody tr[data-id=' + rows[i].id + ']');
tr.replaceWith(rows[i].tdRow);
}
$.growl({
type: 'success',
message: "Elementi aggiornati",
icon: 'fa fa-check fa-fw'
}, grownl_my_default_options);
} else {
$.growl({
type: 'danger',
message: resp.message,
icon: 'fa fa-times fa-fw'
}, grownl_my_default_options);
}
refreshFormComponents();
$('#tablebody').find(':checkbox').iCheck('uncheck');
}
});
}
}
var dialog = $('<div></div>')
.html(choicheHtmlModal)
.dialog({
title:"Scegli lo stato da impostare:",
autoOpen: false,
height: 200,
width: 350,
modal: true,
buttons: {
"OK": confirmChoice,
Cancel: function() {
$(this).dialog( "close" );
}
},
close: function() {
$(this).dialog( "destroy" );
}
});
dialog.dialog( "open" );
})
.delegate(modal_id,'hidden.bs.modal',function(link){
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
});
var choicheHtmlModal = `
<form>
<fieldset>
<select class="form-control" id="selectState" name="selectState">
<option value="1">New</option>
<option value="2">Pending</option>
<option value="3">Resolved</option>
<option value="4">Viewed</option>
</select>
</fieldset>
</form>`;
@@ -0,0 +1,114 @@
'use strict';
//Specializzo la funzione resetForm nel caso ci sia bisogno di campi TEXTAREA o immagini da resettare
function myResetForm(tipo, formid) {
resetForm(tipo, formid);
}
function edit(id) {
$('#save').attr('op', 'edit');
let dati = 'id=' + id;
let url = $(form_id).attr('data-get');
myResetForm('all', form_id);
$.getJSON(url, dati, function (resp) {
if (resp.success) {
$('#main_contenitor').html(resp.text);
$(modal_id).modal('show');
} else {
toastr.error(resp.message);
}
});
}
$(document).ready(function () {
initFormComponents();
initTableFlotHeader();
})
.delegate('#edit,#editLink', 'click', function (link) {
link.preventDefault();
const id = $(this).parents('tr').attr('data-id');
edit(id);
})
.delegate('#delete', 'click', function (link) {
link.preventDefault();
const url = $(form_id).attr('data-delete');
let tr = $(this).parents('tr');
const cod = tr.attr('data-cod');
let id = tr.attr('data-id');
let message = 'Sei sicuro di voler eliminare definitivamente l\'elemento?';
if (confirm(message)) {
$.ajax({
type: 'POST',
url: url,
data: 'id=' + id + "&cod=" + cod,
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
toastr.success('Eliminazione effettuata con successo');
} else {
toastr.error(resp.message);
}
}
});
}
})
.delegate('#delete_select', 'click', function (link) {
link.preventDefault();
let message = 'Sei sicuro di voler eliminare definitivamente gli elementi selezionati?';
if (confirm(message)) {
let data = [];
$('#tablebody').find(':checkbox').each(function () {
if (this.checked) {
data.push($(this).val());
}
});
let url = $(this).attr('href');
$.ajax({
type: 'POST',
url: url,
data: {
data: data
},
dataType: 'json',
complete: function (resp) {
resp = jQuery.parseJSON(resp.responseText);
if (resp.success) {
var ids = resp.id;
for (var i = 0; i < ids.length; i++) {
var tr = $('#tablebody tr[data-id=' + ids[i] + ']');
tr.animate({
'opacity': 'hide'
}, 500, function () {
tr.remove();
});
}
} else {
toastr.error(resp.message);
}
$('#tablebody').find(':checkbox').iCheck('uncheck');
}
});
}
})
.delegate(modal_id,'hidden.bs.modal',function(link){
link.preventDefault();
myResetForm('tutto', form_id);
$('#save').attr('op', 'insert');
});