1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| function setContentPopupModificationNomChantier(e) {
$.ajax({
type : 'GET',
url : Routing.generate('GRDFatoutPriscaIHMPriscaBundle_affaire_popup_modification_nom_chantier', {
'chantierId' : $(e.target).data('chantier-id')
}),
beforeSend : function() {
ouvrirMessageAttente("popup_modification_nom_chantier_js");
},
complete : function() {
fermerMessageAttente("popup_modification_nom_chantier_js");
},
success : function(data) {
$("#popupModificationNomChantier").html($(data).html());
$("#popupModificationNomChantier").find("#boutonAnnuler").click(function(){
$("#popupModificationNomChantier").dialog("close");
});
$("#popupModificationNomChantier").find("#boutonValider").click(function(e){
$.ajax({
type : 'POST',
url : Routing.generate('GRDFatoutPriscaIHMPriscaBundle_affaire_popup_modification_nom_chantier', {
'chantierId' : $("#popupModificationNomChantier").find("input[name=chantierId]").val()
}),
data : $("#popupModificationNomChantier form").serialize(),
dataType: 'json',
beforeSend : function() {
ouvrirMessageAttente("popup_modification_nom_chantier_js");
},
complete : function() {
fermerMessageAttente("popup_modification_nom_chantier_js");
},
success : function(data) {
if(data.statut) {
$('.entete-chantier').find("span[data-chantier-id='" + data.extra.id + "'] span.nom-chantier").text(data.extra.nomChantier)
$("#popupModificationNomChantier").dialog("close");
rafraichirOngletHistorique($("#formConsultation").find('input[id$="_reference"]').val());
} else {
$('div#div-error-nomChantier').html(data.message);
$('div#div-error-nomChantier').addClass('bloc-messages-erreurs');
$('input#input-nom-chantier').addClass('erreur');
}
}
});
});
$("#actionablePopupModificationNomChantier").click();
}
});
} |
Partager