/** * Prepare calendar appointments * * @access protected * @param string mode UPDATE|CREATE|DELETE * @return */ protected function prepareAppointments($a_mode = 'create') { include_once './Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php'; switch ($a_mode) { case 'create': case 'update': if ($this->isRegistrationUnlimited()) { return array(); } $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START); $app->setTitle($this->getTitle()); $app->setSubtitle('grp_cal_reg_start'); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setDescription($this->getLongDescription()); $app->setStart($this->getRegistrationStart()); $apps[] = $app; $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END); $app->setTitle($this->getTitle()); $app->setSubtitle('grp_cal_reg_end'); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setDescription($this->getLongDescription()); $app->setStart($this->getRegistrationEnd()); $apps[] = $app; return $apps; case 'delete': // Nothing to do: The category and all assigned appointments will be deleted. return array(); } }
/** * Prepare calendar appointments * * @access protected * @param string mode UPDATE|CREATE|DELETE * @return */ protected function prepareAppointments($a_mode = 'create') { include_once './Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php'; include_once './Services/Calendar/classes/class.ilDateTime.php'; switch ($a_mode) { case 'create': case 'update': if (!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus()) { $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START); $app->setTitle($this->getTitle()); $app->setSubtitle('crs_cal_activation_start'); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setDescription($this->getLongDescription()); $app->setStart(new ilDateTime($this->getActivationStart(), IL_CAL_UNIX)); $apps[] = $app; $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END); $app->setTitle($this->getTitle()); $app->setSubtitle('crs_cal_activation_end'); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setDescription($this->getLongDescription()); $app->setStart(new ilDateTime($this->getActivationEnd(), IL_CAL_UNIX)); $apps[] = $app; } if ($this->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_LIMITED) { $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START); $app->setTitle($this->getTitle()); $app->setSubtitle('crs_cal_reg_start'); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setDescription($this->getLongDescription()); $app->setStart(new ilDateTime($this->getSubscriptionStart(), IL_CAL_UNIX)); $apps[] = $app; $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END); $app->setTitle($this->getTitle()); $app->setSubtitle('crs_cal_reg_end'); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setDescription($this->getLongDescription()); $app->setStart(new ilDateTime($this->getSubscriptionEnd(), IL_CAL_UNIX)); $apps[] = $app; } return $apps ? $apps : array(); case 'delete': // Nothing to do: The category and all assigned appointments will be deleted. return array(); } }
/** * Prepare calendar appointments * * @access public * @param string mode UPDATE|CREATE|DELETE * @return */ public function prepareCalendarAppointments($a_mode = 'create') { include_once './Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php'; switch ($a_mode) { case 'create': case 'update': $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START); $app->setTranslationType(IL_CAL_TRANSLATION_NONE); $app->setTitle($this->getTitle() ? $this->getTitle() : $this->lng->txt('obj_sess')); $app->setDescription($this->getLongDescription()); $sess_app = $this->getFirstAppointment(); $app->setFullday($sess_app->isFullday()); $app->setStart($sess_app->getStart()); $app->setEnd($sess_app->getEnd()); $apps[] = $app; return $apps; case 'delete': // Nothing to do: The category and all assigned appointments will be deleted. return array(); } }