Skip to content
Snippets Groups Projects
Commit c339aa5c authored by lecluse's avatar lecluse
Browse files

En préparation au déplacement sous le service référentiel des calculs liés aux...

En préparation au déplacement sous le service référentiel des calculs liés aux HETD et heures à payer.
Affichage du total des heures de service référentiel. Formatage à droite des heures de SR.
parent 40ad3d39
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,7 @@ class Ligne extends AbstractHelper implements ServiceLocatorAwareInterface, Cont ...@@ -65,7 +65,7 @@ class Ligne extends AbstractHelper implements ServiceLocatorAwareInterface, Cont
$parts['annee'] = '<td>' . $this->renderAnnee($this->service->getAnnee()) . "</td>\n"; $parts['annee'] = '<td>' . $this->renderAnnee($this->service->getAnnee()) . "</td>\n";
$parts[] = '<td>' . $this->renderFonction($this->service->getFonction()) . "</td>\n"; $parts[] = '<td>' . $this->renderFonction($this->service->getFonction()) . "</td>\n";
$parts[] = '<td>' . $this->renderCommentaires($this->service->getCommentaires()) . "</td>\n"; $parts[] = '<td>' . $this->renderCommentaires($this->service->getCommentaires()) . "</td>\n";
$parts[] = '<td>' . $this->renderHeures($this->service->getHeures()) . "</td>\n"; $parts[] = '<td style="text-align:right;padding-right:2em">' . $this->renderHeures($this->service->getHeures()) . "</td>\n";
$parts[] = $this->renderModifier(); $parts[] = $this->renderModifier();
$parts[] = $this->renderSupprimer(); $parts[] = $this->renderSupprimer();
......
...@@ -8,7 +8,8 @@ use Zend\ServiceManager\ServiceLocatorAwareInterface; ...@@ -8,7 +8,8 @@ use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait; use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Application\Service\ContextProviderAwareInterface; use Application\Service\ContextProviderAwareInterface;
use Application\Service\ContextProviderAwareTrait; use Application\Service\ContextProviderAwareTrait;
use Application\Acl\IntervenantRole; use NumberFormatter;
use UnicaenApp\Util;
/** /**
* Aide de vue permettant d'afficher une liste de services referentiels * Aide de vue permettant d'afficher une liste de services referentiels
...@@ -67,12 +68,19 @@ class Liste extends AbstractHelper implements ServiceLocatorAwareInterface, Cont ...@@ -67,12 +68,19 @@ class Liste extends AbstractHelper implements ServiceLocatorAwareInterface, Cont
$parts[] = "<th class=\"action\" colspan=\"2\">&nbsp;</th>"; $parts[] = "<th class=\"action\" colspan=\"2\">&nbsp;</th>";
$parts[] = "</tr>"; $parts[] = "</tr>";
$total = 0;
foreach ($this->services as $service) { foreach ($this->services as $service) {
$parts[] = '<tr id="service-ref-' . $service->getId() . '-ligne">'; $parts[] = '<tr id="service-ref-' . $service->getId() . '-ligne">';
$parts[] = $this->renderLigne($service); $parts[] = $this->renderLigne($service);
$total += $service->getHeures();
$parts[] = '</tr>'; $parts[] = '</tr>';
} }
$parts[] = '<tfoot>';
$parts[] = '<th style="text-align:right" colspan="'.($this->getColumnsCount()-3).'">Total :</th>';
$parts[] = '<td style="text-align:right;padding-right:2em">'.Util::formattedFloat($total, NumberFormatter::DECIMAL, -1).'</td>';
$parts[] = "<td class=\"action\" colspan=\"2\">&nbsp;</td>";
$parts[] = '</tfoot>';
$parts[] = '</table>'; $parts[] = '</table>';
$parts[] = '<script type="text/javascript">'; $parts[] = '<script type="text/javascript">';
...@@ -92,6 +100,26 @@ class Liste extends AbstractHelper implements ServiceLocatorAwareInterface, Cont ...@@ -92,6 +100,26 @@ class Liste extends AbstractHelper implements ServiceLocatorAwareInterface, Cont
return $helper->render(); return $helper->render();
} }
/**
*
* @return integer
*/
private function getColumnsCount()
{
$count = 8;
$context = $this->getContextProvider()->getGlobalContext();
$role = $this->getContextProvider()->getSelectedIdentityRole();
if (!$this->getRenderIntervenants()) {
$count--;
}
if ($context->getAnnee()) {
$count--;
}
return $count;
}
/** /**
* *
* @param array $parts * @param array $parts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment