les alertes sans date de fin ne peuvent pas etre archivées (fixes #32914)

This commit is contained in:
afornerot 2021-07-12 15:47:57 +02:00
parent 7ecfa45d75
commit a5fbe134cc
2 changed files with 24 additions and 1 deletions

View File

@ -168,6 +168,18 @@ class ScriptCommand extends Command
$this->writeln(""); $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; 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 na pas pour but denvoyer des gros fichiers mais plutôt de communiquer des informations, des liens.");
$this->em->persist($entityItem);
$this->em->flush();
}
}
}

View File

@ -149,7 +149,7 @@ class Alert
{ {
$today = new \DateTime(); $today = new \DateTime();
if (null === $this->unpublishedat) { if (null === $this->unpublishedat) {
return true; return false;
} }
if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) { if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) {
return true; return true;