fix: fiabiliser les fiches animales et vaccinations

This commit is contained in:
Alexandre NOEL 2026-09-15 21:11:21 +02:00
commit 361bef8561
20 changed files with 157 additions and 65 deletions

View file

@ -312,38 +312,12 @@ $currentTime = date('H:i');
<div class="col-md-4"><label class="form-label"><?= h(t('inventory.quantity')) ?></label><input
class="form-control" type="number" min="0" step="0.01" name="inventory_quantity"></div>
<div class="col-md-6">
<label class="form-label"><?= h(t('animal.administered_by')) ?></label>
<select class="form-select" name="administered_by_user_id" id="vaccineAdministrator">
<option value=""><?= h(t('common.not_provided')) ?></option>
<?php foreach (($activeUsers ?? []) as $user): ?><option value="<?= (int)$user['id'] ?>">
<?= h($user['name']) ?></option><?php endforeach; ?><option value="other">
<?= h(t('animal.other_person')) ?></option>
</select>
</div>
<div class="col-md-6 d-none" id="vaccineAdministratorOther">
<label class="form-label"><?= h(t('animal.person_name')) ?></label>
<input class="form-control" name="administered_by_name"
placeholder="<?= h(t('animal.person_placeholder')) ?>">
</div>
<div class="col-md-12">
<label class="form-label"><?= h(t('common.notes')) ?></label>
<input class="form-control" name="notes" placeholder="Optionnel">
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const select = document.getElementById('vaccineAdministrator');
const wrap = document.getElementById('vaccineAdministratorOther');
const sync = () => wrap?.classList.toggle('d-none', select?.value !== 'other');
select?.addEventListener('change', sync);
sync();
});
</script>
</div>
<div class="modal-footer">