24require_once 
"./Services/Container/classes/class.ilContainer.php";
 
   25include_once 
'./Modules/Course/classes/class.ilCourseConstants.php';
 
   26include_once 
'./Services/Membership/interfaces/interface.ilMembershipRegistrationCodes.php';
 
   99    public function __construct($a_id = 0, $a_call_by_reference = 
true)
 
  102        #define("ILIAS_MODULE","course");
 
  103        #define("KEEP_IMAGE_PATH",1);
 
  105        $this->SUBSCRIPTION_DEACTIVATED = 1;
 
  106        $this->SUBSCRIPTION_CONFIRMATION = 2;
 
  107        $this->SUBSCRIPTION_DIRECT = 3;
 
  108        $this->SUBSCRIPTION_PASSWORD = 4;
 
  109        $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
 
  110        $this->ARCHIVE_DISABLED = 1;
 
  111        $this->ARCHIVE_READ = 2;
 
  112        $this->ARCHIVE_DOWNLOAD = 3;
 
  113        $this->ABO_ENABLED = 1;
 
  114        $this->ABO_DISABLED = 0;
 
  115        $this->SHOW_MEMBERS_ENABLED = 1;
 
  116        $this->SHOW_MEMBERS_DISABLED = 0;
 
  121        $this->course_logger = 
$GLOBALS[
'DIC']->logger()->crs();
 
  123        parent::__construct($a_id, $a_call_by_reference);
 
  133        $query = 
'SELECT show_members FROM crs_settings ' .
 
  134                'WHERE obj_id = ' . 
$GLOBALS[
'ilDB']->quote($a_obj_id, 
'integer');
 
  137            return (
bool) 
$row->show_members;
 
  149        $this->member_export = $a_mem_export;
 
  168        $this->reg_access_code = $a_code;
 
  187        $this->reg_access_code_enabled = $a_status;
 
  192        return $this->important;
 
  196        $this->important = $a_info;
 
  200        return $this->syllabus;
 
  204        $this->syllabus = $a_syllabus;
 
  208        return $this->contact_name;
 
  212        $this->contact_name = $a_cn;
 
  216        return $this->contact_consultation;
 
  220        $this->contact_consultation = $a_value;
 
  224        return $this->contact_phone;
 
  228        $this->contact_phone = $a_value;
 
  232        return $this->contact_email;
 
  236        $this->contact_email = $a_value;
 
  240        return $this->contact_responsibility;
 
  244        $this->contact_responsibility = $a_value;
 
  248        return (
int) $this->activation_type;
 
  258        $this->activation_type = 
$a_type;
 
  266        return $this->activation_start;
 
  270        $this->activation_start = $a_value;
 
  274        return $this->activation_end;
 
  278        $this->activation_end = $a_value;
 
  282        return (
bool) $this->activation_offline;
 
  286        $this->activation_offline = (bool) $a_value;
 
  290        $this->activation_visibility = (bool) $a_value;
 
  294        return $this->activation_visibility;
 
  299        return $this->subscription_limitation_type;
 
  303        $this->subscription_limitation_type = 
$a_type;
 
  311        return $this->subscription_start;
 
  315        $this->subscription_start = $a_value;
 
  319        return $this->subscription_end;
 
  323        $this->subscription_end = $a_value;
 
  328        #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED; 
  332        $this->subscription_type = $a_value;
 
  336        return $this->subscription_password;
 
  340        $this->subscription_password = $a_value;
 
  349        return (
bool) $this->waiting_list;
 
  354        $this->waiting_list = (bool) $a_status;
 
  375        $this->session_limit = $a_status;
 
  392        $this->subscription_membership_limitation = $a_status;
 
  402        $this->session_prev = $a_num;
 
  421        $this->session_next = $a_num;
 
  441        return (
bool) $this->subscription_membership_limitation;
 
  446        return $this->subscription_max_members;
 
  450        $this->subscription_max_members = $a_value;
 
  465        $query = 
"SELECT * FROM crs_settings " .
 
  466            "WHERE obj_id = " . 
$ilDB->quote($a_course_id, 
'integer') . 
" " .
 
  467            "AND sub_notify = 1";
 
  469        return $res->numRows() ? true : 
