diff --git a/inc_footer_scripts.php b/inc_footer_scripts.php index 96eaea8..cc519c3 100644 --- a/inc_footer_scripts.php +++ b/inc_footer_scripts.php @@ -450,7 +450,10 @@ if ($strLangue == 'fr') { strpath = '/book/'; } - document.location.href = '' + strpath + code + '/' + intEprId + '?promoteur=1&action=mod&pec_id=' + intPecId; + // MSIN-4474 — ramener à la liste d'origine après Enregistrer / Annuler + document.location.href = '' + strpath + code + '/' + intEprId + + '?promoteur=1&action=mod&pec_id=' + intPecId + + '&return_url=' + encodeURIComponent(window.location.href); }); '; - //sl - // alert('/' + strPage + '/' + strUrl + '/' + $("#sel_epreuve").val() + '?action=mod&switch=true' + strPromoteur + '&pec_id='); - document.location.href = '/' + strPage + '/' + strUrl + '/' + $("#sel_epreuve").val() + '?action=mod&switch=true' + strPromoteur + '&pec_id='; + // MSIN-4474 — préserver return_url au switch d'épreuve + var strReturn = ''; + var $returnUrl = $("#return_url"); + if ($returnUrl.length && $returnUrl.val()) { + strReturn = '&return_url=' + encodeURIComponent($returnUrl.val()); + } + document.location.href = '/' + strPage + '/' + strUrl + '/' + $("#sel_epreuve").val() + '?action=mod&switch=true' + strPromoteur + '&pec_id=' + strReturn; }); $("#frm_participant").valid(); + - diff --git a/superadm/inc_footer.php b/superadm/inc_footer.php index 38b6f73..63b6ad4 100644 --- a/superadm/inc_footer.php +++ b/superadm/inc_footer.php @@ -90,7 +90,9 @@ if (isset($_SESSION['com_info']['com_id'])) { strpath = '/book/'; } - document.location.href = '' + strpath + code + '/' + intEprId + '?promoteur=1&action=mod&pec_id=' + intPecId; + document.location.href = '' + strpath + code + '/' + intEprId + + '?promoteur=1&action=mod&pec_id=' + intPecId + + '&return_url=' + encodeURIComponent(window.location.href); }); $('.btn_update_panier').click(function () {