From 760ed6d00030903c895a7d14df6173d4dda759fa Mon Sep 17 00:00:00 2001 From: Narindra ezway Date: Thu, 24 Apr 2025 11:05:33 +0300 Subject: [PATCH] add client nom in talk notification --- gestion/lib/Db/Bdd.php | 78 +++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index e346c74..8ceb944 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -607,8 +607,8 @@ class Bdd { $sql = "SELECT ".$this->tableprefix."devis.id as devisid, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.comment, ".$this->tableprefix."devis.date, num," .$this->tableprefix."devis.id_nextcloud as didnextcloud,".$this->tableprefix."devis.id_client, id_lieu, id_thanato, return_to_siege, " .$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt," - .$this->tableprefix."client.id as clientid, ".$this->tableprefix."client.nom, " - .$this->tableprefix."client.prenom, legal_one, entreprise, telephone, mail, ".$this->tableprefix."client.adresse," + .$this->tableprefix."client.id as clientid, ".$this->tableprefix."client.nom as nom_client, " + .$this->tableprefix."client.prenom,legal_one, entreprise, telephone, mail, ".$this->tableprefix."client.adresse," .$this->tableprefix."lieu.nom as lieu, ".$this->tableprefix."lieu.adresse as adresse_soin ," .$this->tableprefix."lieu.portal_code as portal_code," .$this->tableprefix."lieu.alarm_code as alarm_code," @@ -3382,12 +3382,12 @@ class Bdd { return $response; } - private function getDevisTalkRoomClientContent($clientPrenom){ + private function getDevisTalkRoomClientContent($clientFullName){ $message = "Pour PF: "; $clientNameContent = "aucun"; - $clientPrenomIsSet = $clientPrenom != null && $clientPrenom != "" && $clientPrenom != "-"; - if($clientPrenomIsSet){ - $clientNameContent = html_entity_decode($clientPrenom); + $clientFullNameIsSet = $clientFullName != null && $clientFullName != "" && $clientFullName != "-"; + if($clientFullNameIsSet){ + $clientNameContent = html_entity_decode($clientFullName); } $message .= $clientNameContent; return $message; @@ -3445,40 +3445,40 @@ class Bdd { $message = "NOUVELLE INTERVENTION: "; $message .= html_entity_decode($devis->nom_defunt) . ' '; $message .= ' -le '.$devisDate; - $message .= ' à '.$devis->startTime. ' '; - $message .= ' -à '.html_entity_decode($devis->lieu). ' '. html_entity_decode($devis->adresse_soin); + le '.$devisDate; + $message .= ' à '.$devis->startTime. ' '; + $message .= ' + à '.html_entity_decode($devis->lieu). ' '. html_entity_decode($devis->adresse_soin); - $clientMessageContent = $this->getDevisTalkRoomClientContent($devis->prenom); - $message .= ' -'.$clientMessageContent; - $productMessage = $this->getDevisTalkRoomProductSectionMessage($devis->products); - $message .= ' -'.$productMessage; - $comment = "aucun"; - if(strtolower($devis->comment) != "commentaire" && $devis->comment != ""){ - $comment = html_entity_decode($devis->comment); - } - $message .= " -COMMENTAIRES: ".$comment; - $locationCodes = [ - "Code portail" => $devis->portal_code, - "Code alarme" => $devis->alarm_code, - "Code funéraire" => $devis->funeral_code - ]; - $locationCodeMessageContent = ""; - foreach($locationCodes as $label => $code){ - $value = "Aucun"; - if($code != null && trim($code) != ""){ - $value = $code; - } - $locationCodeMessageContent .= $label. ": ".$value.". "; - } - $locationCodeMessageContent = trim($locationCodeMessageContent); - $message .= ' -'.$locationCodeMessageContent; - return $message; + $clientMessageContent = $this->getDevisTalkRoomClientContent($devis->nom_client. " " . $devis->prenom ); + $message .= ' + '.$clientMessageContent; + $productMessage = $this->getDevisTalkRoomProductSectionMessage($devis->products); + $message .= ' + '.$productMessage; + $comment = "aucun"; + if(strtolower($devis->comment) != "commentaire" && $devis->comment != ""){ + $comment = html_entity_decode($devis->comment); + } + $message .= " + COMMENTAIRES: ".$comment; + $locationCodes = [ + "Code portail" => $devis->portal_code, + "Code alarme" => $devis->alarm_code, + "Code funéraire" => $devis->funeral_code + ]; + $locationCodeMessageContent = ""; + foreach($locationCodes as $label => $code){ + $value = "Aucun"; + if($code != null && trim($code) != ""){ + $value = $code; + } + $locationCodeMessageContent .= $label. ": ".$value.". "; + } + $locationCodeMessageContent = trim($locationCodeMessageContent); + $message .= ' + '.$locationCodeMessageContent; + return $message; } public function getThanatoById($thanatoId){