Example #1
0
 /**
  * @return array
  */
 public function AjaxCalendarEventAppointmentUpdate()
 {
     $oAccount = $this->getDefaultAccountFromParam();
     if (!$this->oApiCapability->IsCalendarSupported($oAccount)) {
         throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\Notifications::CalendarsNotAllowed);
     }
     $sCalendarId = $this->getParamValue('calendarId');
     $sEventId = $this->getParamValue('uid');
     $sAttendee = $this->getParamValue('attendee');
     $iAction = (int) $this->getParamValue('actionAppointment');
     $sAction = '';
     if ($iAction === \EAttendeeStatus::Accepted) {
         $sAction = 'ACCEPTED';
     } else {
         if ($iAction === \EAttendeeStatus::Declined) {
             $sAction = 'DECLINED';
         } else {
             if ($iAction === \EAttendeeStatus::Tentative) {
                 $sAction = 'TENTATIVE';
             }
         }
     }
     $mResult = $this->oApiCalendar->UpdateAppointment($oAccount, $sCalendarId, $sEventId, $sAttendee, $sAction);
     return $this->DefaultResponse($oAccount, __FUNCTION__, $mResult);
 }