diff --git a/Cron/Functions.php b/Cron/Functions.php index ca8ad189..714b0f16 100755 --- a/Cron/Functions.php +++ b/Cron/Functions.php @@ -189,43 +189,27 @@ function contruireParamLike($param) return "%".$p."%"; } -function liste_options($liste,$val_def,$strict=false) -{ - // '; - foreach ($liste as $option): - $select .= ' '; + + foreach ($liste as $option): + $selected = ($val_def == $option["code"]) ? ' selected' : ''; + $select .= ''; + endforeach; + echo $select; } -function liste_options_consultation($liste,$val_def,$strict=false) -{ - // $select = $strict ? '' : ''; - if (est_anglophone()) - { - $select = $strict ? '' : ''; - } - else - { - $select = $strict ? '' : ''; - } - - foreach ($liste as $option): - $select .= ' '; + + foreach ($liste as $option): + $selected = ($val_def == $option["code"]) ? ' selected' : ''; + $select .= ''; + endforeach; + echo $select; } function datePlus($date,$part, $nb) diff --git a/Js/fonctions.js b/Js/fonctions.js index 47d996a3..8f817cb9 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -91643,12 +91643,18 @@ function initDataTableReference(selector, exportTitle = 'Export_Donnees') { function actualiserSelectPicker(selector) { $(selector).each(function() { const $el = $(this); - $el.removeAttr('title').prop('title', ''); // Supprime la source du doublon + + // On nettoie les attributs qui pourraient forcer un placeholder fantôme + $el.removeAttr('title').prop('title', ''); + if (!$el.data('selectpicker')) { $el.selectpicker({ liveSearch: true, style: 'btn-white border-2 border-start-0 fw-bold', - width: '100%' + width: '100%', + size: 8, + // On ne définit PAS noneSelectedText ici car il est dans le HTML (PHP) + liveSearchPlaceholder: ($("#codeLangue").val() === "en_US") ? "Search..." : "Rechercher..." }); } else { $el.selectpicker('refresh');