Commit d0cbe36c authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Modification suite réunion

parent c164b6d1
Pipeline #11114 passed with stage
in 26 seconds
......@@ -25,7 +25,7 @@ class RenduController extends AbstractActionController {
return new ViewModel([
'title' => "Affichage du contenu #" . $rendu->getId(),
'contenu' => $rendu,
'rendu' => $rendu,
]);
}
......
......@@ -67,6 +67,7 @@ class TemplateController extends AbstractActionController {
$form = $this->getTemplateForm();
$form->setAttribute('action', $this->url()->fromRoute('contenu/template/modifier', ['template' => $template->getId()], [], true));
$form->bind($template);
$form->setOldCode($template->getCode());
$request = $this->getRequest();
if ($request->isPost()) {
......
......@@ -8,6 +8,11 @@ class Template implements ResourceInterface
{
const RESOURCE_ID = 'Template';
public function generateTag() : string
{
return (implode('_', [$this->getResourceId(), $this->getCode()]));
}
/**
* @return string
*/
......
......@@ -92,7 +92,7 @@ class RenduService {
* @param int $id
* @return Rendu|null
*/
public function getRendu(int $id) : ?Rendu
public function getRendu(?int $id) : ?Rendu
{
$qb = $this->createQueryBuilder()
->andWhere('contenu.id = :id')
......@@ -111,7 +111,7 @@ class RenduService {
* @param string $param
* @return Rendu|null
*/
public function getRequestedRendu(AbstractActionController $controller, string $param='contenu') : ?Rendu
public function getRequestedRendu(AbstractActionController $controller, string $param='rendu') : ?Rendu
{
$id = $controller->params()->fromRoute($param);
$result = $this->getRendu($id);
......
......@@ -2,7 +2,7 @@
/**
* @see \UnicaenRenderer\View\Helper\RenduViewHelper
* @var Rendu $contenu
* @var Rendu $rendu
* @var array $options
*/
......@@ -15,29 +15,29 @@ use UnicaenRenderer\Entity\Db\Rendu;
<dl>
<dt> Identifiant </dt>
<dd>
<?php echo $contenu->getId(); ?>
<?php echo $rendu->getId(); ?>
</dd>
<dt> Template </dt>
<dd>
<?php if ($contenu->getTemplate()) : ?>
<?php echo $contenu->getTemplate()->getCode(); ?>
<?php if ($rendu->getTemplate()) : ?>
<?php echo $rendu->getTemplate()->getCode(); ?>
<?php else: ?>
<i>Aucun template associé</i>
<?php endif; ?>
</dd>
<dt> Date de génération </dt>
<dd>
<?php echo $contenu->getDate()->format('d/m/Y'); ?>
<?php echo $rendu->getDate()->format('d/m/Y'); ?>
</dd>
</dl>
</div>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo $contenu->getSujet(); ?>
<?php echo $rendu->getSujet(); ?>
</div>
<div class="panel-body">
<?php echo $contenu->getCorps(); ?>
<?php echo $rendu->getCorps(); ?>
</div>
</div>
</div>
......
Markdown is supported
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