24 require_once
"./Services/Container/classes/class.ilContainer.php";
25 include_once
'./Modules/Course/classes/class.ilCourseConstants.php';
26 include_once
'./Services/Membership/interfaces/interface.ilMembershipRegistrationCodes.php';
125 public function __construct($a_id = 0, $a_call_by_reference =
true)
128 #define("ILIAS_MODULE","course"); 129 #define("KEEP_IMAGE_PATH",1); 131 $this->SUBSCRIPTION_DEACTIVATED = 1;
132 $this->SUBSCRIPTION_CONFIRMATION = 2;
133 $this->SUBSCRIPTION_DIRECT = 3;
134 $this->SUBSCRIPTION_PASSWORD = 4;
135 $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
136 $this->ARCHIVE_DISABLED = 1;
137 $this->ARCHIVE_READ = 2;
138 $this->ARCHIVE_DOWNLOAD = 3;
139 $this->ABO_ENABLED = 1;
140 $this->ABO_DISABLED = 0;
141 $this->SHOW_MEMBERS_ENABLED = 1;
142 $this->SHOW_MEMBERS_DISABLED = 0;
147 $this->course_logger =
$GLOBALS[
'DIC']->logger()->crs();
159 $query =
'SELECT show_members FROM crs_settings ' .
160 'WHERE obj_id = ' .
$GLOBALS[
'DIC'][
'ilDB']->quote($a_obj_id,
'integer');
163 return (
bool) $row->show_members;
175 $this->member_export = $a_mem_export;
194 $this->reg_access_code = $a_code;
213 $this->reg_access_code_enabled = $a_status;
218 return $this->important;
222 $this->important = $a_info;
226 return $this->syllabus;
230 $this->syllabus = $a_syllabus;
246 $this->target_group = $a_tg;
251 return $this->contact_name;
255 $this->contact_name = $a_cn;
259 return $this->contact_consultation;
263 $this->contact_consultation = $a_value;
267 return $this->contact_phone;
271 $this->contact_phone = $a_value;
275 return $this->contact_email;
279 $this->contact_email = $a_value;
283 return $this->contact_responsibility;
287 $this->contact_responsibility = $a_value;
300 return $this->activation_start;
304 $this->activation_start = $a_value;
308 return $this->activation_end;
312 $this->activation_end = $a_value;
316 $this->activation_visibility = (bool) $a_value;
320 return $this->activation_visibility;
325 return $this->subscription_limitation_type;
329 $this->subscription_limitation_type =
$a_type;
337 return $this->subscription_start;
341 $this->subscription_start = $a_value;
345 return $this->subscription_end;
349 $this->subscription_end = $a_value;
354 #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED; 358 $this->subscription_type = $a_value;
362 return $this->subscription_password;
366 $this->subscription_password = $a_value;
375 return (
bool) $this->waiting_list;
380 $this->waiting_list = (bool) $a_status;
401 $this->session_limit = $a_status;
418 $this->subscription_membership_limitation = $a_status;
428 $this->session_prev = $a_num;
447 $this->session_next = $a_num;
467 return (
bool) $this->subscription_membership_limitation;
472 return $this->subscription_max_members;
476 $this->subscription_max_members = $a_value;
491 $ilDB = $DIC[
'ilDB'];
493 $query =
"SELECT * FROM crs_settings " .
494 "WHERE obj_id = " .
$ilDB->quote($a_course_id,
'integer') .
" " .
495 "AND sub_notify = 1";
497 return $res->numRows() ? true :
false;
507 $a_admin_panel_enabled =
false,
508 $a_include_side_block =
false,
518 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block])) {
519 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
523 parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
526 if (!$a_admin_panel_enabled &&
527 !$a_include_side_block &&
528 $this->items[
'sess'] &&
529 is_array($this->items[
'sess']) &&
536 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
543 if (isset(
$_GET[
'crs_prev_sess'])) {
544 $ilUser->writePref(
'crs_sess_show_prev_' . $this->
getId(), (
string) (
int)
$_GET[
'crs_prev_sess']);
546 if (isset(
$_GET[
'crs_next_sess'])) {
547 $ilUser->writePref(
'crs_sess_show_next_' . $this->
getId(), (
string) (
int)
$_GET[
'crs_next_sess']);
550 $session_rbac_checked = [];
551 foreach ($this->items[
'sess'] as $session_tree_info) {
552 if (
$access->checkAccess(
'visible',
'', $session_tree_info[
'ref_id'])) {
553 $session_rbac_checked[] = $session_tree_info;
556 $sessions =
ilUtil::sortArray($session_rbac_checked,
'start',
'ASC',
true,
false);
559 $previous = $current = $next = array();
560 foreach ($sessions as $key => $item) {
572 $num_previous_remove = max(
576 while ($num_previous_remove--) {
577 if (!
$ilUser->getPref(
'crs_sess_show_prev_' . $this->getId())) {
578 array_shift($previous);
580 $this->items[
'sess_link'][
'prev'][
'value'] = 1;
583 $num_next_remove = max(
587 while ($num_next_remove--) {
588 if (!
$ilUser->getPref(
'crs_sess_show_next_' . $this->getId())) {
592 $this->items[
'sess_link'][
'next'][
'value'] = 1;
595 $sessions = array_merge($previous, $current, $next);
596 $this->items[
'sess'] = $sessions;
599 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
601 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block] = $sort->sortItems($this->items);
603 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
609 return $this->subscription_notify ? true :
false;
613 $this->subscription_notify = $a_value ? true :
false;
618 $this->view_mode = $a_mode;
622 return $this->view_mode;
633 $ilDB = $DIC[
'ilDB'];
635 $query =
'SELECT timing_mode FROM crs_settings ' .
636 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
640 return (
int) $row->timing_mode;
650 $this->timing_mode = $a_mode;
671 $ilDB = $DIC[
'ilDB'];
673 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = " .
$ilDB->quote($a_id,
'integer') .
" ";
676 return $row->view_mode;
685 $ilDB = $DIC[
'ilDB'];
687 $query =
"SELECT abo FROM crs_settings WHERE obj_id = " .
$ilDB->quote($a_id,
'integer') .
" ";
697 return $this->archive_start ? $this->archive_start : time();
701 $this->archive_start = $a_value;
705 return $this->archive_end ? $this->archive_end : mktime(0, 0, 0, 12, 12, date(
"Y", time()) + 2);
709 $this->archive_end = $a_value;
717 $this->archive_type = $a_value;
721 $this->abo = $a_status;
729 $this->show_members = $a_status;
733 return $this->show_members;
761 $this->message = $a_message;
766 $this->message .=
"<br /> ";
768 $this->message .= $a_message;
798 include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
810 include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
817 return $this->ABO == $this->ABO_ENABLED;
827 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
832 public function create($a_upload =
false)
836 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
838 parent::create($a_upload);
845 $ilAppEventHandler->raise(
848 array(
'object' => $this,
849 'obj_id' => $this->
getId(),
861 $this->latitude = $a_latitude;
881 $this->longitude = $a_longitude;
901 $this->locationzoom = $a_locationzoom;
921 $this->enablemap = $a_enablemap;
951 ($start instanceof \
ilDate && !$end instanceof
ilDate) ||
952 ($end instanceof \ilDate && !$start instanceof ilDate)
957 if ($start instanceof \ilDate) {
971 $this->course_start_time_indication = $time_indication;
988 $this->crs_start = $a_value;
1004 $this->crs_end = $a_value;
1017 $this->leave_end = $a_value;
1027 if ($a_value !== null) {
1028 $a_value = (int) $a_value;
1030 $this->min_members = $a_value;
1040 $this->auto_fill_from_waiting = (bool) $a_value;
1056 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
1060 $ilDB = $DIC[
'ilDB'];
1062 $certificateLogger = $DIC->logger()->cert();
1065 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
1073 $new_obj->getMemberObject()->updateContact(
$ilUser->getId(), 1);
1079 if ($cwo->isRootNode($this->getRefId())) {
1087 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1091 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
1095 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
1097 $obj_settings->cloneSettings($new_obj->getId());
1098 unset($obj_settings);
1107 $templateRepository,
1108 $DIC->filesystem()->web(),
1113 $cloneAction->cloneCertificate($this, $new_obj);
1116 $book_service->cloneSettings($this->
getId(), $new_obj->getId());
1132 parent::cloneDependencies($a_target_id, $a_copy_id);
1135 include_once(
'Services/Container/classes/class.ilContainerStartObjects.php');
1137 $start->cloneDependencies($a_target_id, $a_copy_id);
1140 include_once(
'Services/Object/classes/class.ilObjectActivation.php');
1144 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
1148 include_once(
'Modules/Course/classes/class.ilCourseObjective.php');
1150 $crs_objective->ilClone($a_target_id, $a_copy_id);
1155 $grouping = new \ilObjCourseGrouping($grouping_id);
1156 $grouping->cloneGrouping($a_target_id, $a_copy_id);
1178 $new_admin = $new_obj->getDefaultAdminRole();
1180 if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->getRefId()) {
1181 $ilLog->write(__METHOD__ .
' : Error cloning auto generated role: il_crs_admin');
1183 $rbacadmin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->getRefId(), $new_admin,
true);
1184 $ilLog->write(__METHOD__ .
' : Finished copying of role crs_admin.');
1187 $new_tutor = $new_obj->getDefaultTutorRole();
1188 if (!$tutor || !$new_tutor) {
1189 $ilLog->write(__METHOD__ .
' : Error cloning auto generated role: il_crs_tutor');
1191 $rbacadmin->copyRolePermissions($tutor, $this->
getRefId(), $new_obj->getRefId(), $new_tutor,
true);
1192 $ilLog->write(__METHOD__ .
' : Finished copying of role crs_tutor.');
1195 $new_member = $new_obj->getDefaultMemberRole();
1196 if (!$member || !$new_member) {
1197 $ilLog->write(__METHOD__ .
' : Error cloning auto generated role: il_crs_member');
1199 $rbacadmin->copyRolePermissions($member, $this->
getRefId(), $new_obj->getRefId(), $new_member,
true);
1200 $ilLog->write(__METHOD__ .
' : Finished copying of role crs_member.');
1212 $this->
appendMessage($this->lng->txt(
"subscription_times_not_valid"));
1215 $this->
appendMessage($this->lng->txt(
"crs_password_required"));
1219 $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_needed"));
1222 $this->
appendMessage($this->lng->txt(
"crs_max_members_needed"));
1225 $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_invalid"));
1236 $this->
appendMessage($this->lng->txt(
"crs_course_period_not_valid"));
1251 foreach ($emails as
$email) {
1252 $email = trim($email);
1254 $ilErr->appendMessage($this->lng->txt(
'contact_email_not_valid') .
" '" . $email .
"'");
1278 public function delete()
1282 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
1285 if (!parent::delete()) {
1296 include_once(
'Modules/Course/classes/class.ilCourseParticipants.php');
1299 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
1302 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
1305 include_once
'./Modules/Course/classes/class.ilCourseFile.php';
1308 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1311 $ilAppEventHandler->raise(
1314 array(
'object' => $this,
1315 'obj_id' => $this->
getId(),
1331 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
1332 $ilLog = $DIC->logger()->crs();
1334 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1343 $ilAppEventHandler->raise(
1346 array(
'object' => $this,
1347 'obj_id' => $this->
getId(),
1359 $ilDB = $DIC[
'ilDB'];
1363 $query =
"SELECT * FROM crs_settings WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
1366 if (!
$res->numRows()) {
1371 $query =
"UPDATE crs_settings SET " .
1413 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
"";
1418 if ($this->ref_id) {
1419 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
1432 $item->update($this->ref_id);
1479 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1504 $ilDB = $DIC[
'ilDB'];
1506 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1509 $query =
"INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
1510 "contact_phone,contact_email,contact_consultation," .
1511 "sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
1512 "sub_max_members,sub_notify,view_mode,timing_mode,abo," .
1513 "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
1514 "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
1516 $ilDB->quote($this->
getId(),
'integer') .
", " .
1533 $ilDB->quote($this->ABO_ENABLED,
'integer') .
", " .
1538 #
"objective_view = '0', ".
1555 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1566 $ilDB = $DIC[
'ilDB'];
1568 $query =
"SELECT * FROM crs_settings WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
"";
1613 if ($row->period_time_indication) {
1618 } elseif (!is_null($row->period_start) && !is_null($row->period_end)) {
1631 if ($this->ref_id) {
1632 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
1634 switch ($activation[
"timing_type"]) {
1647 include_once
"./Modules/Course/classes/class.ilCourseWaitingList.php";
1649 if (!is_object($this->waiting_list_obj)) {
1667 include_once
"./Modules/Course/classes/class.ilCourseParticipant.php";
1683 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
1720 $ilDB = $DIC[
'ilDB'];
1722 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1724 'il_crs_admin_' . $this->
getRefId(),
1725 "Admin of crs obj_no." . $this->
getId(),
1730 'il_crs_tutor_' . $this->
getRefId(),
1731 "Tutor of crs obj_no." . $this->
getId(),
1736 'il_crs_member_' . $this->
getRefId(),
1737 "Member of crs obj_no." . $this->
getId(),
1761 $parent_roles =
$rbacreview->getParentRoleIds($a_parent_ref);
1762 foreach ((array) $parent_roles as $parent_role) {
1765 $parent_role[
'obj_id'],
1766 $parent_role[
'parent'],
1783 $ilDB = $DIC[
'ilDB'];
1785 $q =
"SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1789 return $row[
"obj_id"];
1800 $ilDB = $DIC[
'ilDB'];
1802 $query =
'SELECT obj_id FROM object_data WHERE type = ' .
$ilDB->quote(
'rolt',
'text') .
' AND title = ' .
$ilDB->quote(
'il_crs_non_member',
'text');
1806 return isset($row[
'obj_id']) ? $row[
'obj_id'] : 0;
1822 if (empty($this->local_roles)) {
1823 $this->local_roles = array();
1826 foreach ($role_arr as $role_id) {
1827 if (
$rbacreview->isAssignable($role_id, $this->getRefId()) ==
true) {
1828 $role_Obj = $this->
ilias->obj_factory->getInstanceByObjId($role_id);
1833 $role_name = $role_Obj->getTitle();
1835 $this->local_roles[$role_name] = $role_Obj->getId();
1840 return $this->local_roles;
1861 if (strlen($a_crs_id) > 0) {
1862 $crs_id = $a_crs_id;
1867 $role_arr =
$rbacreview->getRolesOfRoleFolder($crs_id);
1869 foreach ($role_arr as $role_id) {
1870 $role_Obj = &$this->
ilias->obj_factory->getInstanceByObjId($role_id);
1872 $crs_Member =
"il_crs_member_" . $crs_id;
1873 $crs_Admin =
"il_crs_admin_" . $crs_id;
1874 $crs_Tutor =
"il_crs_tutor_" . $crs_id;
1876 if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
1877 $arr_crsDefaultRoles[
"crs_member_role"] = $role_Obj->getId();
1880 if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
1881 $arr_crsDefaultRoles[
"crs_admin_role"] = $role_Obj->getId();
1884 if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
1885 $arr_crsDefaultRoles[
"crs_tutor_role"] = $role_Obj->getId();
1889 return $arr_crsDefaultRoles;
1907 $ilDB = $DIC[
'ilDB'];
1909 $query =
"DELETE FROM crs_settings " .
1910 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
1921 foreach ($local_roles as $role_id) {
1923 if (substr(
$title, 0, 8) ==
'il_crs_m') {
1933 foreach ($local_roles as $role_id) {
1935 if (!strcmp($tmp_role->getTitle(),
"il_crs_tutor_" . $this->
getRefId())) {
1946 foreach ($local_roles as $role_id) {
1948 if (!strcmp($tmp_role->getTitle(),
"il_crs_admin_" . $this->
getRefId())) {
1960 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1963 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
1967 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1983 parent::MDUpdateListener($a_element);
1985 switch ($a_element) {
1988 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
1990 $ecs->handleContentUpdate();
2004 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
2017 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
2018 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
2026 $app->setSubtitle(
'crs_cal_activation_start');
2034 $app->setSubtitle(
'crs_cal_activation_end');
2043 $app->setSubtitle(
'crs_cal_reg_start');
2051 $app->setSubtitle(
'crs_cal_reg_end');
2060 $app->setSubtitle(
'crs_cal_start');
2069 $app->setSubtitle(
'crs_cal_end');
2080 foreach ($active as $null => $item) {
2084 $app->setContextInfo($item[
'ref_id']);
2085 $app->setTitle($item[
'title']);
2086 $app->setSubtitle(
'cal_crs_timing_start');
2089 $app->setFullday(
true);
2093 $app->setContextInfo($item[
'ref_id']);
2094 $app->setTitle($item[
'title']);
2095 $app->setSubtitle(
'cal_crs_timing_end');
2098 $app->setFullday(
true);
2103 return $apps ? $apps : array();
2111 ###### Interface ilMembershipRegistrationCodes 2120 $ilDB = $DIC[
'ilDB'];
2122 $query =
"SELECT obj_id FROM crs_settings " .
2123 "WHERE reg_ac_enabled = " .
$ilDB->quote(1,
'integer') .
" " .
2124 "AND reg_ac = " .
$ilDB->quote($a_code,
'text');
2129 $obj_ids[] = $row->obj_id;
2146 $tree = $DIC[
'tree'];
2147 include_once
'./Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
2148 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
2151 if ($part->isAssigned($a_user_id)) {
2155 if (!$a_force_registration) {
2159 "Can't register to course, course is offline.",
2166 "Can't register to course, course is not activated.",
2189 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2192 $waiting_list->addToList($a_user_id);
2193 $this->lng->loadLanguageModule(
"crs");
2195 $this->lng->txt(
'crs_added_to_list'),
2196 $waiting_list->getPosition($a_user_id)
2198 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
2200 $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
2212 $part->add($a_user_id, $a_role);
2213 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2214 $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
2217 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
2243 $this->auto_notification = $value;
2253 $a_value = (int) $a_value;
2256 if ($a_value == self::STATUS_DETERMINATION_LP) {
2257 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2259 $a_value = self::STATUS_DETERMINATION_MANUAL;
2263 $this->status_dt = $a_value;
2281 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
2298 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2301 include_once(
"Services/Tracking/classes/class.ilLPStatus.php");
2304 $this->
getMembersObject()->updatePassed($a_member_id, $has_completed,
false,
true);
2313 return parent::getOrderType();
2325 $this->course_logger->debug(
'Waiting list or auto fill disabled.');
2332 $this->course_logger->debug(
'Max members: ' . $max);
2333 $this->course_logger->debug(
'Current members: ' . $now);
2340 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2343 foreach ($waiting_list->getUserIds() as $user_id) {
2345 $this->course_logger->warning(
'Cannot create user instance for id: ' . $user_id);
2349 $this->course_logger->warning(
'User is already assigned to course. uid: ' . $user_id .
' course_id: ' . $this->
getRefId());
2354 $waiting_list->removeFromList($user_id);
2357 $this->course_logger->info(
'Assigned user from waiting list to course: ' . $this->
getTitle());
2365 public static function mayLeave($a_course_id, $a_user_id = null, &$a_date = null)
2370 $ilDB = $DIC[
'ilDB'];
2373 $a_user_id =
$ilUser->getId();
2376 $set =
$ilDB->query(
"SELECT leave_end" .
2377 " FROM crs_settings" .
2378 " WHERE obj_id = " .
$ilDB->quote($a_course_id,
"integer"));
2379 $row =
$ilDB->fetchAssoc($set);
2380 if ($row && $row[
"leave_end"]) {
2382 $limit = date(
"Ymd", $row[
"leave_end"]);
2383 if ($limit < date(
"Ymd")) {
2407 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
2409 $set =
$ilDB->query(
"SELECT obj_id, min_members" .
2410 " FROM crs_settings" .
2411 " WHERE min_members > " .
$ilDB->quote(0,
"integer") .
2412 " AND sub_mem_limit = " .
$ilDB->quote(1,
"integer") .
2413 " AND ((leave_end IS NOT NULL" .
2414 " AND leave_end < " .
$ilDB->quote($now,
"text") .
")" .
2415 " OR (leave_end IS NULL" .
2416 " AND sub_end IS NOT NULL" .
2417 " AND sub_end < " .
$ilDB->quote($now,
"text") .
"))" .
2418 " AND (period_start IS NULL OR period_start > " .
$ilDB->quote($now,
"integer") .
")");
2419 while ($row =
$ilDB->fetchAssoc($set)) {
2423 if (
$tree->isDeleted($ref)) {
2428 $reci = $part->getNotificationRecipients();
2429 if (
sizeof($reci)) {
2430 $missing = (int) $row[
"min_members"] - $part->getCountMembers();
2432 $res[$row[
"obj_id"]] = array($missing, $reci);
const LP_STATUS_COMPLETED_NUM
getSubscriptionPassword()
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
setActivationEnd($a_value)
static getUserIdByLogin($a_login)
setSubscriptionNotify($a_value)
getEnableMap()
Type independent wrapper.
setContactResponsibility($a_value)
getMailToMembersType()
Get mail to members type.
getSubscriptionMinMembers()
setSubscriptionStart($a_value)
setSubscriptionEnd($a_value)
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
const IL_CRS_SUBSCRIPTION_LIMITED
setCoursePeriod(\ilDateTime $start=null, \ilDateTime $end=null)
static lookupNumberOfMembers($a_ref_id)
Lookup number of members ilRbacReview $rbacreview <type> $ilObjDataCache.
getSubscriptionMaxMembers()
setShowMembersExport($a_mem_export)
const IL_CRS_VIEW_OBJECTIVE
const ADDED_TO_WAITINGLIST
const IL_CRS_VIEW_TIMING_ABSOLUTE
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
getLongitude()
Get Longitude.
setAutoNotification($value)
Sets automatic notification status in $this->auto_notification, using given $status.
static convertDateToUtcDBTimestamp(\ilDateTime $date=null)
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
static lookupObjectsByCode($a_code)
static _deleteUser($a_usr_id)
Delete user type $ilDB.
getActivationVisibility()
setParentRolePermissions($a_parent_ref)
This method is called before "initDefaultRoles".
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
getDefaultCourseRoles($a_crs_id="")
get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_...
const IL_CAL_TRANSLATION_SYSTEM
static lookupCourseNonMemberTemplatesId()
Lookup course non member id.
static _registrationEnabled($a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
setImportantInformation($a_info)
static _registrationEnabled($a_obj_id)
updateMetaData()
update meta data entry
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.
setMailToMembersType($a_type)
Set mail to members type.
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
getSubItems( $a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0, \ilContainerUserFilter $container_user_filter=null)
Get subitems of container.
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.
static getItem($a_ref_id)
Get item data.
getOfflineStatus()
Get offline status.
static _isSubscriptionNotificationEnabled($a_course_id)
Check if subscription notification is enabled.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
setContactEmail($a_value)
enableSubscriptionMembershipLimitation($a_status)
enable max members
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone course (no member data)
const TIMINGS_DEACTIVATED
createMetaData()
create meta data entry
const REGISTRATION_INVALID_OFFLINE
const OUT_OF_REGISTRATION_PERIOD
enableSessionLimit($a_status)
en/disable limited number of sessions
const IL_CRS_VIEW_TIMING_ABSOLUTE
static _lookupTitle($a_id)
lookup object title
Apointment templates are used for automatic generated apointments.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
$course_start_time_indication
getStatusDetermination()
Get status determination mode.
static lookupTimingMode($a_obj_id)
static _lookupViewMode($a_id)
lookup view mode of container
setSubscriptionPassword($a_value)
static _deleteByContainer($a_container_id)
Delete all fields of a container.
const STATUS_DETERMINATION_LP
addAdditionalSubItemInformation(&$a_item_data)
Add additional information to sub item, e.g.
setRegistrationAccessCode($a_code)
Set refistration access code.
static _clone($a_source_id, $a_target_id)
Clone fields.
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
__createDefaultSettings()
static _usingRegistrationCode()
Using Registration code.
static _getAllReferences($a_id)
get all reference ids of object
const IL_CRS_ARCHIVE_NONE
update()
update complete object
handleAutoFill()
Handle course auto fill.
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
setLatitude($a_latitude)
Set Latitude.
cloneSettings(\ilObjCourse $new_obj)
Clone entries in settings table.
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
getCourseStartTimeIndication()
static _deleteAll($a_course_id)
setLocationZoom($a_locationzoom)
Set LocationZoom.
static _enabledLearningProgress()
check wether learing progress is enabled or not
const IL_CRS_SUBSCRIPTION_PASSWORD
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.
const CAL_ACTIVATION_START
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getLocationZoom()
Get LocationZoom.
setActivationStart($a_value)
isActivated()
Check if course is active and not offline.
getMemberObject()
Get course member object.
foreach($_POST as $key=> $value) $res
setLongitude($a_longitude)
Set Longitude.
getId()
get object id public
Interface for all objects that offer registration with access codes.
getNumberOfNextSessions()
Set number of previous sessions.
setSubscriptionType($a_value)
static _isOffline($a_obj_id)
Type-specific implementation of general status.
getContactResponsibility()
syncMembersStatusWithLP()
Set course status for all members by lp status.
__getCrsNonMemberTemplateId()
get course non-member template private
const REGISTRATION_CODE_DISABLED
static _lookupObjId($a_id)
prepareAppointments($a_mode='create')
Prepare calendar appointments.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (start objects, preconditions)
setSubscriptionMinMembers($a_value)
Low level api for booking service.
setNumberOfNextSessions($a_num)
Set number of previous sessions.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
const IL_CRS_SUBSCRIPTION_UNLIMITED
const CAL_COURSE_TIMING_END
getTitle()
get object title public
setContactConsultation($a_value)
MDUpdateListener($a_element)
Overwriten Metadata update listener for ECS functionalities.
redirection script todo: (a better solution should control the processing via a xml file) ...
cloneMetaData($target_obj)
Copy meta data.
membership registration exception
const IL_CRS_ADMIN
Base class for course and group participants.
const STATUS_DETERMINATION_MANUAL
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
getRegistrationAccessCode()
get access code
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
enableRegistrationAccessCode($a_status)
En/disable registration access code.
static _getTranslation($a_role_title)
getSubscriptionLimitationType()
setTimingType($a_type)
Set timing type.
getLocalCourseRoles($a_translate=false)
get ALL local roles of course, also those created and defined afterwards only fetch data once from da...
static mayLeave($a_course_id, $a_user_id=null, &$a_date=null)
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
checkLPStatusSync($a_member_id)
sync course status from lp
getLatitude()
Get Latitude.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
isSubscriptionMembershipLimited()
is membership limited
static _isActivated($a_obj_id)
Is activated.
setTargetGroup(?string $a_tg)
static generateCode()
Generate new registration key.
setContactPhone($a_value)
const CAL_COURSE_TIMING_START
static _lookupAboStatus($a_id)
const REGISTRATION_INVALID_AVAILABILITY
getActivationUnlimitedStatus()
get activation unlimited no start or no end
setCancellationEnd(ilDate $a_value=null)
static findCoursesWithNotEnoughMembers()
Minimum members check type $ilDB.
static _deleteByCourse($a_course_id)
initCourseMembersObject()
Init course member object ilObjUser $ilUser.
setOfflineStatus($a_status)
Set offline status.
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
__construct(Container $dic, ilPlugin $plugin)
const IL_CRS_ARCHIVE_DOWNLOAD
static _deleteUser($a_usr_id)
Delete user data.
getNumberOfPreviousSessions()
Set number of previous sessions.
getLongDescription()
get object long description (stored in object_description)
setSubscriptionMaxMembers($a_value)
static _deleteAll($course_id)
getRefId()
get reference id public
enableWaitingList($a_status)
static _deleteUser($a_usr_id)
getSubscriptionUnlimitedStatus()
deleteMetaData()
delete meta data entry
toggleCourseStartTimeIndication(bool $time_indication)
initCourseMemberObject()
Init course member object ilObjUser $ilUser.
const IL_CRS_SUBSCRIPTION_DIRECT
static getLogger($a_component_id)
Get component logger.
setWaitingListAutoFill($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance($a_obj_id)
get instance by obj_id
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
static _getGroupings($a_course_id)
getEnableCourseMap()
Get Enable Course Map.
static checkForumsExistsInsert($ref_id, $user_id=0)
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
setCourseEnd(ilDateTime $a_value=null)
setCourseStart(ilDateTime $a_value=null)
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.
Class ilObjectActivation.
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.
appendMessage($a_message)
getImportantInformation()
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
setShowMembers($a_status)
Class ilECSCourseSettings.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
updateSettings()
Update settings.
setStatusDetermination($a_value)
Set status determination mode.
setArchiveStart($a_value)
setSubscriptionLimitationType($a_type)