/**
  * Waiting list tes
  * @param
  * @return
  */
 public function testMembership()
 {
     include_once './Services/Membership/classes/class.ilWaitingList.php';
     include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
     $wait = new ilCourseWaitingList(999999);
     $ret = $wait->addToList(111111);
     $this->assertEquals($ret, true);
     $wait->updateSubscriptionTime(111111, time());
     $wait->removeFromList(111111);
     $wait->addToList(111111);
     $ret = $wait->isOnList(111111);
     $this->assertEquals($ret, true);
     $wait->addToList(111111);
     ilWaitingList::_deleteAll(999999);
     $wait->addToList(111111);
     ilWaitingList::_deleteUser(111111);
 }
Example #2
0
 /**
  * @see ilMembershipRegistrationCodes::register()
  * @param int user_id
  * @param int role
  * @param bool force registration and do not check registration constraints.
  */
 public function register($a_user_id, $a_role = ilCourseConstants::CRS_MEMBER, $a_force_registration = false)
 {
     global $ilCtrl, $tree;
     include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
     include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
     $part = ilCourseParticipants::_getInstanceByObjId($this->getId());
     if ($part->isAssigned($a_user_id)) {
         return true;
     }
     if (!$a_force_registration) {
         // Availability
         if ($this->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED) {
             include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
             if (!ilObjCourseAccess::_usingRegistrationCode()) {
                 throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() . ', course subscription is deactivated.', '456');
             }
         }
         // Time Limitation
         if ($this->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_LIMITED) {
             if (!$this->inSubscriptionTime()) {
                 throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() . ', course is out of registration time.', '789');
             }
         }
         // Max members
         if ($this->isSubscriptionMembershipLimited()) {
             $free = max(0, $this->getSubscriptionMaxMembers() - $part->getCountMembers());
             include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
             $waiting_list = new ilCourseWaitingList($this->getId());
             if ($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers())) {
                 $waiting_list->addToList($a_user_id);
                 $this->lng->loadLanguageModule("crs");
                 $info = sprintf($this->lng->txt('crs_added_to_list'), $waiting_list->getPosition($a_user_id));
                 include_once './Modules/Course/classes/class.ilCourseParticipants.php';
                 $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
                 $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
                 throw new ilMembershipRegistrationException($info, '124');
             }
             if (!$this->enabledWaitingList() && !$free) {
                 throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() . ', membership is limited.', '123');
             }
         }
     }
     $part->add($a_user_id, $a_role);
     $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
     $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
     include_once './Modules/Forum/classes/class.ilForumNotification.php';
     ilForumNotification::checkForumsExistsInsert($this->getRefId(), $a_user_id);
     return true;
 }
 /**
  * Delete user data
  *
  * @access public
  * @static
  *
  * @param int user id
  */
 public static function _deleteUser($a_usr_id)
 {
     global $ilDB;
     $query = "DELETE FROM obj_members WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . "";
     $res = $ilDB->manipulate($query);
     $query = "DELETE FROM il_subscribers WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . "";
     $res = $ilDB->manipulate($query);
     include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
     ilCourseWaitingList::_deleteUser($a_usr_id);
 }
 /**
  * Get item properties
  *
  * @return	array		array of property arrays:
  *						"alert" (boolean) => display as an alert property (usually in red)
  *						"property" (string) => property name
  *						"value" (string) => property value
  */
 function getProperties()
 {
     global $lng, $ilUser;
     $props = parent::getProperties();
     // offline
     include_once 'Modules/Course/classes/class.ilObjCourseAccess.php';
     if (ilObjCourseAccess::_isOffline($this->obj_id)) {
         $showRegistrationInfo = false;
         $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline"));
     }
     // blocked
     include_once 'Modules/Course/classes/class.ilCourseParticipant.php';
     $members = ilCourseParticipant::_getInstanceByObjId($this->obj_id, $ilUser->getId());
     if ($members->isBlocked($ilUser->getId()) and $members->isAssigned($ilUser->getId())) {
         $props[] = array("alert" => true, "property" => $lng->txt("member_status"), "value" => $lng->txt("crs_status_blocked"));
     }
     // pending subscription
     include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
     if (ilCourseParticipants::_isSubscriber($this->obj_id, $ilUser->getId())) {
         $props[] = array("alert" => true, "property" => $lng->txt("member_status"), "value" => $lng->txt("crs_status_pending"));
     }
     include_once './Modules/Course/classes/class.ilObjCourseAccess.php';
     $info = ilObjCourseAccess::lookupRegistrationInfo($this->obj_id);
     if ($info['reg_info_list_prop']) {
         $props[] = array('alert' => false, 'newline' => true, 'property' => $info['reg_info_list_prop']['property'], 'value' => $info['reg_info_list_prop']['value']);
     }
     if ($info['reg_info_list_prop_limit']) {
         $props[] = array('alert' => false, 'newline' => false, 'property' => $info['reg_info_list_prop_limit']['property'], 'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false, 'value' => $info['reg_info_list_prop_limit']['value']);
     }
     // waiting list
     include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
     if (ilCourseWaitingList::_isOnList($ilUser->getId(), $this->obj_id)) {
         $props[] = array("alert" => true, "property" => $lng->txt('member_status'), "value" => $lng->txt('on_waiting_list'));
     }
     // check for certificates
     include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
     if (ilCourseCertificateAdapter::_hasUserCertificate($ilUser->getId(), $this->obj_id)) {
         $lng->loadLanguageModule('certificate');
         $cmd_link = "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $this->ref_id . "&cmd=deliverCertificate";
         $props[] = array("alert" => false, "property" => $lng->txt("passed"), "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
     }
     return $props;
 }
 /**
  * Preload data
  *
  * @param array $a_obj_ids array of object ids
  */
 function _preloadData($a_obj_ids, $a_ref_ids)
 {
     global $ilUser;
     include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
     ilCourseWaitingList::_preloadOnListInfo($ilUser->getId(), $a_obj_ids);
     include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
     ilCourseCertificateAdapter::_preloadListData($ilUser->getId(), $a_obj_ids);
 }
 /**
  * Fetch all users that will be exported
  *
  * @access private
  * 
  */
 private function fetchUsers()
 {
     $this->readCourseSpecificFieldsData();
     if ($this->settings->enabled('admin')) {
         $this->user_ids = $tmp_ids = $this->members->getAdmins();
         $this->readCourseData($tmp_ids);
     }
     if ($this->settings->enabled('tutor')) {
         $this->user_ids = array_merge($tmp_ids = $this->members->getTutors(), $this->user_ids);
         $this->readCourseData($tmp_ids);
     }
     if ($this->settings->enabled('member')) {
         $this->user_ids = array_merge($tmp_ids = $this->members->getMembers(), $this->user_ids);
         $this->readCourseData($tmp_ids);
     }
     if ($this->settings->enabled('subscribers')) {
         $this->user_ids = array_merge($tmp_ids = $this->members->getSubscribers(), $this->user_ids);
         $this->readCourseData($tmp_ids, 'subscriber');
     }
     if ($this->settings->enabled('waiting_list')) {
         include_once 'Modules/Course/classes/class.ilCourseWaitingList.php';
         $waiting_list = new ilCourseWaitingList($this->obj_id);
         $this->user_ids = array_merge($waiting_list->getUserIds(), $this->user_ids);
     }
     // Sort by lastname
     $this->user_ids = ilUtil::_sortIds($this->user_ids, 'usr_data', 'lastname', 'usr_id');
     // Finally read user profile data
     $this->user_profile_data = ilObjUser::_readUsersProfileData($this->user_ids);
 }
 function updateCourse($sid, $course_id, $xml)
 {
     $this->initAuth($sid);
     $this->initIlias();
     if (!$this->__checkSession($sid)) {
         return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
     }
     if (!is_numeric($course_id)) {
         return $this->__raiseError('No valid course id given. Please choose an existing reference id of an ILIAS course', 'Client');
     }
     global $rbacsystem;
     if (($obj_type = ilObject::_lookupType(ilObject::_lookupObjId($course_id))) != 'crs') {
         $course_id = end($ref_ids = ilObject::_getAllReferences($course_id));
         if (ilObject::_lookupType(ilObject::_lookupObjId($course_id)) != 'crs') {
             return $this->__raiseError('Invalid course id. Object with id "' . $course_id . '" is not of type "course"', 'Client');
         }
     }
     if (!($tmp_course = ilObjectFactory::getInstanceByRefId($course_id, false))) {
         return $this->__raiseError('Cannot create course instance!', 'Server');
     }
     if (!$rbacsystem->checkAccess('write', $course_id)) {
         return $this->__raiseError('Check access failed. No permission to write course', 'Server');
     }
     // First delete old meta data
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md = new ilMD($tmp_course->getId(), 0, 'crs');
     $md->deleteAll();
     include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
     ilCourseParticipants::_deleteAllEntries($tmp_course->getId());
     include_once 'Modules/Course/classes/class.ilCourseWaitingList.php';
     ilCourseWaitingList::_deleteAll($tmp_course->getId());
     include_once 'Modules/Course/classes/class.ilCourseXMLParser.php';
     $xml_parser = new ilCourseXMLParser($tmp_course);
     $xml_parser->setXMLContent($xml);
     $xml_parser->startParsing();
     $tmp_course->MDUpdateListener('General');
     return true;
 }
 function __buildWaitingList()
 {
     include_once 'Modules/Course/classes/class.ilCourseWaitingList.php';
     $waiting_list = new ilCourseWaitingList($this->course_obj->getId());
     foreach ($waiting_list->getAllUsers() as $data) {
         $attr['id'] = 'il_' . $this->ilias->getSetting('inst_id') . '_usr_' . $data['usr_id'];
         $attr['position'] = $data['position'];
         $attr['subscriptionTime'] = $data['time'];
         $this->xmlStartTag('WaitingList', $attr);
         $this->xmlEndTag('WaitingList');
     }
     return true;
 }
 /**
  * @see ilMembershipRegistrationCodes::register()
  * @param int user_id
  * @param int role
  * @param bool force registration and do not check registration constraints.
  */
 public function register($a_user_id, $a_role = ilCourseConstants::CRS_MEMBER, $a_force_registration = false)
 {
     include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
     include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
     $part = ilCourseParticipants::_getInstanceByObjId($this->getId());
     if ($part->isAssigned($a_user_id)) {
         return true;
     }
     if (!$a_force_registration) {
         // Availability
         if (!self::_registrationEnabled($this->getId())) {
             $this->lng->loadLanguageModule('crs');
             throw new ilMembershipRegistrationException($this->lng->txt('crs_info_reg_deactivated'), $this->getRefId());
         }
         // Max members
         if ($this->isSubscriptionMembershipLimited()) {
             $free = max(0, $this->getSubscriptionMaxMembers() - $part->getCountMembers());
             include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
             $waiting_list = new ilCourseWaitingList($this->getId());
             if ($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers())) {
                 throw new ilMembershipRegistrationException('', $this->getRefId());
             }
         }
     }
     $part->add($a_user_id, $a_role);
     $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
     include_once './Modules/Forum/classes/class.ilForumNotification.php';
     ilForumNotification::checkForumsExistsInsert($this->getRefId(), $a_user_id);
     return true;
 }
Example #10
0
 /**
  * Get tabs
  */
 function getTabs(&$tabs_gui)
 {
     global $rbacsystem, $ilAccess, $ilUser, $lng, $ilHelp;
     $ilHelp->setScreenIdComponent("crs");
     $this->ctrl->setParameter($this, "ref_id", $this->ref_id);
     if ($ilAccess->checkAccess('read', '', $this->ref_id)) {
         $tabs_gui->addTab('view_content', $lng->txt("content"), $this->ctrl->getLinkTarget($this, ''));
     }
     // learning objectives
     if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
         include_once './Modules/Course/classes/class.ilCourseObjective.php';
         if ($this->object->getViewMode() == IL_CRS_VIEW_OBJECTIVE or ilCourseObjective::_getCountObjectives($this->object->getId())) {
             $tabs_gui->addTarget('crs_objectives', $this->ctrl->getLinkTargetByClass('illoeditorgui', ''), 'illoeditorgui');
         }
     }
     if ($ilAccess->checkAccess('visible', '', $this->ref_id)) {
         //$next_class = $this->ctrl->getNextClass($this);
         // this is not nice. tabs should be displayed in ilcoursegui
         // not via ilrepositorygui, then next_class == ilinfoscreengui
         // could be checked
         $force_active = strtolower($_GET["cmdClass"]) == "ilinfoscreengui" || strtolower($_GET["cmdClass"]) == "ilnotegui" ? true : false;
         $tabs_gui->addTarget("info_short", $this->ctrl->getLinkTargetByClass(array("ilobjcoursegui", "ilinfoscreengui"), "showSummary"), "infoScreen", "", "", $force_active);
     }
     if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
         $force_active = strtolower($_GET["cmdClass"]) == "ilconditionhandlergui" && $_GET["item_id"] == "" ? true : false;
         $tabs_gui->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"), array("edit", "editMapSettings", "editCourseIcons", "listStructure"), "", "", $force_active);
     }
     $is_participant = ilCourseParticipants::_isParticipant($this->ref_id, $ilUser->getId());
     include_once './Services/Mail/classes/class.ilMail.php';
     $mail = new ilMail($GLOBALS['ilUser']->getId());
     // member list
     if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
         $tabs_gui->addTarget("members", $this->ctrl->getLinkTarget($this, "members"), "members", get_class($this));
     } elseif ($this->object->getShowMembers() == $this->object->SHOW_MEMBERS_ENABLED and $is_participant) {
         $tabs_gui->addTarget("members", $this->ctrl->getLinkTarget($this, "membersGallery"), "members", get_class($this));
     } elseif ($this->object->getMailToMembersType() == ilCourseConstants::MAIL_ALLOWED_ALL and $GLOBALS['rbacsystem']->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) and $is_participant) {
         $tabs_gui->addTarget("members", $this->ctrl->getLinkTarget($this, "mailMembers"), "members", get_class($this));
     }
     // learning progress
     include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
     if (ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant)) {
         $tabs_gui->addTarget('learning_progress', $this->ctrl->getLinkTargetByClass(array('ilobjcoursegui', 'illearningprogressgui'), ''), '', array('illplistofobjectsgui', 'illplistofsettingsgui', 'illearningprogressgui', 'illplistofprogressgui'));
     }
     // license overview
     include_once "Services/License/classes/class.ilLicenseAccess.php";
     if ($ilAccess->checkAccess('edit_permission', '', $this->ref_id) and ilLicenseAccess::_isEnabled()) {
         $tabs_gui->addTarget("licenses", $this->ctrl->getLinkTargetByClass('illicenseoverviewgui', ''), "", "illicenseoverviewgui");
     }
     // lom meta data
     if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
         $tabs_gui->addTarget("meta_data", $this->ctrl->getLinkTargetByClass(array('ilobjcoursegui', 'ilmdeditorgui'), 'listSection'), "", "ilmdeditorgui");
     }
     if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
         $tabs_gui->addTarget('export', $this->ctrl->getLinkTargetByClass('ilexportgui', ''), 'export', 'ilexportgui');
     }
     if ($ilAccess->checkAccess('edit_permission', '', $this->ref_id)) {
         $tabs_gui->addTarget("perm_settings", $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), "perm"), array("perm", "info", "owner"), 'ilpermissiongui');
     }
     if ($this->ctrl->getTargetScript() == "adm_object.php") {
         $tabs_gui->addTarget("show_owner", $this->ctrl->getLinkTarget($this, "owner"), "owner", get_class($this));
         if ($this->tree->getSavedNodeData($this->ref_id)) {
             $tabs_gui->addTarget("trash", $this->ctrl->getLinkTarget($this, "trash"), "trash", get_class($this));
         }
     }
     // Join/Leave
     if ($ilAccess->checkAccess('join', '', $this->ref_id) and !$this->object->getMemberObject()->isAssigned()) {
         include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
         if (ilCourseWaitingList::_isOnList($ilUser->getId(), $this->object->getId())) {
             $tabs_gui->addTab('leave', $this->lng->txt('membership_leave'), $this->ctrl->getLinkTargetByClass('ilcourseregistrationgui', 'show', ''));
         } else {
             $tabs_gui->addTarget("join", $this->ctrl->getLinkTargetByClass('ilcourseregistrationgui', "show"), 'show', "");
         }
     }
     if ($ilAccess->checkAccess('leave', '', $this->object->getRefId()) and $this->object->getMemberObject()->isMember()) {
         $tabs_gui->addTarget("crs_unsubscribe", $this->ctrl->getLinkTarget($this, "unsubscribe"), 'leave', "");
     }
 }
 /**
  * add user 
  *
  * @access protected
  * @param
  * @return
  */
 protected function add()
 {
     global $ilUser, $tree, $ilCtrl;
     // TODO: language vars
     // set aggreement accepted
     $this->setAccepted(true);
     include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
     $free = max(0, $this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
     $waiting_list = new ilCourseWaitingList($this->container->getId());
     if ($this->container->isSubscriptionMembershipLimited() and $this->container->enabledWaitingList() and (!$free or $waiting_list->getCountUsers())) {
         $waiting_list->addToList($ilUser->getId());
         $info = sprintf($this->lng->txt('crs_added_to_list'), $waiting_list->getPosition($ilUser->getId()));
         ilUtil::sendSuccess($info, true);
         $this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST, $ilUser->getId());
         $this->participants->sendNotification($this->participants->NOTIFY_WAITING_LIST, $ilUser->getId());
         $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $tree->getParentId($this->container->getRefId()));
         $ilCtrl->redirectByClass("ilrepositorygui", "");
     }
     switch ($this->container->getSubscriptionType()) {
         case IL_CRS_SUBSCRIPTION_CONFIRMATION:
             $this->participants->addSubscriber($ilUser->getId());
             $this->participants->updateSubscriptionTime($ilUser->getId(), time());
             $this->participants->updateSubject($ilUser->getId(), ilUtil::stripSlashes($_POST['subject']));
             $this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST, $ilUser->getId());
             ilUtil::sendSuccess($this->lng->txt("application_completed"), true);
             $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $tree->getParentId($this->container->getRefId()));
             $ilCtrl->redirectByClass("ilrepositorygui", "");
             break;
         default:
             $this->participants->add($ilUser->getId(), IL_CRS_MEMBER);
             $this->participants->sendNotification($this->participants->NOTIFY_ADMINS, $ilUser->getId());
             $this->participants->sendNotification($this->participants->NOTIFY_REGISTERED, $ilUser->getId());
             include_once './Modules/Forum/classes/class.ilForumNotification.php';
             ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $ilUser->getId());
             if ($this->container->getType() == "crs") {
                 $this->container->checkLPStatusSync($ilUser->getId());
             }
             if (!$_SESSION["pending_goto"]) {
                 ilUtil::sendSuccess($this->lng->txt("crs_subscription_successful"), true);
                 $this->ctrl->returnToParent($this);
             } else {
                 $tgt = $_SESSION["pending_goto"];
                 unset($_SESSION["pending_goto"]);
                 ilUtil::redirect($tgt);
             }
             break;
     }
 }
 function sendNotification($a_type, $a_usr_id)
 {
     include_once './Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
     global $ilObjDataCache, $ilUser;
     switch ($a_type) {
         case $this->NOTIFY_DISMISS_SUBSCRIBER:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_REFUSED_SUBSCRIPTION_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_ACCEPT_SUBSCRIBER:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_DISMISS_MEMBER:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_DISMISS_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_BLOCK_MEMBER:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_BLOCKED_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_UNBLOCK_MEMBER:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_UNBLOCKED_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_ACCEPT_USER:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_ADMISSION_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_STATUS_CHANGED:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_STATUS_CHANGED);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_UNSUBSCRIBE:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_UNSUBSCRIBE_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_REGISTERED:
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_SUBSCRIBE_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->send();
             break;
         case $this->NOTIFY_WAITING_LIST:
             include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
             $wl = new ilCourseWaitingList($this->obj_id);
             $pos = $wl->getPosition($a_usr_id);
             $mail = new ilCourseMembershipMailNotification();
             $mail->setType(ilCourseMembershipMailNotification::TYPE_WAITING_LIST_MEMBER);
             $mail->setRefId($this->ref_id);
             $mail->setRecipients(array($a_usr_id));
             $mail->setAdditionalInformation(array('position' => $pos));
             $mail->send();
             break;
         case $this->NOTIFY_SUBSCRIPTION_REQUEST:
             $this->sendSubscriptionRequestToAdmins($a_usr_id);
             break;
         case $this->NOTIFY_ADMINS:
             $this->sendNotificationToAdmins($a_usr_id);
             return true;
             break;
     }
     return true;
 }