179 lines
8.1 KiB
PHP
179 lines
8.1 KiB
PHP
<?php
|
|
/**
|
|
* CV au format IT Club : aperçu A4, enregistrable en PDF depuis le navigateur.
|
|
* Variables : $c (candidat), $d (contenu préparé par donnees_cv()), $langue, $source, $anonyme, $traduction.
|
|
* La barre d'outils suit la langue de l'interface, la feuille suit la langue du CV.
|
|
*/
|
|
$lien = static fn (string $page, array $plus = []): string => url($page, $plus + ['id' => $c['id'], 'langue' => $langue] + ($anonyme ? ['anonyme' => 1] : []));
|
|
$etat = $traduction['etat'];
|
|
?>
|
|
<!doctype html>
|
|
<html lang="<?= e(langue_courante()) ?>">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="robots" content="noindex, nofollow">
|
|
<title><?= e($d['fichier']) ?></title>
|
|
<link rel="stylesheet" href="assets/cv.css?v=1.8">
|
|
</head>
|
|
<body>
|
|
|
|
<div class="outils">
|
|
<a href="<?= e(url('profil', ['id' => $c['id']])) ?>"><?= e(t('Retour à la fiche')) ?></a>
|
|
<span class="versions" role="group" aria-label="<?= e(t('Version')) ?>">
|
|
<a href="<?= e(url('cv', ['id' => $c['id'], 'langue' => $langue])) ?>"<?= $anonyme ? '' : ' aria-current="true"' ?>><?= e(t('Nominatif')) ?></a>
|
|
<a href="<?= e(url('cv', ['id' => $c['id'], 'langue' => $langue, 'anonyme' => 1])) ?>"<?= $anonyme ? ' aria-current="true"' : '' ?>><?= e(t('Anonymisé')) ?></a>
|
|
</span>
|
|
<span class="versions" role="group" aria-label="<?= e(t('Langue du CV')) ?>">
|
|
<?php foreach (LANGUES_CV as $code => $nom): ?>
|
|
<a href="<?= e($lien('cv', ['langue' => $code])) ?>" lang="<?= e($code) ?>" title="<?= e($nom) ?>"<?= $code === $langue ? ' aria-current="true"' : '' ?>><?= e(strtoupper($code)) ?></a>
|
|
<?php endforeach; ?>
|
|
</span>
|
|
<a class="action" href="<?= e($lien('cv_word')) ?>"><?= e(t('Télécharger en Word')) ?></a>
|
|
<button type="button" class="action" id="imprimer"><?= e(t('Enregistrer en PDF')) ?></button>
|
|
</div>
|
|
|
|
<?php if (!empty($_SESSION['flash'])): ?>
|
|
<?php foreach ($_SESSION['flash'] as $f): ?>
|
|
<p class="note note-<?= e($f['type']) ?>" role="status"><?= e($f['message']) ?></p>
|
|
<?php endforeach; unset($_SESSION['flash']); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($etat === 'absente' || $etat === 'perimee'): ?>
|
|
<div class="note note-traduction">
|
|
<p>
|
|
<strong><?= e($etat === 'perimee'
|
|
? t('La fiche a changé depuis la traduction : le contenu s\'affiche dans sa langue d\'origine.')
|
|
: t('Seuls les intitulés sont traduits : le contenu reste dans la langue du CV d\'origine (%s).', strtoupper($source))) ?></strong>
|
|
</p>
|
|
<?php if (peut_ecrire()): ?>
|
|
<div class="note-actions">
|
|
<?php if (Claude::configure()): ?>
|
|
<form method="post" action="<?= e(url('cv_traduire')) ?>" data-attente="<?= e(t('Traduction en cours…')) ?>">
|
|
<?= champ_csrf() ?>
|
|
<input type="hidden" name="id" value="<?= (int) $c['id'] ?>">
|
|
<input type="hidden" name="langue" value="<?= e($langue) ?>">
|
|
<?php if ($anonyme): ?><input type="hidden" name="anonyme" value="1"><?php endif; ?>
|
|
<button type="submit"><?= e(t('Traduire le contenu')) ?></button>
|
|
</form>
|
|
<?php endif; ?>
|
|
<details>
|
|
<summary><?= e(t('Traduire par fichier')) ?></summary>
|
|
<ol>
|
|
<li><a href="<?= e($lien('cv_paquet')) ?>"><?= e(t('Télécharger le fichier à traduire')) ?></a></li>
|
|
<li><?= e(t('Le déposer dans votre projet Claude d\'analyse, qui renvoie le fichier traduit.')) ?></li>
|
|
<li>
|
|
<form method="post" action="<?= e(url('cv_traduction')) ?>" enctype="multipart/form-data">
|
|
<?= champ_csrf() ?>
|
|
<input type="hidden" name="id" value="<?= (int) $c['id'] ?>">
|
|
<input type="hidden" name="langue" value="<?= e($langue) ?>">
|
|
<?php if ($anonyme): ?><input type="hidden" name="anonyme" value="1"><?php endif; ?>
|
|
<label><?= e(t('Charger le fichier traduit')) ?> <input type="file" name="traduction" accept=".json,application/json" required></label>
|
|
<button type="submit"><?= e(t('Enregistrer la traduction')) ?></button>
|
|
</form>
|
|
</li>
|
|
</ol>
|
|
</details>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php elseif ($etat === 'a_jour'): ?>
|
|
<p class="note note-info">
|
|
<?= e($traduction['origine'] === 'automatique'
|
|
? t('Contenu traduit automatiquement le %s. Relisez-le avant d\'envoyer le CV.', date_fr($traduction['cree_le']))
|
|
: t('Contenu traduit par fichier le %s.', date_fr($traduction['cree_le']))) ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<div class="page" lang="<?= e($langue) ?>">
|
|
<header class="bandeau">
|
|
<img class="logo" src="assets/logo-itclub-or.png" alt="IT Club" width="160" height="50">
|
|
<div class="identite">
|
|
<h1><?= e($d['nom']) ?></h1>
|
|
<?php if ($d['titre'] !== ''): ?><p class="titre"><?= e($d['titre']) ?></p><?php endif; ?>
|
|
</div>
|
|
</header>
|
|
|
|
<?php /* Tableau de mise en page : l'en-tête et le pied vides se répètent sur chaque page imprimée et tiennent lieu de marges. */ ?>
|
|
<table class="corps" role="presentation">
|
|
<thead><tr><td><div class="marge-haut"></div></td></tr></thead>
|
|
<tfoot><tr><td><div class="marge-bas"></div></td></tr></tfoot>
|
|
<tbody><tr><td>
|
|
|
|
<p class="reperes">
|
|
<?php foreach ($d['reperes'] as $libelle => $valeur): ?>
|
|
<span><small><?= e($libelle) ?></small> <strong><?= e($valeur) ?></strong></span>
|
|
<?php endforeach; ?>
|
|
</p>
|
|
|
|
<?php if ($d['resume']): ?>
|
|
<section>
|
|
<h2><?= e($d['libelles']['synthese']) ?></h2>
|
|
<?php foreach ($d['resume'] as $l): ?><p><?= e($l) ?></p><?php endforeach; ?>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($d['competences']): ?>
|
|
<section>
|
|
<h2><?= e($d['libelles']['competences']) ?></h2>
|
|
<table class="competences">
|
|
<?php foreach ($d['competences'] as $libelle => $technos): ?>
|
|
<tr>
|
|
<th scope="row"><?= e($libelle) ?></th>
|
|
<td>
|
|
<?php foreach ($technos as $i => $t): ?><?= $i ? ' · ' : '' ?><span class="techno"><?= e($t['nom']) ?><?php if ($t['annees'] !== ''): ?> <small><?= e($t['annees']) ?></small><?php endif; ?></span><?php endforeach; ?>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($d['experiences']): ?>
|
|
<section>
|
|
<h2><?= e($d['libelles']['experiences']) ?></h2>
|
|
<?php foreach ($d['experiences'] as $x): ?>
|
|
<article class="experience">
|
|
<p class="periode"><?= e($x['debut']) ?><span class="fleche"> → </span><br><?= e($x['fin']) ?></p>
|
|
<div>
|
|
<h3><?= e($x['poste']) ?><?php if ($x['contexte'] !== ''): ?> <span class="employeur"><?= e($x['contexte']) ?></span><?php endif; ?></h3>
|
|
<?php if ($x['cadre'] !== ''): ?><p class="cadre"><?= e($x['cadre']) ?></p><?php endif; ?>
|
|
<?php if ($x['mission'] !== ''): ?><p class="mission"><?= e($x['mission']) ?></p><?php endif; ?>
|
|
<?php foreach ($x['lignes'] as $l): ?><p><?= e($l) ?></p><?php endforeach; ?>
|
|
<?php if ($x['environnement'] !== ''): ?><p class="environnement"><strong><?= e($d['libelles']['environnement']) ?></strong> <?= e($x['environnement']) ?></p><?php endif; ?>
|
|
</div>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($d['formations'] || $d['certifications']): ?>
|
|
<section class="deux">
|
|
<?php foreach ([$d['libelles']['formation'] => $d['formations'], $d['libelles']['certifications'] => $d['certifications']] as $intitule => $liste): if (!$liste) { continue; } ?>
|
|
<div>
|
|
<h2><?= e($intitule) ?></h2>
|
|
<ul>
|
|
<?php foreach ($liste as $f): ?>
|
|
<li><strong><?= e($f['titre']) ?></strong><?= $f['detail'] !== '' ? ', ' . e($f['detail']) : '' ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<footer class="contact">
|
|
<span class="signature"><?= e($d['signature']) ?></span>
|
|
<span><?= e($d['contact']) ?></span>
|
|
</footer>
|
|
|
|
</td></tr></tbody>
|
|
</table>
|
|
|
|
<p class="mentions"><?= e($d['mentions']) ?></p>
|
|
</div>
|
|
|
|
<script src="assets/cv.js?v=1.8" defer></script>
|
|
</body>
|
|
</html>
|