Ejemplo n.º 1
0
 /**
  * @return array
  */
 public function AjaxCalendarList()
 {
     $mResult = false;
     $bIsPublic = (bool) $this->getParamValue('IsPublic');
     $sPublicCalendarId = $this->getParamValue('PublicCalendarId');
     $oAccount = null;
     if ($bIsPublic) {
         $oCalendar = $this->oApiCalendar->getPublicCalendar($sPublicCalendarId);
         $mResult = array();
         if ($oCalendar instanceof \CCalendar) {
             $aCalendar = $oCalendar->toArray($oAccount);
             $mResult = array($aCalendar);
         }
     } else {
         $oAccount = $this->getDefaultAccountFromParam();
         if (!$this->oApiCapability->isCalendarSupported($oAccount)) {
             throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::CalendarsNotAllowed);
         }
         $mResult = $this->oApiCalendar->getCalendars($oAccount);
     }
     return $this->DefaultResponse($oAccount, __FUNCTION__, $mResult);
 }