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

Ajout d'autodoc

parent 6fd1dcf5
Loading
Loading
Loading
Loading
+6 −0
Changes for module/These/config/others/co-encadrant.config.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ return [
                'options'       => [
                    'route'    => '/co-encadrant',
                    'defaults' => [
                        /** @see CoEncadrantController::indexAction() */
                        'controller'    => CoEncadrantController::class,
                        'action'        => 'index',
                    ],
@@ -62,6 +63,7 @@ return [
                        'options'       => [
                            'route'    => '/historique[/:co-encadrant]',
                            'defaults' => [
                                /** @see CoEncadrantController::historiqueAction() */
                                'controller'    => CoEncadrantController::class,
                                'action'        => 'historique',
                            ],
@@ -83,6 +85,7 @@ return [
                        'options'       => [
                            'route'    => '/generer-export-csv/:structure-type/:structure-id',
                            'defaults' => [
                                /** @see CoEncadrantController::genererExportCsvAction() */
                                'controller'    => CoEncadrantController::class,
                                'action'        => 'generer-export-csv',
                            ],
@@ -93,6 +96,7 @@ return [
                        'options'       => [
                            'route'    => '/rechercher-co-encadrant',
                            'defaults' => [
                                /** @see CoEncadrantController::rechercherCoEncadrantAction() */
                                'controller'    => CoEncadrantController::class,
                                'action'        => 'rechercher-co-encadrant',
                            ],
@@ -103,6 +107,7 @@ return [
                        'options'       => [
                            'route'    => '/ajouter-co-encadrant/:these',
                            'defaults' => [
                                /** @see CoEncadrantController::ajouterCoEncadrantAction() */
                                'controller'    => CoEncadrantController::class,
                                'action'        => 'ajouter-co-encadrant',
                            ],
@@ -113,6 +118,7 @@ return [
                        'options'       => [
                            'route'    => '/retirer-co-encadrant/:these/:co-encadrant',
                            'defaults' => [
                                /** @see CoEncadrantController::retirerCoEncadrantAction() */
                                'controller'    => CoEncadrantController::class,
                                'action'        => 'retirer-co-encadrant',
                            ],
+19 −11
Changes for module/These/src/These/Controller/CoEncadrantController.php: 19 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@ use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\JsonModel;
use Laminas\View\Model\ViewModel;
use Laminas\View\Renderer\PhpRenderer;
use Laminas\View\Resolver\TemplatePathStack;
use Mpdf\MpdfException;
use RuntimeException;
use Structure\Entity\Db\EcoleDoctorale;
use Structure\Entity\Db\UniteRecherche;
use Structure\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait;
@@ -44,13 +45,8 @@ class CoEncadrantController extends AbstractActionController
    use RenduServiceAwareTrait;


    /** @var PhpRenderer */
    private $renderer;

    /**
     * @param PhpRenderer $renderer
     */
    public function setRenderer($renderer)
    private ?PhpRenderer $renderer = null;
    public function setRenderer(PhpRenderer $renderer): void
    {
        $this->renderer = $renderer;
    }
@@ -59,7 +55,8 @@ class CoEncadrantController extends AbstractActionController
    {
        $form = $this->getRechercherCoEncadrantForm();
        $form->setAttribute('action', $this->url()->fromRoute('co-encadrant', [], [], true));
        //todo !doit remonter un acteur

        /** @see CoEncadrantController::rechercherCoEncadrantAction() */
        $form->setUrlCoEncadrant($this->url()->fromRoute('co-encadrant/rechercher-co-encadrant', [], [], true));
        $form->get('bouton')->setLabel("Afficher l'historique de co-encadrement");

@@ -67,6 +64,7 @@ class CoEncadrantController extends AbstractActionController
        if ($request->isPost()) {
            $data = $request->getPost();
            if ($data['co-encadrant']['id'] !== "") {
                /** @see CoEncadrantController::historiqueAction() */
                $this->redirect()->toRoute('co-encadrant/historique', ['co-encadrant' => $data['co-encadrant']['id']]);
            }
        }
@@ -198,9 +196,15 @@ class CoEncadrantController extends AbstractActionController
        }
        $listing .= "</ul>";

        try {
            $logoCOMUE = $this->etablissementService->fetchEtablissementComue() ? $this->fichierStorageService->getFileForLogoStructure($this->etablissementService->fetchEtablissementComue()->getStructure()) : null;
            $logoETAB = $coencadrant->getEtablissement() ? $this->fichierStorageService->getFileForLogoStructure($coencadrant->getEtablissement()->getStructure()) : null;
        } catch (StorageAdapterException $e) {
            throw new RuntimeException("Un problème est survenu lors de la récupération de logo.", 0, $e);
        }
        $logos = [
            "COMUE" => $this->etablissementService->fetchEtablissementComue()?$this->fichierStorageService->getFileForLogoStructure($this->etablissementService->fetchEtablissementComue()->getStructure()):null,
            "ETAB" => $coencadrant->getEtablissement()?$this->fichierStorageService->getFileForLogoStructure($coencadrant->getEtablissement()->getStructure()):null,
            "COMUE" => $logoCOMUE,
            "ETAB" => $logoETAB,
        ];

        $rendu = $this->getRenduService()->generateRenduByTemplateCode(PdfTemplates::COENCADREMENTS_JUSTIFICATIF, $vars);
@@ -209,6 +213,7 @@ class CoEncadrantController extends AbstractActionController

        $export = new PdfExporter();

        try {
            $export->getMpdf()->SetMargins(0, 0, 60);
            //todo passer un header exploitant les logo
//        $export->setHeaderScript('pdf/header.phtml', null, $logos);
@@ -216,6 +221,9 @@ class CoEncadrantController extends AbstractActionController
            $export->setFooterScriptToNone();
            $export->addBodyHtml($corps);
            return $export->export($filename);
        } catch (MpdfException $e) {
            throw new RuntimeException("Un problème est survenu lors de la génération du PDF", 0 , $e);
        }
    }

    public function genererExportCsvAction(): CsvModel
+3 −1
Changes for module/These/src/These/Form/CoEncadrant/RechercherCoEncadrantForm.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@ use Laminas\Form\Form;
use Laminas\InputFilter\Factory;
use UnicaenApp\Form\Element\SearchAndSelect;

class RechercherCoEncadrantForm extends Form {
class RechercherCoEncadrantForm extends Form
{

    private ?string $urlCoEncadrant = null;
    private ?string $urlEtablissement = null;
@@ -17,6 +18,7 @@ class RechercherCoEncadrantForm extends Form {
        $this->urlCoEncadrant = $urlCoEncadrant;
        $this->get('co-encadrant')->setAutocompleteSource($this->urlCoEncadrant);
    }

    public function setUrlEtablisssement(string $urlEtablissement): void
    {
        $this->urlEtablissement = $urlEtablissement;
+2 −1
Changes for module/These/src/These/Service/CoEncadrant/CoEncadrantServiceFactory.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@ use Interop\Container\ContainerInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class CoEncadrantServiceFactory {
class CoEncadrantServiceFactory
{

    /**
     * @param ContainerInterface $container
+1 −0
Changes for module/These/view/these/co-encadrant/partial/table-these.phtml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ use These\Entity\Db\These;
                <?php echo $these->getAnneeUniv1ereInscription(); ?>
            </td>
            <td>
                <?php /** @see \These\Controller\TheseController::detailIdentiteAction() */ ?>
                <a href="<?php echo $this->url('these/identite', ['these' => $these->getId()], [], true); ?>">
                    <span class="icon icon-voir"></span>
                </a>