-
+
+
+
@@ -3121,6 +3121,7 @@ if ($teamMode <= 0) {
+
Bib assignment means giving each registered participant a bib number for race day.
This panel lets you define available numbers (sequences), assign in batch, or assign automatically on registration.
',
+('bib_assignment', 'bib_doc_overview', 'en', 'What is bib assignment?', 'Role of this panel',
+'
+Bib assignment means giving each registered participant on a race a bib number — the number they will wear on event day.
+Why this panel exists
+On each race, registrations arrive over time. This block lets the organizer:
+
+- define which numbers are available (sequences);
+- assign numbers in bulk to registrants who do not yet have a bib;
+- or have a number assigned automatically on each new registration.
+
+Logical order (not the order of buttons on screen)
+
+- Understand what a bib sequence is (page 2).
+- Create your sequences in the table (+ Add, Start, End, OK).
+- Optional: enable automatic assignment (page 4).
+- For registrants already without a number: Assign by sequence → Simulate → GO (page 3).
+
+Two types of help on screen
+
+- Short ? next to the title — one-sentence reminder.
+- Guide ? (this document) — full explanations, page by page.
+- Each button also has its own ? for immediate help.
+
+',
'compte.php', 10, 1, NOW()),
+
('bib_assignment', 'bib_doc_sequences', 'en', 'What is a bib sequence?', 'Concept then the table',
-'
A sequence is a range of consecutive numbers (e.g. 1–500). Multiple sequences can exist per race.
Use + Add, set Start/End, click OK. Check rows for batch or auto.
',
+'
+What is a bib sequence?
+A sequence is a range of consecutive numbers reserved for a race.
+Example: sequence 1 to 500 → bibs 1, 2, 3 … through 500 can be assigned. When 250 is taken, the system moves to the next free number in the range.
+You can have multiple sequences on the same race (e.g. 1–500 for the public, 1000–1100 for volunteers).
+Checkbox on the left of each row
+
+- What is it?
- It selects this sequence for an operation (batch or auto).
+- When to use it?
- Before Assign by sequence or before Accept for automatic assignment.
+- How?
- Check one or more rows. Row order may affect priority of ranges.
+
+The table — each column
+
+Eye icon
+- What is it?
- Visual grid: free and used numbers in this sequence.
+- When?
- Check range status or correct a number manually.
+
+
+Start / End
+- What is it?
- First and last number in the range.
+- How?
- Edit the values then click OK on the row to save.
+
+
+OK (green check)
+- What is it?
- Saves the sequence (new row or Start/End change).
+- Note
- Required after + Add or after changing bounds.
+
+
+Delete
+- What is it?
- Removes the sequence from the configuration.
+- Note
- Use carefully if bibs in this range are already assigned.
+
+
+Last / Used / Avail.
+- What is it?
- Last = last number assigned; Used = how many taken; Avail. = how many remain.
+
+
++ Add
+- What is it?
- Adds a new empty sequence row.
+- How?
- + Add → fill Start and End → OK on the row.
+
+',
'compte.php', 20, 1, NOW()),
+
('bib_assignment', 'bib_doc_batch', 'en', 'Buttons: batch assignment', 'Assign by sequence, Simulate, GO…',
-'
Each button explained with: What is it? When? How? Notes.
Assign by sequence
- What is it?
- Opens batch mode.
- How?
- Check sequences → order → Simulate → GO.
Simulate
- What is it?
- Preview without saving.
GO
- What is it?
- Runs assignment for real.
',
+'
+These buttons assign bibs in one operation to all participants who do not yet have a number. Each button below uses the same explanation template.
+
+
+« Assign by sequence » button
+
+- What is it?
+- Opens batch mode: panel with assignment order, Simulate and GO.
+- When to use it?
+- When participants are registered but without a bib, and you want to process them all at once.
+- How?
+- Click the button → check sequences in the table → choose order → Simulate → GO.
+- Note
+- Clicked again, the label becomes Cancel: closes the batch panel without assigning.
+
+
+
+
+« Assignment order » list
+
+- What is it?
+- Sets in what order participants are sorted before receiving a number.
+- When to use it?
+- Always in batch mode, before Simulate or GO.
+- How?
+- Choose from the list: family name, first name, registration date, team name (team race), etc.
+- Note
+- On a solo race, the « team name » option does not appear.
+
+
+
+
+« Simulate » button
+
+- What is it?
+- Shows who would receive which bib if you ran the assignment.
+- When to use it?
+- Always before GO — to verify without risk.
+- How?
+- Sequences checked + order chosen → click Simulate → read the summary (available / to assign / missing).
+- Note
+- No changes to the database: this is a preview only.
+
+
+
+
+« GO » button
+
+- What is it?
+- Runs the batch assignment for real.
+- When to use it?
+- When the simulation looks correct.
+- How?
+- After Simulate (recommended) → GO. Participants without a bib receive a number.
+- Note
+- Real action: numbers are saved. No automatic undo — use Reset if needed.
+
+
+
+
+« Reset » button (red)
+
+- What is it?
+- Removes already assigned bibs on the race.
+- When to use it?
+- Start over, fix a strategy mistake — use with care.
+- Note
+- Only visible when at least one bib is already assigned on the race. Check impact before confirming.
+
+
+',
'compte.php', 30, 1, NOW()),
-('bib_assignment', 'bib_doc_auto', 'en', 'Automatic assignment', 'Concept and buttons',
-'
Auto assigns a bib on each new registration from checked sequences.
',
+
+('bib_assignment', 'bib_doc_auto', 'en', 'Automatic assignment', 'Concept and each button',
+'
+What is automatic assignment?
+As soon as a new participant registers, the system assigns the next free bib in the sequences you checked — without going through Simulate / GO.
+
+
+« Automatic assignment » / « Auto — configure » button
+
+- What is it?
+- Grey = inactive. Green « Auto — configure » = already active; you change which sequences are used.
+- When?
+- During registration if you want numbers assigned immediately on signup.
+- How?
+- Click → check sequences → Accept.
+
+
+
+
+« Auto on » badge
+
+- What is it?
+- Green indicator: auto is running for this race.
+
+
+
+
+« Accept » button
+
+- What is it?
+- Saves the auto configuration (which sequences are used).
+- Note
+- Sequences must be checked before Accept.
+
+
+
+
+« Cancel » button (auto)
+
+- What is it?
+- Closes auto edit mode without saving checkbox changes.
+
+
+
+
+« Disable auto » button
+
+- What is it?
+- Stops automatic assignment.
+- Note
+- Sequences remain; bibs already assigned are not removed.
+
+
+',
'compte.php', 40, 1, NOW()),
-('bib_assignment', 'bib_doc_solo', 'en', 'Individual race', 'Solo impact on buttons',
-'
One participant = one bib. No team sort order.
',
+
+('bib_assignment', 'bib_doc_solo', 'en', 'Individual race (solo)', 'What it is and impact on buttons',
+'
+What is a solo race?
+Each participant competes alone: one registrant = one person = one bib.
+Impact on buttons
+
+- Assignment order: name, first name, registration date, date of birth — no sort by team name.
+- No « Individual bibs » / « 1 team = 1 bib » choice (team races only).
+- Grid (eye): one row per participant.
+
+',
'compte.php', 50, 1, NOW()),
+
('bib_assignment', 'bib_doc_equipe', 'en', 'Team race', 'Assignment method',
-'
Individual bibs vs 1 team = 1 bib. Choose before first assignment.
',
+'
+What is a team race?
+Participants register as a team. How many bibs to assign depends on the method chosen on the left.
+
+
+« Individual bibs »
+
+- What is it?
+- Each member gets their own number, like a solo race.
+- When?
+- Each runner needs a distinct bib on the start line.
+- Note
+- « Team name » sort order is available in batch mode.
+
+
+
+
+« 1 team = 1 bib »
+
+- What is it?
+- All members of a team share the same number.
+- When?
+- The number identifies the team, not each person.
+- Note
+- Batch assigns by team. Choice is locked after the first bib is assigned.
+
+
+',
'compte.php', 60, 1, NOW());
diff --git a/sql/MSIN-doc-bib_gestion.sql b/sql/MSIN-doc-bib_gestion.sql
new file mode 100644
index 0000000..4dbdf1b
--- /dev/null
+++ b/sql/MSIN-doc-bib_gestion.sql
@@ -0,0 +1,115 @@
+-- =============================================================================
+-- MSIN — Documentation : Gestion des épreuves (module bib_gestion)
+-- =============================================================================
+-- Deuxième bloc doc (même niveau que bib_assignment / assignation de dossard).
+-- Ancre UI : bib_v4_gestion_doc → en-tête « Gestion des épreuves ».
+-- Prérequis : tables doc_mod, doc_page, doc_anchor (MSIN-doc-module.sql).
+-- Exécuter sur la BD client (inscription).
+-- =============================================================================
+
+DELETE FROM `doc_page` WHERE `doc_mod_clef` = 'bib_gestion';
+DELETE FROM `doc_anchor` WHERE `doc_mod_clef` = 'bib_gestion';
+DELETE FROM `doc_mod` WHERE `doc_mod_clef` = 'bib_gestion';
+
+INSERT INTO `doc_mod` (`doc_mod_clef`, `doc_mod_prg`, `doc_mod_titre`, `doc_mod_actif`, `doc_mod_tri`, `doc_mod_creation`)
+VALUES ('bib_gestion', 'compte.php', 'Gestion des épreuves', 1, 20, NOW());
+
+INSERT INTO `doc_anchor` (`doc_anchor_clef`, `doc_mod_clef`, `doc_prg`, `doc_actif`, `doc_creation`)
+VALUES ('bib_v4_gestion_doc', 'bib_gestion', 'compte.php', 1, NOW());
+
+-- -----------------------------------------------------------------------------
+-- FR
+-- -----------------------------------------------------------------------------
+
+INSERT INTO `doc_page` (`doc_mod_clef`, `doc_page_clef`, `doc_langue`, `doc_titre`, `doc_sous_titre`, `doc_html`, `doc_prg`, `doc_tri`, `doc_actif`, `doc_creation`) VALUES
+('bib_gestion', 'bib_gest_overview', 'fr', 'C''est quoi la gestion des épreuves ?', 'Rôle de ce bloc',
+'
+La gestion des épreuves regroupe les paramètres et indicateurs liés à chaque épreuve de l''événement — en dehors de l''assignation des dossards.
+À quoi sert ce bloc ?
+Pour chaque épreuve, ce panneau permettra au promoteur de :
+
+- consulter et ajuster les quantités (places disponibles, inscrits, ajustements) ;
+- gérer les paramètres spécifiques à l''épreuve ;
+- suivre les statistiques utiles à la planification (total inscrits, avec dossard, etc.).
+
+Relation avec l''assignation de dossard
+Les deux blocs sont au même niveau pour chaque épreuve :
+
+- Gestion des épreuves — quantités et paramètres de l''épreuve ;
+- Assignation de dossard — séquences et attribution des numéros.
+
+Ce guide est en cours de composition. Utilisez l''icône livre (mode Textes ON) pour éditer le contenu.
+',
+'compte.php', 10, 1, NOW()),
+
+('bib_gestion', 'bib_gest_quantites', 'fr', 'Quantités et places', 'À venir dans ce bloc',
+'
+Quantités d''épreuve
+Chaque épreuve possède une capacité (nombre de places). Le promoteur peut :
+
+- voir la quantité originale et la quantité courante ;
+- appliquer un ajustement (+ / − places) ;
+- consulter le nombre d''inscrits et de places restantes.
+
+Contenu à compléter
+Les champs et boutons de ce bloc seront documentés ici au fur et à mesure de leur mise en place dans l''interface.
+',
+'compte.php', 20, 1, NOW());
+
+-- -----------------------------------------------------------------------------
+-- EN (same structure)
+-- -----------------------------------------------------------------------------
+
+INSERT INTO `doc_page` (`doc_mod_clef`, `doc_page_clef`, `doc_langue`, `doc_titre`, `doc_sous_titre`, `doc_html`, `doc_prg`, `doc_tri`, `doc_actif`, `doc_creation`) VALUES
+('bib_gestion', 'bib_gest_overview', 'en', 'What is race management?', 'Role of this block',
+'
+Race management covers settings and indicators for each race in the event — separate from bib assignment.
+What is this block for?
+For each race, this panel will let the organizer:
+
+- view and adjust quantities (available spots, registrants, adjustments);
+- manage race-specific settings;
+- track statistics useful for planning (total registered, with bib, etc.).
+
+Relationship with bib assignment
+Both blocks sit at the same level for each race:
+
+- Race management — quantities and race settings;
+- Bib assignment — sequences and number allocation.
+
+This guide is a work in progress. Use the book icon (Text mode ON) to edit content.
+',
+'compte.php', 10, 1, NOW()),
+
+('bib_gestion', 'bib_gest_quantites', 'en', 'Quantities and capacity', 'Coming in this block',
+'
+Race quantities
+Each race has a capacity (number of spots). The organizer can:
+
+- view the original and current quantity;
+- apply an adjustment (+ / − spots);
+- see registrants and remaining spots.
+
+Content to complete
+Fields and buttons in this block will be documented here as they are added to the interface.
+',
+'compte.php', 20, 1, NOW());
+
+-- Libellés info (titre bloc + aide courte Tippy)
+UPDATE `info` SET `info_texte` = 'Gestion des épreuves',
+ `info_aide` = 'Quantités, paramètres et statistiques de l''épreuve — distinct de l''assignation des dossards.',
+ `info_maj` = NOW()
+WHERE `info_clef` = 'bib_v4_gestion_title' AND `info_langue` = 'fr' AND `info_prg` = 'compte.php';
+
+UPDATE `info` SET `info_texte` = 'Race management',
+ `info_aide` = 'Race quantities, settings and statistics — separate from bib assignment.',
+ `info_maj` = NOW()
+WHERE `info_clef` = 'bib_v4_gestion_title' AND `info_langue` = 'en' AND `info_prg` = 'compte.php';
+
+UPDATE `info` SET `info_texte` = 'Quantités et paramètres — contenu à venir.',
+ `info_maj` = NOW()
+WHERE `info_clef` = 'bib_v4_gestion_placeholder' AND `info_langue` = 'fr' AND `info_prg` = 'compte.php';
+
+UPDATE `info` SET `info_texte` = 'Quantities and settings — content coming soon.',
+ `info_maj` = NOW()
+WHERE `info_clef` = 'bib_v4_gestion_placeholder' AND `info_langue` = 'en' AND `info_prg` = 'compte.php';