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';
94 public function __construct($a_id = 0,$a_call_by_reference =
true)
97 #define("ILIAS_MODULE","course"); 98 #define("KEEP_IMAGE_PATH",1); 100 $this->SUBSCRIPTION_DEACTIVATED = 1;
101 $this->SUBSCRIPTION_CONFIRMATION = 2;
102 $this->SUBSCRIPTION_DIRECT = 3;
103 $this->SUBSCRIPTION_PASSWORD = 4;
104 $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
105 $this->ARCHIVE_DISABLED = 1;
106 $this->ARCHIVE_READ = 2;
107 $this->ARCHIVE_DOWNLOAD = 3;
108 $this->ABO_ENABLED = 1;
109 $this->ABO_DISABLED = 0;
110 $this->SHOW_MEMBERS_ENABLED = 1;
111 $this->SHOW_MEMBERS_DISABLED = 0;
116 $this->course_logger =
$GLOBALS[
'DIC']->logger()->crs();
118 parent::__construct($a_id,$a_call_by_reference);
129 $query =
'SELECT show_members FROM crs_settings '.
130 'WHERE obj_id = '.$GLOBALS[
'ilDB']->quote($a_obj_id,
'integer');
134 return (
bool)
$row->show_members;
155 $this->reg_access_code = $a_code;
174 $this->reg_access_code_enabled = $a_status;
179 return $this->important;
183 $this->important = $a_info;
187 return $this->syllabus;
191 $this->syllabus = $a_syllabus;
195 return $this->contact_name;
199 $this->contact_name = $a_cn;
203 return $this->contact_consultation;
207 $this->contact_consultation = $a_value;
211 return $this->contact_phone;
215 $this->contact_phone = $a_value;
219 return $this->contact_email;
223 $this->contact_email = $a_value;
227 return $this->contact_responsibility;
231 $this->contact_responsibility = $a_value;
235 return (
int) $this->activation_type;
246 $this->activation_type =
$a_type;
254 return $this->activation_start;
258 $this->activation_start = $a_value;
262 return $this->activation_end;
266 $this->activation_end = $a_value;
270 return (
bool)$this->activation_offline;
274 $this->activation_offline = (bool) $a_value;
278 $this->activation_visibility = (bool) $a_value;
282 return $this->activation_visibility;
287 return $this->subscription_limitation_type;
291 $this->subscription_limitation_type =
$a_type;
299 return $this->subscription_start;
303 $this->subscription_start = $a_value;
307 return $this->subscription_end;
311 $this->subscription_end = $a_value;
316 #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED; 320 $this->subscription_type = $a_value;
324 return $this->subscription_password;
328 $this->subscription_password = $a_value;
337 return (
bool) $this->waiting_list;
342 $this->waiting_list = (bool) $a_status;
365 $this->session_limit = $a_status;
382 $this->subscription_membership_limitation = $a_status;
392 $this->session_prev = $a_num;
411 $this->session_next = $a_num;
431 return (
bool) $this->subscription_membership_limitation;
436 return $this->subscription_max_members;
440 $this->subscription_max_members = $a_value;
455 $query =
"SELECT * FROM crs_settings ".
456 "WHERE obj_id = ".$ilDB->quote($a_course_id ,
'integer').
" ".
457 "AND sub_notify = 1";
459 return $res->numRows() ? true :
false;
468 public function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false, $a_get_single = 0)
473 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]))
475 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
479 parent::getSubItems($a_admin_panel_enabled,$a_include_side_block, $a_get_single);
482 if(!$a_admin_panel_enabled &&
483 !$a_include_side_block &&
484 $this->items[
'sess'] &&
485 is_array($this->items[
'sess']) &&
494 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
501 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']))
507 $ilUser->writePref(
'crs_sess_show_next_'.$this->
getId(), (
string) (
int)
$_GET[
'crs_next_sess']);
512 $previous = $current = $next =
array();
513 foreach($sessions as $key => $item)
531 $num_previous_remove = max(
535 while($num_previous_remove--)
537 if(!$ilUser->getPref(
'crs_sess_show_prev_'.$this->getId()))
539 array_shift($previous);
541 $this->items[
'sess_link'][
'prev'][
'value'] = 1;
544 $num_next_remove = max(
548 while($num_next_remove--)
550 if(!$ilUser->getPref(
'crs_sess_show_next_'.$this->getId()))
555 $this->items[
'sess_link'][
'next'][
'value'] = 1;
558 $sessions = array_merge($previous,$current,$next);
559 $this->items[
'sess'] = $sessions;
562 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
564 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block] = $sort->sortItems($this->items);
566 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
572 return $this->subscription_notify ? true :
false;
576 $this->subscription_notify = $a_value ? true :
false;
581 $this->view_mode = $a_mode;
585 return $this->view_mode;
597 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
601 return $row->view_mode;
610 $query =
"SELECT abo FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
621 return $this->archive_start ? $this->archive_start :
time();
625 $this->archive_start = $a_value;
629 return $this->archive_end ? $this->archive_end : mktime(0,0,0,12,12,
date(
"Y",
time())+2);
633 $this->archive_end = $a_value;
641 $this->archive_type = $a_value;
645 $this->abo = $a_status;
653 $this->show_members = $a_status;
657 return $this->show_members;
681 return $this->message;
685 $this->message = $a_message;
691 $this->message .=
"<br /> ";
693 $this->message .= $a_message;
722 include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
734 include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
741 return $this->ABO == $this->ABO_ENABLED;
751 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
758 global $ilAppEventHandler;
760 parent::create($a_upload);
768 $ilAppEventHandler->raise(
'Modules/Course',
770 array(
'object' => $this,
771 'obj_id' => $this->
getId(),
783 $this->latitude = $a_latitude;
803 $this->longitude = $a_longitude;
823 $this->locationzoom = $a_locationzoom;
843 $this->enablemap = $a_enablemap;
867 $this->crs_start = $a_value;
877 $this->crs_end = $a_value;
887 $this->leave_end = $a_value;
897 if($a_value !== null)
899 $a_value = (int)$a_value;
901 $this->min_members = $a_value;
911 $this->auto_fill_from_waiting = (bool)$a_value;
927 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
931 $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
937 $new_obj->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
939 $new_obj->getMemberObject()->updateContact($ilUser->getId(), 1);
945 if($cwo->isRootNode($this->getRefId()))
954 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
958 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
962 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
964 $obj_settings->cloneSettings($new_obj->getId());
965 unset($obj_settings);
969 $ilLog->write(__METHOD__.
': '.$this->getBigIconPath().
' '.$this->
getSmallIconPath());
975 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
976 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
979 $cert->cloneCertificate($newcert);
994 parent::cloneDependencies($a_target_id,$a_copy_id);
997 include_once(
'Services/Container/classes/class.ilContainerStartObjects.php');
999 $start->cloneDependencies($a_target_id,$a_copy_id);
1002 include_once(
'Services/Object/classes/class.ilObjectActivation.php');
1006 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
1010 include_once(
'Modules/Course/classes/class.ilCourseObjective.php');
1012 $crs_objective->ilClone($a_target_id,$a_copy_id);
1026 global
$ilLog,$rbacadmin,$rbacreview;
1029 $new_admin = $new_obj->getDefaultAdminRole();
1031 if(!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->getRefId())
1033 $ilLog->write(__METHOD__.
' : Error cloning auto generated role: il_crs_admin');
1035 $rbacadmin->copyRolePermissions($admin,$this->
getRefId(),$new_obj->getRefId(),$new_admin,
true);
1036 $ilLog->write(__METHOD__.
' : Finished copying of role crs_admin.');
1039 $new_tutor = $new_obj->getDefaultTutorRole();
1040 if(!$tutor || !$new_tutor)
1042 $ilLog->write(__METHOD__.
' : Error cloning auto generated role: il_crs_tutor');
1044 $rbacadmin->copyRolePermissions($tutor,$this->
getRefId(),$new_obj->getRefId(),$new_tutor,
true);
1045 $ilLog->write(__METHOD__.
' : Finished copying of role crs_tutor.');
1048 $new_member = $new_obj->getDefaultMemberRole();
1049 if(!$member || !$new_member)
1051 $ilLog->write(__METHOD__.
' : Error cloning auto generated role: il_crs_member');
1053 $rbacadmin->copyRolePermissions($member,$this->
getRefId(),$new_obj->getRefId(),$new_member,
true);
1054 $ilLog->write(__METHOD__.
' : Finished copying of role crs_member.');
1064 #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and 1065 # $this->getSubscriptionType() == ) 1067 # $this->appendMessage($this->lng->txt('crs_select_registration_type')); 1073 $this->
appendMessage($this->lng->txt(
"activation_times_not_valid"));
1078 $this->
appendMessage($this->lng->txt(
"subscription_times_not_valid"));
1080 #if((!$this->getActivationUnlimitedStatus() and 1081 # !$this->getSubscriptionUnlimitedStatus()) and 1082 # ($this->getSubscriptionStart() > $this->getActivationEnd() or 1083 # $this->getSubscriptionStart() < $this->getActivationStart() or 1084 # $this->getSubscriptionEnd() > $this->getActivationEnd() or 1085 # $this->getSubscriptionEnd() < $this->getActivationStart())) 1088 # $this->appendMessage($this->lng->txt("subscription_time_not_within_activation")); 1092 $this->
appendMessage($this->lng->txt(
"crs_password_required"));
1098 $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_needed"));
1102 $this->
appendMessage($this->lng->txt(
"crs_max_members_needed"));
1106 $this->
appendMessage($this->lng->txt(
"crs_max_and_min_members_invalid"));
1119 $this->
appendMessage($this->lng->txt(
"crs_course_period_not_valid"));
1132 foreach ($emails as $email) {
1133 $email = trim($email);
1136 $ilErr->appendMessage($this->lng->txt(
'contact_email_not_valid').
" '".$email.
"'");
1162 global $ilAppEventHandler;
1165 if (!parent::delete())
1177 include_once(
'Modules/Course/classes/class.ilCourseParticipants.php');
1180 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
1183 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
1186 include_once
'./Modules/Course/classes/class.ilCourseFile.php';
1189 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1192 $ilAppEventHandler->raise(
'Modules/Course',
1194 array(
'object' => $this,
1195 'obj_id' => $this->
getId(),
1209 global $ilAppEventHandler,
$ilLog;
1211 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1220 $ilAppEventHandler->raise(
'Modules/Course',
1222 array(
'object' => $this,
1223 'obj_id' => $this->
getId(),
1234 $query =
"SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ";
1237 if(!
$res->numRows())
1242 $query =
"UPDATE crs_settings SET ".
1243 "syllabus = ".$ilDB->quote($this->
getSyllabus() ,
'text').
", ".
1244 "contact_name = ".$ilDB->quote($this->
getContactName() ,
'text').
", ".
1246 "contact_phone = ".$ilDB->quote($this->
getContactPhone() ,
'text').
", ".
1247 "contact_email = ".$ilDB->quote($this->
getContactEmail() ,
'text').
", ".
1249 "activation_type = ".$ilDB->quote(!$this->
getOfflineStatus() ,
'integer').
", ".
1258 "view_mode = ".$ilDB->quote($this->
getViewMode() ,
'integer').
", ".
1259 "abo = ".$ilDB->quote($this->
getAboStatus() ,
'integer').
", ".
1262 "show_members = ".$ilDB->quote($this->
getShowMembers() ,
'integer').
", ".
1263 "latitude = ".$ilDB->quote($this->
getLatitude() ,
'text').
", ".
1264 "longitude = ".$ilDB->quote($this->
getLongitude() ,
'text').
", ".
1265 "location_zoom = ".$ilDB->quote($this->
getLocationZoom() ,
'integer').
", ".
1266 "enable_course_map = ".$ilDB->quote((
int) $this->
getEnableCourseMap() ,
'integer').
", ".
1280 "WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
"";
1287 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
1303 $item->update($this->ref_id);
1346 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1369 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1372 $query =
"INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility,".
1373 "contact_phone,contact_email,contact_consultation,activation_type,activation_start,".
1374 "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit,".
1375 "sub_max_members,sub_notify,view_mode,abo," .
1376 "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, ".
1377 "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) ".
1379 $ilDB->quote($this->
getId() ,
'integer').
", ".
1386 $ilDB->quote(0 ,
'integer').
", ".
1398 $ilDB->quote($this->ABO_ENABLED ,
'integer').
", ".
1403 #"objective_view = '0', ". 1419 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1430 $query =
"SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
"";
1477 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
1479 switch($activation[
"timing_type"])
1504 include_once
"./Modules/Course/classes/class.ilCourseWaitingList.php";
1506 if(!is_object($this->waiting_list_obj))
1523 include_once
"./Modules/Course/classes/class.ilCourseParticipant.php";
1537 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
1572 global $rbacadmin,$rbacreview,
$ilDB;
1574 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1577 "Admin of crs obj_no.".$this->
getId(),
1583 "Tutor of crs obj_no.".$this->
getId(),
1588 'il_crs_member_'.$this->
getRefId(),
1589 "Member of crs obj_no.".$this->
getId(),
1608 global $rbacadmin, $rbacreview;
1610 $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1611 foreach((
array) $parent_roles as $parent_role)
1613 $rbacadmin->initIntersectionPermissions(
1615 $parent_role[
'obj_id'],
1616 $parent_role[
'parent'],
1633 $q =
"SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1637 return $row[
"obj_id"];
1648 $query =
'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote(
'rolt',
'text').
' AND title = '.$ilDB->quote(
'il_crs_non_member',
'text');
1652 return isset(
$row[
'obj_id']) ?
$row[
'obj_id'] : 0;
1663 global $rbacadmin,$rbacreview;
1665 if (empty($this->local_roles))
1667 $this->local_roles =
array();
1668 $role_arr = $rbacreview->getRolesOfRoleFolder($this->
getRefId());
1670 foreach ($role_arr as $role_id)
1672 if ($rbacreview->isAssignable($role_id,$this->getRefId()) ==
true)
1674 $role_Obj = $this->
ilias->obj_factory->getInstanceByObjId($role_id);
1682 $role_name = $role_Obj->getTitle();
1684 $this->local_roles[$role_name] = $role_Obj->getId();
1689 return $this->local_roles;
1705 global $rbacadmin, $rbacreview;
1707 if (strlen($a_crs_id) > 0)
1709 $crs_id = $a_crs_id;
1716 $role_arr = $rbacreview->getRolesOfRoleFolder($crs_id);
1718 foreach ($role_arr as $role_id)
1720 $role_Obj =& $this->
ilias->obj_factory->getInstanceByObjId($role_id);
1722 $crs_Member =
"il_crs_member_".$crs_id;
1723 $crs_Admin =
"il_crs_admin_".$crs_id;
1724 $crs_Tutor =
"il_crs_tutor_".$crs_id;
1726 if (strcmp($role_Obj->getTitle(), $crs_Member) == 0 )
1728 $arr_crsDefaultRoles[
"crs_member_role"] = $role_Obj->getId();
1731 if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0)
1733 $arr_crsDefaultRoles[
"crs_admin_role"] = $role_Obj->getId();
1736 if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0)
1738 $arr_crsDefaultRoles[
"crs_tutor_role"] = $role_Obj->getId();
1742 return $arr_crsDefaultRoles;
1751 return $rbacreview->getRolesOfRoleFolder($this->
getRefId(),
false);
1758 $query =
"DELETE FROM crs_settings ".
1759 "WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ";
1770 foreach($local_roles as $role_id)
1773 if(substr(
$title,0,8) ==
'il_crs_m')
1784 foreach($local_roles as $role_id)
1788 if(!strcmp($tmp_role->getTitle(),
"il_crs_tutor_".$this->getRefId()))
1800 foreach($local_roles as $role_id)
1804 if(!strcmp($tmp_role->getTitle(),
"il_crs_admin_".$this->getRefId()))
1817 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1820 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
1824 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1838 parent::MDUpdateListener($a_element);
1844 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
1846 $ecs->handleContentUpdate();
1860 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
1873 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1874 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
1884 $app->setSubtitle(
'crs_cal_activation_start');
1892 $app->setSubtitle(
'crs_cal_activation_end');
1902 $app->setSubtitle(
'crs_cal_reg_start');
1910 $app->setSubtitle(
'crs_cal_reg_end');
1920 $app->setSubtitle(
'crs_start');
1924 $app->setFullday(
true);
1929 $app->setSubtitle(
'crs_end');
1933 $app->setFullday(
true);
1938 return $apps ? $apps :
array();
1946 ###### Interface ilMembershipRegistrationCodes 1955 $query =
"SELECT obj_id FROM crs_settings ".
1956 "WHERE reg_ac_enabled = ".$ilDB->quote(1,
'integer').
" ".
1957 "AND reg_ac = ".$ilDB->quote($a_code,
'text');
1963 $obj_ids[] =
$row->obj_id;
1977 include_once
'./Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1978 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
1981 if($part->isAssigned($a_user_id))
1986 if(!$a_force_registration)
1991 include_once
'./Modules/Group/classes/class.ilObjGroupAccess.php';
2014 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2018 $waiting_list->addToList($a_user_id);
2019 $this->lng->loadLanguageModule(
"crs");
2020 $info = sprintf($this->lng->txt(
'crs_added_to_list'),
2021 $waiting_list->getPosition($a_user_id));
2022 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
2024 $participants->sendNotification($participants->NOTIFY_WAITING_LIST,$a_user_id);
2037 $part->add($a_user_id,$a_role);
2038 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2039 $part->sendNotification($part->NOTIFY_ADMINS,$a_user_id);
2042 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
2068 $this->auto_notification = $value;
2078 $a_value = (int)$a_value;
2081 if($a_value == self::STATUS_DETERMINATION_LP)
2083 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2086 $a_value = self::STATUS_DETERMINATION_MANUAL;
2090 $this->status_dt = $a_value;
2108 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
2126 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2130 include_once(
"Services/Tracking/classes/class.ilLPStatus.php");
2133 $this->
getMembersObject()->updatePassed($a_member_id, $has_completed,
false,
true);
2143 return parent::getOrderType();
2156 $this->course_logger->debug(
'Waiting list or auto fill disabled.');
2163 $this->course_logger->debug(
'Max members: ' . $max);
2164 $this->course_logger->debug(
'Current members: ' . $now);
2172 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2175 foreach($waiting_list->getUserIds() as $user_id)
2179 $this->course_logger->warning(
'Cannot create user instance for id: ' . $user_id);
2184 $this->course_logger->warning(
'User is already assigned to course. uid: ' . $user_id.
' course_id: ' . $this->getRefId());
2189 $waiting_list->removeFromList($user_id);
2192 $this->course_logger->info(
'Assigned user from waiting list to course: ' . $this->
getTitle());
2201 public static function mayLeave($a_course_id, $a_user_id = null, &$a_date = null)
2207 $a_user_id = $ilUser->getId();
2210 $set = $ilDB->query(
"SELECT leave_end".
2211 " FROM crs_settings".
2212 " WHERE obj_id = ".$ilDB->quote($a_course_id,
"integer"));
2213 $row = $ilDB->fetchAssoc($set);
2217 $limit =
date(
"Ymd",
$row[
"leave_end"]);
2218 if($limit <
date(
"Ymd"))
2235 $tree =
$GLOBALS[
'DIC']->repositoryTree();
2241 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
2243 $set =
$ilDB->query(
"SELECT obj_id, min_members".
2244 " FROM crs_settings".
2245 " WHERE min_members > ".
$ilDB->quote(0,
"integer").
2246 " AND sub_mem_limit = ".$ilDB->quote(1,
"integer").
2247 " AND ((leave_end IS NOT NULL".
2248 " AND leave_end < ".$ilDB->quote($now,
"text").
")".
2249 " OR (leave_end IS NULL".
2250 " AND sub_end IS NOT NULL".
2251 " AND sub_end < ".$ilDB->quote($now,
"text").
"))".
2252 " AND (crs_start IS NULL OR crs_start > ".$ilDB->quote($now,
"integer").
")");
2258 if($tree->isDeleted($ref))
2264 $reci = $part->getNotificationRecipients();
2267 $missing = (int)
$row[
"min_members"]-$part->getCountMembers();
const LP_STATUS_COMPLETED_NUM
getSubscriptionPassword()
setActivationEnd($a_value)
static getUserIdByLogin($a_login)
setSubscriptionNotify($a_value)
const IL_CRS_ACTIVATION_LIMITED
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()
const IL_CRS_VIEW_OBJECTIVE
const ADDED_TO_WAITINGLIST
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".
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 _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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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
getBigIconPath()
Get path for big icon.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone course (no member data)
const TIMINGS_DEACTIVATED
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
setOfflineStatus($a_value)
createMetaData()
create meta data entry
const OUT_OF_REGISTRATION_PERIOD
getTinyIconPath()
Get path for tiny icon.
enableSessionLimit($a_status)
en/disable limited number of sessions
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 _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.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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.
Test certificate adapter.
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)
getMemberObject()
Get course member object.
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)
const IL_CRS_ACTIVATION_OFFLINE
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.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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
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()
Create styles array
The data for the language used.
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.
checkLPStatusSync($a_member_id)
sync course status from lp
getLatitude()
Get Latitude.
getSmallIconPath()
Get path for small icon.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
isSubscriptionMembershipLimited()
is membership limited
setActivationType($a_type)
static _isActivated($a_obj_id)
Is activated.
static generateCode()
Generate new registration key.
setContactPhone($a_value)
static _lookupAboStatus($a_id)
getActivationUnlimitedStatus()
setCancellationEnd(ilDate $a_value=null)
static findCoursesWithNotEnoughMembers()
Minimum members check type $ilDB.
static _deleteByCourse($a_course_id)
initCourseMembersObject()
Init course member object ilObjUser $ilUser.
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
setWaitingListAutoFill($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static _getInstance($a_obj_id)
get instance by obj_id
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
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)
Class ilECSCourseSettings.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
setCourseStart(ilDate $a_value=null)
const IL_CRS_ACTIVATION_UNLIMITED
setStatusDetermination($a_value)
Set status determination mode.
setArchiveStart($a_value)
setSubscriptionLimitationType($a_type)