From 3c90728464e8360aca6e0779af317f65f6b1e469 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 5 Mar 2021 13:50:07 +0100 Subject: [PATCH] ajout de l'option forcereload sur les pages de type url (fixes #31676) --- .../src/Cadoles/PortalBundle/Entity/Page.php | 31 +++++++++++++++++++ .../PortalBundle/Form/PageUpdateURLType.php | 5 +++ .../Resources/views/Page/menugroupe.html.twig | 6 ++-- .../Resources/views/Page/pages.html.twig | 5 +-- .../Resources/views/Page/updateurl.html.twig | 4 ++- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Page.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Page.php index 2ce82170..7a2a0cab 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Page.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Page.php @@ -60,6 +60,13 @@ class Page */ private $url; + /** + * @var boolean + * + * @ORM\Column(name="toreload", type="boolean", nullable=true) + */ + private $toreload; + /** * @var string * @@ -616,4 +623,28 @@ class Page { return $this->fonticon; } + + /** + * Set toreload + * + * @param boolean $toreload + * + * @return Page + */ + public function setToreload($toreload) + { + $this->toreload = $toreload; + + return $this; + } + + /** + * Get toreload + * + * @return boolean + */ + public function getToreload() + { + return $this->toreload; + } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php index 48994304..b36331cf 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php @@ -31,6 +31,11 @@ class PageUpdateURLType extends AbstractType 'label' => 'URL' ]) + ->add("toreload",ChoiceType::class,[ + "label" =>"Forcer le rechargement de l'url à chaque accès à cette page", + "choices" => ["non"=>"0","oui"=>"1"] + ]) + ->add('roworder', IntegerType::class, [ 'label' => 'Ordre', ]) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/menugroupe.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/menugroupe.html.twig index 4b4afe79..87c61532 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/menugroupe.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/menugroupe.html.twig @@ -4,7 +4,7 @@ {% for page in groupshared.pagesshared %} {% set forcereload=true %} {% if page.pagecategory.id==1 %} - {% set forcereload=false %} + {% set forcereload=page.toreload %} {% endif %} {% set isactive="" %} @@ -46,7 +46,7 @@ {% set page = groupshared.pagesshared[0] %} {% set forcereload=true %} {% if page.pagecategory.id==1 %} - {% set forcereload=false %} + {% set forcereload=page.toreload %} {% endif %} {% set isactive="" %} @@ -84,7 +84,7 @@ {% for page in groupshared.pagesshared %} {% set forcereload=true %} {% if page.pagecategory.id==1 %} - {% set forcereload=false %} + {% set forcereload=page.toreload %} {% endif %} {% set isactive="" %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig index 99797a38..063b097f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig @@ -10,7 +10,7 @@ {% for page in pagesadmin %} {% set forcereload=true %} {% if page.pagecategory.id==1 %} - {% set forcereload=false %} + {% set forcereload=page.toreload %} {% endif %} {% if entity.id is defined and page.id==entity.id %} @@ -39,8 +39,9 @@ {% for page in pagesuser %} {% set forcereload=true %} {% if page.pagecategory.id==1 %} - {% set forcereload=false %} + {% set forcereload=page.toreload %} {% endif %} + {% if entity.id is defined and page.id==entity.id %}