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';
32 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
34 global
$ilUser,
$lng, $rbacsystem, $ilAccess, $ilias;
39 $a_user_id = $ilUser->getId();
42 if($ilUser->getId() == $a_user_id)
55 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
65 if($a_permission ==
'leave')
67 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
68 if(!$participants->isAssigned($a_user_id))
74 if($a_permission ==
'join')
76 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
87 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
95 switch ($a_permission)
100 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
105 if(!$tutor and !$active && !$visible)
112 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
123 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
131 if(!self::_registrationEnabled($a_obj_id))
136 if($participants->isAssigned($a_user_id))
160 $commands[] = array(
"permission" =>
"crs_linked",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
162 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
166 'permission' =>
'read',
167 'cmd' =>
'fileManagerLaunch',
168 'lang_var' =>
'fm_start',
169 'enable_anonymous' =>
false
173 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
176 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
179 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
181 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
184 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
187 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
191 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
195 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
196 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
207 $t_arr = explode(
"_", $a_target);
210 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
216 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
223 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
224 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
242 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
246 return $row->view_mode;
261 $query =
"SELECT * FROM crs_settings ".
262 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
265 return (
bool)
$row->activation_type;
277 public static function _isActivated($a_obj_id, &$a_visible_flag = null, $a_mind_member_view =
true)
280 if($a_mind_member_view)
282 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
285 $a_visible_flag =
true;
291 if(!self::_isOnline($a_obj_id))
293 $a_visible_flag =
false;
300 $a_visible_flag =
true;
302 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
304 switch($item[
'timing_type'])
307 if(time() < $item[
'timing_start'] or
308 time() > $item[
'timing_end'])
310 $a_visible_flag = $item[
'visible'];
329 $query =
"SELECT * FROM crs_settings ".
330 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
335 $type =
$row->sub_limitation_type;
336 $reg_start =
$row->sub_start;
337 $reg_end =
$row->sub_end;
349 if(time() > $reg_start and
372 $query =
'SELECT sub_limitation_type, sub_start, sub_end, sub_mem_limit, sub_max_members FROM crs_settings '.
373 'WHERE obj_id = '.$ilDB->quote($a_obj_id);
381 $info[
'reg_info_type'] =
$row->sub_limitation_type;
382 $info[
'reg_info_max_members'] =
$row->sub_max_members;
383 $info[
'reg_info_mem_limit'] =
$row->sub_mem_limit;
386 $registration_possible =
true;
394 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_start');
399 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_end');
404 $registration_possible =
false;
405 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
406 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
411 $registration_possible =
true;
415 $registration_possible =
false;
416 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
417 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
420 if($info[
'reg_info_mem_limit'] && $registration_possible)
428 if($part->getNumberOfMembers() <= $info[
'reg_info_max_members'])
430 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'crs_list_reg_limit_places');
431 $info[
'reg_info_list_prop_limit'][
'value'] = max(
433 $info[
'reg_info_max_members'] - $part->getNumberOfMembers()
438 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
439 $info[
'reg_info_list_prop_limit'][
'value'] = $lng->txt(
'crs_list_reg_limit_full');
469 include_once(
"./Modules/Course/classes/class.ilCourseWaitingList.php");
472 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";