Update anomaly navigation badge functionality and localization, increment version code to 4.72.771
This commit enhances the anomaly navigation badge by updating the label format to include a count of items to review. The JavaScript and PHP files are modified to support this new format, improving user feedback on the number of anomalies. Additionally, new localization keys are added for the formatted label in both French and English. The version code is incremented to 4.72.771 to reflect these updates.
This commit is contained in:
@ -478,7 +478,7 @@
|
||||
if (toolId === 'anomalies') {
|
||||
var anomCount = panel.querySelector('.bib-anomalies-count');
|
||||
var destBadge = dest.querySelector('[data-bib-anomalies-nav-badge]');
|
||||
var strTodo = bibJs('jsAnomaliesNavTodo') || 'Élément à valider';
|
||||
var strTodoFmt = bibJs('jsAnomaliesNavTodoFmt') || 'Élément à valider : %d';
|
||||
var intCount = 0;
|
||||
var blnPending = true;
|
||||
|
||||
@ -492,13 +492,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
function bibAnomaliesNavBadgeLabel(count) {
|
||||
return strTodoFmt.replace(/%d/g, String(count));
|
||||
}
|
||||
|
||||
if (!destBadge) {
|
||||
dest.innerHTML = '';
|
||||
if (!blnPending && intCount > 0) {
|
||||
var strLabel = bibAnomaliesNavBadgeLabel(intCount);
|
||||
dest.innerHTML = '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge"'
|
||||
+ ' data-bib-anomalies-nav-badge="1"'
|
||||
+ ' title="' + strTodo.replace(/"/g, '"') + '">'
|
||||
+ strTodo
|
||||
+ ' data-bib-anomalies-nav-count="' + intCount + '"'
|
||||
+ ' title="' + strLabel.replace(/"/g, '"') + '">'
|
||||
+ strLabel
|
||||
+ '</span>';
|
||||
}
|
||||
return;
|
||||
@ -508,11 +514,14 @@
|
||||
destBadge.classList.add('bib-ui-hidden');
|
||||
destBadge.setAttribute('aria-hidden', 'true');
|
||||
destBadge.textContent = '';
|
||||
destBadge.removeAttribute('data-bib-anomalies-nav-count');
|
||||
} else {
|
||||
var strBadgeLabel = bibAnomaliesNavBadgeLabel(intCount);
|
||||
destBadge.classList.remove('bib-ui-hidden');
|
||||
destBadge.removeAttribute('aria-hidden');
|
||||
destBadge.textContent = strTodo;
|
||||
destBadge.setAttribute('title', strTodo);
|
||||
destBadge.textContent = strBadgeLabel;
|
||||
destBadge.setAttribute('title', strBadgeLabel);
|
||||
destBadge.setAttribute('data-bib-anomalies-nav-count', String(intCount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3332,6 +3332,7 @@ function fxBibStaticFallback($clef) {
|
||||
'bib_v4_event_config_title' => ['fr' => "Configuration globale pour l'assignation de dossard", 'en' => 'Global bib assignment settings'],
|
||||
'bib_v4_event_config_inter_epr_on' => ['fr' => 'Inter épreuve', 'en' => 'Inter-race'],
|
||||
'bib_v4_anomalies_nav_todo' => ['fr' => 'Élément à valider', 'en' => 'Item to review'],
|
||||
'bib_v4_anomalies_nav_todo_fmt' => ['fr' => 'Élément à valider : %d', 'en' => 'Item to review: %d'],
|
||||
'bib_v4_qty_summary_title' => ['fr' => 'Sommaire des quantités', 'en' => 'Quantity summary'],
|
||||
'bib_v4_qty_summary_a_assigner' => ['fr' => 'À assigner', 'en' => 'To assign'],
|
||||
'bib_v4_qty_summary_bib_restant' => ['fr' => 'Dossards restants', 'en' => 'Bibs remaining'],
|
||||
@ -3579,7 +3580,8 @@ function fxBibModuleJsDataAttrs() {
|
||||
'assign-full' => 'bib_v4_ajax_assign_full',
|
||||
'assign-partial' => 'bib_v4_ajax_assign_partial',
|
||||
'assign-none' => 'bib_v4_ajax_assign_none',
|
||||
'anomalies-nav-todo' => 'bib_v4_anomalies_nav_todo',
|
||||
'anomalies-nav-todo' => 'bib_v4_anomalies_nav_todo',
|
||||
'anomalies-nav-todo-fmt' => 'bib_v4_anomalies_nav_todo_fmt',
|
||||
];
|
||||
$html = '';
|
||||
foreach ($map as $attr => $clef) {
|
||||
@ -4421,10 +4423,14 @@ function renderBibAnomaliesNavBadge($intCount = 0, $blnPending = false) {
|
||||
. '" data-bib-anomalies-nav-badge="1" aria-hidden="true"></span>';
|
||||
}
|
||||
|
||||
$strLabel = fxBibTexte('bib_v4_anomalies_nav_todo', 0);
|
||||
$strLabel = fxBibMsg('bib_v4_anomalies_nav_todo_fmt', (int)$intCount);
|
||||
if ($strLabel === '' || $strLabel === 'bib_v4_anomalies_nav_todo_fmt') {
|
||||
$strLabel = fxBibTexte('bib_v4_anomalies_nav_todo', 0) . ' : ' . (int)$intCount;
|
||||
}
|
||||
|
||||
return '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge"'
|
||||
. ' data-bib-anomalies-nav-badge="1"'
|
||||
. ' data-bib-anomalies-nav-count="' . (int)$intCount . '"'
|
||||
. ' title="' . fxBibEsc($strLabel) . '">'
|
||||
. fxBibEsc($strLabel)
|
||||
. '</span>';
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Constantes *
|
||||
*
|
||||
**************/
|
||||
define('_VERSION_CODE', '4.72.770');
|
||||
define('_VERSION_CODE', '4.72.771');
|
||||
define('_DATE_CODE', '2026-07-08');
|
||||
//MSIN-4290
|
||||
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');
|
||||
|
||||
@ -1,9 +1,15 @@
|
||||
-- MSIN-4440 — Pastille tuile Anomalies (grille outils bib v4)
|
||||
-- Libellé « Élément à valider » sur la tuile, style Inter épreuve (pas de compteur rouge).
|
||||
-- Libellé « Élément à valider : N » sur la tuile, style Inter épreuve (pas de compteur rouge).
|
||||
-- Idempotent.
|
||||
|
||||
SELECT 'bib_v4_anomalies_nav_todo', 'fr', 'Élément à valider', 'Pastille tuile Anomalies quand au moins une anomalie est ouverte.', 'compte.php', '', 0, 1, '', '', '', NOW()
|
||||
SELECT 'bib_v4_anomalies_nav_todo', 'fr', 'Élément à valider', 'Libellé court pastille tuile Anomalies.', 'compte.php', '', 0, 1, '', '', '', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_nav_todo' AND info_langue = 'fr' AND info_prg = 'compte.php');
|
||||
|
||||
SELECT 'bib_v4_anomalies_nav_todo', 'en', 'Item to review', 'Anomalies tool tile badge when at least one issue is present.', 'compte.php', '', 0, 1, '', '', '', NOW()
|
||||
SELECT 'bib_v4_anomalies_nav_todo', 'en', 'Item to review', 'Short label for anomalies tool tile badge.', 'compte.php', '', 0, 1, '', '', '', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_nav_todo' AND info_langue = 'en' AND info_prg = 'compte.php');
|
||||
|
||||
SELECT 'bib_v4_anomalies_nav_todo_fmt', 'fr', 'Élément à valider : %d', 'Pastille tuile Anomalies avec quantité.', 'compte.php', '', 0, 1, '', '', '', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_nav_todo_fmt' AND info_langue = 'fr' AND info_prg = 'compte.php');
|
||||
|
||||
SELECT 'bib_v4_anomalies_nav_todo_fmt', 'en', 'Item to review: %d', 'Anomalies tool tile badge with count.', 'compte.php', '', 0, 1, '', '', '', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_nav_todo_fmt' AND info_langue = 'en' AND info_prg = 'compte.php');
|
||||
|
||||
Reference in New Issue
Block a user