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';
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;
454 $ilDB = $DIC[
'ilDB'];
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;
592 $ilDB = $DIC[
'ilDB'];
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;
630 $ilDB = $DIC[
'ilDB'];
632 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = " .
$ilDB->quote($a_id,
'integer') .
" ";
635 return $row->view_mode;
644 $ilDB = $DIC[
'ilDB'];
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)
967 $ilDB = $DIC[
'ilDB'];
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) {
1155 $email = trim($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'];
1235 $ilLog = $DIC->logger()->crs();
1237 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1246 $ilAppEventHandler->raise(
1249 array(
'object' => $this,
1250 'obj_id' => $this->
getId(),
1259 $ilDB = $DIC[
'ilDB'];
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';
1398 $ilDB = $DIC[
'ilDB'];
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');
1460 $ilDB = $DIC[
'ilDB'];
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";
1602 $ilDB = $DIC[
'ilDB'];
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'],
1665 $ilDB = $DIC[
'ilDB'];
1667 $q =
"SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1671 return $row[
"obj_id"];
1682 $ilDB = $DIC[
'ilDB'];
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;
1789 $ilDB = $DIC[
'ilDB'];
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 2002 $ilDB = $DIC[
'ilDB'];
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;
2028 $tree = $DIC[
'tree'];
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");
2141 $a_value = self::STATUS_DETERMINATION_MANUAL;
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)
2252 $ilDB = $DIC[
'ilDB'];
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);
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
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 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.
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.
getStatusDetermination()
Get status determination mode.
static lookupTimingMode($a_obj_id)
static _lookupViewMode($a_id)
lookup view mode of container
setSubscriptionPassword($a_value)
setCourseEnd(ilDate $a_value=null)
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.
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
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
catch(Exception $e) $message
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)
setNumberOfNextSessions($a_num)
Set number of previous sessions.
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.
cloneSettings($new_obj)
Clone entries in settings table.
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()
getSubItems($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
Get subitems of container.
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.
update($pash, $contents, Config $config)
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.
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.
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
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?
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)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Class ilECSCourseSettings.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
setCourseStart(ilDate $a_value=null)
setStatusDetermination($a_value)
Set status determination mode.
setArchiveStart($a_value)
setSubscriptionLimitationType($a_type)