Merge branch 'hytha/hotfixes/error-on-saving-calendar' into staging
This commit is contained in:
commit
41c6e074b0
@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace OCA\Gestion\Listener;
|
namespace OCA\Gestion\Listener;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||||
use OCA\Gestion\Service\GestionService;
|
use OCA\Gestion\Service\GestionService;
|
||||||
use OCP\EventDispatcher\Event;
|
use OCP\EventDispatcher\Event;
|
||||||
@ -50,8 +51,16 @@ class CalendarObjectCreatedListener implements IEventListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$calendarData = $event->getObjectData();
|
$calendarData = $event->getObjectData();
|
||||||
|
try{
|
||||||
$vCalendarString = $calendarData["calendardata"];
|
$vCalendarString = $calendarData["calendardata"];
|
||||||
$this->gestionService->HandleCreatedCalendarObject($vCalendarString);
|
$this->gestionService->HandleCreatedCalendarObject($vCalendarString);
|
||||||
}
|
}
|
||||||
|
catch(\OC\OCS\Exception $e){
|
||||||
|
$this->logger->error("Error while handling created calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->logger->error("Error while handling created calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace OCA\Gestion\Listener;
|
namespace OCA\Gestion\Listener;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
||||||
use OCA\Gestion\Service\GestionService;
|
use OCA\Gestion\Service\GestionService;
|
||||||
@ -51,8 +52,16 @@ class CalendarObjectUpdatedListener implements IEventListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$calendarData = $event->getObjectData();
|
$calendarData = $event->getObjectData();
|
||||||
|
try{
|
||||||
$vCalendarString = $calendarData["calendardata"];
|
$vCalendarString = $calendarData["calendardata"];
|
||||||
$this->gestionService->HandleUpdatedCalendarObject($vCalendarString);
|
$this->gestionService->HandleUpdatedCalendarObject($vCalendarString);
|
||||||
}
|
}
|
||||||
|
catch(\OC\OCS\Exception $e){
|
||||||
|
$this->logger->error("Error while handling updated calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->logger->error("Error while handling updated calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace OCA\Gestion\Service;
|
namespace OCA\Gestion\Service;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use OCA\Gestion\Constants\BddConstant;
|
use OCA\Gestion\Constants\BddConstant;
|
||||||
use OCA\Gestion\Constants\DevisMentionConstant;
|
use OCA\Gestion\Constants\DevisMentionConstant;
|
||||||
use OCA\Gestion\Constants\VCalendarPropertyConstant;
|
use OCA\Gestion\Constants\VCalendarPropertyConstant;
|
||||||
@ -205,6 +206,7 @@ class GestionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function HandleUpdatedCalendarObject(string $vCalendarString){
|
public function HandleUpdatedCalendarObject(string $vCalendarString){
|
||||||
|
try{
|
||||||
$isCalendarForLeave = $this->GetIsLeaveFromVCalendarString($vCalendarString);
|
$isCalendarForLeave = $this->GetIsLeaveFromVCalendarString($vCalendarString);
|
||||||
if($isCalendarForLeave){
|
if($isCalendarForLeave){
|
||||||
//from devis calendar to leave calendar
|
//from devis calendar to leave calendar
|
||||||
@ -234,6 +236,13 @@ class GestionService {
|
|||||||
//update from calendar leave or calendar pending to calendar devis
|
//update from calendar leave or calendar pending to calendar devis
|
||||||
$this->HandleCreatedCalendarObject($vCalendarString);
|
$this->HandleCreatedCalendarObject($vCalendarString);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(\OC\OCS\Exception $e){
|
||||||
|
$this->logger->error("Error while handling created calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->logger->error("Error while handling created calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,6 +268,7 @@ class GestionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function HandleCreatedCalendarObject(string $vCalendarString){
|
public function HandleCreatedCalendarObject(string $vCalendarString){
|
||||||
|
try{
|
||||||
$isCalendarForLeave = $this->GetIsLeaveFromVCalendarString($vCalendarString);
|
$isCalendarForLeave = $this->GetIsLeaveFromVCalendarString($vCalendarString);
|
||||||
if($isCalendarForLeave){
|
if($isCalendarForLeave){
|
||||||
return;
|
return;
|
||||||
@ -290,6 +300,13 @@ class GestionService {
|
|||||||
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
|
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
|
||||||
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$userName);
|
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$userName);
|
||||||
}
|
}
|
||||||
|
catch(\OC\OCS\Exception $e){
|
||||||
|
$this->logger->error("Error while handling created calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->logger->error("Error while handling created calendar object: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function GetThanatoNameFromVCalendarString($vCalendarString){
|
private function GetThanatoNameFromVCalendarString($vCalendarString){
|
||||||
$thanatoName = $this->getPrincipalUsernameFromVCalendarString($vCalendarString);
|
$thanatoName = $this->getPrincipalUsernameFromVCalendarString($vCalendarString);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user