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';
84 #define("ILIAS_MODULE","course"); 85 #define("KEEP_IMAGE_PATH",1); 87 $this->SUBSCRIPTION_DEACTIVATED = 1;
88 $this->SUBSCRIPTION_CONFIRMATION = 2;
89 $this->SUBSCRIPTION_DIRECT = 3;
90 $this->SUBSCRIPTION_PASSWORD = 4;
91 $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
92 $this->ARCHIVE_DISABLED = 1;
93 $this->ARCHIVE_READ = 2;
94 $this->ARCHIVE_DOWNLOAD = 3;
95 $this->ABO_ENABLED = 1;
96 $this->ABO_DISABLED = 0;
97 $this->SHOW_MEMBERS_ENABLED = 1;
98 $this->SHOW_MEMBERS_DISABLED = 0;
103 parent::__construct($a_id,$a_call_by_reference);
114 $query =
'SELECT show_members FROM crs_settings '.
115 'WHERE obj_id = '.$GLOBALS[
'ilDB']->quote($a_obj_id,
'integer');
119 return (
bool)
$row->show_members;
140 $this->reg_access_code = $a_code;
159 $this->reg_access_code_enabled = $a_status;
164 return $this->important;
168 $this->important = $a_info;
172 return $this->syllabus;
176 $this->syllabus = $a_syllabus;
180 return $this->contact_name;
184 $this->contact_name = $a_cn;
188 return $this->contact_consultation;
192 $this->contact_consultation = $a_value;
196 return $this->contact_phone;
200 $this->contact_phone = $a_value;
204 return $this->contact_email;
208 $this->contact_email = $a_value;
212 return $this->contact_responsibility;
216 $this->contact_responsibility = $a_value;
220 return (
int) $this->activation_type;
231 $this->activation_type = $a_type;
239 return $this->activation_start ? $this->activation_start : time();
243 $this->activation_start = $a_value;
247 return $this->activation_end ? $this->activation_end : mktime(0,0,0,12,12,date(
"Y",time())+2);
251 $this->activation_end = $a_value;
255 return (
bool)$this->activation_offline;
259 $this->activation_offline = (bool) $a_value;
263 $this->activation_visibility = (bool) $a_value;
267 return $this->activation_visibility;
272 return $this->subscription_limitation_type;
276 $this->subscription_limitation_type = $a_type;
284 return $this->subscription_start ? $this->subscription_start : time();
288 $this->subscription_start = $a_value;
292 return $this->subscription_end ? $this->subscription_end : mktime(0,0,0,12,12,date(
"Y",time())+2);
296 $this->subscription_end = $a_value;
301 #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED; 305 $this->subscription_type = $a_value;
309 return $this->subscription_password;
313 $this->subscription_password = $a_value;
322 return (
bool) $this->waiting_list;
327 $this->waiting_list = (bool) $a_status;
350 $this->session_limit = $a_status;
367 $this->subscription_membership_limitation = $a_status;
377 $this->session_prev = $a_num;
396 $this->session_next = $a_num;
416 return (
bool) $this->subscription_membership_limitation;
421 return $this->subscription_max_members;
425 $this->subscription_max_members = $a_value;
440 $query =
"SELECT * FROM crs_settings ".
441 "WHERE obj_id = ".$ilDB->quote($a_course_id ,
'integer').
" ".
442 "AND sub_notify = 1";
444 return $res->numRows() ? true :
false;
453 public function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false)
458 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]))
460 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
464 parent::getSubItems($a_admin_panel_enabled,$a_include_side_block);
467 if(!is_array($this->items[
'sess']) or !$this->items[
'sess'])
469 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
474 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
477 if($a_include_side_block)
479 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
483 if(isset(
$_GET[
'crs_prev_sess']))
485 $ilUser->writePref(
'crs_sess_show_prev_'.$this->
getId(), (
string) (
int)
$_GET[
'crs_prev_sess']);
487 if(isset(
$_GET[
'crs_next_sess']))
489 $ilUser->writePref(
'crs_sess_show_next_'.$this->
getId(), (
string) (
int)
$_GET[
'crs_next_sess']);
494 $previous = $current = $next = array();
495 foreach($sessions as $key => $item)
513 $num_previous_remove = max(
517 while($num_previous_remove--)
519 if(!$ilUser->getPref(
'crs_sess_show_prev_'.$this->getId()))
521 array_shift($previous);
523 $this->items[
'sess_link'][
'prev'][
'value'] = 1;
526 $num_next_remove = max(
530 while($num_next_remove--)
532 if(!$ilUser->getPref(
'crs_sess_show_next_'.$this->getId()))
537 $this->items[
'sess_link'][
'next'][
'value'] = 1;
540 $sessions = array_merge($previous,$current,$next);
541 $this->items[
'sess'] = $sessions;
544 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
546 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block] = $sort->sortItems($this->items);
548 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
554 return $this->subscription_notify ? true :
false;
558 $this->subscription_notify = $a_value ? true :
false;
563 $this->view_mode = $a_mode;
567 return $this->view_mode;
574 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
578 return $row->view_mode;
587 $query =
"SELECT abo FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
598 return $this->archive_start ? $this->archive_start : time();
602 $this->archive_start = $a_value;
606 return $this->archive_end ? $this->archive_end : mktime(0,0,0,12,12,date(
"Y",time())+2);
610 $this->archive_end = $a_value;
618 $this->archive_type = $a_value;
622 $this->abo = $a_status;
630 $this->show_members = $a_status;
634 return $this->show_members;
644 $this->mail_members = $a_type;
658 return $this->message;
662 $this->message = $a_message;
668 $this->message .=
"<br /> ";
670 $this->message .= $a_message;
706 include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
718 include_once(
"./Modules/Course/classes/class.ilObjCourseAccess.php");
737 return $this->ABO == $this->ABO_ENABLED;
740 function read($a_force_db =
false)
742 parent::read($a_force_db);
748 global $ilAppEventHandler;
750 parent::create($a_upload);
758 $ilAppEventHandler->raise(
'Modules/Course',
760 array(
'object' => $this,
761 'obj_id' => $this->
getId(),
773 $this->latitude = $a_latitude;
793 $this->longitude = $a_longitude;
813 $this->locationzoom = $a_locationzoom;
833 $this->enablemap = $a_enablemap;
858 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
864 $new_obj->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
868 if($cwo->isRootNode($this->getRefId()))
877 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
881 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
885 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
887 $obj_settings->cloneSettings($new_obj->getId());
888 unset($obj_settings);
892 $ilLog->write(__METHOD__.
': '.$this->getBigIconPath().
' '.$this->
getSmallIconPath());
898 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
899 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
902 $cert->cloneCertificate($newcert);
917 parent::cloneDependencies($a_target_id,$a_copy_id);
920 include_once(
'Modules/Course/classes/class.ilCourseStart.php');
922 $start->cloneDependencies($a_target_id,$a_copy_id);
925 include_once(
'Services/Object/classes/class.ilObjectActivation.php');
929 include_once(
'Modules/Course/classes/class.ilCourseObjective.php');
931 $crs_objective->ilClone($a_target_id,$a_copy_id);
945 global
$ilLog,$rbacadmin,$rbacreview;
948 $new_admin = $new_obj->getDefaultAdminRole();
949 $source_rolf = $rbacreview->getRoleFolderIdOfObject($this->
getRefId());
950 $target_rolf = $rbacreview->getRoleFolderIdOfObject($new_obj->getRefId());
952 if(!$admin || !$new_admin || !$source_rolf || !$target_rolf)
954 $ilLog->write(__METHOD__.
' : Error cloning auto generated role: il_crs_admin');
956 $rbacadmin->copyRolePermissions($admin,$source_rolf,$target_rolf,$new_admin,
true);
957 $ilLog->write(__METHOD__.
' : Finished copying of role crs_admin.');
960 $new_tutor = $new_obj->getDefaultTutorRole();
961 if(!$tutor || !$new_tutor)
963 $ilLog->write(__METHOD__.
' : Error cloning auto generated role: il_crs_tutor');
965 $rbacadmin->copyRolePermissions($tutor,$source_rolf,$target_rolf,$new_tutor,
true);
966 $ilLog->write(__METHOD__.
' : Finished copying of role crs_tutor.');
969 $new_member = $new_obj->getDefaultMemberRole();
970 if(!$member || !$new_member)
972 $ilLog->write(__METHOD__.
' : Error cloning auto generated role: il_crs_member');
974 $rbacadmin->copyRolePermissions($member,$source_rolf,$target_rolf,$new_member,
true);
975 $ilLog->write(__METHOD__.
' : Finished copying of role crs_member.');
985 #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and 986 # $this->getSubscriptionType() == ) 988 # $this->appendMessage($this->lng->txt('crs_select_registration_type')); 994 $this->
appendMessage($this->lng->txt(
"activation_times_not_valid"));
999 $this->
appendMessage($this->lng->txt(
"subscription_times_not_valid"));
1001 #if((!$this->getActivationUnlimitedStatus() and 1002 # !$this->getSubscriptionUnlimitedStatus()) and 1003 # ($this->getSubscriptionStart() > $this->getActivationEnd() or 1004 # $this->getSubscriptionStart() < $this->getActivationStart() or 1005 # $this->getSubscriptionEnd() > $this->getActivationEnd() or 1006 # $this->getSubscriptionEnd() < $this->getActivationStart())) 1009 # $this->appendMessage($this->lng->txt("subscription_time_not_within_activation")); 1013 $this->
appendMessage($this->lng->txt(
"crs_password_required"));
1017 $this->
appendMessage($this->lng->txt(
"max_members_not_numeric"));
1022 $this->
appendMessage($this->lng->txt(
"archive_times_not_valid"));
1040 foreach ($emails as $email) {
1041 $email = trim($email);
1044 $ilErr->appendMessage($this->lng->txt(
'contact_email_not_valid').
" '".$email.
"'");
1070 global $ilAppEventHandler;
1073 if (!parent::delete())
1085 include_once(
'Modules/Course/classes/class.ilCourseParticipants.php');
1089 $this->archives_obj->deleteAll();
1091 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
1094 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
1097 include_once
'./Modules/Course/classes/class.ilCourseFile.php';
1100 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1103 $ilAppEventHandler->raise(
'Modules/Course',
1105 array(
'object' => $this,
1106 'obj_id' => $this->
getId(),
1120 global $ilAppEventHandler,
$ilLog;
1122 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1131 $ilAppEventHandler->raise(
'Modules/Course',
1133 array(
'object' => $this,
1134 'obj_id' => $this->
getId(),
1145 $query =
"SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ";
1148 if(!
$res->numRows())
1153 $query =
"UPDATE crs_settings SET ".
1154 "syllabus = ".$ilDB->quote($this->
getSyllabus() ,
'text').
", ".
1155 "contact_name = ".$ilDB->quote($this->
getContactName() ,
'text').
", ".
1157 "contact_phone = ".$ilDB->quote($this->
getContactPhone() ,
'text').
", ".
1158 "contact_email = ".$ilDB->quote($this->
getContactEmail() ,
'text').
", ".
1160 "activation_type = ".$ilDB->quote(!$this->
getOfflineStatus() ,
'integer').
", ".
1169 "view_mode = ".$ilDB->quote($this->
getViewMode() ,
'integer').
", ".
1170 "archive_start = ".$ilDB->quote($this->
getArchiveStart() ,
'integer').
", ".
1171 "archive_end = ".$ilDB->quote($this->
getArchiveEnd() ,
'integer').
", ".
1172 "archive_type = ".$ilDB->quote($this->
getArchiveType() ,
'integer').
", ".
1173 "abo = ".$ilDB->quote($this->
getAboStatus() ,
'integer').
", ".
1176 "show_members = ".$ilDB->quote($this->
getShowMembers() ,
'integer').
", ".
1177 "latitude = ".$ilDB->quote($this->
getLatitude() ,
'text').
", ".
1178 "longitude = ".$ilDB->quote($this->
getLongitude() ,
'text').
", ".
1179 "location_zoom = ".$ilDB->quote($this->
getLocationZoom() ,
'integer').
", ".
1180 "enable_course_map = ".$ilDB->quote((
int) $this->
getEnableCourseMap() ,
'integer').
", ".
1189 "WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
"";
1197 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
1213 $item->update($this->ref_id);
1259 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1271 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1274 $query =
"INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility,".
1275 "contact_phone,contact_email,contact_consultation,activation_type,activation_start,".
1276 "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit,".
1277 "sub_max_members,sub_notify,view_mode,archive_start,archive_end,archive_type,abo," .
1278 "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, ".
1279 "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) ".
1281 $ilDB->quote($this->
getId() ,
'integer').
", ".
1288 $ilDB->quote(0 ,
'integer').
", ".
1303 $ilDB->quote($this->ABO_ENABLED ,
'integer').
", ".
1308 #"objective_view = '0', ". 1324 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
1335 $query =
"SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
"";
1380 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
1382 switch($activation[
"timing_type"])
1407 include_once
"./Modules/Course/classes/class.ilCourseWaitingList.php";
1409 if(!is_object($this->waiting_list_obj))
1426 include_once
"./Modules/Course/classes/class.ilCourseParticipant.php";
1440 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
1473 include_once
"./Modules/Course/classes/class.ilCourseArchives.php";
1475 if(!is_object($this->archives_obj))
1487 global $rbacadmin,$rbacreview,$ilDB;
1492 $role_obj = $rolf_obj->createRole(
"il_crs_admin_".$this->
getRefId(),
"Admin of course obj_no.".$this->
getId());
1493 $admin_id = $role_obj->getId();
1496 $query =
"SELECT obj_id FROM object_data ".
1497 " WHERE type='rolt' AND title='il_crs_admin'";
1500 $rbacadmin->copyRoleTemplatePermissions(
$res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
1503 $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),
"crs",$rolf_obj->getRefId());
1504 $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->
getRefId());
1512 $role_obj = $rolf_obj->createRole(
"il_crs_tutor_".$this->
getRefId(),
"Tutors of course obj_no.".$this->
getId());
1513 $member_id = $role_obj->getId();
1516 $query =
"SELECT obj_id FROM object_data ".
1517 " WHERE type='rolt' AND title='il_crs_tutor'";
1519 $rbacadmin->copyRoleTemplatePermissions(
$res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
1522 $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),
"crs",$rolf_obj->getRefId());
1523 $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->
getRefId());
1531 $role_obj = $rolf_obj->createRole(
"il_crs_member_".$this->
getRefId(),
"Member of course obj_no.".$this->
getId());
1532 $member_id = $role_obj->getId();
1535 $query =
"SELECT obj_id FROM object_data ".
1536 " WHERE type='rolt' AND title='il_crs_member'";
1538 $rbacadmin->copyRoleTemplatePermissions(
$res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
1541 $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),
"crs",$rolf_obj->getRefId());
1542 $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->
getRefId());
1576 global $rbacadmin, $rbacreview, $rbacsystem;
1579 $rolf_data = $rbacreview->getRoleFolderOfObject($this->
getRefId());
1582 $arr_parentRoles = $rbacreview->getParentRoleIds($this->
getRefId());
1583 $arr_relevantParentRoleIds = array_diff(array_keys($arr_parentRoles),$this->
getDefaultCourseRoles());
1588 if (is_null($template_id))
1590 $template_ops = array();
1592 $template_ops = $rbacreview->getOperationsOfRole($template_id,
'crs', ROLE_FOLDER_ID);
1595 foreach ($arr_relevantParentRoleIds as $parentRole)
1597 if ($rbacreview->isProtected($arr_parentRoles[$parentRole][
'parent'],$parentRole))
1602 $granted_permissions = array();
1606 $rbacadmin->deleteLocalRole($parentRole,$rolf_data[
"child"]);
1613 $current_ops = $rbacreview->getRoleOperationsOnObject($parentRole, $this->
getRefId());
1614 $rbacadmin->revokePermission($this->
getRefId(), $parentRole);
1615 foreach ($template_ops as $template_op)
1617 if (in_array($template_op,$current_ops))
1619 array_push($granted_permissions,$template_op);
1622 if (!empty($granted_permissions))
1624 $rbacadmin->grantPermission($parentRole, $granted_permissions, $this->
getRefId());
1631 if (! is_null($template_id))
1633 $rbacadmin->copyRolePermissionIntersection(
1634 $template_id, ROLE_FOLDER_ID,
1635 $parentRole, $arr_parentRoles[$parentRole][
'parent'],
1636 $rolf_data[
"child"], $parentRole
1639 $rbacadmin->assignRoleToFolder($parentRole,$rolf_data[
"child"],
"false");
1653 $q =
"SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1657 return $row[
"obj_id"];
1668 global $rbacadmin,$rbacreview;
1670 if (empty($this->local_roles))
1672 $this->local_roles = array();
1673 $rolf = $rbacreview->getRoleFolderOfObject($this->
getRefId());
1674 $role_arr = $rbacreview->getRolesOfRoleFolder($rolf[
"ref_id"]);
1676 foreach ($role_arr as $role_id)
1678 if ($rbacreview->isAssignable($role_id,$rolf[
"ref_id"]) ==
true)
1680 $role_Obj = $this->
ilias->obj_factory->getInstanceByObjId($role_id);
1688 $role_name = $role_Obj->getTitle();
1690 $this->local_roles[$role_name] = $role_Obj->getId();
1695 return $this->local_roles;
1711 global $rbacadmin, $rbacreview;
1713 if (strlen($a_crs_id) > 0)
1715 $crs_id = $a_crs_id;
1722 $rolf = $rbacreview->getRoleFolderOfObject($crs_id);
1723 $role_arr = $rbacreview->getRolesOfRoleFolder($rolf[
"ref_id"]);
1725 foreach ($role_arr as $role_id)
1727 $role_Obj =& $this->
ilias->obj_factory->getInstanceByObjId($role_id);
1729 $crs_Member =
"il_crs_member_".$crs_id;
1730 $crs_Admin =
"il_crs_admin_".$crs_id;
1731 $crs_Tutor =
"il_crs_tutor_".$crs_id;
1733 if (strcmp($role_Obj->getTitle(), $crs_Member) == 0 )
1735 $arr_crsDefaultRoles[
"crs_member_role"] = $role_Obj->getId();
1738 if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0)
1740 $arr_crsDefaultRoles[
"crs_admin_role"] = $role_Obj->getId();
1743 if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0)
1745 $arr_crsDefaultRoles[
"crs_tutor_role"] = $role_Obj->getId();
1749 return $arr_crsDefaultRoles;
1758 $rolf = $rbacreview->getRoleFolderOfObject($this->
getRefId());
1760 return $rbacreview->getRolesOfRoleFolder($rolf[
"ref_id"],
false);
1767 $query =
"DELETE FROM crs_settings ".
1768 "WHERE obj_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ";
1779 foreach($local_roles as $role_id)
1782 if(substr(
$title,0,8) ==
'il_crs_m')
1793 foreach($local_roles as $role_id)
1797 if(!strcmp($tmp_role->getTitle(),
"il_crs_tutor_".$this->getRefId()))
1809 foreach($local_roles as $role_id)
1813 if(!strcmp($tmp_role->getTitle(),
"il_crs_admin_".$this->getRefId()))
1827 $a_usr_id = $a_usr_id ? $a_usr_id : $ilUser->getId();
1829 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
1845 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1848 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
1852 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
1866 parent::MDUpdateListener($a_element);
1872 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
1874 $ecs->handleContentUpdate();
1888 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
1901 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1902 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
1912 $app->setSubtitle(
'crs_cal_activation_start');
1920 $app->setSubtitle(
'crs_cal_activation_end');
1930 $app->setSubtitle(
'crs_cal_reg_start');
1938 $app->setSubtitle(
'crs_cal_reg_end');
1945 return $apps ? $apps : array();
1953 ###### Interface ilMembershipRegistrationCodes 1962 $query =
"SELECT obj_id FROM crs_settings ".
1963 "WHERE reg_ac_enabled = ".$ilDB->quote(1,
'integer').
" ".
1964 "AND reg_ac = ".$ilDB->quote($a_code,
'text');
1970 $obj_ids[] =
$row->obj_id;
1984 include_once
'./Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1985 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
1988 if($part->isAssigned($a_user_id))
1993 if(!$a_force_registration)
1998 include_once
'./Modules/Group/classes/class.ilObjGroupAccess.php';
2003 ', course subscription is deactivated.',
'456');
2013 ', course is out of registration time.',
'789');
2021 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2025 $waiting_list->addToList($a_user_id);
2026 $this->lng->loadLanguageModule(
"crs");
2027 $info = sprintf($this->lng->txt(
'crs_added_to_list'),
2028 $waiting_list->getPosition($a_user_id));
2029 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
2031 $participants->sendNotification($participants->NOTIFY_WAITING_LIST,$a_user_id);
2039 ', membership is limited.',
'123');
2044 $part->add($a_user_id,$a_role);
2045 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2046 $part->sendNotification($part->NOTIFY_ADMINS,$a_user_id);
2049 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
2075 $this->auto_notification = $value;
2085 $a_value = (int)$a_value;
2088 if($a_value == self::STATUS_DETERMINATION_LP)
2090 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2093 $a_value = self::STATUS_DETERMINATION_MANUAL;
2097 $this->status_dt = $a_value;
2115 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
2133 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2137 include_once(
"Services/Tracking/classes/class.ilLPStatus.php");
2139 $this->
getMembersObject()->updatePassed($a_member_id, $has_completed,
false,
true);
getSubscriptionPassword()
setActivationEnd($a_value)
setSubscriptionNotify($a_value)
const IL_CRS_ACTIVATION_LIMITED
setContactResponsibility($a_value)
getMailToMembersType()
Get mail to members type.
setSubscriptionStart($a_value)
setSubscriptionEnd($a_value)
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
const IL_CRS_SUBSCRIPTION_LIMITED
getSubscriptionMaxMembers()
const IL_CRS_VIEW_OBJECTIVE
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 lookupObjectsByCode($a_code)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
isActivated($a_check_archive=false)
getActivationVisibility()
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
setImportantInformation($a_info)
_registrationEnabled($a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
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 _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.
_getTranslation($a_role_title)
static getItem($a_ref_id)
Get item data.
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.
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
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.
_checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id=0)
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.
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.
__createDefaultSettings()
static _usingRegistrationCode()
Using Registration code.
const IL_CRS_ARCHIVE_NONE
update()
update complete object
const DB_FETCHMODE_OBJECT
setLatitude($a_latitude)
Set Latitude.
getOrderType()
Get order type default implementation.
getUserIdByLogin($a_login)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
Test certificate adapter.
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
_isActivated($a_obj_id)
Is activated.
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
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
prepareAppointments($a_mode='create')
Prepare calendar appointments.
ilObjCourse($a_id=0, $a_call_by_reference=true)
Constructor public.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (start objects, preconditions)
__setCourseStatus()
set course status
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.
const IL_CRS_VIEW_ARCHIVE
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
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.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
cloneSettings($new_obj)
Clone entries in settings table.
const STATUS_DETERMINATION_MANUAL
getSubItems($a_admin_panel_enabled=false, $a_include_side_block=false)
Get subitems of container.
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
getRegistrationAccessCode()
get access code
enableRegistrationAccessCode($a_status)
En/disable registration access code.
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...
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 _deleteUser($user_id)
static generateCode()
Generate new registration key.
setContactPhone($a_value)
getActivationUnlimitedStatus()
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)
getRefId()
get reference id public
enableWaitingList($a_status)
getSubscriptionUnlimitedStatus()
deleteMetaData()
delete meta data entry
initCourseMemberObject()
Init course member object ilObjUser $ilUser.
const IL_CRS_SUBSCRIPTION_DIRECT
cloneObject($a_target_id, $a_copy_id=0)
Clone course (no member data)
static _getInstance($a_obj_id)
get instance by obj_id
_deleteByCourse($a_course_id)
initCourseArchiveObject()
getEnableCourseMap()
Get Enable Course Map.
createRoleFolder()
creates a local role folder
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()
setShowMembers($a_status)
Class ilECSCourseSettings.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
const IL_CRS_ACTIVATION_UNLIMITED
setStatusDetermination($a_value)
Set status determination mode.
setArchiveStart($a_value)
setSubscriptionLimitationType($a_type)