/** * @param CAccount $oAccount * @param string $sUri * * @return CalendarInfo|null */ private function &getCalendar($oAccount, $sUri) { $mResult = null; if ($this->oApiCalendarManager) { if (!isset($this->aCalendars[$sUri])) { $this->aCalendars[$sUri] = $this->oApiCalendarManager->getCalendar($oAccount, $sUri); } if (isset($this->aCalendars[$sUri])) { $mResult =& $this->aCalendars[$sUri]; } } return $mResult; }
/** * @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); }