From 7310013da7248ade6d10f46cb1ef5f3d82c46387 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Fri, 25 Apr 2025 17:00:13 +0300 Subject: [PATCH] thanato email , date for new functionnalities h2f --- gestion/lib/Db/Bdd.php | 6 ++++-- gestion/lib/Service/GestionService.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index 8ceb944..f22fff7 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -26,6 +26,8 @@ class Bdd { private String $tableprefix; private $l; + private $dateForNewTrajetFunctionnalities = "2025-04-25"; + public function __construct(IDbConnection $db, IL10N $l) { $this->whiteColumn = array("date", "num", "id_client", "entreprise", "nom", "prenom", "legal_one", "telephone", "mail", "adresse", "produit_id", "quantite", "date_paiement", "type_paiement", @@ -1335,7 +1337,7 @@ class Bdd { * l'ajout d'un thanato depuis son domicile ver le siege . */ $dateTime = new DateTime($date); - $dateTimeForFunctionalityGoToHome = new DateTime('2025-04-07'); + $dateTimeForFunctionalityGoToHome = new DateTime($this->dateForNewTrajetFunctionnalities);//Don't edit this date, it's a date for the new functionality if ( $dateTime <= $dateTimeForFunctionalityGoToHome) { return; @@ -1384,7 +1386,7 @@ class Bdd { foreach($datesLignes as $date => $currentDateLignes){ $dateTime = new DateTime($date); - $dateTimeForFunctionalityGoToHome = new DateTime('2025-04-07');//Don't edit this date, it's a date for the new functionality + $dateTimeForFunctionalityGoToHome = new DateTime($this->dateForNewTrajetFunctionnalities);//Don't edit this date, it's a date for the new functionality if ( $dateTime <= $dateTimeForFunctionalityGoToHome) { diff --git a/gestion/lib/Service/GestionService.php b/gestion/lib/Service/GestionService.php index 065567e..6a2d7a0 100644 --- a/gestion/lib/Service/GestionService.php +++ b/gestion/lib/Service/GestionService.php @@ -313,7 +313,7 @@ class GestionService { } if ($thanatoIsSubcontractor && $devisExist) { - $thanatoHasEmail = $thanato["thanato_email"] != null; + $thanatoHasEmail = $thanato["thanato_email"] != null && $thanato["thanato_email"] != "" && $thanato["thanato_email"] != "-"; if($thanatoHasEmail){ $emailBody = $this->extractBodyOfEmailAttachment(VCalendarHelpers::getEmailIdInVCalendar($vCalendarString)); $this->sendEmailAndAttachment($thanato["thanato_email"] , $devis["defunt_nom"],$emailBody ,$attachmentsCalendar ,$orderContent);