Merge branch 'fixes/fixe/fixing-retour-notification-and-other' into staging

This commit is contained in:
Narindra ezway 2025-04-24 11:40:54 +03:00
commit 91fb4b5c82

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," $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."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."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.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."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.nom as lieu, ".$this->tableprefix."lieu.adresse as adresse_soin ,"
.$this->tableprefix."lieu.portal_code as portal_code," .$this->tableprefix."lieu.portal_code as portal_code,"
.$this->tableprefix."lieu.alarm_code as alarm_code," .$this->tableprefix."lieu.alarm_code as alarm_code,"
@ -3382,12 +3382,12 @@ class Bdd {
return $response; return $response;
} }
private function getDevisTalkRoomClientContent($clientPrenom){ private function getDevisTalkRoomClientContent($clientFullName){
$message = "Pour PF: "; $message = "Pour PF: ";
$clientNameContent = "aucun"; $clientNameContent = "aucun";
$clientPrenomIsSet = $clientPrenom != null && $clientPrenom != "" && $clientPrenom != "-"; $clientFullNameIsSet = $clientFullName != null && $clientFullName != "" && $clientFullName != "-";
if($clientPrenomIsSet){ if($clientFullNameIsSet){
$clientNameContent = html_entity_decode($clientPrenom); $clientNameContent = html_entity_decode($clientFullName);
} }
$message .= $clientNameContent; $message .= $clientNameContent;
return $message; return $message;
@ -3445,40 +3445,40 @@ class Bdd {
$message = "NOUVELLE INTERVENTION: "; $message = "NOUVELLE INTERVENTION: ";
$message .= html_entity_decode($devis->nom_defunt) . ' '; $message .= html_entity_decode($devis->nom_defunt) . ' ';
$message .= ' $message .= '
le '.$devisDate; le '.$devisDate;
$message .= ' à '.$devis->startTime. ' '; $message .= ' à '.$devis->startTime. ' ';
$message .= ' $message .= '
à '.html_entity_decode($devis->lieu). ' '. html_entity_decode($devis->adresse_soin); à '.html_entity_decode($devis->lieu). ' '. html_entity_decode($devis->adresse_soin);
$clientMessageContent = $this->getDevisTalkRoomClientContent($devis->prenom); $clientMessageContent = $this->getDevisTalkRoomClientContent($devis->nom_client. " " . $devis->prenom );
$message .= ' $message .= '
'.$clientMessageContent; '.$clientMessageContent;
$productMessage = $this->getDevisTalkRoomProductSectionMessage($devis->products); $productMessage = $this->getDevisTalkRoomProductSectionMessage($devis->products);
$message .= ' $message .= '
'.$productMessage; '.$productMessage;
$comment = "aucun"; $comment = "aucun";
if(strtolower($devis->comment) != "commentaire" && $devis->comment != ""){ if(strtolower($devis->comment) != "commentaire" && $devis->comment != ""){
$comment = html_entity_decode($devis->comment); $comment = html_entity_decode($devis->comment);
} }
$message .= " $message .= "
COMMENTAIRES: ".$comment; COMMENTAIRES: ".$comment;
$locationCodes = [ $locationCodes = [
"Code portail" => $devis->portal_code, "Code portail" => $devis->portal_code,
"Code alarme" => $devis->alarm_code, "Code alarme" => $devis->alarm_code,
"Code funéraire" => $devis->funeral_code "Code funéraire" => $devis->funeral_code
]; ];
$locationCodeMessageContent = ""; $locationCodeMessageContent = "";
foreach($locationCodes as $label => $code){ foreach($locationCodes as $label => $code){
$value = "Aucun"; $value = "Aucun";
if($code != null && trim($code) != ""){ if($code != null && trim($code) != ""){
$value = $code; $value = $code;
} }
$locationCodeMessageContent .= $label. ": ".$value.". "; $locationCodeMessageContent .= $label. ": ".$value.". ";
} }
$locationCodeMessageContent = trim($locationCodeMessageContent); $locationCodeMessageContent = trim($locationCodeMessageContent);
$message .= ' $message .= '
'.$locationCodeMessageContent; '.$locationCodeMessageContent;
return $message; return $message;
} }
public function getThanatoById($thanatoId){ public function getThanatoById($thanatoId){