From a5fbe134ccc26ce7c8cdb215d55e8d82532afbab Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 12 Jul 2021 15:47:57 +0200 Subject: [PATCH] =?UTF-8?q?les=20alertes=20sans=20date=20de=20fin=20ne=20p?= =?UTF-8?q?euvent=20pas=20etre=20archiv=C3=A9es=20(fixes=20#32914)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreBundle/Command/ScriptCommand.php | 23 +++++++++++++++++++ .../src/Cadoles/PortalBundle/Entity/Alert.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php index 38fbf39d..5d277ef9 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php @@ -168,6 +168,18 @@ class ScriptCommand extends Command $this->writeln(""); } + $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"updateorthographe02"]); + if(!$script) { + $this->writeln("== SCRIPT = updateorthographe02"); + $this->updateorthographe02(); + + $script=new Script(); + $script->setName("updateorthographe02"); + $this->em->persist($script); + $this->em->flush(); + $this->writeln(""); + } + return 1; } @@ -410,6 +422,17 @@ class ScriptCommand extends Command } } + private function updateorthographe02(){ + $entityItem = $this->em->getRepository('CadolesPortalBundle:Item')->find(-398); + if($entityItem) { + if($entityItem->getSubtitle()!="Messagerie") { + $entityItem->setSubtitle("Messagerie"); + $entityItem->setContent("Messagerie permettant la communication sécurisée par méls. La messagerie n’a pas pour but d’envoyer des gros fichiers mais plutôt de communiquer des informations, des liens."); + $this->em->persist($entityItem); + $this->em->flush(); + } + } + } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php index 8d4cc2b5..52300fa5 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php @@ -149,7 +149,7 @@ class Alert { $today = new \DateTime(); if (null === $this->unpublishedat) { - return true; + return false; } if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) { return true;