Merge branch 'fixes/fix-trajet-start-for-thanato' into staging

This commit is contained in:
Tiavina 2024-12-31 01:55:48 +03:00
commit f5f5956e18

View File

@ -67,7 +67,7 @@ class GestionService {
}
else{
//get from calendar object
$organizerName = $this->getOrganizerNameFromVCalendarString($vCalendarString);
$organizerName = $this->getPrincipalUsernameFromVCalendarString($vCalendarString);
if($organizerName != null){
$thanatoIdFromDb = $this->gestionBdd->getFirstThanatoIdByName($organizerName);
if($thanatoIdFromDb != null){
@ -78,10 +78,10 @@ class GestionService {
return $thanatoId;
}
private function getOrganizerNameFromVCalendarString(string $vCalendarString){
private function getPrincipalUsernameFromVCalendarString(string $vCalendarString){
$calendarUuid = VCalendarHelpers::GetValueFromKeyInVCalendarString("UID", $vCalendarString);
$organizerName = $this->gestionBdd->getCalendarOrganizerNameByCalendarObjectUuid($calendarUuid);
return $organizerName;
$principalUsername = $this->gestionBdd->getCalendarOrganizerNameByCalendarObjectUuid($calendarUuid);
return $principalUsername;
}
private function GetAttendeesNameFromVCalendarString(string $vCalendarString): array
{
@ -132,8 +132,21 @@ class GestionService {
$articlesId = $this->gestionBdd->getArticlesIdFromArticlesNameArray($articlesValue);
$this->gestionBdd->insertDevisArticleFromDevisIdAndArticlesIdArray($devisId, $articlesId);
}
$organizerName = $this->getOrganizerNameFromVCalendarString($vCalendarString);
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$organizerName);
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$userName);
}
private function GetThanatoNameFromVCalendarString($vCalendarString){
$thanatoName = null;
$thanatoNames = $this->GetAttendeesNameFromVCalendarString($vCalendarString);
if(count($thanatoNames) > 0){
$thanatoName = $thanatoNames[0];
}
else{
//get from calendar object
$thanatoName = $this->getPrincipalUsernameFromVCalendarString($vCalendarString);
}
return $thanatoName;
}
private function GetClientIdFromVCalendarString(string $vCalendarString){