/** * @return array */ public function AjaxCalendarCreate() { $mResult = false; $oAccount = $this->getDefaultAccountFromParam(); if (!$this->oApiCapability->IsCalendarSupported($oAccount)) { throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\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) { $mResult = $this->oApiCalendar->GetCalendarAsArray($oAccount, $oCalendar); } } return $this->DefaultResponse($oAccount, __FUNCTION__, $mResult); }