87 lines
4.1 KiB
PHP
87 lines
4.1 KiB
PHP
<?php
|
|
$dateHeure = static fn (string $d): string => date_fr($d, !str_ends_with($d, '00:00:00'));
|
|
$dues = count(array_filter($relances, static fn ($r) => $r['jours'] <= 0));
|
|
$delai = static function (int $j): string {
|
|
return match (true) {
|
|
$j < 0 => t('en retard de %d j', -$j),
|
|
$j === 0 => t('aujourd\'hui'),
|
|
default => t('dans %d j', $j),
|
|
};
|
|
};
|
|
?>
|
|
<h1><?= e(t('Suivi')) ?> <small><?= e(tn(count($relances), '%d relance prévue', '%d relances prévues')) ?><?php if ($dues): ?> · <span class="retard"><?= e(tn($dues, 'dont %d à faire aujourd\'hui ou en retard', 'dont %d à faire aujourd\'hui ou en retard')) ?></span><?php endif; ?></small></h1>
|
|
|
|
<div class="deux-egales">
|
|
<section class="carte" id="relances">
|
|
<h2><?= e(t('Relances')) ?></h2>
|
|
<?php if (!$relances): ?>
|
|
<p class="vide"><?= e(t('Aucune relance prévue. Une relance se crée sur la fiche d\'un profil.')) ?></p>
|
|
<?php else: ?>
|
|
<ul class="simple agenda">
|
|
<?php foreach ($relances as $r): ?>
|
|
<li>
|
|
<?= avatar(['id' => $r['candidat_id'], 'prenom' => $r['prenom'], 'nom' => $r['nom'], 'photo' => $r['photo']]) ?>
|
|
<div>
|
|
<a href="<?= e(url('profil', ['id' => $r['candidat_id']])) ?>#relances"><?= e($r['prenom'] . ' ' . $r['nom']) ?></a>
|
|
<span class="<?= $r['jours'] <= 0 ? 'retard' : '' ?>"><?= e(date_fr($r['echeance'])) ?>, <?= e($delai((int) $r['jours'])) ?></span>
|
|
<p><?= e(objet_relance($r)) ?></p>
|
|
<small><?= e(t(STATUTS[$r['statut']])) ?> · <?= e(t('créée par %s', $r['nom_affiche'])) ?></small>
|
|
<?php if (peut_ecrire()): ?>
|
|
<form method="post" action="<?= e(url('relance')) ?>" class="actions-ligne">
|
|
<?= champ_csrf() ?>
|
|
<input type="hidden" name="relance_id" value="<?= (int) $r['id'] ?>">
|
|
<input type="hidden" name="retour" value="suivi">
|
|
<button type="submit" name="action" value="faite" class="lien"><?= e(t('Marquer comme faite')) ?></button>
|
|
</form>
|
|
<?php endif; ?>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<div>
|
|
<section class="carte" id="entretiens">
|
|
<h2><?= e(t('Entretiens des 30 prochains jours')) ?></h2>
|
|
<?php if (!$entretiens): ?>
|
|
<p class="vide"><?= e(t('Aucun entretien prévu. Un entretien se saisit sur la fiche d\'un profil.')) ?></p>
|
|
<?php else: ?>
|
|
<ul class="simple agenda">
|
|
<?php foreach ($entretiens as $x): ?>
|
|
<li>
|
|
<?= avatar(['id' => $x['candidat_id'], 'prenom' => $x['prenom'], 'nom' => $x['nom'], 'photo' => $x['photo']]) ?>
|
|
<div>
|
|
<a href="<?= e(url('profil', ['id' => $x['candidat_id']])) ?>#entretiens"><?= e($x['prenom'] . ' ' . $x['nom']) ?></a>
|
|
<span><?= e($dateHeure($x['date_entretien'])) ?></span>
|
|
<p><?= e(implode(' · ', array_filter([
|
|
t(TYPES_ENTRETIEN[$x['type']]),
|
|
$x['interlocuteur'] ? t('mené par %s', $x['interlocuteur']) : null,
|
|
$x['besoin_intitule'] ? $x['besoin_client'] . ' : ' . $x['besoin_intitule'] : null,
|
|
]))) ?></p>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<?php if ($sansAvis): ?>
|
|
<section class="carte attention" id="sans-avis">
|
|
<h2><?= e(t('Entretiens passés sans avis')) ?></h2>
|
|
<ul class="simple agenda">
|
|
<?php foreach ($sansAvis as $x): ?>
|
|
<li>
|
|
<?= avatar(['id' => $x['candidat_id'], 'prenom' => $x['prenom'], 'nom' => $x['nom'], 'photo' => $x['photo']]) ?>
|
|
<div>
|
|
<a href="<?= e(url('profil', ['id' => $x['candidat_id']])) ?>#entretiens"><?= e($x['prenom'] . ' ' . $x['nom']) ?></a>
|
|
<span><?= e($dateHeure($x['date_entretien'])) ?> · <?= e(t(TYPES_ENTRETIEN[$x['type']])) ?></span>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</section>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|