$vDomaine . '/ajax_promoteur_hub.php',
'preloaderWait' => $strWait,
// MSIN-4399 — Ouvrir automatiquement la carte de cet événement au chargement.
'focusEveId' => function_exists('fxPromoteurHubParseFocusEveId')
? fxPromoteurHubParseFocusEveId()
: 0,
'i18n' => [
'ajaxError' => $strAjaxError,
],
];
}
/** Config injectée dans window.MS1_V2_INSCR_GESTION avant inscr-gestion.js */
function fxV2InscrGestionConfig($strLangue) {
global $vDomaine;
$strLangue = ($strLangue === 'en') ? 'en' : 'fr';
return [
'domain' => $vDomaine,
'lang' => $strLangue,
// MSIN-4401 — true = OCR dossard via serveur (Vision), pas Tesseract local.
'bibOcrCloud' => function_exists('fxInscrGestionBibOcrCloudEnabled')
? (bool)fxInscrGestionBibOcrCloudEnabled()
: false,
'preloaderWait' => afficheTexte('preloader_wait', 0, 0, 1),
'refundCancelHint' => function_exists('fxInscrGestionT')
? fxInscrGestionT('inscr_gestion_refund_cancel_hint')
: '',
'loginMessages' => [
'txt_login' => function_exists('fxInscrGestionT')
? fxInscrGestionT('inscr_gestion_login_err_user')
: '',
'txt_password' => function_exists('fxInscrGestionT')
? fxInscrGestionT('inscr_gestion_login_err_pass')
: '',
],
// MSIN-4401 — libellés Info injectés (pas de FR/EN en dur dans le JS).
'i18n' => function_exists('fxInscrGestionT') ? [
'errLoad' => fxInscrGestionT('inscr_gestion_err_load'),
'errNetwork' => fxInscrGestionT('inscr_gestion_err_network'),
'errRefund' => fxInscrGestionT('inscr_gestion_err_refund'),
'refundOk' => fxInscrGestionT('inscr_gestion_refund_ok'),
'bibOcrNotConfigured' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_not_configured')
: fxInscrGestionT('inscr_gestion_bib_ocr_not_configured'),
'bibOcrVisionPrefix' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_vision_prefix')
: fxInscrGestionT('inscr_gestion_bib_ocr_vision_prefix'),
'bibOcrImageInvalid' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_image_invalid')
: fxInscrGestionT('inscr_gestion_bib_ocr_image_invalid'),
'bibOcrNetwork' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_network')
: fxInscrGestionT('inscr_gestion_bib_ocr_network'),
'bibOcrUnreadable' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_invalid')
: fxInscrGestionT('inscr_gestion_bib_scan_invalid'),
'bibScanScanning' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_scanning')
: '',
'bibScanLoading' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_loading')
: '',
'bibScanReady' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_ready')
: '',
'bibScanFound' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_found')
: '',
'bibScanFoundSearch' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_found_search')
: '',
'bibScanInvalid' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_bib_scan_invalid')
: '',
'bibScanCamera' => function_exists('fxInscrGestionScanLabel')
? fxInscrGestionScanLabel('inscr_gestion_qr_camera_error')
: '',
// MSIN-4448 — Remis inline liste (confirmation retrait).
'remisConfirmTitle' => fxInscrGestionT('inscr_gestion_remis_confirm_title'),
'remisConfirmMsg' => fxInscrGestionT('inscr_gestion_remis_confirm_msg'),
'remisConfirmOk' => fxInscrGestionT('inscr_gestion_remis_confirm_ok'),
'remisConfirmCancel' => fxInscrGestionT('inscr_gestion_remis_confirm_cancel'),
// MSIN-4464 — historique fiche (!).
'auditPopupTitle' => fxInscrGestionT('inscr_gestion_audit_popup_title'),
'auditPopupEmpty' => fxInscrGestionT('inscr_gestion_audit_popup_empty'),
'auditPopupClose' => fxInscrGestionT('inscr_gestion_audit_popup_close'),
'auditColWhen' => fxInscrGestionT('inscr_gestion_audit_col_when'),
'auditColWho' => fxInscrGestionT('inscr_gestion_audit_col_who'),
'auditColFrom' => fxInscrGestionT('inscr_gestion_audit_col_from'),
'auditColTo' => fxInscrGestionT('inscr_gestion_audit_col_to'),
'auditFieldStatut' => fxInscrGestionT('inscr_gestion_audit_field_par_statut_course'),
'auditFieldBib' => fxInscrGestionT('inscr_gestion_audit_field_no_bib'),
'auditFieldRemis' => fxInscrGestionT('inscr_gestion_audit_field_no_bib_remis'),
'auditFieldCancel' => fxInscrGestionT('inscr_gestion_audit_field_is_cancelled'),
] : [],
// MSIN-4448 — Operateur pour no_bib_remis_par (chemin superadm / usa_id).
'remisOperator' => [
'par_id' => intval($_SESSION['com_info']['com_id'] ?? ($_SESSION['com_id'] ?? 0)),
'par' => trim(
(string)($_SESSION['com_info']['com_prenom'] ?? '')
. ' '
. (string)($_SESSION['com_info']['com_nom'] ?? '')
),
],
];
}
/** À appeler dans inc_footer.php après inc_footer_scripts.php */
function fxV2RenderFooterScripts() {
global $MS1_V2_SCRIPTS, $vDomaine, $strLangue;
if (empty($MS1_V2_SCRIPTS) || !is_array($MS1_V2_SCRIPTS)) {
return;
}
$mapFiles = [
'bib-assignments' => '/js/v2/bib-assignments.js',
'inscr-gestion' => '/js/v2/inscr-gestion.js',
'promoteur-hub' => '/js/v2/promoteur-hub.js',
];
if (in_array('promoteur-hub', $MS1_V2_SCRIPTS, true)) {
$cfg = fxV2PromoteurHubConfig($strLangue ?? 'fr');
echo '' . "\n";
}
if (in_array('inscr-gestion', $MS1_V2_SCRIPTS, true)) {
$cfg = fxV2InscrGestionConfig($strLangue ?? 'fr');
echo '' . "\n";
}
foreach ($MS1_V2_SCRIPTS as $strName) {
if (!isset($mapFiles[$strName])) {
continue;
}
$strSrc = htmlspecialchars($vDomaine . $mapFiles[$strName], ENT_QUOTES, 'UTF-8');
echo '' . "\n";
}
}
}