Commit b2ad8516 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Utilisation de l'aide de vue avec renderTitle pour les titres des pages de l'intervenant

parent e2b4036a
......@@ -122,4 +122,19 @@ class IntervenantViewHelper extends AbstractHtmlElement
return $out;
}
public function renderTitle(?string $title)
{
$title = 'tt' . $title;
$intervenant = $this->getIntervenant();
//echo $intervenant . ' <small>' . $intervenant->getStatut() . '</small>';
$this->getView()->headTitle()->append($intervenant->getNomUsuel())->append($title);
$title .= ' <small>' . $intervenant . '</small>';
echo $this->getView()->tag('h1', ['class' => 'page-header'])->html($title);
}
}
\ No newline at end of file
......@@ -10,19 +10,18 @@
* @var $hasActions boolean
*/
$this->headTitle()->append($intervenant->getNomUsuel())->append("Agrément $typeAgrement");
$title = "Agrément par " . $typeAgrement->toString(true);
$this->intervenant($intervenant)->renderTitle($title);
?>
<h1 class="page-header"><?= sprintf("Agrément par %s <small>%s</small>", $typeAgrement->toString(true), $intervenant) ?></h1>
<?php if (!empty($data)): ?>
if (!empty($data)): ?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<?php if ($needStructure): ?><th style="width: 100px">Composante</th><?php endif; ?>
<?php if ($needStructure): ?>
<th style="width: 100px">Composante</th><?php endif; ?>
<th>Agrément</th>
<?php if ($hasActions): ?><th style="width:1px">Action</th><?php endif; ?>
<?php if ($hasActions): ?>
<th style="width:1px">Action</th><?php endif; ?>
</tr>
</thead>
<tbody>
......@@ -46,8 +45,9 @@ $this->headTitle()->append($intervenant->getNomUsuel())->append("Agrément $type
L'agrément ne peut être retiré que l'année de sa décision.
<?php else: ?>
<?php if ($actionUrl): ?>
<a class="btn btn-primary pop-ajax " data-submit-reload="true" data-min-width="13em" data-placement="left"
href="<?= $actionUrl ?>"><?= $actionLabel ?></a>
<a class="btn btn-primary pop-ajax " data-submit-reload="true" data-min-width="13em"
data-placement="left"
href="<?= $actionUrl ?>"><?= $actionLabel ?></a>
<?php endif; ?>
<?php endif; ?>
......@@ -63,6 +63,5 @@ $this->headTitle()->append($intervenant->getNomUsuel())->append("Agrément $type
<?php endif; ?>
<hr/>
<?= $this->feuilleDeRoute($intervenant)->renderNav($typeAgrement->getCode()); ?>
<hr/>
<?= $this->feuilleDeRoute($intervenant)->renderNav($typeAgrement->getCode()); ?>
......@@ -16,7 +16,7 @@ foreach ($contrats as $contrat) {
}
}
$this->headTitle()->append($intervenant->getNomUsuel())->append("Contrat/avenant");
$this->intervenant($intervenant)->renderTitle("Contrat/avenant");
$this->messenger()->addMessagesFromFlashMessenger();
if ($services['non-contractualises']) {
......@@ -25,11 +25,7 @@ if ($services['non-contractualises']) {
$this->messenger()->addMessage('Tous les enseignements prévisionnels validés ont fait l\'objet d\'un contrat ou d\'un avenant.', 'success');
}
?>
<h1 class="page-header"><?= $title ?></h1>
<?= $this->messenger() ?>
$this->messenger() ?>
<style>
th.structure, td.structure {
......
......@@ -33,13 +33,7 @@ $menuUrl = $this->url('intervenant/services', ['intervenant' => $intervenant->ge
$btnNextUrl = $this->url('workflow/feuille-de-route-btn-next', ['intervenant' => $intervenant->getId(), 'wfEtapeCode' => $nextEtape]);
$this->headTitle()->append($intervenant->getNomUsuel())->append($title);
$title .= ' <small>' . $intervenant . '</small>';
?>
<h1 class="page-header"><?= $title; ?></h1>
<?php
$this->intervenant($intervenant)->renderTitle($title);
echo $this->messenger()->addCurrentMessagesFromFlashMessenger();
......
......@@ -10,7 +10,6 @@ $totalService =
+ (float)vn($data, 'SERVICE_FC')
+ (float)vn($data, 'SERVICE_REFERENTIEL');
$this->headTitle()->append($intervenant->getNomUsuel())->append("Heures compl.");
function vn(array $array, $key, $type = 's')
{
......@@ -34,6 +33,8 @@ function vn(array $array, $key, $type = 's')
return null;
}
$this->intervenant($intervenant)->renderTitle('Calcul HETD');
?>
<style>
......@@ -41,9 +42,6 @@ function vn(array $array, $key, $type = 's')
background-color: #eee
}
</style>
<h1 class="page-header"><?= $intervenant ?>
<small><?= $intervenant->getStatut()->getTypeIntervenant() ?></small>
</h1>
<?= $this->form()->openTag($form->prepare()); ?>
<div class="row">
<div class="col-sm-4"><?= $this->formControlGroup($form->get('type-volume-horaire')); ?></div>
......
......@@ -5,15 +5,7 @@ use Application\Provider\Privilege\Privileges;
/* @var $intervenant \Application\Entity\Db\Intervenant */
/* @var $role \Application\Acl\Role */
$this->headTitle()->append($intervenant->getNomUsuel())->append("Fiche");
?>
<h1 class="page-header"><?= $intervenant ?>
<small><?= $intervenant->getStatut()->getTypeIntervenant() ?></small>
</h1>
<?php
$this->intervenant($intervenant)->renderTitle('Fiche');
$tabs = [
[
......
<?php
/**
* @var $this \Application\View\Renderer\PhpRenderer
* @var $intervenant Application\Entity\Db\Intervenant
* @var $serviceaAPayer Application\Entity\Db\ServiceAPayerInterface[]
* @var $saved boolean
* @var $dateDerniereModif DateTime
* @var $this \Application\View\Renderer\PhpRenderer
* @var $intervenant Application\Entity\Db\Intervenant
* @var $serviceaAPayer Application\Entity\Db\ServiceAPayerInterface[]
* @var $saved boolean
* @var $dateDerniereModif DateTime
* @var $dernierModificateur \Application\Entity\Db\Utilisateur
* @var $changeIndex integer
* @var $budget array
* @var $whyNotEditable array
* @var $changeIndex integer
* @var $budget array
* @var $whyNotEditable array
*/
$title = 'Demande de mise en paiement';
if ($intervenant){
$title .= ' <small>'.$intervenant.'</small>';
$this->headTitle()->append($intervenant->getNomUsuel())->append($title);
}else{
if ($intervenant) {
$this->intervenant($intervenant)->renderTitle($title);
} else {
$this->headTitle()->append($title);
echo $this->tag('h1', ['class' => 'page-header'])->html($title);
}
$this->headTitle()->append($intervenant->getNomUsuel())->append($title) ?>
<h1 class="page-header"><?= $title; ?></h1>
<?php
if ($whyNotEditable){
if ($whyNotEditable) {
echo '<div class="alert alert-warning">'
.'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
.'<strong>Attention</strong> : certaines demandes de mise en paiement ne peuvent pas être faites :'
.'<ul>';
foreach ($whyNotEditable as $ws){
echo '<li>'.($ws['structure'] ? $ws['structure'] : 'Toutes composantes');
. '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
. '<strong>Attention</strong> : certaines demandes de mise en paiement ne peuvent pas être faites :'
. '<ul>';
foreach ($whyNotEditable as $ws) {
echo '<li>' . ($ws['structure'] ? $ws['structure'] : 'Toutes composantes');
echo '<ul>';
foreach( $ws['raisons'] as $raison){
foreach ($ws['raisons'] as $raison) {
echo "<li>$raison</li>";
}
echo '</ul></li>';
......@@ -44,17 +37,16 @@ if ($whyNotEditable){
}
echo $this->demandeMiseEnPaiement($servicesAPayer, $changeIndex)->setBudget($budget)->render();
echo $this->historique()->setHistoModification($dateDerniereModif)->setHistoModificateur($dernierModificateur);
if ($saved){
?>
<script type="text/javascript">
$(function() {
alertFlash('La demande de paiement a bien été prise en compte.', 'success', 2000);
});
</script>
<?php
if ($saved) {
?>
<script type="text/javascript">
$(function () {
alertFlash('La demande de paiement a bien été prise en compte.', 'success', 2000);
});
</script>
<?php
}
\ No newline at end of file
......@@ -6,12 +6,9 @@
* @var $paiements \Application\Entity\Db\MiseEnPaiement[]
*/
$this->headTitle()->append($intervenant->getNomUsuel())->append("Mises en paiement");
$this->intervenant($intervenant)->renderTitle('Annulation de mises en paiement');
?>
<h1 class="page-header">Annulation de mises en paiement
<small><?= $intervenant ?></small>
</h1>
<form method="post" id="mepform">
<table class="table table-bordered table-condensed table-extra-condensed table-hover table-sort">
<thead>
......
......@@ -6,17 +6,11 @@
* @var $paiements \Application\Entity\Db\TblPaiement[]
*/
$this->headTitle()->append($intervenant->getNomUsuel())->append("Mises en paiement");
$this->intervenant($intervenant)->renderTitle("Mises en paiement");
?>
<h1 class="page-header">Mises en paiement
<small><?= $intervenant ?></small>
</h1>
<?php
$data = [];
$data = [];
$periodes = [];
$total = [
$total = [
'heures-a-payer' => 0,
'heures-demandees' => 0,
'heures-payees' => ['total' => 0],
......@@ -26,10 +20,10 @@ foreach ($paiements as $paiement) {
$sap = $paiement->getServiceAPayer();
if ($sap instanceof \Application\Entity\Db\FormuleResultatService) {
$sid = 'service-'.$sap->getService()->getId();
}else{
$sid = 'service-' . $sap->getService()->getId();
} else {
/* @var $sap \Application\Entity\Db\FormuleResultatServiceReferentiel */
$sid = 'referentiel-'.$sap->getServiceReferentiel()->getId();
$sid = 'referentiel-' . $sap->getServiceReferentiel()->getId();
}
......@@ -44,7 +38,7 @@ foreach ($paiements as $paiement) {
$d['etape'] = (string)$this->etape($service->getElementPedagogique()->getEtape())->renderLink();
$d['element'] = (string)$this->elementPedagogique($service->getElementPedagogique())->renderLink();
} else {
$d['structure'] = (string)$this->structure($service->getIntervenant()->getStructure())->renderLink();
$d['structure'] = (string)$this->structure($service->getIntervenant()->getStructure())->renderLink();
$d['etablissement'] = $this->etablissement($service->getEtablissement())->renderLink();
$d['description'] = $service->getDescription();
}
......@@ -57,43 +51,43 @@ foreach ($paiements as $paiement) {
$d['fonction'] = (string)$this->fonctionReferentiel($serviceReferentiel->getFonction())->renderLink();
$d['description'] = $serviceReferentiel->getCommentaires();
}
$d['heures-a-payer'] = $paiement->getHeuresAPayer();
$d['heures-a-payer'] = $paiement->getHeuresAPayer();
$total['heures-a-payer'] += $paiement->getHeuresAPayer();
$d['heures-demandees'] = 0;
$d['heures-payees'] = ['total' => 0];
$data[$sid] = $d;
$d['heures-demandees'] = 0;
$d['heures-payees'] = ['total' => 0];
$data[$sid] = $d;
}
// addition des heures demandées
$data[$sid]['heures-demandees'] += $paiement->getHeuresDemandees();
$total['heures-demandees'] += $paiement->getHeuresDemandees();
$total['heures-demandees'] += $paiement->getHeuresDemandees();
// addition des heures payées
if ($hp = $paiement->getHeuresPayees()){
if ($hp = $paiement->getHeuresPayees()) {
$data[$sid]['heures-payees']['total'] += $paiement->getHeuresPayees();
$total['heures-payees']['total'] += $paiement->getHeuresPayees();
$total['heures-payees']['total'] += $paiement->getHeuresPayees();
$ppId = $paiement->getPeriodePaiement()->getId();
if (!isset($periodes[$ppId])){
if (!isset($periodes[$ppId])) {
$periodes[$ppId] = $paiement->getPeriodePaiement();
}
if (!isset($data[$sid]['heures-payees'][$ppId])){
if (!isset($data[$sid]['heures-payees'][$ppId])) {
$data[$sid]['heures-payees'][$ppId] = 0;
}
$data[$sid]['heures-payees'][$ppId] += $paiement->getHeuresPayees();
if (!isset($total['heures-payees'][$ppId])){
if (!isset($total['heures-payees'][$ppId])) {
$total['heures-payees'][$ppId] = 0;
}
$total['heures-payees'][$ppId] += $paiement->getHeuresPayees();
}
}
uasort($periodes, function($p1,$p2){
uasort($periodes, function ($p1, $p2) {
return $p1->getOrdre() > $p2->getOrdre();
});
foreach( $periodes as $id => $periode ){
foreach ($periodes as $id => $periode) {
/* @var $periode \Application\Entity\Db\Periode */
$periodes[$id] = $periode->getLibelleAnnuel($intervenant->getAnnee());
}
......@@ -105,55 +99,53 @@ foreach( $periodes as $id => $periode ){
<th style="width:25%">Formation</th>
<th style="width:25%">Enseignement</th>
<th style="width:10%">À payer <abbr title="Heures équivalent TD">(HETD)</abbr></th>
<th style="width:10%"><abbr title="Demandes émanant de la composante">Demandes de paiement</abbr> <abbr title="Heures équivalent TD">(HETD)</abbr></th>
<th style="width:10%"><abbr title="Demandes émanant de la composante">Demandes de paiement</abbr> <abbr
title="Heures équivalent TD">(HETD)</abbr></th>
<th style="width:20%">Mises en paiement <abbr title="Heures équivalent TD">(HETD)</abbr></th>
</tr>
<?php
foreach( $data as $d ){
if ($d['heures-a-payer'] > 0 ){
$d['heures-restantes'] = $d['heures-a-payer'] - $d['heures-payees']['total'];
echo '<tr>';
if (isset($d['element'])){
// enseignement normal
echo '<td>'.$d['structure'].'</td>';
echo '<td>'.$d['etape'].'</td>';
echo '<td>'.$d['element'].'</td>';
}elseif(isset($d['etablissement'])){
// enseignement extérieur
echo '<td colspan="2">'.$d['etablissement'].'</td>';
echo '<td>'.$d['description'].'</td>';
}elseif(isset($d['fonction'])){
// référentiel
echo '<td>'.$d['structure'].'</td>';
echo '<td>'.$d['fonction'].' <small>(Référentiel)</small></td>';
echo '<td>'.$d['description'].'</td>';
}
<?php
foreach ($data as $d) {
if ($d['heures-a-payer'] > 0) {
$d['heures-restantes'] = $d['heures-a-payer'] - $d['heures-payees']['total'];
echo '<tr>';
if (isset($d['element'])) {
// enseignement normal
echo '<td>' . $d['structure'] . '</td>';
echo '<td>' . $d['etape'] . '</td>';
echo '<td>' . $d['element'] . '</td>';
} elseif (isset($d['etablissement'])) {
// enseignement extérieur
echo '<td colspan="2">' . $d['etablissement'] . '</td>';
echo '<td>' . $d['description'] . '</td>';
} elseif (isset($d['fonction'])) {
// référentiel
echo '<td>' . $d['structure'] . '</td>';
echo '<td>' . $d['fonction'] . ' <small>(Référentiel)</small></td>';
echo '<td>' . $d['description'] . '</td>';
}
echo '<td>'.\UnicaenApp\Util::formattedNumber($d['heures-a-payer']).'</td>';
echo '<td>'.\UnicaenApp\Util::formattedNumber($d['heures-demandees']).'</td>';
echo '<td><table class="table table-bordered table-condensed table-extra-condensed" style="margin-bottom: 0px">';
echo '<td>' . \UnicaenApp\Util::formattedNumber($d['heures-a-payer']) . '</td>';
echo '<td>' . \UnicaenApp\Util::formattedNumber($d['heures-demandees']) . '</td>';
echo '<td><table class="table table-bordered table-condensed table-extra-condensed" style="margin-bottom: 0px">';
foreach( $periodes as $pid => $periode ){
if (isset($d['heures-payees'][$pid])){
$heures = $d['heures-payees'][$pid];
echo '<tr><td style="width:60%">'.$periode.'</td><td style="width:40%;text-align:right">'.\UnicaenApp\Util::formattedNumber($heures).'</td></tr>';
foreach ($periodes as $pid => $periode) {
if (isset($d['heures-payees'][$pid])) {
$heures = $d['heures-payees'][$pid];
echo '<tr><td style="width:60%">' . $periode . '</td><td style="width:40%;text-align:right">' . \UnicaenApp\Util::formattedNumber($heures) . '</td></tr>';
}
}
echo '<tr><th>Total</th><td style="text-align:right">' . \UnicaenApp\Util::formattedNumber($d['heures-payees']['total']) . '</td></tr>';
if ($d['heures-restantes'] > 0) {
echo '<tr><th>Restant</th><td style="text-align:right">' . \UnicaenApp\Util::formattedNumber($d['heures-restantes']) . '</td></tr>';
}
}
echo '<tr><th>Total</th><td style="text-align:right">'.\UnicaenApp\Util::formattedNumber($d['heures-payees']['total']).'</td></tr>';
if ($d['heures-restantes'] > 0){
echo '<tr><th>Restant</th><td style="text-align:right">'.\UnicaenApp\Util::formattedNumber($d['heures-restantes']).'</td></tr>';
}
echo '</table></td>';
echo '</table></td>';
echo '</tr>';
echo '</tr>';
}
}
}
?>
?>
</table>
<table class="table table-bordered table-condensed" style="width:30em">
<tr>
......@@ -161,24 +153,28 @@ foreach( $data as $d ){
<td colspan="2" style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-a-payer']) ?></td>
</tr>
<tr>
<th><abbr title="Demandes émanant de la composante">Demandes de paiement</abbr> <abbr title="Heures équivalent TD">(HETD)</abbr></th>
<th><abbr title="Demandes émanant de la composante">Demandes de paiement</abbr> <abbr title="Heures équivalent TD">(HETD)</abbr>
</th>
<td colspan="2" style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-demandees']) ?></td>
</tr>
<tr>
<th rowspan="<?= count($total['heures-payees']) ?>">Mises en paiement <abbr title="Heures équivalent TD">(HETD)</abbr></th>
</tr>
<?php foreach( $periodes as $pid => $periode ): if (isset($total['heures-payees'][$pid])): ?>
<tr>
<td><?= $periode ?></td>
<td style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-payees'][$pid]) ?></td>
<th rowspan="<?= count($total['heures-payees']) ?>">Mises en paiement <abbr title="Heures équivalent TD">(HETD)</abbr>
</th>
</tr>
<?php foreach ($periodes as $pid => $periode): if (isset($total['heures-payees'][$pid])): ?>
<tr>
<td><?= $periode ?></td>
<td style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-payees'][$pid]) ?></td>
</tr>
<?php endif; endforeach; ?>
<tr>
<th>Mises en paiement (total <abbr title="Heures équivalent TD">HETD</abbr>)</th>
<td colspan="2" style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-payees']['total']) ?></td>
<td colspan="2"
style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-payees']['total']) ?></td>
</tr>
<tr>
<th>Restant à payer <abbr title="Heures équivalent TD">(HETD)</abbr></th>
<td colspan="2" style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-a-payer']-$total['heures-payees']['total']) ?></td>
<td colspan="2"
style="text-align:right"><?= \UnicaenApp\Util::formattedNumber($total['heures-a-payer'] - $total['heures-payees']['total']) ?></td>
</tr>
</table>
\ No newline at end of file
......@@ -6,14 +6,8 @@
* @var $typeVolumehoraire \Application\Entity\Db\TypeVolumeHoraire
*/
$this->headTitle()->append($intervenant->getNomUsuel())->append($title);
?>
<h1 class="page-header">
<?= $title ?>
<small><?= $intervenant ?></small>
</h1>
<?php
$this->intervenant($intervenant)->renderTitle($title);
$wells = [
'non-valides' => 'Enseignements non validés',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment