Class ilObjGroupAccess.
More...
◆ _checkAccess()
ilObjGroupAccess::_checkAccess |
( |
string |
$cmd, |
|
|
string |
$permission, |
|
|
int |
$ref_id, |
|
|
int |
$obj_id, |
|
|
?int |
$user_id = null |
|
) |
| |
Definition at line 36 of file class.ilObjGroupAccess.php.
References $DIC, $lng, $user_id, ilWaitingList\_isOnList(), ilGroupParticipants\_isParticipant(), ilDatePresentation\formatDate(), ilAccessInfo\IL_STATUS_INFO, ilObjGroup\mayLeave(), and null.
40 $ilUser = $DIC[
'ilUser'];
42 $ilAccess = $DIC[
'ilAccess'];
60 if (!self::_registrationEnabled($obj_id)) {
75 if ($permission ==
'leave') {
78 $ilAccess->addInfoItem(
93 if ($permission ==
'join') {
101 switch ($permission) {
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static _isOnList(int $a_usr_id, int $a_obj_id)
static mayLeave(int $a_group_id, ?int $a_user_id=null, ?ilDate &$a_date=null)
◆ _checkGoto()
static ilObjGroupAccess::_checkGoto |
( |
string |
$target | ) |
|
|
static |
Definition at line 138 of file class.ilObjGroupAccess.php.
References $DIC, and ANONYMOUS_USER_ID.
142 $ilAccess = $DIC->access();
143 $ilUser = $DIC->user();
145 $t_arr = explode(
"_", $target);
147 if (substr((
string) ($t_arr[2] ??
""), 0, 5) ===
'rcode' and $ilUser->getId() !=
ANONYMOUS_USER_ID) {
148 self::$using_code =
true;
152 if ($t_arr[0] !=
"grp" || ((
int) $t_arr[1]) <= 0) {
156 if ($ilAccess->checkAccess(
"read",
"", (
int) $t_arr[1]) ||
157 $ilAccess->checkAccess(
"visible",
"", (
int) $t_arr[1])) {
◆ _getCommands()
static ilObjGroupAccess::_getCommands |
( |
| ) |
|
|
static |
Definition at line 111 of file class.ilObjGroupAccess.php.
References ilDAVActivationChecker\_isActive().
Referenced by ilObjGroupReferenceAccess\_getCommands(), and ilObjGroupListGUI\init().
114 $commands[] = array(
"permission" =>
"grp_linked",
"cmd" =>
"",
"lang_var" =>
"show",
"default" =>
true);
116 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
119 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leaveWaitList",
"lang_var" =>
"leave_waiting_list");
122 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"grp_btn_unsubscribe");
126 $commands[] = $webdav_obj->retrieveWebDAVCommandArrayForActionMenu();
129 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
130 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
◆ _preloadData()
static ilObjGroupAccess::_preloadData |
( |
array |
$obj_ids, |
|
|
array |
$ref_ids |
|
) |
| |
|
static |
◆ _registrationEnabled()
static ilObjGroupAccess::_registrationEnabled |
( |
int |
$a_obj_id | ) |
|
|
static |
Definition at line 163 of file class.ilObjGroupAccess.php.
References $DIC, $ilDB, $res, ilDateTime\_after(), ilDateTime\_before(), ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, and IL_CAL_UNIX.
167 $ilDB = $DIC->database();
168 $query =
"SELECT * FROM grp_settings " .
169 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
173 $enabled = $unlimited =
false;
176 $enabled = $row->registration_enabled;
177 $unlimited = $row->registration_unlimited;
178 $start = $row->registration_start;
179 $end = $row->registration_end;
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
◆ _usingRegistrationCode()
static ilObjGroupAccess::_usingRegistrationCode |
( |
| ) |
|
|
static |
◆ lookupPeriodInfo()
static ilObjGroupAccess::lookupPeriodInfo |
( |
int |
$a_obj_id | ) |
|
|
static |
- Parameters
-
- Returns
- array<{property: string, value: string}> | null
- Exceptions
-
Definition at line 289 of file class.ilObjGroupAccess.php.
References $DIC, $ilDB, $lng, $res, ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatPeriod(), IL_CAL_DATETIME, null, ilDBConstants\T_INTEGER, and ilTimeZone\UTC.
Referenced by ilObjGroupListGUI\getProperties().
293 $ilDB = $DIC->database();
294 $lng = $DIC->language();
296 $start = $end =
null;
297 $query =
'SELECT period_start, period_end, period_time_indication FROM grp_settings ' .
302 if (!$row->period_time_indication) {
303 $start = ($row->period_start
306 $end = ($row->period_end
310 $start = ($row->period_start
313 $end = ($row->period_end
318 if ($start && $end) {
319 $lng->loadLanguageModule(
'grp');
323 'property' =>
$lng->txt(
'grp_period'),
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
◆ lookupRegistrationInfo()
static ilObjGroupAccess::lookupRegistrationInfo |
( |
int |
$a_obj_id | ) |
|
|
static |
Definition at line 208 of file class.ilObjGroupAccess.php.
References $DIC, $ilDB, $info, $lng, $res, ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, ilWaitingList\lookupListSize(), and ilDBConstants\T_INTEGER.
Referenced by ilGroupRegistrationGUI\fillMaxMembers(), ilObjGroupListGUI\getProperties(), and ilObjGroupGUI\infoScreen().
212 $ilDB = $DIC->database();
213 $lng = $DIC->language();
215 $query =
'SELECT registration_type, registration_enabled, registration_unlimited, registration_start, ' .
216 'registration_end, registration_mem_limit, registration_max_members FROM grp_settings ' .
224 $info[
'reg_info_type'] = $row->registration_type;
225 $info[
'reg_info_mem_limit'] = $row->registration_mem_limit;
226 $info[
'reg_info_unlimited'] = $row->registration_unlimited;
228 $info[
'reg_info_max_members'] = 0;
229 if (
$info[
'reg_info_mem_limit']) {
230 $info[
'reg_info_max_members'] = $row->registration_max_members;
233 $info[
'reg_info_enabled'] = $row->registration_enabled;
236 $registration_possible =
$info[
'reg_info_enabled'];
239 if (!
$info[
'reg_info_unlimited'] && $registration_possible) {
242 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_start');
245 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_end');
248 $registration_possible =
false;
249 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_period');
250 $info[
'reg_info_list_prop'][
'value'] =
$lng->txt(
'grp_list_reg_noreg');
254 if (!$registration_possible) {
255 $registration_possible =
false;
256 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg');
257 $info[
'reg_info_list_prop'][
'value'] =
$lng->txt(
'grp_list_reg_noreg');
261 if (
$info[
'reg_info_mem_limit'] &&
$info[
'reg_info_max_members'] && $registration_possible) {
266 if (
$info[
'reg_info_list_size']) {
267 $info[
'reg_info_free_places'] = 0;
269 $info[
'reg_info_free_places'] = max(0,
$info[
'reg_info_max_members'] - $part->getCountMembers());
272 if (
$info[
'reg_info_free_places']) {
273 $info[
'reg_info_list_prop_limit'][
'property'] =
$lng->txt(
'grp_list_reg_limit_places');
274 $info[
'reg_info_list_prop_limit'][
'value'] =
$info[
'reg_info_free_places'];
276 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
277 $info[
'reg_info_list_prop_limit'][
'value'] =
$lng->txt(
'grp_list_reg_limit_full');
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static lookupListSize(int $a_obj_id)
◆ $using_code
bool ilObjGroupAccess::$using_code = false |
|
staticprotected |
The documentation for this class was generated from the following file: