Add functionality to render a full account link in the mobile interface for users with extended permissions. Implement new functions to determine visibility and URL for the link, enhancing user navigation to the dashboard or account page. Update styles for the new button and increment version code to 4.72.787, aligning with MSIN-4401 requirements for improved event management functionality.

This commit is contained in:
2026-07-13 13:19:08 -04:00
parent 2970007d2b
commit ec15b07f21
4 changed files with 79 additions and 1 deletions

View File

@ -3331,6 +3331,10 @@ a.ms1-trad-link.btn-aide-trad{
margin-bottom:12px;
}
.inscr-gestion-full-account{
margin-bottom:12px;
}
.inscr-gestion-page-head,
.inscr-gestion-fiche-head{
margin-bottom:14px;

View File

@ -104,6 +104,9 @@ require_once('inc_header.php');
echo fxMessage($_SESSION['msg'], '', $strLangue);
}
// MSIN-4401 — Sortie vers hub / Mon compte (si droits plus larges).
fxInscrGestionRenderFullAccountLink($strLangue);
if ($intEveId === 0) {
if (count($tabEveIds) === 0) {
echo '<div class="alert alert-warning" role="alert">';

View File

@ -367,6 +367,9 @@ function fxInscrGestionFallbackTexte($strClef, $strLangue) {
'inscr_gestion_statut_transfert' => $blnFr ? 'Transférée' : 'Transferred',
'inscr_gestion_back_bib' => $blnFr ? 'Retour aux dossards' : 'Back to bibs',
'inscr_gestion_back_prev' => $blnFr ? 'Retour' : 'Back',
// MSIN-4401 — Sortie de /mobile vers hub ou Mon compte (usagers avec plus de droits).
'inscr_gestion_back_full_account' => $blnFr ? 'Retour au tableau de bord' : 'Back to dashboard',
'inscr_gestion_back_mon_compte' => $blnFr ? 'Retour à Mon compte' : 'Back to My account',
'inscr_gestion_chk_cancelled' => $blnFr
? 'Montrer les inscriptions annulées ou transférées'
: 'Show cancelled or transferred registrations',
@ -500,6 +503,74 @@ function fxInscrGestionRenderNavBack($strUrl, $strLabel) {
echo '</a>';
}
/**
* MSIN-4401 — Sur /mobile, proposer une sortie vers le hub (ou Mon compte)
* si l'usager a plus que l'outil inscriptions seul.
*/
function fxInscrGestionShouldShowFullAccountLink($intComId) {
if (!fxInscrGestionIsEntry()) {
return false;
}
$intComId = intval($intComId);
if ($intComId <= 0) {
return false;
}
if (!function_exists('fxPromoteurHubIsAvailable')) {
require_once __DIR__ . '/inc_fx_promoteur_hub.php';
}
if (fxPromoteurHubIsAvailable($intComId)) {
return true;
}
return fxInscrGestionUserHasPromoteurMenu($intComId);
}
/** MSIN-4401 — URL hub si dispo, sinon Mon compte. */
function fxInscrGestionFullAccountUrl($strLangue) {
global $vDomaine;
$strLangue = ($strLangue === 'en') ? 'en' : 'fr';
$intComId = intval($_SESSION['com_id'] ?? 0);
if (!function_exists('fxPromoteurHubIsAvailable')) {
require_once __DIR__ . '/inc_fx_promoteur_hub.php';
}
if ($intComId > 0 && fxPromoteurHubIsAvailable($intComId)) {
return fxPromoteurHubUrl($strLangue);
}
return $vDomaine . ($strLangue === 'en' ? '/account' : '/compte');
}
/** MSIN-4401 — Bouton « Retour au tableau de bord / Mon compte » (entrée /mobile). */
function fxInscrGestionRenderFullAccountLink($strLangue) {
$intComId = intval($_SESSION['com_id'] ?? 0);
if (!fxInscrGestionShouldShowFullAccountLink($intComId)) {
return;
}
$strLangue = ($strLangue === 'en') ? 'en' : 'fr';
$strUrl = fxInscrGestionFullAccountUrl($strLangue);
if (!function_exists('fxPromoteurHubIsAvailable')) {
require_once __DIR__ . '/inc_fx_promoteur_hub.php';
}
$blnHub = ($intComId > 0 && fxPromoteurHubIsAvailable($intComId));
$strLabel = $blnHub
? fxInscrGestionT('inscr_gestion_back_full_account')
: fxInscrGestionT('inscr_gestion_back_mon_compte');
echo '<div class="inscr-gestion-full-account">';
echo '<a class="btn btn-outline-secondary btn-sm rounded-0" href="' . fxInscrGestionEsc($strUrl) . '">';
echo '<i class="fa fa-th-large mr-2" aria-hidden="true"></i>' . fxInscrGestionEsc($strLabel);
echo '</a>';
echo '</div>';
}
function fxInscrGestionRenderPageHead($strTitle, $strSub = '') {
echo '<div class="inscr-gestion-page-head">';
echo '<h1 class="inscr-gestion-page-title">' . fxInscrGestionEsc($strTitle) . '</h1>';

View File

@ -7,7 +7,7 @@
* Constantes *
*
**************/
define('_VERSION_CODE', '4.72.786');
define('_VERSION_CODE', '4.72.787');
define('_DATE_CODE', '2026-07-13');
//MSIN-4290
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');