diff --git a/php/inc_fx_promoteur_hub.php b/php/inc_fx_promoteur_hub.php index 1c023db7..f175bcc0 100644 --- a/php/inc_fx_promoteur_hub.php +++ b/php/inc_fx_promoteur_hub.php @@ -508,7 +508,10 @@ function fxPromoteurHubTexte($clef, $mem_echo = 0) * fidele a inc_tableau_promoteur.php. */ /** - * MSIN-4401 — liens hub : legacy = menus complets ; V2 seul = pages cochées dans le kit. + * MSIN-4401 — liens hub : + * - Super admin / kit total (grants_all) → tout + * - Accès V2 présent → menus selon les pages du kit (prioritaire sur legacy) + * - Legacy seul (com_eve_promoteur, sans V2) → menus complets comme avant */ function fxPromoteurHubGetEventLinks($arrItem, $strLangue) { @@ -532,11 +535,14 @@ function fxPromoteurHubGetEventLinks($arrItem, $strLangue) } $blnSuper = !empty($_SESSION['usa_id']); - $blnLegacy = $blnSuper || fxIsPromoteur($intComId, $intEveId); - $blnGrantsAll = !$blnLegacy && fxEveAccesComEventHasGrantsAllKit($intComId, $intEveId); + $blnHasV2 = fxEveAccesComHasV2ForEvent($intComId, $intEveId); + $blnLegacyPromoteur = fxIsPromoteur($intComId, $intEveId); + // Menus « tout ouvert » legacy seulement si PAS de kit V2 sur cet événement + $blnLegacyMenus = $blnLegacyPromoteur && !$blnHasV2; + $blnGrantsAll = $blnHasV2 && fxEveAccesComEventHasGrantsAllKit($intComId, $intEveId); - $fnCan = function ($arrKeys) use ($intComId, $intEveId, $blnSuper, $blnLegacy, $blnGrantsAll) { - if ($blnSuper || $blnLegacy || $blnGrantsAll) { + $fnCan = function ($arrKeys) use ($intComId, $intEveId, $blnSuper, $blnLegacyMenus, $blnGrantsAll) { + if ($blnSuper || $blnLegacyMenus || $blnGrantsAll) { return true; } return fxEveAccesHasAnyPermission($intComId, $intEveId, $arrKeys); @@ -581,7 +587,7 @@ function fxPromoteurHubGetEventLinks($arrItem, $strLangue) $arrRapports[] = array('label' => ($strLangue === 'fr' ? 'Paiements' : 'Payments'), 'url' => $strRapport . 'remboursements&e=' . $strE . '&lng=' . $strLangue, 'target' => '_blank'); } - if (($blnLegacy || $blnGrantsAll || $fnCan(array('reports.custom'))) && function_exists('fxGetMenussuperadm')) { + if (($blnLegacyMenus || $blnGrantsAll || $blnSuper || $fnCan(array('reports.custom'))) && function_exists('fxGetMenussuperadm')) { $tabRapports = fxGetMenussuperadm(0, 0, 1, $intEveId); if (is_array($tabRapports)) { for ($intCtr = 1; $intCtr <= count($tabRapports); $intCtr++) { @@ -596,8 +602,8 @@ function fxPromoteurHubGetEventLinks($arrItem, $strLangue) // ---- Gestion ---- if (!$blnDon) { - // Menus legacy (dossards / quantités classiques) : promoteur legacy seulement - if ($blnLegacy) { + // Menus legacy (dossards / quantités classiques) : promoteur legacy seul (sans kit V2) + if ($blnLegacyMenus || $blnSuper || $blnGrantsAll) { $arrGestion[] = array('label' => fxPromoteurHubTexte('tableau_promoteur_menudossard', 0), 'url' => $strCompte . 'inc_tableau_dossards?promoteur_eve_id=' . $strE . '&lng=' . $strLangue, 'icon' => 'fa-id-card-o'); if (intval($arrItem['qte_modifiable'] ?? 0) == 1) { @@ -611,7 +617,7 @@ function fxPromoteurHubGetEventLinks($arrItem, $strLangue) } } - if ($blnLegacy) { + if ($blnLegacyMenus || $blnSuper || $blnGrantsAll) { $arrGestion[] = array('label' => fxPromoteurHubTexte('tableau_promoteur_menueinscription', 0), 'url' => $strCompte . 'inc_tableau_inscriptions?promoteur_eve_id=' . $strE . '&lng=' . $strLangue, 'icon' => 'fa-users'); } @@ -640,7 +646,7 @@ function fxPromoteurHubGetEventLinks($arrItem, $strLangue) ); } - if ($intTeId == 13 && $blnLegacy) { + if ($intTeId == 13 && ($blnLegacyMenus || $blnSuper || $blnGrantsAll)) { $arrGestion[] = array('label' => fxPromoteurHubTexte('tableau_promoteur_envoie_email_questions', 0), 'url' => $strCompte . 'inc_tableau_mail_questions?promoteur_eve_id=' . $strE . '&lng=' . $strLangue, 'icon' => 'fa-paper-plane'); }