sélectionnée.
Lorsque l'implantation est changée, on ajuste les valeurs de points en fonction de cette sélection */
var implantation_id = $("#id_implantation").val();
- if (implantation_id) {
+ var null_vp_min = $("#valeur_point_min").val() == '';
+ var null_vp_max = $("#valeur_point_max").val() == '';
+
+ if (implantation_id && null_vp_min && null_vp_max) {
charger_postes(implantation_id);
charger_valeurs_point(implantation_id);
}
var chargement_poste = $.getJSON("/dae/poste_resume/" + poste_id);
chargement_poste.success(function(data) {
$('#' + prefix_poste_connexe + 'implantation').val(data['implantation']);
+ $('#' + prefix_poste_connexe + 'cmp_poste').val(data['d_id']);
$('#' + prefix_poste_connexe + 'nom').val(data['poste']);
$('#' + prefix_poste_connexe + 'montant').val(data['montant']);
$('#' + prefix_poste_connexe + 'devise').val(data['devise']);
$('#' + prefix_poste_connexe + 'statut').val(data['statut']);
$('#' + prefix_poste_connexe + 'classement').val(data['classement']);
});
+
chargement_poste.error(function(data) {
alert(data.responseText);
});
$(this).find('div').remove();
input.val('');
+ var lnk = $(this).parent().find('.clear-cmp a');
+ lnk.show();
+ lnk.unbind('click');
+ lnk.click(function(e){
+ e.preventDefault();
+ $('#' + prefix_poste_connexe + 'implantation').val('');
+ $('#' + prefix_poste_connexe + 'cmp_poste').val('');
+ $('#' + prefix_poste_connexe + 'nom').val('');
+ $('#' + prefix_poste_connexe + 'montant').val('');
+ $('#' + prefix_poste_connexe + 'devise').val('');
+ $('#' + prefix_poste_connexe + 'montant_euros').val('');
+ $('#' + prefix_poste_connexe + 'statut').val('');
+ $('#' + prefix_poste_connexe + 'classement').val('');
+ lnk.hide();
+ });
+ });
+ $(".comparaison-interne .results_on_deck").each(function(i, e){
+ /* on ne veut pas afficher la personne en-dessous */
+ var input_id = $(this).attr('id').replace('_on_deck', '');
+ var input = $('#'+input_id);
+ var prefix_poste_connexe = $(this).attr('id').replace('recherche_on_deck', '');
+ var poste_id = input.val();
+ var lnk = $(this).parent().find('.clear-cmp a');
+ if (poste_id != null && poste_id == '') {
+ lnk.show()
+ }
+ lnk.click(function(e){
+ e.preventDefault();
+ $('#' + prefix_poste_connexe + 'implantation').val('');
+ $('#' + prefix_poste_connexe + 'cmp_poste').val('');
+ $('#' + prefix_poste_connexe + 'nom').val('');
+ $('#' + prefix_poste_connexe + 'montant').val('');
+ $('#' + prefix_poste_connexe + 'devise').val('');
+ $('#' + prefix_poste_connexe + 'montant_euros').val('');
+ $('#' + prefix_poste_connexe + 'statut').val('');
+ $('#' + prefix_poste_connexe + 'classement').val('');
+ lnk.hide();
+ });
});
-
-
});