24require_once 
"./Services/Container/classes/class.ilContainer.php";
 
   25include_once 
'./Modules/Course/classes/class.ilCourseConstants.php';
 
   26include_once 
'./Services/Membership/interfaces/interface.ilMembershipRegistrationCodes.php';
 
  105    public function __construct($a_id = 0, $a_call_by_reference = 
true)
 
  108        #define("ILIAS_MODULE","course");
 
  109        #define("KEEP_IMAGE_PATH",1);
 
  111        $this->SUBSCRIPTION_DEACTIVATED = 1;
 
  112        $this->SUBSCRIPTION_CONFIRMATION = 2;
 
  113        $this->SUBSCRIPTION_DIRECT = 3;
 
  114        $this->SUBSCRIPTION_PASSWORD = 4;
 
  115        $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
 
  116        $this->ARCHIVE_DISABLED = 1;
 
  117        $this->ARCHIVE_READ = 2;
 
  118        $this->ARCHIVE_DOWNLOAD = 3;
 
  119        $this->ABO_ENABLED = 1;
 
  120        $this->ABO_DISABLED = 0;
 
  121        $this->SHOW_MEMBERS_ENABLED = 1;
 
  122        $this->SHOW_MEMBERS_DISABLED = 0;
 
  127        $this->course_logger = 
$GLOBALS[
'DIC']->logger()->crs();
 
  129        parent::__construct($a_id, $a_call_by_reference);
 
  139        $query = 
'SELECT show_members FROM crs_settings ' .
 
  140                'WHERE obj_id = ' . 
$GLOBALS[
'DIC'][
'ilDB']->quote($a_obj_id, 
'integer');
 
  143            return (
bool) 
$row->show_members;
 
  155        $this->member_export = $a_mem_export;
 
  174        $this->reg_access_code = $a_code;
 
  193        $this->reg_access_code_enabled = $a_status;
 
  198        return $this->important;
 
  202        $this->important = $a_info;
 
  206        return $this->syllabus;
 
  210        $this->syllabus = $a_syllabus;
 
  214        return $this->contact_name;
 
  218        $this->contact_name = $a_cn;
 
  222        return $this->contact_consultation;
 
  226        $this->contact_consultation = $a_value;
 
  230        return $this->contact_phone;
 
  234        $this->contact_phone = $a_value;
 
  238        return $this->contact_email;
 
  242        $this->contact_email = $a_value;
 
  246        return $this->contact_responsibility;
 
  250        $this->contact_responsibility = $a_value;
 
  263        return $this->activation_start;
 
  267        $this->activation_start = $a_value;
 
  271        return $this->activation_end;
 
  275        $this->activation_end = $a_value;
 
  279        $this->activation_visibility = (bool) $a_value;
 
  283        return $this->activation_visibility;
 
  288        return $this->subscription_limitation_type;
 
  292        $this->subscription_limitation_type = 
$a_type;
 
  300        return $this->subscription_start;
 
  304        $this->subscription_start = $a_value;
 
  308        return $this->subscription_end;
 
  312        $this->subscription_end = $a_value;
 
  317        #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED; 
  321        $this->subscription_type = $a_value;
 
  325        return $this->subscription_password;
 
  329        $this->subscription_password = $a_value;
 
  338        return (
bool) $this->waiting_list;
 
  343        $this->waiting_list = (bool) $a_status;
 
  364        $this->session_limit = $a_status;
 
  381        $this->subscription_membership_limitation = $a_status;
 
  391        $this->session_prev = $a_num;
 
  410        $this->session_next = $a_num;
 
  430        return (
bool) $this->subscription_membership_limitation;
 
  435        return $this->subscription_max_members;
 
  439        $this->subscription_max_members = $a_value;
 
  456        $query = 
"SELECT * FROM crs_settings " .
 
  457            "WHERE obj_id = " . 
$ilDB->quote($a_course_id, 
'integer') . 
" " .
 
  458            "AND sub_notify = 1";
 
  460        return $res->numRows() ? true : 
