From 64ce1285aabf510f58afc882432c4da16c7bd916 Mon Sep 17 00:00:00 2001 From: oversu <95a7002b-481b-4ef3-b578-f9c421550aa4@localhost> Date: Thu, 3 Sep 2026 23:08:03 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9parer=20les=20scripts=20int=C3=A9gr?= =?UTF-8?q?=C3=A9s=20aux=20vues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Views/_animal_show_modals.php | 38 ++++++++++++------------- app/Views/_expense_modal.php | 12 ++++---- app/Views/agenda.php | 18 ++++++------ app/Views/animals_list.php | 4 +-- app/Views/auth.php | 16 +++++------ app/Views/layout.php | 46 +++++++++++++++---------------- app/Views/litter_add_existing.php | 4 +-- app/Views/litter_form.php | 8 +++--- app/Views/public_site_contact.php | 10 +++---- app/Views/settings_asm3.php | 12 ++++---- app/Views/statistics.php | 25 ++++++++--------- tests/run.php | 16 +++++++++++ 12 files changed, 112 insertions(+), 97 deletions(-) diff --git a/app/Views/_animal_show_modals.php b/app/Views/_animal_show_modals.php index e3e17eb..09a727a 100644 --- a/app/Views/_animal_show_modals.php +++ b/app/Views/_animal_show_modals.php @@ -138,9 +138,9 @@ $today = date('Y-m-d'); select.required = !opening; name.required = opening; button.setAttribute('aria-expanded', opening ? 'true' : 'false'); - button.textContent = opening ? < ? = json_encode(t('common.choose_from_list'), - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ? > : '+ ' + < ? = json_encode(t( - 'common.add'), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ? > ; + button.textContent = opening ? : '+ ' + ; if (opening) name.focus(); }); }); @@ -746,10 +746,10 @@ $today = date('Y-m-d'); const kind = sterilizedCheckbox.form.querySelector('select[name="kind"]'); const reason = document.getElementById('medicalReason'); if (kind) kind.value = 'acte'; - if (reason && reason.value.trim() === '') reason.value = < ? = json_encode(t( - 'animal.sterilization_label'), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ? > ; + if (reason && reason.value.trim() === '') reason.value = ; }); - const animalId = < ? = (int) $animal['id'] ? > ; + const animalId = ; const legacyKey = 'animal_show_active_tab_' + animalId; // L'ancien comportement mémorisait le dernier onglet par animal. Une // ouverture normale doit désormais toujours revenir sur Identité. @@ -822,8 +822,8 @@ $today = date('Y-m-d'); select = document.getElementById('labTemplate'); if (!body) return; const presets = {}; - const references = < ? = json_encode($labReferenceSets ?? [], JSON_UNESCAPED_UNICODE | - JSON_UNESCAPED_SLASHES) ? > ; + const references = ; Object.entries(references).forEach(([key, set]) => presets['ref:' + key] = (set.parameters || []).map(p => [ p.code + ' — ' + p.name, p.unit, p.min, p.max ])); @@ -882,16 +882,16 @@ $today = date('Y-m-d'); pointRadius: 4, tension: .2 }, { - label: < ? = json_encode(t('medical_document.reference_min'), - JSON_UNESCAPED_UNICODE) ? > , + label: , data: points.map(p => p.min), borderColor: '#74c0fc', borderDash: [5, 5], pointRadius: 0, spanGaps: true }, { - label: < ? = json_encode(t('medical_document.reference_max'), - JSON_UNESCAPED_UNICODE) ? > , + label: , data: points.map(p => p.max), borderColor: '#ffa8a8', borderDash: [5, 5], @@ -921,7 +921,7 @@ $today = date('Y-m-d'); x: { title: { display: true, - text: < ? = json_encode(t('chart.date'), JSON_UNESCAPED_UNICODE) ? > + text: } } } @@ -936,7 +936,7 @@ $today = date('Y-m-d'); const el = document.getElementById('weightChart'); if (!el) return; - const rows = < ? = json_encode($weights ?? [], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) ? > ; + const rows = ; // labels = dates, data = poids const labels = rows.map(r => (r.measured_at || '').slice(0, 10)); // YYYY-MM-DD @@ -948,7 +948,7 @@ $today = date('Y-m-d'); data: { labels, datasets: [{ - label: < ? = json_encode(t('chart.weight'), JSON_UNESCAPED_UNICODE) ? > , + label: , data, tension: 0.25, pointRadius: 2 @@ -972,7 +972,7 @@ $today = date('Y-m-d'); x: { title: { display: true, - text: < ? = json_encode(t('chart.date'), JSON_UNESCAPED_UNICODE) ? > + text: } } } @@ -985,14 +985,14 @@ $today = date('Y-m-d'); (function() { const btn = document.getElementById('btn-icad-refresh'); const body = document.getElementById('icad-card-body'); - const tr = < ? = json_encode(['error' => t('animal.icad_error'), 'empty' => t('animal.no_icad'), 'date' => + const tr = t('animal.icad_error'), 'empty' => t('animal.no_icad'), 'date' => t('common.date'), 'recorded' => t('animal.recorded'), 'noEvent' => t('animal.no_event'), 'holder' => t('animal.holder_internal'), 'name' => t('common.name'), 'phone' => t( 'common.phone'), 'email' => t('common.email'), 'icadName' => t('animal.icad_name'), 'microchip' => t('animal.microchip'), 'sex' => t('animal.sex'), 'birth' => t('animal.birth'), 'appearance' => t('animal.appearance'), 'history' => t('animal.icad_history'), 'fetching' => t( 'animal.icad_fetching'), 'fetchError' => t('animal.icad_fetch_error') - ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ? > ; + ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?> ; if (!btn || !body) return; function esc(s) { @@ -1082,7 +1082,7 @@ ${ownerHtml} body: new URLSearchParams({ id, force: '1', - csrf: < ? = json_encode(Auth::csrf()) ? > + csrf: }) }); const j = await r.json(); diff --git a/app/Views/_expense_modal.php b/app/Views/_expense_modal.php index a4fb192..b80cfef 100644 --- a/app/Views/_expense_modal.php +++ b/app/Views/_expense_modal.php @@ -44,14 +44,14 @@ document.addEventListener('DOMContentLoaded', () => { const s = document.getElementById('expenseTariff'), h = document.getElementById('expenseHint'), - template = < ? = json_encode(t('expense.unit_estimate'), JSON_UNESCAPED_UNICODE | - JSON_UNESCAPED_SLASHES) ? > , - empty = < ? = json_encode(t('expense.price_after_discount'), JSON_UNESCAPED_UNICODE | - JSON_UNESCAPED_SLASHES) ? > ; + template = , + empty = ; s?.addEventListener('change', () => { const o = s.selectedOptions[0], - price = (Number(o?.dataset.price || 0) / 100).toLocaleString( < ? = json_encode(I18n:: - locale() === 'fr' ? 'fr-FR' : 'en-GB') ? > , { + price = (Number(o?.dataset.price || 0) / 100).toLocaleString( , { minimumFractionDigits: 2 }); h.textContent = o?.value ? template.replace(':price', price).replace(':discount', o.dataset diff --git a/app/Views/agenda.php b/app/Views/agenda.php index a89680c..e9cfd05 100644 --- a/app/Views/agenda.php +++ b/app/Views/agenda.php @@ -327,7 +327,7 @@ foreach ($volunteers as $v): ?>