/** * 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(); } }
/** * Handle calendar entries for deadline(s) * * @param string $a_event */ protected function handleCalendarEntries($a_event) { global $ilAppEventHandler; $dl_id = $this->getId() . "0"; $fbdl_id = $this->getId() . "1"; $context_ids = array($dl_id, $fbdl_id); $apps = array(); if ($a_event != "delete") { include_once "Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php"; if ($this->getDeadline()) { $app = new ilCalendarAppointmentTemplate($dl_id); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setSubtitle("cal_exc_deadline"); $app->setTitle($this->getTitle()); $app->setFullday(false); $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX)); $apps[] = $app; } if ($this->getPeerReview() && $this->getPeerReviewDeadline()) { $app = new ilCalendarAppointmentTemplate($fbdl_id); $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM); $app->setSubtitle("cal_exc_peer_review_deadline"); $app->setTitle($this->getTitle()); $app->setFullday(false); $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX)); $apps[] = $app; } } include_once "Modules/Exercise/classes/class.ilObjExercise.php"; $exc = new ilObjExercise($this->getExerciseId(), false); $ilAppEventHandler->raise('Modules/Exercise', $a_event . 'Assignment', array('object' => $exc, 'obj_id' => $exc->getId(), 'context_ids' => $context_ids, 'appointments' => $apps)); }
/** * 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 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(); } }