Enhance mobile registration interface by adding profile details rendering functionality; update CSS for improved layout
This commit introduces new functions to fetch and render participant profile details within the mobile registration interface, including role, name, email, birthdate, and custom questions. The CSS is updated to improve the layout of the profile section. The version code is incremented to 4.72.679 to reflect these changes, enhancing the overall user experience in mobile registrations.
This commit is contained in:
@ -2746,6 +2746,15 @@ a.ms1-trad-link.btn-aide-trad{
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.inscr-mobile-fiche-profile{
|
||||
border-top:1px solid #eee;
|
||||
margin-top:4px;
|
||||
}
|
||||
|
||||
.inscr-mobile-dl--profile{
|
||||
padding-top:8px;
|
||||
}
|
||||
|
||||
.inscr-mobile-bib-row{
|
||||
display:flex;
|
||||
gap:8px;
|
||||
|
||||
@ -209,6 +209,128 @@ function fxInscrMobileBibDisplay($arrRow) {
|
||||
return fxShowBibNumber($arrRow['no_bib'], $arrRow['epr_id'], 'participant');
|
||||
}
|
||||
|
||||
function fxInscrMobileFetchFicheProfile($arrRow, $strLangue) {
|
||||
global $objDatabase;
|
||||
|
||||
$intParId = (int)$arrRow['par_id'];
|
||||
$intPecId = (int)$arrRow['pec_id_original'];
|
||||
$intEveId = (int)$arrRow['eve_id'];
|
||||
$strLangCol = ($strLangue === 'en') ? 'en' : 'fr';
|
||||
|
||||
$tabProfile = $objDatabase->fxGetRow(
|
||||
'SELECT p.par_courriel, p.par_naissance, p.par_sexe, p.par_nom, p.par_prenom, p.par_id_original,'
|
||||
. ' r.rol_nom_' . $strLangCol . ' AS rol_nom'
|
||||
. ' FROM resultats_participants p'
|
||||
. ' LEFT JOIN inscriptions_roles r ON r.rol_id = p.rol_id'
|
||||
. ' WHERE p.par_id = ' . $intParId
|
||||
. ' LIMIT 1'
|
||||
);
|
||||
|
||||
if ($tabProfile === null) {
|
||||
return array(
|
||||
'role' => '',
|
||||
'name' => '',
|
||||
'email' => '',
|
||||
'birth_gender' => '',
|
||||
'questions' => array(),
|
||||
);
|
||||
}
|
||||
|
||||
$strRole = trim((string)$tabProfile['rol_nom']);
|
||||
$strName = trim(fxUnescape($tabProfile['par_nom']) . ', ' . fxUnescape($tabProfile['par_prenom']), ', ');
|
||||
$strEmail = trim((string)$tabProfile['par_courriel']);
|
||||
|
||||
$strBirthGender = '';
|
||||
$strNaissance = trim((string)$tabProfile['par_naissance']);
|
||||
if ($strNaissance !== '' && $strNaissance !== '0000-00-00') {
|
||||
$strBirthGender = fxShowDate($strNaissance, $strLangue)
|
||||
. ' - '
|
||||
. fxGetGender($tabProfile['par_sexe'], $strLangue);
|
||||
}
|
||||
|
||||
$intParIdOriginal = (int)$tabProfile['par_id_original'];
|
||||
$sqlQuestions = 'SELECT rq.que_choix_' . $strLangCol . ' AS que_choix,'
|
||||
. ' iq.que_cart_label_' . $strLangCol . ' AS que_label,'
|
||||
. ' rq.que_question_' . $strLangCol . ' AS que_question,'
|
||||
. ' iq.que_tri, iq.que_id'
|
||||
. ' FROM resultats_questions rq'
|
||||
. ' INNER JOIN inscriptions_questions iq ON iq.que_id = rq.que_id'
|
||||
. ' WHERE iq.que_cart_show = 1'
|
||||
. ' AND iq.eve_id = ' . $intEveId
|
||||
. ' AND rq.pec_id = ' . $intPecId
|
||||
. ' AND (rq.par_id = ' . $intParId . ' OR rq.par_id = ' . $intParIdOriginal . ')'
|
||||
. ' AND rq.que_actif = 1'
|
||||
. " AND TRIM(COALESCE(rq.que_choix_" . $strLangCol . ", '')) <> ''"
|
||||
. ' ORDER BY iq.que_tri, iq.que_id';
|
||||
|
||||
$tabQuestionsRaw = $objDatabase->fxGetResults($sqlQuestions);
|
||||
$tabQuestions = array();
|
||||
|
||||
if ($tabQuestionsRaw !== null) {
|
||||
for ($i = 1; $i <= count($tabQuestionsRaw); $i++) {
|
||||
$tabQ = $tabQuestionsRaw[$i];
|
||||
$strLabel = trim(fxUnescape($tabQ['que_label']));
|
||||
if ($strLabel === '') {
|
||||
$strLabel = trim(fxUnescape($tabQ['que_question']));
|
||||
}
|
||||
$strValue = trim(fxUnescape($tabQ['que_choix']));
|
||||
if ($strLabel === '' || $strValue === '') {
|
||||
continue;
|
||||
}
|
||||
$tabQuestions[] = array(
|
||||
'label' => $strLabel,
|
||||
'value' => $strValue,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'role' => $strRole,
|
||||
'name' => $strName,
|
||||
'email' => $strEmail,
|
||||
'birth_gender' => $strBirthGender,
|
||||
'questions' => $tabQuestions,
|
||||
);
|
||||
}
|
||||
|
||||
function fxInscrMobileRenderFicheProfileDetails($arrRow, $strLangue) {
|
||||
$tabProfile = fxInscrMobileFetchFicheProfile($arrRow, $strLangue);
|
||||
|
||||
$blnHasRole = ($tabProfile['role'] !== '' && $tabProfile['name'] !== '');
|
||||
$blnHasEmail = ($tabProfile['email'] !== '');
|
||||
$blnHasBirth = ($tabProfile['birth_gender'] !== '');
|
||||
$blnHasQuestions = (count($tabProfile['questions']) > 0);
|
||||
|
||||
if (!$blnHasRole && !$blnHasEmail && !$blnHasBirth && !$blnHasQuestions) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<div class="inscr-mobile-fiche-profile">';
|
||||
echo '<dl class="inscr-mobile-dl inscr-mobile-dl--profile">';
|
||||
|
||||
if ($blnHasRole) {
|
||||
echo '<dt>' . fxInscrMobileEsc($tabProfile['role']) . '</dt>';
|
||||
echo '<dd>' . fxInscrMobileEsc($tabProfile['name']) . '</dd>';
|
||||
}
|
||||
|
||||
if ($blnHasEmail) {
|
||||
echo '<dt>' . fxInscrMobileEsc(fxInscrMobileT('inscr_mobile_email')) . '</dt>';
|
||||
echo '<dd>' . fxInscrMobileEsc($tabProfile['email']) . '</dd>';
|
||||
}
|
||||
|
||||
if ($blnHasBirth) {
|
||||
echo '<dt>' . fxInscrMobileEsc(fxInscrMobileT('inscr_mobile_birthdate')) . '</dt>';
|
||||
echo '<dd>' . fxInscrMobileEsc($tabProfile['birth_gender']) . '</dd>';
|
||||
}
|
||||
|
||||
foreach ($tabProfile['questions'] as $tabQuestion) {
|
||||
echo '<dt>' . fxInscrMobileEsc($tabQuestion['label']) . '</dt>';
|
||||
echo '<dd>' . fxInscrMobileEsc($tabQuestion['value']) . '</dd>';
|
||||
}
|
||||
|
||||
echo '</dl></div>';
|
||||
}
|
||||
|
||||
/** Code statut course par défaut (Confirmé). */
|
||||
function fxInscrMobileParStatutCourseDefault() {
|
||||
return 'CONF';
|
||||
@ -704,7 +826,9 @@ function fxInscrMobileRenderFiche($intEveId, $strLangue, $strBaseUrl, $arrReq, $
|
||||
echo '<dd>' . fxInscrMobileEsc($strDetailsType) . '</dd>';
|
||||
echo '<dt>' . fxInscrMobileEsc(fxInscrMobileT('inscr_mobile_modified')) . '</dt>';
|
||||
echo '<dd>' . fxCheckMAJ($arrRow['pec_id_original'], $intParId, $strLangue) . '</dd>';
|
||||
echo '</dl></div>';
|
||||
echo '</dl>';
|
||||
fxInscrMobileRenderFicheProfileDetails($arrRow, $strLangue);
|
||||
echo '</div>';
|
||||
|
||||
$strStyleEdit = $strStyleCancel = '';
|
||||
$strStyleRetablir = ' d-none';
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Constantes *
|
||||
*
|
||||
**************/
|
||||
define('_VERSION_CODE', '4.72.678');
|
||||
define('_VERSION_CODE', '4.72.679');
|
||||
define('_DATE_CODE', '2026-06-18');
|
||||
//MSIN-4290
|
||||
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');
|
||||
|
||||
12
sql/MSIN-inscriptions-mobile-fiche-profile-i18n.sql
Normal file
12
sql/MSIN-inscriptions-mobile-fiche-profile-i18n.sql
Normal file
@ -0,0 +1,12 @@
|
||||
-- Inscriptions mobile — fiche participant (courriel, date de naissance)
|
||||
|
||||
|
||||
|
||||
DELETE FROM info WHERE info_clef IN (
|
||||
|
||||
'inscr_mobile_email',
|
||||
|
||||
'inscr_mobile_birthdate'
|
||||
|
||||
) AND info_prg = 'compte.php';
|
||||
|
||||
Reference in New Issue
Block a user