5 include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
6 include_once
'./Modules/Course/classes/class.ilCourseConstants.php';
7 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
8 include_once
'Modules/Course/classes/class.ilCourseParticipant.php';
35 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
37 global
$ilUser,
$lng, $rbacsystem, $ilAccess, $ilias;
42 $a_user_id = $ilUser->getId();
45 if($ilUser->getId() == $a_user_id)
58 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
68 if($a_permission ==
'leave')
70 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
71 if(!$participants->isAssigned($a_user_id))
77 if($a_permission ==
'join')
79 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
90 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
98 switch ($a_permission)
103 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
108 if(!$tutor and !$active && !$visible)
115 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
126 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
134 if(!self::_registrationEnabled($a_obj_id))
139 if($participants->isAssigned($a_user_id))
163 $commands[] = array(
"permission" =>
"crs_linked",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
165 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
169 'permission' =>
'read',
170 'cmd' =>
'fileManagerLaunch',
171 'lang_var' =>
'fm_start',
172 'enable_anonymous' =>
false
176 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
179 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
182 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
184 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
187 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
190 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
194 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
198 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
199 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
210 $t_arr = explode(
"_", $a_target);
213 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
215 self::$using_code =
true;
220 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
227 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
228 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
246 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
250 return $row->view_mode;
265 $query =
"SELECT * FROM crs_settings ".
266 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
269 return (
bool)
$row->activation_type;
281 public static function _isActivated($a_obj_id, &$a_visible_flag = null, $a_mind_member_view =
true)
284 if($a_mind_member_view)
286 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
289 $a_visible_flag =
true;
295 if(!self::_isOnline($a_obj_id))
297 $a_visible_flag =
false;
304 $a_visible_flag =
true;
306 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
308 switch($item[
'timing_type'])
311 if(time() < $item[
'timing_start'] or
312 time() > $item[
'timing_end'])
314 $a_visible_flag = $item[
'visible'];
333 $query =
"SELECT * FROM crs_settings ".
334 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
339 $type =
$row->sub_limitation_type;
340 $reg_start =
$row->sub_start;
341 $reg_end =
$row->sub_end;
353 if(time() > $reg_start and
376 $query =
'SELECT sub_limitation_type, sub_start, sub_end, sub_mem_limit, sub_max_members FROM crs_settings '.
377 'WHERE obj_id = '.$ilDB->quote($a_obj_id);
385 $info[
'reg_info_type'] =
$row->sub_limitation_type;
386 $info[
'reg_info_max_members'] =
$row->sub_max_members;
387 $info[
'reg_info_mem_limit'] =
$row->sub_mem_limit;
390 $registration_possible =
true;
398 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_start');
403 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_end');
408 $registration_possible =
false;
409 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
410 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
415 $registration_possible =
true;
419 $registration_possible =
false;
420 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
421 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
424 if($info[
'reg_info_mem_limit'] && $registration_possible)
432 if($part->getNumberOfMembers() <= $info[
'reg_info_max_members'])
434 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'crs_list_reg_limit_places');
435 $info[
'reg_info_list_prop_limit'][
'value'] = max(
437 $info[
'reg_info_max_members'] - $part->getNumberOfMembers()
442 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
443 $info[
'reg_info_list_prop_limit'][
'value'] = $lng->txt(
'crs_list_reg_limit_full');
473 include_once(
"./Modules/Course/classes/class.ilCourseWaitingList.php");
476 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";