false;
 
  469    public function getSubItems($a_admin_panel_enabled = 
false, $a_include_side_block = 
false, $a_get_single = 0)
 
  477        if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block])) {
 
  478            return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  482        parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
 
  485        if (!$a_admin_panel_enabled &&
 
  486            !$a_include_side_block &&
 
  487            $this->items[
'sess'] &&
 
  488            is_array($this->items[
'sess']) &&
 
  495            return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  502        if (isset(
$_GET[
'crs_prev_sess'])) {
 
  503            $ilUser->writePref(
'crs_sess_show_prev_' . $this->
getId(), (string) (
int) 
$_GET[
'crs_prev_sess']);
 
  505        if (isset(
$_GET[
'crs_next_sess'])) {
 
  506            $ilUser->writePref(
'crs_sess_show_next_' . $this->
getId(), (string) (
int) 
$_GET[
'crs_next_sess']);
 
  509        $session_rbac_checked = [];
 
  510        foreach ($this->items[
'sess'] as $session_tree_info) {
 
  511            if (
$access->checkAccess(
'visible', 
'', $session_tree_info[
'ref_id'])) {
 
  512                $session_rbac_checked[] = $session_tree_info;
 
  515        $sessions = 
ilUtil::sortArray($session_rbac_checked, 
'start', 
'ASC', 
true, 
false);
 
  518        $previous = 
$current = $next = array();
 
  519        foreach ($sessions as 
$key => $item) {
 
  531        $num_previous_remove = max(
 
  535        while ($num_previous_remove--) {
 
  536            if (!
$ilUser->getPref(
'crs_sess_show_prev_' . $this->getId())) {
 
  537                array_shift($previous);
 
  539            $this->items[
'sess_link'][
'prev'][
'value'] = 1;
 
  542        $num_next_remove = max(
 
  546        while ($num_next_remove--) {
 
  547            if (!
$ilUser->getPref(
'crs_sess_show_next_' . $this->getId())) {
 
  551            $this->items[
'sess_link'][
'next'][
'value'] = 1;
 
  554        $sessions = array_merge($previous, 
$current, $next);
 
  555        $this->items[
'sess'] = $sessions;
 
  558        include_once(
'Services/Container/classes/class.ilContainerSorting.php');
 
  560        $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block] = $sort->sortItems($this->items);
 
  562        return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  568        return $this->subscription_notify ? true : 
false;
 
  572        $this->subscription_notify = $a_value ? true : 
false;
 
  577        $this->view_mode = $a_mode;
 
  581        return $this->view_mode;
 
  594        $query = 
'SELECT timing_mode FROM crs_settings ' .
 
  595            'WHERE obj_id = ' . 
$ilDB->quote($a_obj_id, 
'integer');
 
  599            return (
int) 
$row->timing_mode;
 
  609        $this->timing_mode = $a_mode;
 
  632        $query = 
"SELECT view_mode FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($a_id, 
'integer') . 
" ";
 
  635            return $row->view_mode;
 
  646        $query = 
"SELECT abo FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($a_id, 
'integer') . 
" ";
 
  656        return $this->archive_start ? $this->archive_start : time();
 
  660        $this->archive_start = $a_value;
 
  664        return $this->archive_end ? $this->archive_end : mktime(0, 0, 0, 12, 12, date(
"Y", time()) + 2);
 
  668        $this->archive_end = $a_value;
 
  676        $this->archive_type = $a_value;
 
  680        $this->abo = $a_status;
 
  688        $this->show_members = $a_status;
 
  692        return $this->show_members;
 
  720        $this->message = $a_message;
 
  725            $this->message .= 
"<br /> ";
 
  727        $this->message .= $a_message;
 
  757        include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
 
  769        include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
 
  776        return $this->ABO == $this->ABO_ENABLED;
 
  786        include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
  791    public function create($a_upload = 
false)
 
  795        $ilAppEventHandler = 
$DIC[
'ilAppEventHandler'];
 
  797        parent::create($a_upload);
 
  804        $ilAppEventHandler->raise(
 
  807            array(
'object' => $this,
 
  808                'obj_id' => $this->
getId(),
 
  820        $this->latitude = $a_latitude;
 
  840        $this->longitude = $a_longitude;
 
  860        $this->locationzoom = $a_locationzoom;
 
  880        $this->enablemap = $a_enablemap;
 
  904        $this->crs_start = $a_value;
 
  914        $this->crs_end = $a_value;
 
  924        $this->leave_end = $a_value;
 
  934        if ($a_value !== 
null) {
 
  935            $a_value = (int) $a_value;
 
  937        $this->min_members = $a_value;
 
  947        $this->auto_fill_from_waiting = (bool) $a_value;
 
  963    public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = 
false)
 
  969        $certificateLogger = 
$DIC->logger()->cert();
 
  972        $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
 
  980        $new_obj->getMemberObject()->updateContact(
$ilUser->getId(), 1);
 
  986        if ($cwo->isRootNode($this->getRefId())) {
 
  994        include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
  998        include_once(
'Modules/Course/classes/class.ilCourseFile.php');
 
 1002        include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
 
 1004        $obj_settings->cloneSettings($new_obj->getId());
 
 1005        unset($obj_settings);
 
 1014            $templateRepository,
 
 1015            $DIC->filesystem()->web(),
 
 1020        $cloneAction->cloneCertificate($this, $new_obj);
 
 1035        parent::cloneDependencies($a_target_id, $a_copy_id);
 
 1038        include_once(
'Services/Container/classes/class.ilContainerStartObjects.php');
 
 1040        $start->cloneDependencies($a_target_id, $a_copy_id);
 
 1043        include_once(
'Services/Object/classes/class.ilObjectActivation.php');
 
 1047        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
 1051        include_once(
'Modules/Course/classes/class.ilCourseObjective.php');
 
 1053        $crs_objective->ilClone($a_target_id, $a_copy_id);
 
 1058            $grouping = new \ilObjCourseGrouping($grouping_id);
 
 1059            $grouping->cloneGrouping($a_target_id, $a_copy_id);
 
 1081        $new_admin = $new_obj->getDefaultAdminRole();
 
 1083        if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->getRefId()) {
 
 1084            $ilLog->write(__METHOD__ . 
' : Error cloning auto generated role: il_crs_admin');
 
 1086        $rbacadmin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->getRefId(), $new_admin, 
true);
 
 1087        $ilLog->write(__METHOD__ . 
' : Finished copying of role crs_admin.');
 
 1090        $new_tutor = $new_obj->getDefaultTutorRole();
 
 1091        if (!$tutor || !$new_tutor) {
 
 1092            $ilLog->write(__METHOD__ . 
' : Error cloning auto generated role: il_crs_tutor');
 
 1094        $rbacadmin->copyRolePermissions($tutor, $this->
getRefId(), $new_obj->getRefId(), $new_tutor, 
true);
 
 1095        $ilLog->write(__METHOD__ . 
' : Finished copying of role crs_tutor.');
 
 1098        $new_member = $new_obj->getDefaultMemberRole();
 
 1099        if (!$member || !$new_member) {
 
 1100            $ilLog->write(__METHOD__ . 
' : Error cloning auto generated role: il_crs_member');
 
 1102        $rbacadmin->copyRolePermissions($member, $this->
getRefId(), $new_obj->getRefId(), $new_member, 
true);
 
 1103        $ilLog->write(__METHOD__ . 
' : Finished copying of role crs_member.');
 
 1115            $this->
appendMessage($this->lng->txt(
"subscription_times_not_valid"));
 
 1118            $this->
appendMessage($this->lng->txt(
"crs_password_required"));
 
 1122                $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_needed"));
 
 1125                $this->
appendMessage($this->lng->txt(
"crs_max_members_needed"));
 
 1128                $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_invalid"));
 
 1139            $this->
appendMessage($this->lng->txt(
"crs_course_period_not_valid"));
 
 1154            foreach ($emails as 
$email) {
 
 1157                    $ilErr->appendMessage($this->lng->txt(
'contact_email_not_valid') . 
" '" . 
$email . 
"'");
 
 1181    public function delete()
 
 1185        $ilAppEventHandler = 
$DIC[
'ilAppEventHandler'];
 
 1188        if (!parent::delete()) {
 
 1199        include_once(
'Modules/Course/classes/class.ilCourseParticipants.php');
 
 1202        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
 1205        include_once 
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
 
 1208        include_once 
'./Modules/Course/classes/class.ilCourseFile.php';
 
 1211        include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
 1214        $ilAppEventHandler->raise(
 
 1217            array(
'object' => $this,
 
 1218                'obj_id' => $this->
getId(),
 
 1234        $ilAppEventHandler = 
$DIC[
'ilAppEventHandler'];
 
 1237        include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
 1246        $ilAppEventHandler->raise(
 
 1249            array(
'object' => $this,
 
 1250                'obj_id' => $this->
getId(),
 
 1263        $query = 
"SELECT * FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
" ";
 
 1266        if (!
$res->numRows()) {
 
 1270        $query = 
"UPDATE crs_settings SET " .
 
 1310            "WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
"";
 
 1315        if ($this->ref_id) {
 
 1316            include_once 
"./Services/Object/classes/class.ilObjectActivation.php";
 
 1329            $item->update($this->ref_id);
 
 1375        include_once 
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
 
 1400        include_once 
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
 
 1403        $query = 
"INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
 
 1404            "contact_phone,contact_email,contact_consultation," .
 
 1405            "sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
 
 1406            "sub_max_members,sub_notify,view_mode,timing_mode,abo," .
 
 1407            "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
 
 1408            "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
 
 1410            $ilDB->quote($this->
getId(), 
'integer') . 
", " .
 
 1427            $ilDB->quote($this->ABO_ENABLED, 
'integer') . 
", " .
 
 1432            #
"objective_view = '0', ".
 
 1449        include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
 1462        $query = 
"SELECT * FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
"";
 
 1513        if ($this->ref_id) {
 
 1514            include_once 
"./Services/Object/classes/class.ilObjectActivation.php";
 
 1516            switch ($activation[
"timing_type"]) {
 
 1529        include_once 
"./Modules/Course/classes/class.ilCourseWaitingList.php";
 
 1531        if (!is_object($this->waiting_list_obj)) {
 
 1549        include_once 
"./Modules/Course/classes/class.ilCourseParticipant.php";
 
 1565        include_once 
"./Modules/Course/classes/class.ilCourseParticipants.php";
 
 1604        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
 1606            'il_crs_admin_' . $this->
getRefId(),
 
 1607            "Admin of crs obj_no." . $this->
getId(),
 
 1612            'il_crs_tutor_' . $this->
getRefId(),
 
 1613            "Tutor of crs obj_no." . $this->
getId(),
 
 1618            'il_crs_member_' . $this->
getRefId(),
 
 1619            "Member of crs obj_no." . $this->
getId(),
 
 1643        $parent_roles = 
$rbacreview->getParentRoleIds($a_parent_ref);
 
 1644        foreach ((array) $parent_roles as $parent_role) {
 
 1647                $parent_role[
'obj_id'],
 
 1648                $parent_role[
'parent'],
 
 1667        $q = 
"SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
 
 1671        return $row[
"obj_id"];
 
 1684        $query = 
'SELECT obj_id FROM object_data WHERE type = ' . 
$ilDB->quote(
'rolt', 
'text') . 
' AND title = ' . 
$ilDB->quote(
'il_crs_non_member', 
'text');
 
 1688        return isset(
$row[
'obj_id']) ? 
$row[
'obj_id'] : 0;
 
 1704        if (empty($this->local_roles)) {
 
 1705            $this->local_roles = array();
 
 1708            foreach ($role_arr as $role_id) {
 
 1709                if (
$rbacreview->isAssignable($role_id, $this->getRefId()) == 
true) {
 
 1710                    $role_Obj = $this->
ilias->obj_factory->getInstanceByObjId($role_id);
 
 1715                        $role_name = $role_Obj->getTitle();
 
 1717                    $this->local_roles[$role_name] = $role_Obj->getId();
 
 1722        return $this->local_roles;
 
 1743        if (strlen($a_crs_id) > 0) {
 
 1744            $crs_id = $a_crs_id;
 
 1749        $role_arr = 
$rbacreview->getRolesOfRoleFolder($crs_id);
 
 1751        foreach ($role_arr as $role_id) {
 
 1752            $role_Obj = &$this->
ilias->obj_factory->getInstanceByObjId($role_id);
 
 1754            $crs_Member = 
"il_crs_member_" . $crs_id;
 
 1755            $crs_Admin = 
"il_crs_admin_" . $crs_id;
 
 1756            $crs_Tutor = 
"il_crs_tutor_" . $crs_id;
 
 1758            if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
 
 1759                $arr_crsDefaultRoles[
"crs_member_role"] = $role_Obj->getId();
 
 1762            if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
 
 1763                $arr_crsDefaultRoles[
"crs_admin_role"] = $role_Obj->getId();
 
 1766            if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
 
 1767                $arr_crsDefaultRoles[
"crs_tutor_role"] = $role_Obj->getId();
 
 1771        return $arr_crsDefaultRoles;
 
 1791        $query = 
"DELETE FROM crs_settings " .
 
 1792            "WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
'integer') . 
" ";
 
 1803        foreach ($local_roles as $role_id) {
 
 1805            if (substr(
$title, 0, 8) == 
'il_crs_m') {
 
 1815        foreach ($local_roles as $role_id) {
 
 1817                if (!strcmp($tmp_role->getTitle(), 
"il_crs_tutor_" . $this->getRefId())) {
 
 1828        foreach ($local_roles as $role_id) {
 
 1830                if (!strcmp($tmp_role->getTitle(), 
"il_crs_admin_" . $this->getRefId())) {
 
 1842        include_once 
'./Modules/Course/classes/class.ilCourseLMHistory.php';
 
 1845        include_once 
'./Modules/Course/classes/class.ilCourseParticipants.php';
 
 1849        include_once 
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
 
 1865        parent::MDUpdateListener($a_element);
 
 1867        switch ($a_element) {
 
 1870                include_once 
'Modules/Course/classes/class.ilECSCourseSettings.php';
 
 1872                $ecs->handleContentUpdate();
 
 1886        include_once 
'./Services/Object/classes/class.ilObjectActivation.php';
 
 1899        include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
 
 1900        include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
 
 1908                    $app->setSubtitle(
'crs_cal_activation_start');
 
 1916                    $app->setSubtitle(
'crs_cal_activation_end');
 
 1925                    $app->setSubtitle(
'crs_cal_reg_start');
 
 1933                    $app->setSubtitle(
'crs_cal_reg_end');
 
 1942                    $app->setSubtitle(
'crs_cal_start');
 
 1946                    $app->setFullday(
true);
 
 1951                    $app->setSubtitle(
'crs_cal_end');
 
 1955                    $app->setFullday(
true);
 
 1962                    foreach ($active as $null => $item) {
 
 1966                            $app->setContextInfo($item[
'ref_id']);
 
 1967                            $app->setTitle($item[
'title']);
 
 1968                            $app->setSubtitle(
'cal_crs_timing_start');
 
 1971                            $app->setFullday(
true);
 
 1975                            $app->setContextInfo($item[
'ref_id']);
 
 1976                            $app->setTitle($item[
'title']);
 
 1977                            $app->setSubtitle(
'cal_crs_timing_end');
 
 1980                            $app->setFullday(
true);
 
 1985                return $apps ? $apps : array();
 
 1993    ###### Interface ilMembershipRegistrationCodes 
 2004        $query = 
"SELECT obj_id FROM crs_settings " .
 
 2005            "WHERE reg_ac_enabled = " . 
$ilDB->quote(1, 
'integer') . 
" " .
 
 2006            "AND reg_ac = " . 
$ilDB->quote($a_code, 
'text');
 
 2011            $obj_ids[] = 
$row->obj_id;
 
 2029        include_once 
'./Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
 
 2030        include_once 
"./Modules/Course/classes/class.ilCourseParticipants.php";
 
 2033        if ($part->isAssigned($a_user_id)) {
 
 2037        if (!$a_force_registration) {
 
 2041                    "Can't register to course, course is offline.",
 
 2048                    "Can't register to course, course is not activated.",
 
 2071                include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
 
 2074                    $waiting_list->addToList($a_user_id);
 
 2075                    $this->lng->loadLanguageModule(
"crs");
 
 2077                        $this->lng->txt(
'crs_added_to_list'),
 
 2078                        $waiting_list->getPosition($a_user_id)
 
 2080                    include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
 
 2082                    $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
 
 2094        $part->add($a_user_id, $a_role);
 
 2095        $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
 
 2096        $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
 
 2099        include_once 
'./Modules/Forum/classes/class.ilForumNotification.php';
 
 2125        $this->auto_notification = $value;
 
 2135        $a_value = (int) $a_value;
 
 2138        if ($a_value == self::STATUS_DETERMINATION_LP) {
 
 2139            include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
 
 2145        $this->status_dt = $a_value;
 
 2163        include_once 
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
 
 2180        include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
 
 2183            include_once(
"Services/Tracking/classes/class.ilLPStatus.php");
 
 2186            $this->
getMembersObject()->updatePassed($a_member_id, $has_completed, 
false, 
true);
 
 2195        return parent::getOrderType();
 
 2207            $this->course_logger->debug(
'Waiting list or auto fill disabled.');
 
 2214        $this->course_logger->debug(
'Max members: ' . $max);
 
 2215        $this->course_logger->debug(
'Current members: ' . $now);
 
 2222        include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
 
 2225        foreach ($waiting_list->getUserIds() as $user_id) {
 
 2227                $this->course_logger->warning(
'Cannot create user instance for id: ' . $user_id);
 
 2231                $this->course_logger->warning(
'User is already assigned to course. uid: ' . $user_id . 
' course_id: ' . $this->
getRefId());
 
 2236            $waiting_list->removeFromList($user_id);
 
 2239            $this->course_logger->info(
'Assigned user from waiting list to course: ' . $this->
getTitle());
 
 2247    public static function mayLeave($a_course_id, $a_user_id = 
null, &$a_date = 
null)
 
 2255            $a_user_id = 
$ilUser->getId();
 
 2258        $set = 
$ilDB->query(
"SELECT leave_end" .
 
 2259            " FROM crs_settings" .
 
 2260            " WHERE obj_id = " . 
$ilDB->quote($a_course_id, 
"integer"));
 
 2264            $limit = date(
"Ymd", 
$row[
"leave_end"]);
 
 2265            if ($limit < date(
"Ymd")) {
 
 2289        include_once 
"Modules/Course/classes/class.ilCourseParticipants.php";
 
 2291        $set = 
$ilDB->query(
"SELECT obj_id, min_members" .
 
 2292            " FROM crs_settings" .
 
 2293            " WHERE min_members > " . 
$ilDB->quote(0, 
"integer") .
 
 2294            " AND sub_mem_limit = " . 
$ilDB->quote(1, 
"integer") . 
 
 2295            " AND ((leave_end IS NOT NULL" .
 
 2296                " AND leave_end < " . 
$ilDB->quote($now, 
"text") . 
")" .
 
 2297                " OR (leave_end IS NULL" .
 
 2298                " AND sub_end IS NOT NULL" .
 
 2299                " AND sub_end < " . 
$ilDB->quote($now, 
"text") . 
"))" .
 
 2300            " AND (crs_start IS NULL OR crs_start > " . 
$ilDB->quote($now, 
"integer") . 
")");
 
 2301        while (
$row = 
$ilDB->fetchAssoc($set)) {
 
 2305            if (
$tree->isDeleted($ref)) {
 
 2310            $reci = $part->getNotificationRecipients();
 
 2311            if (
sizeof($reci)) {
 
 2312                $missing = (int) 
$row[
"min_members"] - $part->getCountMembers();
 
 2314                    $res[
$row[
"obj_id"]] = array($missing, $reci);
 
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_TRANSLATION_SYSTEM
const IL_CRS_SUBSCRIPTION_LIMITED
const IL_CRS_VIEW_TIMING_ABSOLUTE
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_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.
const IL_CRS_VIEW_TIMING_ABSOLUTE
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 getLogger($a_component_id)
Get component logger.
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 _isOffline($a_obj_id)
Type-specific implementation of general status.
static _deleteAll($a_course_id)
static _getGroupings($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
isActivated()
Check if course is active and not offline.
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)
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.
const CAL_COURSE_TIMING_START
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
appendMessage($a_message)
getActivationUnlimitedStatus()
get activation unlimited no start or no end
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.
static lookupTimingMode($a_obj_id)
const CAL_COURSE_TIMING_END
cloneSettings($new_obj)
Clone entries in settings table.
setArchiveStart($a_value)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
getSubscriptionMinMembers()
setSubscriptionLimitationType($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 getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
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)
setOfflineStatus($a_status)
Set offline status.
static _lookupTitle($a_id)
lookup object title
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
getOfflineStatus()
Get offline status.
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 _getInstance()
Get instance of ilPrivacySettings.
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.
Interface for all objects that offer registration with access codes.
catch(Exception $e) $message
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
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