FFE ↔︎ Equipe Import/Export Extension
A PHP extension that imports FFECompet entries into Equipe and exports results back to the FFE (FFECompet), for show jumping and dressage. It provides a self‑contained web UI embedded in an iframe inside Equipe, and an AJAX API.
End-user instructions (FR/EN): see USAGE.md. This document is the technical reference.
Table of Contents
- Overview
- Key Features
- Frontend UI Flow
- What the Import Creates
- AJAX Actions (API)
- Export Formats
- Translations
- Troubleshooting
Overview
The extension exposes a single entry point, index.php, that can:
- Parse an FFE XML entries file (official FFECompet export, e.g.
202642038.xml) and stage its data for import into Equipe. - Push the parsed data to Equipe using its REST endpoints (via
EquipeApiSender). - Export results from Equipe to FFECompet V24 TXT and SIF XML (WinJump).
- Provide a language‑switchable UI (French/English) suitable for embedding in an iframe.
The extension talks to Equipe with an API key and a meeting URL. When launched from Equipe, both are passed automatically through a JWT (GET ?token=...): the user has nothing to enter. A plain POST JSON payload is also accepted for automation.
One file per discipline: the FFE requires a separate result file per discipline, so a mixed show jumping + dressage meeting produces two export files.
Key Features
- ✅ Parse FFE XML and display the show summary (name, FFE number, dates, organiser) and stats (competitions, riders, officials, horses, clubs, entries)
- ✅ Select competitions to import (grouped by date, discipline badge H = jumping / D = dressage) and force a level (Club/Local/Regional/National/Elite/International)
- ✅ Send data to Equipe in the correct order (people, clubs, horses, starts, competitions, etc.)
- ✅ FFE → FEI 2026 judging conversion for show jumping (e.g.
238.1.1→220.1.1.1); dressage test recognised from the FFE protocol - ✅ Height read from the FFE category name (e.g. "(1,10 m)")
- ✅ Safe re‑import: competitions edited manually in Equipe are not overwritten
- ✅ FFE judging table stored at XML analysis and shown in the imports list
- ✅ Export FFECompet V24 (single competition or global batch, one file per discipline)
- ✅ Export SIF XML (WinJump) (single competition)
- ✅ Detect competitions with available results before export
- ✅ Custom fields "Engagement terrain" / "Invitation organisateur": created on import when allowed, status check and Create button, exported as FFE lines 21 / 22
- ✅ On‑site entries also detected from negative back numbers (e.g.
-5) - ✅ Officials/Jury export → FFE line 20 (PDTJ/ASSJ) with judge licence lookup
- ✅ Dressage: per‑judge scores and percentages for positions C, H, M, B, E, average, total, collective marks
- ✅ Two authentication flows: JWT (GET, automatic from Equipe) or plain POST
- ✅ Iframe‑ready (SameSite=None, Secure cookies) and CORS‑controlled
Frontend UI Flow
- Loading → tests the Equipe API connection, then checks whether the meeting already contains FFE competitions:
- none → opens the import screen directly;
- at least one → opens the imports list. The View imports / New import buttons switch between both screens.
- Imports view → lists Equipe competitions tagged as FFE (
foreignidlikeFFE_*or^\d{9}_\d+$), grouped by date. Each row shows the discipline badge, number, name, FFE show number, the stored FFE judging table (e.g. "Barème A sans chrono, sans barrage238.1.1"), the results status (🏆 has results · 🕓 not run yet) and the export buttons (only when results exist). A status line above the list shows whether the custom fields exist on the meeting (✅ present / ❌ missing + Create). Refresh reloads the list. - Upload FFE XML → Analyse file → show summary, stats and competition list. Analysis also stores each competition's FFE judging table; re‑analysing (New import → Analyse → Back) is enough to fill it for competitions already imported.
- Select competitions (all ticked by default, Select all / Deselect all in Quick selection) and choose level (K/L/R/N/E/I), then Import.
- Export from the imports view: FFE / SIF per row, or Export all below the list.
The UI supports language switching (FR/EN) via flag buttons (see Translations).
What the Import Creates
| Item | Show jumping | Dressage |
|---|---|---|
| Competitions | Name = FFE category (e.g. "Préparatoire (1,10 m)"), displayed number FFE-1, FFE-2… |
Same |
| Judging | FFE article converted to the matching 2026 FEI article (e.g. 238.1.1 → 220.1.1.1) | Test recognised from the FFE protocol |
| Height | Read from the category name | — |
| Arena and time | Arena name and start time | Same |
| Entries | Riders, horses (SIRE number), clubs, back numbers | Same |
| Officials | Officials listed in the XML | Same |
| Custom fields | "Engagement terrain" and "Invitation organisateur", created if at least one imported competition allows them | Same |
When the FFE code has no known match (judging table, dressage test) or the height is not in the category name, the value is left empty for the user to set in Equipe; a manually set value is then kept on re‑import.
AJAX Actions (API)
All actions are POSTed to index.php with action=.... Common parameters are api_key and meeting_url.
| Action | Purpose | Required Params | Returns (success) |
|---|---|---|---|
test_connection |
Quick health check against competitions.json |
api_key, meeting_url |
{ success, message, http_code } |
check_imported |
List Equipe competitions flagged as FFE and mark those with results | api_key, meeting_url |
{ success, has_imports, competitions:[...] } |
parse_ffe_xml |
Parse uploaded FFE XML file (also stores FFE judging tables) | xml_file (multipart) |
Parsed structure + stats stored in session |
import_to_equipe |
Import selected competitions (from parsed XML) into Equipe | selected_competitions (JSON array of foreign_id), competition_level (K/L/R/N/E/I), api_key, meeting_url |
{ success, results } |
export_sif |
Export a single competition to SIF XML (WinJump) | competition_id, api_key, meeting_url |
{ filename, content(base64) } |
export_ffecompet |
Export a single competition to FFECompet V24 | competition_id, api_key, meeting_url |
{ filename, content(base64) } |
export_ffecompet_global |
Export all FFE competitions with results, one file per discipline/meeting | api_key, meeting_url |
{ filename, content(base64) } (first file only; the UI reports how many files were generated) |
update_competition_levels |
Update level of competitions in the in‑memory (session) dataset | competitions (JSON array), level |
{ success } |
export_results |
Flat text result export (pretty) | competition_id, competition_name, competition_clabb?, competition_date?, discipline?, api_key, meeting_url |
{ filename, content(base64) } |
change_language |
Toggle UI language | lang = fr or en |
{ success, language } |
Note: All downloads are returned as base64 content. The UI converts and triggers a browser download.
Export Formats
FFECompet (V24)
The generator writes fixed‑width record lines according to the FFECompet V24 spec:
- 00: file header (
date, tagV024FFECompet ...) - 01: contest header (
concours number,discipline codeviamapDisciplineToFFECompetCode()and number of classes) - 02: class declaration (
class number,number of results) - 20: jury lines (president
PDTJ+ assessorsASSJ) with licence number detection - 21, 22: optional custom fields lines (engagement terrain / invitation organisateur) derived from each result's
start_custom_fields; a negative back number is also treated as an on‑site entry (line 21) - 05: Show Jumping results (faults/time for round and jump‑off, indice, presentation, place, prize money)
- 06: Dressage results (score and percentage per judge C/H/M/B/E, average %, total, collective marks, place, prize money)
- 99: file footer (line count)
Result status mapping (determineResultStatus()):
FI(Finished),AB(Retired),EL(Eliminated),DI(Disqualified),NP(Non‑starter)- Priority is given to result field
or(Equipe results), with legacy fallbacks.
SIF (WinJump XML)
Single‑competition export in the WinJump / SIF XML format, with the same filtering rules as FFECompet.
Export rules
- Only combinations that actually competed are exported (result or EL/AB/DI/NP status).
- A competition not yet run is never exported; a combination that has not started yet is left out.
- On‑site entries and organiser's invitations are declared automatically.
- Jury and prize money are exported when filled in Equipe; both are optional in the FFE format.
- Mixed meetings:
export_ffecompet_globalbuilds one file per discipline but returns only the first; the other discipline is exported with the per‑competition FFE button.
Translations
- Language detection and loading via
languages/config.php - Current languages: French (
fr) and English (en) - Users switch language via the 🇫🇷 / 🇬🇧 flag buttons, which invoke
action=change_languageand reload the page.
Troubleshooting
Connection & environment
- 401 / 403 on test connection → invalid X-Api-Key (or expired JWT)
- 404 on
/competitions.json→ invalid meeting_url or meeting not published/accessible - "Aucun fichier XML valide" → ensure the form uses
enctype="multipart/form-data"and PHPupload_max_filesize/post_max_sizeare sufficient - Downloads do nothing → check browser pop‑up blockers and that base64 is converted client‑side (the UI does this automatically)
- Iframe session lost → must be served over HTTPS (SameSite=None requires Secure), and third‑party cookies must not be blocked for your embed scenario
- Wrong jury licences → ensure
people.jsonincludes officials (rnr/id) and that the IDs in competition fields (ckb,hkb, …) match your People dataset
Data & results
- Competition shows "Pending" although finished → results not entered in Equipe; enter them, then Refresh
- Combination missing from the export → no result and no EL/AB/NP status in Equipe
- Judging table / dressage test / height not set → no known FFE match or no height in the category name; set it in Equipe (kept on re‑import)
- Judging table not shown in the imports list → analyse the XML again (New import → Analyse → Back), no re‑import needed
- Custom fields "missing" → click Create in View imports; existing custom fields of the meeting are preserved. To see them in start lists: Equipe Tools → Field selector (
vv) → add Start custom fields - Only one file with "Export all" on a mixed meeting → expected; export the other discipline with each competition's FFE button