fix: fiabiliser les fiches animales et vaccinations
This commit is contained in:
parent
f45cfc40f2
commit
361bef8561
20 changed files with 157 additions and 65 deletions
|
|
@ -410,7 +410,7 @@ ORDER BY created_at ASC
|
|||
<th><?= h(t('animal.done_on')) ?></th>
|
||||
<th><?= h(t('animal.reminder_due')) ?></th>
|
||||
<th><?= h(t('animal.batch_traceability')) ?></th>
|
||||
<th><?= h(t('animal.administered_by')) ?></th>
|
||||
<th><?= h(t('animal.veterinary_clinic')) ?></th>
|
||||
<th><?= h(t('common.notes')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -424,7 +424,7 @@ ORDER BY created_at ASC
|
|||
<div class="text-muted small">
|
||||
<?= h(t('animal.expires_on', ['date' => date('d/m/Y', strtotime((string)$v['batch_expires_on']))])) ?>
|
||||
</div><?php endif; ?></td>
|
||||
<td><?= !empty($v['administrator_name']) ? h($v['administrator_name']) : '—' ?></td>
|
||||
<td><?= !empty($v['clinic_name']) ? h($v['clinic_name']) : '—' ?></td>
|
||||
<td><?= $v['notes'] ? h($v['notes']) : '—' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -370,12 +370,15 @@ $estMonths = $birth_estimated_months > 0 ? ($birth_estimated_months % 12) : '';
|
|||
<option value="unknown"
|
||||
<?= (($animal['identification_registration_status'] ?? 'unknown') === 'unknown') ? 'selected' : '' ?>>
|
||||
<?= h(t('common.unknown')) ?></option>
|
||||
<option value="pending"
|
||||
<?= (($animal['identification_registration_status'] ?? 'unknown') === 'pending') ? 'selected' : '' ?>>
|
||||
<?= h(t('animal.form.pending')) ?></option>
|
||||
<option value="registered"
|
||||
<?= (($animal['identification_registration_status'] ?? 'unknown') === 'registered') ? 'selected' : '' ?>>
|
||||
<?= h(t('animal.form.registered')) ?></option>
|
||||
<option value="change_pending"
|
||||
<?= in_array(($animal['identification_registration_status'] ?? 'unknown'), ['pending', 'change_pending'], true) ? 'selected' : '' ?>>
|
||||
<?= h(t('animal.form.change_pending')) ?></option>
|
||||
<option value="owner_changed"
|
||||
<?= (($animal['identification_registration_status'] ?? 'unknown') === 'owner_changed') ? 'selected' : '' ?>>
|
||||
<?= h(t('animal.form.owner_changed')) ?></option>
|
||||
</select></div>
|
||||
|
||||
<div class="col-12">
|
||||
|
|
|
|||
|
|
@ -296,9 +296,9 @@ if ($felvPos) {
|
|||
<?php $availability = $animal['adoption_availability'] ?? 'unknown';
|
||||
$availabilityMeta = ['unknown' => [t('animal.availability_define'),'bg-secondary-lt'],'not_available' => [t('animals.unavailable_title'),'bg-orange-lt'],'available' => [t('animals.available_title'),'bg-green-lt']];
|
||||
[$availabilityLabel,$availabilityClass] = $availabilityMeta[$availability] ?? $availabilityMeta['unknown'];
|
||||
$registrationLabels = ['unknown' => t('animal.registration_unknown'),'pending' => t('animal.registration_pending'),'registered' => t('animal.registration_done')];
|
||||
$registrationLabels = ['unknown' => t('animal.registration_unknown'),'pending' => t('animal.registration_change_pending'),'change_pending' => t('animal.registration_change_pending'),'registered' => t('animal.registration_done'),'owner_changed' => t('animal.registration_owner_changed')];
|
||||
$registration = $animal['identification_registration_status'] ?? 'unknown';
|
||||
$registrationClass = $registration === 'registered' ? 'bg-green-lt' : ($registration === 'pending' ? 'bg-yellow-lt' : 'bg-secondary-lt'); ?>
|
||||
$registrationClass = in_array($registration, ['registered', 'owner_changed'], true) ? 'bg-green-lt' : (in_array($registration, ['pending', 'change_pending'], true) ? 'bg-yellow-lt' : 'bg-secondary-lt'); ?>
|
||||
<div class="mt-2 d-flex flex-wrap align-items-center gap-1"><span
|
||||
class="badge <?= h($registrationClass) ?>"><?= h($registrationLabels[$registration] ?? $registrationLabels['unknown']) ?></span><span
|
||||
class="badge <?= h($availabilityClass) ?>"><?= h($availabilityLabel) ?></span><?php if (!empty($animal['website_published'])): ?><span
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
<div class="col-lg-6">
|
||||
<section class="card h-100">
|
||||
<div class="card-body">
|
||||
<span class="badge bg-blue-lt mb-2">1.0.0-rc.25</span>
|
||||
<h3>Portées modifiables et fiables</h3>
|
||||
<p class="text-muted">La création d’une fratrie ne dépend plus d’un ancien traitement de photo et
|
||||
son historique reste compatible avec les bases existantes.</p>
|
||||
<span class="badge bg-blue-lt mb-2">1.0.0-rc.26</span>
|
||||
<h3>Données animales fiabilisées</h3>
|
||||
<p class="text-muted">Les salles configurables, les états I-CAD et le suivi vaccinal restent
|
||||
cohérents sur les installations neuves comme sur les bases historiques.</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue