5 include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
30 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
34 if ($a_user_id ==
"") {
35 $a_user_id = $ilUser->getId();
41 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
51 if (!self::_registrationEnabled($a_obj_id)) {
55 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
60 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
69 if ($a_permission ==
'leave') {
70 include_once
'./Modules/Group/classes/class.ilObjGroup.php';
73 $ilAccess->addInfoItem(
80 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
86 if ($a_permission ==
'join') {
87 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
96 switch ($a_permission) {
98 include_once
'./Modules/Group/classes/class.ilObjGroup.php';
119 $commands[] =
array(
"permission" =>
"grp_linked",
"cmd" =>
"",
"lang_var" =>
"show",
"default" =>
true);
121 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
124 'permission' =>
'read',
125 'cmd' =>
'fileManagerLaunch',
126 'lang_var' =>
'fm_start',
127 'enable_anonymous' =>
false 131 $commands[] =
array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
134 $commands[] =
array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
137 $commands[] =
array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"grp_btn_unsubscribe");
139 include_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
141 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
143 $commands[] =
array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
145 $commands[] =
array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
149 $commands[] =
array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
150 $commands[] =
array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
162 $t_arr = explode(
"_", $a_target);
164 if (substr($t_arr[2], 0, 5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID) {
165 self::$using_code =
true;
169 if ($t_arr[0] !=
"grp" || ((
int) $t_arr[1]) <= 0) {
173 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
174 $ilAccess->checkAccess(
"visible",
"", $t_arr[1])) {
189 $query =
"SELECT * FROM grp_settings " .
190 "WHERE obj_id = " . $ilDB->quote($a_obj_id,
'integer') .
" ";
194 $enabled = $unlimited =
false;
196 $enabled =
$row->registration_enabled;
197 $unlimited =
$row->registration_unlimited;
198 $start =
$row->registration_start;
229 include_once(
"./Modules/Group/classes/class.ilGroupWaitingList.php");
245 $query =
'SELECT registration_type, registration_enabled, registration_unlimited, registration_start, ' .
246 'registration_end, registration_mem_limit, registration_max_members FROM grp_settings ' .
247 'WHERE obj_id = ' . $ilDB->quote($a_obj_id);
254 $info[
'reg_info_type'] =
$row->registration_type;
255 $info[
'reg_info_max_members'] =
$row->registration_max_members;
256 $info[
'reg_info_mem_limit'] =
$row->registration_mem_limit;
257 $info[
'reg_info_unlimited'] =
$row->registration_unlimited;
259 $info[
'reg_info_max_members'] = 0;
260 if (
$info[
'reg_info_mem_limit']) {
261 $info[
'reg_info_max_members'] =
$row->registration_max_members;
264 $info[
'reg_info_enabled'] =
$row->registration_enabled;
267 $registration_possible =
$info[
'reg_info_enabled'];
270 if (!
$info[
'reg_info_unlimited'] && $registration_possible) {
273 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_start');
276 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_end');
279 $registration_possible =
false;
280 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_period');
281 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'grp_list_reg_noreg');
285 if (!$registration_possible) {
286 $registration_possible =
false;
287 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg');
288 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'grp_list_reg_noreg');
292 if (
$info[
'reg_info_mem_limit'] &&
$info[
'reg_info_max_members'] && $registration_possible) {
294 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
297 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
299 if (
$info[
'reg_info_list_size']) {
300 $info[
'reg_info_free_places'] = 0;
302 $info[
'reg_info_free_places'] = max(0,
$info[
'reg_info_max_members'] - $part->getCountMembers());
305 if (
$info[
'reg_info_free_places']) {
306 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'grp_list_reg_limit_places');
307 $info[
'reg_info_list_prop_limit'][
'value'] =
$info[
'reg_info_free_places'];
309 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
310 $info[
'reg_info_list_prop_limit'][
'value'] = $lng->txt(
'grp_list_reg_limit_full');
327 $start =
$end = null;
329 $query =
'SELECT grp_start, grp_end FROM grp_settings' .
330 ' WHERE obj_id = ' . $ilDB->quote($a_obj_id);
331 $set = $ilDB->query(
$query);
332 while (
$row = $ilDB->fetchAssoc($set)) {
333 $start =
$row[
'grp_start']
341 if ($start &&
$end) {
342 $lng->loadLanguageModule(
'grp');
345 'property' => $lng->txt(
'grp_period'),
359 return self::$using_code;
static mayLeave($a_group_id, $a_user_id=null, &$a_date=null)
static _registrationEnabled($a_obj_id)
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
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.
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 formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static _isActive()
Static getter.
static _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
_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...
static _getCommands()
get commands
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
static lookupPeriodInfo($a_obj_id)
Lookup course period info.
foreach($_POST as $key=> $value) $res
static _usingRegistrationCode()
Using Registration code.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static getInstance()
Get singleton instance.
static lookupListSize($a_obj_id)
Lookup waiting lit size.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static _checkGoto($a_target)
check whether goto script will succeed
static getInstance()
Get singleton instance.