/** * @return array */ public function AjaxCalendarCreate() { $mResult = false; $oAccount = $this->getDefaultAccountFromParam(); if (!$this->oApiCapability->isCalendarSupported($oAccount)) { throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::CalendarsNotAllowed); } $sName = $this->getParamValue('Name'); $sDescription = $this->getParamValue('Description'); $sColor = $this->getParamValue('Color'); $mCalendarId = $this->oApiCalendar->createCalendar($oAccount, $sName, $sDescription, 0, $sColor); if ($mCalendarId) { $oCalendar = $this->oApiCalendar->getCalendar($oAccount, $mCalendarId); if ($oCalendar instanceof \CCalendar) { $mResult = $oCalendar->toArray($oAccount); } } return $this->DefaultResponse($oAccount, __FUNCTION__, $mResult); }