This commit is contained in:
KONE SOREL 2026-03-23 10:46:29 +00:00
parent c2c2bab2a7
commit bae46aa358
2 changed files with 23 additions and 31 deletions

View File

@ -62020,52 +62020,44 @@ function detail_baremepriseencharge(idBaremePriseEnCharge)
* Gère l'affichage de la Section 1 : Standard de la Famille
*/
function afficherMasquerGarantiesBareme() {
// 1. Récupération sécurisée de la valeur
// 1. Récupérer l'état actuel
var masquerGarantie = $("#masquerGarantie").val();
// Si c'est la première fois ou indéfini, on initialise à 1 (fermé)
if(masquerGarantie == undefined || masquerGarantie == "") {
masquerGarantie = "1";
}
if (masquerGarantie == undefined) { masquerGarantie = "1"; }
// 2. Ciblage des éléments
var blocContenu = $('#div_garanties_masquer');
var iconeChevron = $("#span_bareme");
// 2. Cibler les éléments
var divMasquer = $('#div_garanties_masquer');
var icone = $("#span_bareme");
if (masquerGarantie == "1") {
// --- ACTION : FERMER ---
divMasquer.hide();
$("#masquerGarantie").val("0");
// On remet le chevron vers le BAS (Fermé)
icone.attr('class', 'fas fa-chevron-down text-muted');
} else {
// --- ACTION : OUVRIR ---
blocContenu.show();
$("#masquerGarantie").val("0"); // On change l'état à "ouvert"
divMasquer.show();
$("#masquerGarantie").val("1");
// Bascule l'icône vers le HAUT
iconeChevron.removeClass("fa-chevron-down text-muted").addClass("fa-chevron-up text-primary");
// Initialisation métier
intit_saisie_garantiebareme();
actualiser_bareme_garantie();
// On met le chevron vers le HAUT (Ouvert)
icone.attr('class', 'fas fa-chevron-up text-primary');
// --- ACCORDÉON : FERMER LES AUTRES ---
// On réinitialise les inputs des autres blocs
$("#masquerGarantieLienParente").val("1");
$("#masquerActe").val("1");
$("#masquerActeLienParente").val("1");
// On appelle les fonctions de fermeture des autres sections
// (Assure-toi que ces fonctions existent et ne plantent pas)
if(typeof afficherMasquerGarantiesBaremeLienParente === "function") afficherMasquerGarantiesBaremeLienParente();
if(typeof afficherMasquerActeBareme === "function") afficherMasquerActeBareme();
if(typeof afficherMasquerActeBaremeLienParente === "function") afficherMasquerActeBaremeLienParente();
} else {
// --- ACTION : FERMER ---
blocContenu.hide();
$("#masquerGarantie").val("1"); // On remet l'état à "fermé"
// Bascule l'icône vers le BAS
iconeChevron.removeClass("fa-chevron-up text-primary").addClass("fa-chevron-down text-muted");
afficherMasquerGarantiesBaremeLienParente();
afficherMasquerActeBareme();
afficherMasquerActeBaremeLienParente();
}
// 3. Mise à jour du compteur
// 3. Update compteur
afficheNombreLigneBareme('garantiesbaremepriseencharge');
}

View File

@ -36,7 +36,7 @@
<div class="card-header bg-white py-3 cursor-pointer d-flex justify-content-between align-items-center" onclick="afficherMasquerGarantiesBareme();">
<span class="fw-bold text-dark small text-uppercase">
1. <?= _("Règle Standard de la Famille") ?>
<span id="garantiesbaremepriseencharge" class="ms-2 badge bg-light text-primary border fw-normal"></span>
<span id="garantiesbaremepriseencharge" class="ms-2 badge bg-light text-primary border"></span>
</span>
<i id="span_bareme" class="fas fa-chevron-down text-muted"></i>
</div>