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';
9 include_once
'./Services/AccessControl/interfaces/interface.ilConditionHandling.php';
29 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
44 public static function checkCondition($a_obj_id,$a_operator,$a_value,$a_usr_id)
46 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
47 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
69 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
71 global
$ilUser,
$lng, $rbacsystem, $ilAccess, $ilias;
76 $a_user_id = $ilUser->getId();
79 if($ilUser->getId() == $a_user_id)
92 if($participants->isBlocked($a_user_id)
and $participants->isAssigned($a_user_id))
102 if($a_permission ==
'leave')
104 include_once
'./Modules/Course/classes/class.ilObjCourse.php';
108 $ilAccess->addInfoItem(IL_STATUS_MESSAGE,
113 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
114 if(!$participants->isAssigned($a_user_id))
120 if($a_permission ==
'join')
122 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
133 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
141 switch ($a_permission)
145 $active = self::_isActivated($a_obj_id, $visible);
146 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
151 if(!$tutor
and !$active && !$visible)
158 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
163 $active = self::_isActivated($a_obj_id);
169 if($participants->isBlocked($a_user_id)
and $participants->isAssigned($a_user_id))
177 if(!self::_registrationEnabled($a_obj_id))
182 if($participants->isAssigned($a_user_id))
189 include_once
'./Modules/Course/classes/class.ilObjCourse.php';
210 $commands[] =
array(
"permission" =>
"crs_linked",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
212 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
216 'permission' =>
'read',
217 'cmd' =>
'fileManagerLaunch',
218 'lang_var' =>
'fm_start',
219 'enable_anonymous' =>
false 223 $commands[] =
array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
226 $commands[] =
array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
229 $commands[] =
array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
231 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
234 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
237 $commands[] =
array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
241 $commands[] =
array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
245 $commands[] =
array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
246 $commands[] =
array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
257 $t_arr = explode(
"_", $a_target);
260 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
262 self::$using_code =
true;
267 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
274 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
275 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
293 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
297 return $row->view_mode;
312 $query =
"SELECT * FROM crs_settings ".
313 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
316 return (
bool)
$row->activation_type;
328 public static function _isActivated($a_obj_id, &$a_visible_flag = null, $a_mind_member_view =
true)
331 if($a_mind_member_view)
333 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
336 $a_visible_flag =
true;
342 if(!self::_isOnline($a_obj_id))
344 $a_visible_flag =
false;
351 $a_visible_flag =
true;
353 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
355 switch($item[
'timing_type'])
358 if(
time() < $item[
'timing_start']
or 359 time() > $item[
'timing_end'])
361 $a_visible_flag = $item[
'visible'];
380 $query =
"SELECT * FROM crs_settings ".
381 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
386 $type =
$row->sub_limitation_type;
387 $reg_start =
$row->sub_start;
388 $reg_end =
$row->sub_end;
423 $query =
'SELECT sub_limitation_type, sub_start, sub_end, sub_mem_limit, sub_max_members FROM crs_settings '.
424 'WHERE obj_id = '.$ilDB->quote($a_obj_id);
432 $info[
'reg_info_type'] =
$row->sub_limitation_type;
433 $info[
'reg_info_max_members'] =
$row->sub_max_members;
434 $info[
'reg_info_mem_limit'] =
$row->sub_mem_limit;
437 $registration_possible =
true;
445 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_start');
450 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_end');
455 $registration_possible =
false;
456 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
457 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
462 $registration_possible =
true;
466 $registration_possible =
false;
467 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
468 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
471 if(
$info[
'reg_info_mem_limit'] &&
$info[
'reg_info_max_members'] && $registration_possible)
474 include_once
'./Modules/Course/classes/class.ilCourseParticipant.php';
477 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
479 if(
$info[
'reg_info_list_size'])
481 $info[
'reg_info_free_places'] = 0;
485 $info[
'reg_info_free_places'] = max(0,
$info[
'reg_info_max_members'] - $part->getNumberOfMembers());
488 if(
$info[
'reg_info_free_places'])
490 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'crs_list_reg_limit_places');
491 $info[
'reg_info_list_prop_limit'][
'value'] =
$info[
'reg_info_free_places'];
495 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
496 $info[
'reg_info_list_prop_limit'][
'value'] = $lng->txt(
'crs_list_reg_limit_full');
514 return !self::_isActivated($a_obj_id, $dummy,
false);
526 $lng->loadLanguageModule(
"crs");
528 include_once(
"./Modules/Course/classes/class.ilCourseWaitingList.php");
531 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
542 return self::$using_code;
557 $query =
'SELECT crs_start, crs_end FROM crs_settings'.
558 ' WHERE obj_id = '.$ilDB->quote($a_obj_id);
559 $set = $ilDB->query(
$query);
560 while(
$row = $ilDB->fetchAssoc($set))
565 $end =
$row[
'crs_end']
572 $lng->loadLanguageModule(
'crs');
575 'property' => $lng->txt(
'crs_period'),
static lookupPeriodInfo($a_obj_id)
Lookup course period info.
static getConditionOperators()
Get operators.
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
ilObjUser $ilUser
static _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
const IL_CRS_SUBSCRIPTION_LIMITED
const SUBSCRIPTION_LIMITED
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcce...
const IL_NO_OBJECT_ACCESS
static _registrationEnabled($a_obj_id)
static _preloadOnListInfo($a_usr_ids, $a_obj_ids)
Preload on list info.
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 formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
static getItem($a_ref_id)
Get item data.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Interface for condition handling.
static _checkGoto($a_target)
check whether goto script will succeed
static _isActive()
Static getter.
static _usingRegistrationCode()
Using Registration code.
static _getAllReferences($a_id)
get all reference ids of object
static _preloadListData($a_usr_ids, $a_obj_ids)
Get certificate/passed status for all given objects and users.
static _isOffline($a_obj_id)
Type-specific implementation of general status.
const IL_CRS_SUBSCRIPTION_UNLIMITED
static formatDate(ilDateTime $date)
Format a date public.
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
const SUBSCRIPTION_UNLIMITED
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
Create styles array
The data for the language used.
static mayLeave($a_course_id, $a_user_id=null, &$a_date=null)
static getInstance()
Get singleton instance.
static lookupListSize($a_obj_id)
Lookup waiting lit size.
static getInstance()
Get instance.
static _isOnline($a_obj_id)
Check if online setting is active.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
static getInstance()
Get singleton instance.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
static _lookupViewMode($a_id)
Lookup view mode.
static _getCommands()
get commands