From 651aaad4057efaee102e92740822df8d67234513 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Fri, 24 Jan 2025 14:49:46 +0300 Subject: [PATCH] when is leave , don't create a devis --- gestion/lib/Service/GestionService.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gestion/lib/Service/GestionService.php b/gestion/lib/Service/GestionService.php index 753f540..c1d69fd 100644 --- a/gestion/lib/Service/GestionService.php +++ b/gestion/lib/Service/GestionService.php @@ -49,6 +49,15 @@ class GestionService { $this->talkService = $talkService; } + private function GetIsLeaveFromVCalendarString(string $vCalendarString): bool{ + $isLeave = false; + $isLeaveValue = VCalendarHelpers::GetValueFromKeyInVCalendarString("ISLEAVE", $vCalendarString); + if($isLeaveValue == "1"){ + $isLeave = true; + } + return $isLeave; + } + private function GetCalendarSummaryFromVCalendarString(string $vCalendarString): string { $summaryValue = "Nom du défunt"; @@ -197,6 +206,10 @@ class GestionService { } public function HandleCreatedCalendarObject(string $vCalendarString){ + $isCalendarForLeave = $this->GetIsLeaveFromVCalendarString($vCalendarString); + if($isCalendarForLeave){ + return; + } $calendarSummary = $this->GetCalendarSummaryFromVCalendarString($vCalendarString); $clientId = $this->GetClientIdFromVCalendarString($vCalendarString); $locationId = $this->GetLocationIdFromVCalendarString($vCalendarString);