Commit 93d5a3ac authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Navigation : pas besoin de page 'Thèse sélectionnée' s'il y a une page 'Ma thèse'

parent 86932bef
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Application/config/others/these.config.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -939,7 +939,7 @@ return [
                     * Navigation pour LA thèse "sélectionnée".
                     */
                    // DEPTH = 1
                    'these_selectionnee' => [
                    ApplicationNavigationFactory::THESE_SELECTIONNEE_PAGE_ID => [
                        'label' => 'Thèse sélectionnée',
                        'route' => 'these/identite',
                        'withtarget' => true,
+19 −0
Changes for module/Application/src/Application/Navigation/ApplicationNavigationFactory.php: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ class ApplicationNavigationFactory extends NavigationFactory
    use UserContextServiceAwareTrait;
    use TheseServiceAwareTrait;

    const THESE_SELECTIONNEE_PAGE_ID = 'THESE_SELECTIONNEE';
    const MA_THESE_PAGE_ID = 'MA_THESE';
    const MES_THESES_PAGE_ID = 'MES_THESES';
    const NOS_THESES_PAGE_ID = 'NOS_THESES';
@@ -42,6 +43,11 @@ class ApplicationNavigationFactory extends NavigationFactory
     */
    private $individu;

    /**
     * @var bool
     */
    private $pageMaTheseCreated = false;

    /**
     * @inheritDoc
     */
@@ -106,6 +112,9 @@ class ApplicationNavigationFactory extends NavigationFactory
                $newPages = $this->createPagesMaThese($protoPage, $theses);
                $page['pages'] = array_merge($page['pages'], $newPages);
                $page['visible'] = true;

                // si une page 'Ma thèse' est présente, la page 'Thèse sélectionnée' qui fait doublon sera supprimée
                $this->pageMaTheseCreated = true;
            }
            unset($page['pages'][$key]);
        }
@@ -136,6 +145,16 @@ class ApplicationNavigationFactory extends NavigationFactory
                unset($page['pages'][$key]);
            }
        }

        /**
         * Thèse sélectionnée
         */
        if ($page['pages'][$key = self::THESE_SELECTIONNEE_PAGE_ID] ?? null) {
            if ($this->pageMaTheseCreated) {
                // si une page 'Ma thèse' est présente, la page 'Thèse sélectionnée' qui fait doublon est supprimée
                unset($page['pages'][$key]);
            }
        }
    }

    /**
+1 −1
Changes for module/Soutenance/config/module.config.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ return array(
                     * Navigation pour LA thèse courante.
                     */
                    // DEPTH = 1
                    'these_selectionnee' => [
                    ApplicationNavigationFactory::THESE_SELECTIONNEE_PAGE_ID => [
                        'pages' => [
                            // DEPTH = 2
                            'soutenance' => [
+2 −1
Changes for module/Soutenance/config/others/intervention.config.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Soutenance;

use Application\Navigation\ApplicationNavigationFactory;
use Soutenance\Assertion\InterventionAssertion;
use Soutenance\Assertion\InterventionAssertionFactory;
use Soutenance\Controller\InterventionController;
@@ -71,7 +72,7 @@ return [
                     * Navigation pour LA thèse courante.
                     */
                    // DEPTH = 1
                    'these_selectionnee' => [
                    ApplicationNavigationFactory::THESE_SELECTIONNEE_PAGE_ID => [
                        'pages' => [
                            // DEPTH = 2
                            'soutenance' => [