Enhance bib management with translation buttons and CSS updates; increment version code
This commit introduces new functions for handling translation buttons in the bib management system, improving user interaction with translated content. The CSS is updated to style these buttons appropriately within the bib summary sections. Additionally, the version code is incremented to 4.72.667 to reflect these enhancements, further improving the user experience in managing bib assignments.
This commit is contained in:
@ -1670,6 +1670,19 @@ a.ms1-trad-link.btn-aide-trad{
|
||||
font-size:9px;
|
||||
}
|
||||
|
||||
#module-bib .epr-header-summary .btn-aide-trad,
|
||||
#module-bib .bib-auto-badge--row .btn-aide-trad{
|
||||
width:18px;
|
||||
height:18px;
|
||||
margin-left:4px;
|
||||
flex-shrink:0;
|
||||
}
|
||||
|
||||
#module-bib .epr-header-summary .btn-aide-trad .fa,
|
||||
#module-bib .bib-auto-badge--row .btn-aide-trad .fa{
|
||||
font-size:9px;
|
||||
}
|
||||
|
||||
.tippy-box[data-theme~='ms1-bib']{
|
||||
background-color:#1e293b;
|
||||
color:#f8fafc;
|
||||
|
||||
@ -1052,7 +1052,9 @@ function fxShowAjouterQuantiteV4($int_epr_id, $intQte, $strLangue) {
|
||||
?>
|
||||
<div class="epr-gestion-qte-edit">
|
||||
<input class="form-control epr-gestion-qte-input" type="number" min="0" maxlength="7" id="qte_restante_<?php echo (int)$int_epr_id; ?>" value="<?php echo (int)$intQte; ?>">
|
||||
<?php echo fxBibBtnAideSegmentOpen(); ?>
|
||||
<button class="btn_qte btn btn-primary btn-sm epr-gestion-qte-ok" type="button" data-epr_id="<?php echo (int)$int_epr_id; ?>" data-qte_initiale="<?php echo (int)$intQte; ?>"><?php fxBibTexte('bib_v4_btn_ok', 1); ?></button>
|
||||
<?php echo fxBibBtnAideSegmentClose('bib_v4_btn_ok'); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@ -2771,6 +2773,34 @@ function fxBibMsg($clef, ...$args) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
/** Crayon traduction bib v4 (page info bib). */
|
||||
function fxBibTradButton($clef) {
|
||||
return fxAdminTradButton($clef, fxBibInfoPage());
|
||||
}
|
||||
|
||||
/** Texte bib + crayon si mode Textes actif. */
|
||||
function fxBibTexteTrad($clef, $mem_echo = 0, $blnAllowEmptyLabel = false) {
|
||||
$html = fxBibEsc(fxBibTexte($clef, 0, $blnAllowEmptyLabel)) . fxBibTradButton($clef);
|
||||
if ($mem_echo) {
|
||||
echo $html;
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/** Message sprintf + crayon. */
|
||||
function fxBibMsgTrad($clef, ...$args) {
|
||||
return fxBibEsc(fxBibMsg($clef, ...$args)) . fxBibTradButton($clef);
|
||||
}
|
||||
|
||||
/** Clé site promoteur_* puis repli bib_v4_* + crayon sur la clé bib. */
|
||||
function fxBibSiteOrBibTexteTrad($strSiteClef, $strBibClef, $mem_echo = 0) {
|
||||
$html = fxBibEsc(fxBibSiteOrBibTexte($strSiteClef, $strBibClef)) . fxBibTradButton($strBibClef);
|
||||
if ($mem_echo) {
|
||||
echo $html;
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/** Description d'une épreuve en conflit : type + catégorie (langue courante), (inactive) si epr_actif = 0. */
|
||||
function fxBibEpreuveDisplayName(array $row, $strLangue = 'fr') {
|
||||
$strLangue = in_array($strLangue, ['fr', 'en'], true) ? $strLangue : 'fr';
|
||||
@ -3024,12 +3054,16 @@ function fxBibBlockHeader($clef, $docAnchorClef = '') {
|
||||
}
|
||||
|
||||
/** Pastille résumé dans la bande bleue (quantité dispo, séquences, etc.). */
|
||||
function fxBibHeaderSummaryBadge($strText, $strVariant = '') {
|
||||
function fxBibHeaderSummaryBadge($strText, $strVariant = '', $strTradClef = '') {
|
||||
$strClass = 'epr-header-summary';
|
||||
if ($strVariant !== '') {
|
||||
$strClass .= ' epr-header-summary--' . preg_replace('/[^a-z0-9-]/', '', $strVariant);
|
||||
}
|
||||
return '<span class="' . $strClass . '">' . fxBibEsc($strText) . '</span>';
|
||||
$strInner = fxBibEsc($strText);
|
||||
if ($strTradClef !== '') {
|
||||
$strInner .= fxBibTradButton($strTradClef);
|
||||
}
|
||||
return '<span class="' . $strClass . '">' . $strInner . '</span>';
|
||||
}
|
||||
|
||||
/** Résumé gestion : quantité disponible. */
|
||||
@ -3037,7 +3071,7 @@ function fxBibGestionHeaderSummary($epr_id) {
|
||||
$arrQuantites = fxGetQuantites((int)$epr_id);
|
||||
$intDispo = (int)$arrQuantites['qte_restante'];
|
||||
$strLabel = fxBibSiteOrBibTexte('promoteur_qte_epr_qte', 'bib_v4_summary_dispo');
|
||||
return fxBibHeaderSummaryBadge($strLabel . ' : ' . $intDispo, 'dispo');
|
||||
return fxBibHeaderSummaryBadge($strLabel . ' : ' . $intDispo, 'dispo', 'bib_v4_summary_dispo');
|
||||
}
|
||||
|
||||
/** Résumé assignation : nombre de séquences (+ auto si actif). */
|
||||
@ -3046,16 +3080,31 @@ function fxBibAssignHeaderSummary($intSeqCount, $blnAutoActive = false) {
|
||||
$intSeqCount = (int)$intSeqCount;
|
||||
if ($intSeqCount > 0) {
|
||||
if ($intSeqCount === 1) {
|
||||
$strSeq = fxBibTexte('bib_v4_summary_seq_one', 0);
|
||||
$html .= fxBibHeaderSummaryBadge(
|
||||
fxBibTexte('bib_v4_summary_seq_one', 0),
|
||||
'seq',
|
||||
'bib_v4_summary_seq_one'
|
||||
);
|
||||
} else {
|
||||
$strSeq = fxBibMsg('bib_v4_summary_seq_many', $intSeqCount);
|
||||
$html .= fxBibHeaderSummaryBadge(
|
||||
fxBibMsg('bib_v4_summary_seq_many', $intSeqCount),
|
||||
'seq',
|
||||
'bib_v4_summary_seq_many'
|
||||
);
|
||||
}
|
||||
$html .= fxBibHeaderSummaryBadge($strSeq, 'seq');
|
||||
} else {
|
||||
$html .= fxBibHeaderSummaryBadge(fxBibTexte('bib_v4_summary_seq_empty', 0), 'seq-empty');
|
||||
$html .= fxBibHeaderSummaryBadge(
|
||||
fxBibTexte('bib_v4_summary_seq_empty', 0),
|
||||
'seq-empty',
|
||||
'bib_v4_summary_seq_empty'
|
||||
);
|
||||
}
|
||||
if ($blnAutoActive) {
|
||||
$html .= fxBibHeaderSummaryBadge(fxBibTexte('bib_v4_auto_badge', 0), 'auto');
|
||||
$html .= fxBibHeaderSummaryBadge(
|
||||
fxBibTexte('bib_v4_auto_badge', 0),
|
||||
'auto',
|
||||
'bib_v4_auto_badge'
|
||||
);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
@ -3214,6 +3263,7 @@ function fxBibRenderRangeAutoBadge(array $range, $mode = 'assign') {
|
||||
. fxBibTippyAttr('bib_v4_auto')
|
||||
. '>'
|
||||
. fxBibEsc(fxBibTexte('bib_v4_auto', 0))
|
||||
. fxBibTradButton('bib_v4_auto')
|
||||
. '</span>';
|
||||
}
|
||||
|
||||
@ -3221,22 +3271,28 @@ function fxBibRenderRangeAutoBadge(array $range, $mode = 'assign') {
|
||||
function fxBibEpreuveHeaderSummaries($tabEpreuve, $infoBib) {
|
||||
$html = '';
|
||||
if ((int)$tabEpreuve['epr_equipe'] === 1) {
|
||||
$strMode = fxBibSiteOrBibTexte('promoteur_epr_equipe', 'bib_v4_summary_team');
|
||||
$html .= fxBibHeaderSummaryBadge($strMode, 'team');
|
||||
$html .= fxBibHeaderSummaryBadge(
|
||||
fxBibSiteOrBibTexte('promoteur_epr_equipe', 'bib_v4_summary_team'),
|
||||
'team',
|
||||
'bib_v4_summary_team'
|
||||
);
|
||||
} else {
|
||||
$strMode = fxBibSiteOrBibTexte('promoteur_epr_solo', 'bib_v4_summary_solo');
|
||||
$html .= fxBibHeaderSummaryBadge($strMode, 'solo');
|
||||
$html .= fxBibHeaderSummaryBadge(
|
||||
fxBibSiteOrBibTexte('promoteur_epr_solo', 'bib_v4_summary_solo'),
|
||||
'solo',
|
||||
'bib_v4_summary_solo'
|
||||
);
|
||||
}
|
||||
|
||||
$strInscLabel = fxBibSiteOrBibTexte('promoteur_qte_epr_qte_ordered', 'bib_v4_summary_registered');
|
||||
$html .= '<span class="epr-header-summary epr-header-summary--insc">'
|
||||
. '<span class="bib-total">' . (int)$infoBib['total'] . '</span> '
|
||||
. fxBibEsc($strInscLabel) . '</span>';
|
||||
. fxBibSiteOrBibTexteTrad('promoteur_qte_epr_qte_ordered', 'bib_v4_summary_registered')
|
||||
. '</span>';
|
||||
|
||||
$strBibLabel = fxBibSiteOrBibTexte('promoteur_qte_epr_qte_orderedavec_bib', 'bib_v4_summary_with_bib');
|
||||
$html .= '<span class="epr-header-summary epr-header-summary--bib">'
|
||||
. '<span class="bib-avec">' . (int)$infoBib['avec_bib'] . '</span> '
|
||||
. fxBibEsc($strBibLabel) . '</span>';
|
||||
. fxBibSiteOrBibTexteTrad('promoteur_qte_epr_qte_orderedavec_bib', 'bib_v4_summary_with_bib')
|
||||
. '</span>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
@ -3301,6 +3357,7 @@ function fxBibColHeader($clef) {
|
||||
return '<span class="' . $strClass . '">'
|
||||
. fxBibEsc($strLabel)
|
||||
. fxBibAideButton($clef)
|
||||
. fxBibTradButton($clef)
|
||||
. '</span>';
|
||||
}
|
||||
|
||||
@ -3613,7 +3670,7 @@ if ($teamMode <= 0) {
|
||||
data-epr-id="<?php echo (int)$tabEpreuves[$i]['epr_id']; ?>">
|
||||
|
||||
<div class="team-mode-title">
|
||||
<?php fxBibTexte('bib_v4_team_mode_title', 1); ?>
|
||||
<?php echo fxBibTexteTrad('bib_v4_team_mode_title', 1); ?>
|
||||
</div>
|
||||
|
||||
<label class="team-mode-option">
|
||||
@ -3623,7 +3680,7 @@ if ($teamMode <= 0) {
|
||||
<?php echo ($lockTeamMode ? 'disabled' : ''); ?>
|
||||
<?php echo ($teamMode === 1 ? 'checked' : ''); ?>>
|
||||
|
||||
<span><?php fxBibTexte('bib_v4_team_mode_individual', 1); ?></span>
|
||||
<span><?php echo fxBibTexteTrad('bib_v4_team_mode_individual', 1); ?></span>
|
||||
</label>
|
||||
|
||||
<label class="team-mode-option">
|
||||
@ -3633,7 +3690,7 @@ if ($teamMode <= 0) {
|
||||
<?php echo ($lockTeamMode ? 'disabled' : ''); ?>
|
||||
<?php echo ($teamMode === 3 ? 'checked' : ''); ?>>
|
||||
|
||||
<span><?php fxBibTexte('bib_v4_team_mode_one_team', 1); ?></span>
|
||||
<span><?php echo fxBibTexteTrad('bib_v4_team_mode_one_team', 1); ?></span>
|
||||
</label>
|
||||
|
||||
|
||||
@ -4097,7 +4154,7 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
|
||||
<div class="epr-content bib-anomalies-content">
|
||||
<?php if (!$blnHasIssues) { ?>
|
||||
<p class="bib-anomalies-empty text-muted mb-0">
|
||||
<?php fxBibTexte('bib_v4_anomalies_none', 1); ?>
|
||||
<?php echo fxBibTexteTrad('bib_v4_anomalies_none', 1); ?>
|
||||
</p>
|
||||
<?php } else { ?>
|
||||
<?php if (!empty($tabAnomalies['dupes'])) { ?>
|
||||
@ -4111,15 +4168,15 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
|
||||
<?php foreach ($tabAnomalies['dupes'] as $item) { ?>
|
||||
<li class="bib-anomaly-item">
|
||||
<strong><?php echo fxBibEsc($item['epr_label']); ?></strong>
|
||||
— <?php echo fxBibEsc(sprintf(
|
||||
fxBibTexte('bib_v4_anomalies_range_fmt', 0),
|
||||
— <?php echo fxBibMsgTrad(
|
||||
'bib_v4_anomalies_range_fmt',
|
||||
(int)$item['range_start'],
|
||||
(int)$item['range_end']
|
||||
)); ?>
|
||||
— <?php echo fxBibEsc(sprintf(
|
||||
fxBibTexte('bib_v4_anomalies_bib_fmt', 0),
|
||||
); ?>
|
||||
— <?php echo fxBibMsgTrad(
|
||||
'bib_v4_anomalies_bib_fmt',
|
||||
(int)$item['no_bib']
|
||||
)); ?>
|
||||
); ?>
|
||||
<ul class="bib-anomaly-sublist list-unstyled mb-0">
|
||||
<?php foreach ($item['participants'] as $p) { ?>
|
||||
<li><?php echo fxBibEsc(trim($p['par_prenom'] . ' ' . $p['par_nom'])); ?></li>
|
||||
@ -4146,18 +4203,18 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
|
||||
?>
|
||||
<li class="bib-anomaly-item">
|
||||
<strong><?php echo fxBibEsc($item['epr_label']); ?></strong>
|
||||
— <?php echo fxBibEsc(sprintf(
|
||||
fxBibTexte('bib_v4_anomalies_range_fmt', 0),
|
||||
— <?php echo fxBibMsgTrad(
|
||||
'bib_v4_anomalies_range_fmt',
|
||||
(int)$item['range_start'],
|
||||
(int)$item['range_end']
|
||||
)); ?>
|
||||
— <?php echo fxBibEsc(sprintf(
|
||||
fxBibTexte('bib_v4_anomalies_bib_fmt', 0),
|
||||
); ?>
|
||||
— <?php echo fxBibMsgTrad(
|
||||
'bib_v4_anomalies_bib_fmt',
|
||||
(int)$item['no_bib']
|
||||
)); ?>
|
||||
); ?>
|
||||
<div class="bib-anomaly-detail text-muted small">
|
||||
<?php echo fxBibEsc(trim($item['par_prenom'] . ' ' . $item['par_nom'])); ?>
|
||||
— <?php echo fxBibEsc(fxBibTexte($strTypeKey, 0)); ?>
|
||||
— <?php echo fxBibTexteTrad($strTypeKey, 1); ?>
|
||||
<?php if ($item['orphan_type'] === 'transferred' && $item['participant_epr_label'] !== '') { ?>
|
||||
(<?php echo fxBibEsc($item['participant_epr_label']); ?>)
|
||||
<?php } ?>
|
||||
@ -4607,6 +4664,7 @@ $blnRangeLocked = fxBibRangeIsLocked($range);
|
||||
value="<?php echo $range['epr_bib_finish']; ?>"
|
||||
<?php echo $blnRangeLocked ? 'readonly' : ''; ?>>
|
||||
|
||||
<?php echo fxBibBtnAideSegmentOpen(); ?>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-primary btn-save-range"
|
||||
data-id="<?php echo $range['epr_bib_id']; ?>"
|
||||
@ -4614,6 +4672,7 @@ $blnRangeLocked = fxBibRangeIsLocked($range);
|
||||
<?php echo $blnRangeLocked ? 'disabled' : ''; ?>>
|
||||
<?php fxBibTexte('bib_v4_btn_ok', 1); ?>
|
||||
</button>
|
||||
<?php echo fxBibBtnAideSegmentClose('bib_v4_btn_ok'); ?>
|
||||
<?php if ((int)$range['epr_bib_id'] > 0) { ?>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-danger btn-delete-range"
|
||||
@ -4680,11 +4739,11 @@ if (!$blnRangeLocked && (
|
||||
|
||||
<div class="bib-error text-danger small mb-2" style="<?php echo (!empty($range['liste_trous']) || !empty($range['liste_doublons'])) ? 'display:block;' : 'display:none;'; ?>">
|
||||
<?php if (!empty($range['liste_trous'])) { ?>
|
||||
<div><?php echo fxBibEsc(fxBibTexte('bib_v4_err_gaps', 0)); ?> <?php echo fxBibEsc($range['liste_trous']); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_err_gaps', 0); ?> <?php echo fxBibEsc($range['liste_trous']); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (!empty($range['liste_doublons'])) { ?>
|
||||
<div><?php echo fxBibEsc(fxBibTexte('bib_v4_err_dupes', 0)); ?> <?php echo fxBibEsc($range['liste_doublons']); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_err_dupes', 0); ?> <?php echo fxBibEsc($range['liste_doublons']); ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -4803,9 +4862,9 @@ if ($title != '') {
|
||||
} else {
|
||||
|
||||
if ($hasRange) {
|
||||
echo fxBibEsc(sprintf(fxBibTexte('bib_v4_view_title_range', 0), $start, $end));
|
||||
echo fxBibMsgTrad('bib_v4_view_title_range', $start, $end);
|
||||
} else {
|
||||
fxBibTexte('bib_v4_view_title_all', 1);
|
||||
echo fxBibTexteTrad('bib_v4_view_title_all', 1);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -4820,16 +4879,16 @@ if ($title != '') {
|
||||
<!-- HEADER -->
|
||||
<div class="bib-view-header">
|
||||
|
||||
<div><?php fxBibTexte('bib_v4_view_col_epreuve', 1); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_view_col_epreuve', 1); ?></div>
|
||||
|
||||
<div><?php fxBibTexte('bib_v4_view_col_participant', 1); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_view_col_participant', 1); ?></div>
|
||||
|
||||
<?php if ((int)$tabEpreuve['epr_equipe'] === 1) { ?>
|
||||
<div><?php fxBibTexte('bib_v4_view_col_team_no', 1); ?></div>
|
||||
<div><?php fxBibTexte('bib_v4_view_col_team', 1); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_view_col_team_no', 1); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_view_col_team', 1); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<div><?php fxBibTexte('bib_v4_view_col_bib', 1); ?></div>
|
||||
<div><?php echo fxBibTexteTrad('bib_v4_view_col_bib', 1); ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -4875,7 +4934,7 @@ echo $p['no_equipe'];
|
||||
echo $p['pec_nom_equipe'];
|
||||
|
||||
if ((int)$p['rol_id'] === 1) {
|
||||
echo ' ' . fxBibEsc(fxBibTexte('bib_v4_view_captain', 0));
|
||||
echo ' ' . fxBibTexteTrad('bib_v4_view_captain', 0);
|
||||
}
|
||||
?>
|
||||
|
||||
@ -4894,16 +4953,18 @@ echo $p['no_equipe'];
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="bib-view-empty">
|
||||
<?php fxBibTexte('bib_v4_view_empty', 1); ?>
|
||||
<?php echo fxBibTexteTrad('bib_v4_view_empty', 1); ?>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div class="bib-view-footer">
|
||||
<?php echo fxBibBtnAideSegmentOpen(); ?>
|
||||
<button type="button" class="btn btn-sm btn-secondary btn-close-view">
|
||||
<?php fxBibTexte('bib_v4_view_close', 1); ?>
|
||||
</button>
|
||||
<?php echo fxBibBtnAideSegmentClose('bib_v4_view_close'); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Constantes *
|
||||
*
|
||||
**************/
|
||||
define('_VERSION_CODE', '4.72.666');
|
||||
define('_VERSION_CODE', '4.72.667');
|
||||
define('_DATE_CODE', '2026-06-18');
|
||||
//MSIN-4290
|
||||
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');
|
||||
|
||||
Reference in New Issue
Block a user