false;
 
  478    public function getSubItems($a_admin_panel_enabled = 
false, $a_include_side_block = 
false, $a_get_single = 0)
 
  483        if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block])) {
 
  484            return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  488        parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
 
  491        if (!$a_admin_panel_enabled &&
 
  492            !$a_include_side_block &&
 
  493            $this->items[
'sess'] &&
 
  494            is_array($this->items[
'sess']) &&
 
  501            return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  508        if (isset(
$_GET[
'crs_prev_sess'])) {
 
  509            $ilUser->writePref(
'crs_sess_show_prev_' . $this->
getId(), (string) (
int) 
$_GET[
'crs_prev_sess']);
 
  511        if (isset(
$_GET[
'crs_next_sess'])) {
 
  512            $ilUser->writePref(
'crs_sess_show_next_' . $this->
getId(), (string) (
int) 
$_GET[
'crs_next_sess']);
 
  515        $sessions = 
ilUtil::sortArray($this->items[
'sess'], 
'start', 
'ASC', 
true, 
false);
 
  517        $previous = 
$current = $next = array();
 
  518        foreach ($sessions as 
$key => $item) {
 
  530        $num_previous_remove = max(
 
  534        while ($num_previous_remove--) {
 
  535            if (!
$ilUser->getPref(
'crs_sess_show_prev_' . $this->getId())) {
 
  536                array_shift($previous);
 
  538            $this->items[
'sess_link'][
'prev'][
'value'] = 1;
 
  541        $num_next_remove = max(
 
  545        while ($num_next_remove--) {
 
  546            if (!
$ilUser->getPref(
'crs_sess_show_next_' . $this->getId())) {
 
  550            $this->items[
'sess_link'][
'next'][
'value'] = 1;
 
  553        $sessions = array_merge($previous, 
$current, $next);
 
  554        $this->items[
'sess'] = $sessions;
 
  557        include_once(
'Services/Container/classes/class.ilContainerSorting.php');
 
  559        $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block] = $sort->sortItems($this->items);
 
  561        return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  567        return $this->subscription_notify ? true : 
false;
 
  571        $this->subscription_notify = $a_value ? true : 
false;
 
  576        $this->view_mode = $a_mode;
 
  580        return $this->view_mode;
 
  592        $query = 
"SELECT view_mode FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($a_id, 
'integer') . 
" ";
 
  595            return $row->view_mode;
 
  604        $query = 
"SELECT abo FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($a_id, 
'integer') . 
" ";
 
  614        return $this->archive_start ? $this->archive_start : time();
 
  618        $this->archive_start = $a_value;
 
  622        return $this->archive_end ? $this->archive_end : mktime(0, 0, 0, 12, 12, 
date(
"Y", time())+2);
 
  626        $this->archive_end = $a_value;
 
  634        $this->archive_type = $a_value;
 
  638        $this->abo = $a_status;
 
  646        $this->show_members = $a_status;
 
  650        return $this->show_members;
 
  678        $this->message = $a_message;
 
  683            $this->message .= 
"<br /> ";
 
  685        $this->message .= $a_message;
 
  711        include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
 
  723        include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
 
  730        return $this->ABO == $this->ABO_ENABLED;
 
  740        include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
  745    public function create($a_upload = 
false)
 
  747        global $ilAppEventHandler;
 
  749        parent::create($a_upload);
 
  756        $ilAppEventHandler->raise(
 
  759            array(
'object' => $this,
 
  760                'obj_id' => $this->
getId(),
 
  772        $this->latitude = $a_latitude;
 
  792        $this->longitude = $a_longitude;
 
  812        $this->locationzoom = $a_locationzoom;
 
  832        $this->enablemap = $a_enablemap;
 
  856        $this->crs_start = $a_value;
 
  866        $this->crs_end = $a_value;
 
  876        $this->leave_end = $a_value;
 
  886        if ($a_value !== 
null) {
 
  887            $a_value = (int) $a_value;
 
  889        $this->min_members = $a_value;
 
  899        $this->auto_fill_from_waiting = (bool) $a_value;
 
  915    public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = 
false)
 
  919        $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
 
  927        $new_obj->getMemberObject()->updateContact(
$ilUser->getId(), 1);
 
  933        if ($cwo->isRootNode($this->getRefId())) {
 
  941        include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
  945        include_once(
'Modules/Course/classes/class.ilCourseFile.php');
 
  949        include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
 
  951        $obj_settings->cloneSettings($new_obj->getId());
 
  952        unset($obj_settings);
 
  955        include_once 
"./Services/Certificate/classes/class.ilCertificate.php";
 
  956        include_once 
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
 
  959        $cert->cloneCertificate($newcert);
 
  974        parent::cloneDependencies($a_target_id, $a_copy_id);
 
  977        include_once(
'Services/Container/classes/class.ilContainerStartObjects.php');
 
  979        $start->cloneDependencies($a_target_id, $a_copy_id);
 
  982        include_once(
'Services/Object/classes/class.ilObjectActivation.php');
 
  986        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  990        include_once(
'Modules/Course/classes/class.ilCourseObjective.php');
 
  992        $crs_objective->ilClone($a_target_id, $a_copy_id);
 
 1009        $new_admin = $new_obj->getDefaultAdminRole();
 
 1011        if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->getRefId()) {
 
 1012            $ilLog->write(__METHOD__ . 
' : Error cloning auto generated role: il_crs_admin');
 
 1014        $rbacadmin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->getRefId(), $new_admin, 
true);
 
 1015        $ilLog->write(__METHOD__ . 
' : Finished copying of role crs_admin.');
 
 1018        $new_tutor = $new_obj->getDefaultTutorRole();
 
 1019        if (!$tutor || !$new_tutor) {
 
 1020            $ilLog->write(__METHOD__ . 
' : Error cloning auto generated role: il_crs_tutor');
 
 1022        $rbacadmin->copyRolePermissions($tutor, $this->
getRefId(), $new_obj->getRefId(), $new_tutor, 
true);
 
 1023        $ilLog->write(__METHOD__ . 
' : Finished copying of role crs_tutor.');
 
 1026        $new_member = $new_obj->getDefaultMemberRole();
 
 1027        if (!$member || !$new_member) {
 
 1028            $ilLog->write(__METHOD__ . 
' : Error cloning auto generated role: il_crs_member');
 
 1030        $rbacadmin->copyRolePermissions($member, $this->
getRefId(), $new_obj->getRefId(), $new_member, 
true);
 
 1031        $ilLog->write(__METHOD__ . 
' : Finished copying of role crs_member.');
 
 1041        #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and 
 1042        #   $this->getSubscriptionType() == ) 
 1044        #       $this->appendMessage($this->lng->txt('crs_select_registration_type')); 
 1049            $this->
appendMessage($this->lng->txt(
"activation_times_not_valid"));
 
 1053            $this->
appendMessage($this->lng->txt(
"subscription_times_not_valid"));
 
 1055        #if((!$this->getActivationUnlimitedStatus() and 
 1056        #       !$this->getSubscriptionUnlimitedStatus()) and 
 1057        #       ($this->getSubscriptionStart() > $this->getActivationEnd() or 
 1058        #        $this->getSubscriptionStart() < $this->getActivationStart() or 
 1059        #        $this->getSubscriptionEnd() > $this->getActivationEnd() or 
 1060        #        $this->getSubscriptionEnd() <  $this->getActivationStart())) 
 1063        #       $this->appendMessage($this->lng->txt("subscription_time_not_within_activation"));
 
 1066            $this->
appendMessage($this->lng->txt(
"crs_password_required"));
 
 1070                $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_needed"));
 
 1073                $this->
appendMessage($this->lng->txt(
"crs_max_members_needed"));
 
 1076                $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_invalid"));
 
 1087            $this->
appendMessage($this->lng->txt(
"crs_course_period_not_valid"));
 
 1100            foreach ($emails as 
$email) {
 
 1103                    $ilErr->appendMessage($this->lng->txt(
'contact_email_not_valid') . 
" '" . 
$email . 
"'");
 
 1127    public function delete()
 
 1129        global $ilAppEventHandler;
 
 1132        if (!parent::delete()) {
 
 1143        include_once(
'Modules/Course/classes/class.ilCourseParticipants.php');
 
 1146        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
 1149        include_once 
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
 
 1152        include_once 
'./Modules/Course/classes/class.ilCourseFile.php';
 
 1155        include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
 1158        $ilAppEventHandler->raise(
 
 1161            array(
'object' => $this,
 
 1162                'obj_id' => $this->
getId(),
 
 1177        global $ilAppEventHandler,
$ilLog;
 
 1179        include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
 1188        $ilAppEventHandler->raise(
 
 1191            array(
'object' => $this,
 
 1192                'obj_id' => $this->
getId(),
 
 1203        $query = 
"SELECT * FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
" ";
 
 1206        if (!
$res->numRows()) {
 
 1210        $query = 
"UPDATE crs_settings SET " .
 
 1211            "syllabus = " . $ilDB->quote($this->
getSyllabus(), 
'text') . 
", " .
 
 1212            "contact_name = " . $ilDB->quote($this->
getContactName(), 
'text') . 
", " .
 
 1214            "contact_phone = " . $ilDB->quote($this->
getContactPhone(), 
'text') . 
", " .
 
 1215            "contact_email = " . $ilDB->quote($this->
getContactEmail(), 
'text') . 
", " .
 
 1217            "activation_type = " . $ilDB->quote(!$this->
getOfflineStatus(), 
'integer') . 
", " .
 
 1226            "view_mode = " . $ilDB->quote($this->
getViewMode(), 
'integer') . 
", " .
 
 1227            "abo = " . $ilDB->quote($this->
getAboStatus(), 
'integer') . 
", " .
 
 1230            "show_members = " . $ilDB->quote($this->
getShowMembers(), 
'integer') . 
", " .
 
 1232            "latitude = " . $ilDB->quote($this->
getLatitude(), 
'text') . 
", " .
 
 1233            "longitude = " . $ilDB->quote($this->
getLongitude(), 
'text') . 
", " .
 
 1234            "location_zoom = " . $ilDB->quote($this->
getLocationZoom(), 
'integer') . 
", " .
 
 1235            "enable_course_map = " . $ilDB->quote((
int) $this->
getEnableCourseMap(), 
'integer') . 
", " .
 
 1241            'auto_notification = ' . $ilDB->quote((
int) $this->
getAutoNotification(), 
'integer') . 
', ' .
 
 1249            "WHERE obj_id = " . $ilDB->quote($this->
getId(), 
'integer') . 
"";
 
 1254        if ($this->ref_id) {
 
 1255            include_once 
"./Services/Object/classes/class.ilObjectActivation.php";
 
 1268            $item->update($this->ref_id);
 
 1314        include_once 
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
 
 1337        include_once 
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
 
 1340        $query = 
"INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
 
 1341            "contact_phone,contact_email,contact_consultation,activation_type,activation_start," .
 
 1342            "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
 
 1343            "sub_max_members,sub_notify,view_mode,abo," .
 
 1344            "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
 
 1345            "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
 
 1347            $ilDB->quote($this->
getId(), 
'integer') . 
", " .
 
 1348            $ilDB->quote($this->
getSyllabus(), 
'text') . 
", " .
 
 1354            $ilDB->quote(0, 
'integer') . 
", " .
 
 1366            $ilDB->quote($this->ABO_ENABLED, 
'integer') . 
", " .
 
 1371            #
"objective_view = '0', ".
 
 1388        include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
 1399        $query = 
"SELECT * FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
"";
 
 1444        if ($this->ref_id) {
 
 1445            include_once 
"./Services/Object/classes/class.ilObjectActivation.php";
 
 1447            switch ($activation[
"timing_type"]) {
 
 1469        include_once 
"./Modules/Course/classes/class.ilCourseWaitingList.php";
 
 1471        if (!is_object($this->waiting_list_obj)) {
 
 1487        include_once 
"./Modules/Course/classes/class.ilCourseParticipant.php";
 
 1501        include_once 
"./Modules/Course/classes/class.ilCourseParticipants.php";
 
 1536        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
 1538            'il_crs_admin_' . $this->
getRefId(),
 
 1539            "Admin of crs obj_no." . $this->
getId(),
 
 1544            'il_crs_tutor_' . $this->
getRefId(),
 
 1545            "Tutor of crs obj_no." . $this->
getId(),
 
 1550            'il_crs_member_' . $this->
getRefId(),
 
 1551            "Member of crs obj_no." . $this->
getId(),
 
 1572        $parent_roles = 
$rbacreview->getParentRoleIds($a_parent_ref);
 
 1573        foreach ((array) $parent_roles as $parent_role) {
 
 1576                $parent_role[
'obj_id'],
 
 1577                $parent_role[
'parent'],
 
 1594        $q = 
"SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
 
 1598        return $row[
"obj_id"];
 
 1609        $query = 
'SELECT obj_id FROM object_data WHERE type = ' . 
$ilDB->quote(
'rolt', 
'text') . 
' AND title = ' . 
$ilDB->quote(
'il_crs_non_member', 
'text');
 
 1613        return isset(
$row[
'obj_id']) ? 
$row[
'obj_id'] : 0;
 
 1626        if (empty($this->local_roles)) {
 
 1627            $this->local_roles = array();
 
 1630            foreach ($role_arr as $role_id) {
 
 1631                if (
$rbacreview->isAssignable($role_id, $this->getRefId()) == 
true) {
 
 1632                    $role_Obj = $this->
ilias->obj_factory->getInstanceByObjId($role_id);
 
 1637                        $role_name = $role_Obj->getTitle();
 
 1639                    $this->local_roles[$role_name] = $role_Obj->getId();
 
 1644        return $this->local_roles;
 
 1662        if (strlen($a_crs_id) > 0) {
 
 1663            $crs_id = $a_crs_id;
 
 1668        $role_arr  = 
$rbacreview->getRolesOfRoleFolder($crs_id);
 
 1670        foreach ($role_arr as $role_id) {
 
 1671            $role_Obj =&$this->
ilias->obj_factory->getInstanceByObjId($role_id);
 
 1673            $crs_Member =
"il_crs_member_" . $crs_id;
 
 1674            $crs_Admin  =
"il_crs_admin_" . $crs_id;
 
 1675            $crs_Tutor  =
"il_crs_tutor_" . $crs_id;
 
 1677            if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
 
 1678                $arr_crsDefaultRoles[
"crs_member_role"] = $role_Obj->getId();
 
 1681            if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
 
 1682                $arr_crsDefaultRoles[
"crs_admin_role"] = $role_Obj->getId();
 
 1685            if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
 
 1686                $arr_crsDefaultRoles[
"crs_tutor_role"] = $role_Obj->getId();
 
 1690        return $arr_crsDefaultRoles;
 
 1706        $query = 
"DELETE FROM crs_settings " .
 
 1707            "WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
" ";
 
 1718        foreach ($local_roles as $role_id) {
 
 1720            if (substr(
$title, 0, 8) == 
'il_crs_m') {
 
 1730        foreach ($local_roles as $role_id) {
 
 1732                if (!strcmp($tmp_role->getTitle(), 
"il_crs_tutor_" . $this->getRefId())) {
 
 1743        foreach ($local_roles as $role_id) {
 
 1745                if (!strcmp($tmp_role->getTitle(), 
"il_crs_admin_" . $this->getRefId())) {
 
 1757        include_once 
'./Modules/Course/classes/class.ilCourseLMHistory.php';
 
 1760        include_once 
'./Modules/Course/classes/class.ilCourseParticipants.php';
 
 1764        include_once 
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
 
 1778        parent::MDUpdateListener($a_element);
 
 1780        switch ($a_element) {
 
 1783                include_once 
'Modules/Course/classes/class.ilECSCourseSettings.php';
 
 1785                $ecs->handleContentUpdate();
 
 1799        include_once 
'./Services/Object/classes/class.ilObjectActivation.php';
 
 1812        include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
 
 1813        include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
 
 1821                    $app->setSubtitle(
'crs_cal_activation_start');
 
 1829                    $app->setSubtitle(
'crs_cal_activation_end');
 
 1838                    $app->setSubtitle(
'crs_cal_reg_start');
 
 1846                    $app->setSubtitle(
'crs_cal_reg_end');
 
 1855                    $app->setSubtitle(
'crs_cal_start');
 
 1859                    $app->setFullday(
true);
 
 1864                    $app->setSubtitle(
'crs_cal_end');
 
 1868                    $app->setFullday(
true);
 
 1873                return $apps ? $apps : array();
 
 1881    ###### Interface ilMembershipRegistrationCodes 
 1890        $query = 
"SELECT obj_id FROM crs_settings " .
 
 1891            "WHERE reg_ac_enabled = " . 
$ilDB->quote(1, 
'integer') . 
" " .
 
 1892            "AND reg_ac = " . 
$ilDB->quote($a_code, 
'text');
 
 1897            $obj_ids[] = 
$row->obj_id;
 
 1912        include_once 
'./Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
 
 1913        include_once 
"./Modules/Course/classes/class.ilCourseParticipants.php";
 
 1916        if ($part->isAssigned($a_user_id)) {
 
 1920        if (!$a_force_registration) {
 
 1924                    "Can't register to course, course is offline.",
 
 1932                    "Can't register to course, course is not activated.",
 
 1955                include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
 
 1958                    $waiting_list->addToList($a_user_id);
 
 1959                    $this->lng->loadLanguageModule(
"crs");
 
 1961                        $this->lng->txt(
'crs_added_to_list'),
 
 1962                        $waiting_list->getPosition($a_user_id)
 
 1964                    include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
 
 1966                    $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
 
 1978        $part->add($a_user_id, $a_role);
 
 1979        $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
 
 1980        $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
 
 1983        include_once 
'./Modules/Forum/classes/class.ilForumNotification.php';
 
 2009        $this->auto_notification = $value;
 
 2019        $a_value = (int) $a_value;
 
 2022        if ($a_value == self::STATUS_DETERMINATION_LP) {
 
 2023            include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
 
 2029        $this->status_dt = $a_value;
 
 2047        include_once 
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
 
 2064        include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
 
 2067            include_once(
"Services/Tracking/classes/class.ilLPStatus.php");
 
 2070            $this->
getMembersObject()->updatePassed($a_member_id, $has_completed, 
false, 
true);
 
 2079        return parent::getOrderType();
 
 2091            $this->course_logger->debug(
'Waiting list or auto fill disabled.');
 
 2098        $this->course_logger->debug(
'Max members: ' . $max);
 
 2099        $this->course_logger->debug(
'Current members: ' . $now);
 
 2106        include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
 
 2109        foreach ($waiting_list->getUserIds() as $user_id) {
 
 2111                $this->course_logger->warning(
'Cannot create user instance for id: ' . $user_id);
 
 2115                $this->course_logger->warning(
'User is already assigned to course. uid: ' . $user_id . 
' course_id: ' . $this->
getRefId());
 
 2120            $waiting_list->removeFromList($user_id);
 
 2123            $this->course_logger->info(
'Assigned user from waiting list to course: ' . $this->
getTitle());
 
 2131    public static function mayLeave($a_course_id, $a_user_id = 
null, &$a_date = 
null)
 
 2136            $a_user_id = 
$ilUser->getId();
 
 2139        $set = 
$ilDB->query(
"SELECT leave_end" .
 
 2140            " FROM crs_settings" .
 
 2141            " WHERE obj_id = " . 
$ilDB->quote($a_course_id, 
"integer"));
 
 2145            $limit = 
date(
"Ymd", 
$row[
"leave_end"]);
 
 2146            if ($limit < 
date(
"Ymd")) {
 
 2168        include_once 
"Modules/Course/classes/class.ilCourseParticipants.php";
 
 2170        $set = 
$ilDB->query(
"SELECT obj_id, min_members" .
 
 2171            " FROM crs_settings" .
 
 2172            " WHERE min_members > " . 
$ilDB->quote(0, 
"integer") .
 
 2173            " AND sub_mem_limit = " . 
$ilDB->quote(1, 
"integer") . 
 
 2174            " AND ((leave_end IS NOT NULL" .
 
 2175                " AND leave_end < " . 
$ilDB->quote($now, 
"text") . 
")" .
 
 2176                " OR (leave_end IS NULL" .
 
 2177                " AND sub_end IS NOT NULL" .
 
 2178                " AND sub_end < " . 
$ilDB->quote($now, 
"text") . 
"))" .
 
 2179            " AND (crs_start IS NULL OR crs_start > " . 
$ilDB->quote($now, 
"integer") . 
")");
 
 2180        while (
$row = 
$ilDB->fetchAssoc($set)) {
 
 2184            if (
$tree->isDeleted($ref)) {
 
 2189            $reci = $part->getNotificationRecipients();
 
 2190            if (
sizeof($reci)) {
 
 2191                $missing = (int) 
$row[
"min_members"]-$part->getCountMembers();
 
 2193                    $res[
$row[
"obj_id"]] = array($missing, $reci);
 
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_TRANSLATION_SYSTEM
const IL_CRS_SUBSCRIPTION_LIMITED
const IL_CRS_ACTIVATION_OFFLINE
const IL_CRS_ACTIVATION_UNLIMITED
const IL_CRS_VIEW_OBJECTIVE
const IL_CRS_SUBSCRIPTION_PASSWORD
const IL_CRS_ARCHIVE_NONE
const IL_CRS_ARCHIVE_DOWNLOAD
const IL_CRS_SUBSCRIPTION_UNLIMITED
const IL_CRS_ACTIVATION_LIMITED
const IL_CRS_SUBSCRIPTION_DEACTIVATED
const IL_CRS_SUBSCRIPTION_DIRECT
const IL_CRS_ADMIN
Base class for course and group participants.
Apointment templates are used for automatic generated apointments.
static _lookupSortMode($a_obj_id)
lookup sort mode
static _getInstance($a_obj_id)
get instance by obj_id
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Test certificate adapter.
static _deleteByContainer($a_container_id)
Delete all fields of a container.
static _clone($a_source_id, $a_target_id)
Clone fields.
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.
static _deleteByCourse($a_course_id)
static _deleteUser($a_usr_id)
Delete user @global type $ilDB.
static _deleteAll($course_id)
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check whether an date is within a date duration given by start and end.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Class ilECSCourseSettings.
static checkForumsExistsInsert($ref_id, $user_id=0)
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
const LP_STATUS_COMPLETED_NUM
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
static generateCode()
Generate new registration key.
membership registration exception
const ADDED_TO_WAITINGLIST
const REGISTRATION_CODE_DISABLED
const REGISTRATION_INVALID_OFFLINE
const REGISTRATION_INVALID_AVAILABILITY
const OUT_OF_REGISTRATION_PERIOD
static _registrationEnabled($a_obj_id)
static _usingRegistrationCode()
Using Registration code.
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
static _isOnline($a_obj_id)
Check if online setting is active.
static _deleteAll($a_course_id)
static lookupCourseNonMemberTemplatesId()
Lookup course non member id.
getDefaultCourseRoles($a_crs_id="")
get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_...
getImportantInformation()
static _lookupViewMode($a_id)
lookup view mode of container
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone course (no member data)
getNumberOfNextSessions()
Set number of previous sessions.
getMailToMembersType()
Get mail to members type.
setParentRolePermissions($a_parent_ref)
This method is called before "initDefaultRoles".
const STATUS_DETERMINATION_MANUAL
getSubscriptionPassword()
setLongitude($a_longitude)
Set Longitude.
static _registrationEnabled($a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
const STATUS_DETERMINATION_LP
setActivationStart($a_value)
setStatusDetermination($a_value)
Set status determination mode.
setSubscriptionNotify($a_value)
enableWaitingList($a_status)
setShowMembersExport($a_mem_export)
getActivationVisibility()
static _isSubscriptionNotificationEnabled($a_course_id)
Check if subscription notification is enabled.
handleAutoFill()
Handle course auto fill.
update()
update complete object
isSubscriptionMembershipLimited()
is membership limited
enableSubscriptionMembershipLimitation($a_status)
enable max members
enableSessionLimit($a_status)
en/disable limited number of sessions
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
getLatitude()
Get Latitude.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (start objects, preconditions)
getLocalCourseRoles($a_translate=false)
get ALL local roles of course, also those created and defined afterwards only fetch data once from da...
getViewMode()
Get container view mode.
static _lookupAboStatus($a_id)
setNumberOfNextSessions($a_num)
Set number of previous sessions.
setWaitingListAutoFill($a_value)
setCourseEnd(ilDate $a_value=null)
setSubscriptionType($a_value)
MDUpdateListener($a_element)
Overwriten Metadata update listener for ECS functionalities.
__getCrsNonMemberTemplateId()
get course non-member template @access private
static lookupObjectsByCode($a_code)
getSubItems($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
Get subitems of container.
static mayLeave($a_course_id, $a_user_id=null, &$a_date=null)
getSubscriptionUnlimitedStatus()
setCourseStart(ilDate $a_value=null)
static _isActivated($a_obj_id)
Is activated.
setContactEmail($a_value)
setOfflineStatus($a_value)
initCourseMemberObject()
Init course member object @global ilObjUser $ilUser.
setActivationEnd($a_value)
setRegistrationAccessCode($a_code)
Set refistration access code.
getSubscriptionLimitationType()
prepareAppointments($a_mode='create')
Prepare calendar appointments.
setContactPhone($a_value)
__createDefaultSettings()
getLocationZoom()
Get LocationZoom.
initCourseMembersObject()
Init course member object @global ilObjUser $ilUser.
static findCoursesWithNotEnoughMembers()
Minimum members check @global type $ilDB.
getEnableCourseMap()
Get Enable Course Map.
setSubscriptionEnd($a_value)
setLatitude($a_latitude)
Set Latitude.
enableRegistrationAccessCode($a_status)
En/disable registration access code.
getSubscriptionMaxMembers()
setSubscriptionMaxMembers($a_value)
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
getRegistrationAccessCode()
get access code
getMemberObject()
Get course member object.
checkLPStatusSync($a_member_id)
sync course status from lp
syncMembersStatusWithLP()
Set course status for all members by lp status.
setShowMembers($a_status)
getContactResponsibility()
setMailToMembersType($a_type)
Set mail to members type.
setSubscriptionPassword($a_value)
setSubscriptionStart($a_value)
setImportantInformation($a_info)
const CAL_ACTIVATION_START
getOrderType()
Get order type default implementation.
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
appendMessage($a_message)
getActivationUnlimitedStatus()
setContactConsultation($a_value)
__construct($a_id=0, $a_call_by_reference=true)
Constructor @access public.
setSubscriptionMinMembers($a_value)
setContactResponsibility($a_value)
getStatusDetermination()
Get status determination mode.
addAdditionalSubItemInformation(&$a_item_data)
Add additional information to sub item, e.g.
cloneSettings($new_obj)
Clone entries in settings table.
setArchiveStart($a_value)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
getSubscriptionMinMembers()
setSubscriptionLimitationType($a_type)
setActivationType($a_type)
static _deleteUser($a_usr_id)
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getEnableMap()
Type independent wrapper.
setCancellationEnd(ilDate $a_value=null)
setLocationZoom($a_locationzoom)
Set LocationZoom.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getNumberOfPreviousSessions()
Set number of previous sessions.
setAutoNotification($value)
Sets automatic notification status in $this->auto_notification, using given $status.
setActivationVisibility($a_value)
getLongitude()
Get Longitude.
static _getTranslation($a_role_title)
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
static _enabledLearningProgress()
check wether learing progress is enabled or not
static getUserIdByLogin($a_login)
Class ilObjectActivation.
const TIMINGS_DEACTIVATED
setTimingType($a_type)
Set timing type.
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.
static getItem($a_ref_id)
Get item data.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
createMetaData()
create meta data entry
getRefId()
get reference id @access public
getLongDescription()
get object long description (stored in object_description)
static _getAllReferences($a_id)
get all reference ids of object
cloneMetaData($target_obj)
Copy meta data.
getId()
get object id @access public
getTitle()
get object title @access public
static lookupNumberOfMembers($a_ref_id)
Lookup number of members @global ilRbacReview $rbacreview @global <type> $ilObjDataCache.
static _deleteUser($a_usr_id)
Delete user data.
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Interface for all objects that offer registration with access codes.
catch(Exception $e) $message
update($pash, $contents, Config $config)
redirection script todo: (a better solution should control the processing via a xml file)
foreach($_POST as $key=> $value) $res