add client nom in talk notification

This commit is contained in:
Narindra ezway 2025-04-24 11:05:33 +03:00
parent ec37cf9c81
commit 760ed6d000

View File

@ -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){