ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjCourseAccess Class Reference

Class ilObjCourseAccess. More...

+ Inheritance diagram for ilObjCourseAccess:
+ Collaboration diagram for ilObjCourseAccess:

Public Member Functions

 _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::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _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::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 

Static Public Member Functions

static getConditionOperators ()
 Get operators. More...
 
static checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 ilObjUser $ilUser More...
 
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _lookupViewMode ($a_id)
 Lookup view mode. More...
 
static _isActivated ($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
 Is activated? More...
 
static _registrationEnabled ($a_obj_id)
 
static lookupRegistrationInfo ($a_obj_id)
 Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng. More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 
static _usingRegistrationCode ()
 Using Registration code. More...
 
static lookupPeriodInfo ($a_obj_id)
 Lookup course period info. More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Static Protected Attributes

static $using_code = false
 

Detailed Description

Class ilObjCourseAccess.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 19 of file class.ilObjCourseAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjCourseAccess::_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::checkAccess)

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Definition at line 67 of file class.ilObjCourseAccess.php.

References $DIC, $ilUser, $lng, ilCourseParticipant\_getInstanceByObjId(), ilCourseParticipants\_getInstanceByObjId(), ilWaitingList\_isOnList(), ilDatePresentation\formatDate(), IL_NO_OBJECT_ACCESS, ilAccessInfo\IL_STATUS_INFO, and ilObjCourse\mayLeave().

68  {
69  global $DIC;
70 
71  $ilUser = $DIC['ilUser'];
72  $lng = $DIC['lng'];
73  $rbacsystem = $DIC['rbacsystem'];
74  $ilAccess = $DIC['ilAccess'];
75  $ilias = $DIC['ilias'];
76 
77  if ($a_user_id == "") {
78  $a_user_id = $ilUser->getId();
79  }
80 
81  if ($ilUser->getId() == $a_user_id) {
82  $participants = ilCourseParticipant::_getInstanceByObjId($a_obj_id, $a_user_id);
83  } else {
84  $participants = ilCourseParticipants::_getInstanceByObjId($a_obj_id);
85  }
86 
87 
88  switch ($a_cmd) {
89  case "view":
90  if ($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id)) {
91  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("crs_status_blocked"));
92  return false;
93  }
94  break;
95 
96  case 'leave':
97 
98  // Regular member
99  if ($a_permission == 'leave') {
100  include_once './Modules/Course/classes/class.ilObjCourse.php';
101  $limit = null;
102  if (!ilObjCourse::mayLeave($a_obj_id, $a_user_id, $limit)) {
103  $ilAccess->addInfoItem(
105  sprintf($lng->txt("crs_cancellation_end_rbac_info"), ilDatePresentation::formatDate($limit))
106  );
107  return false;
108  }
109 
110  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
111  if (!$participants->isAssigned($a_user_id)) {
112  return false;
113  }
114  }
115  // Waiting list
116  if ($a_permission == 'join') {
117  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
118  if (!ilCourseWaitingList::_isOnList($a_user_id, $a_obj_id)) {
119  return false;
120  }
121  return true;
122  }
123  break;
124 
125  case 'join':
126 
127  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
128  if (ilCourseWaitingList::_isOnList($a_user_id, $a_obj_id)) {
129  return false;
130  }
131  break;
132  }
133 
134  switch ($a_permission) {
135  case 'visible':
136  $visible = null;
137  $active = self::_isActivated($a_obj_id, $visible);
138  $tutor = $rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id);
139  if (!$active) {
140  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
141  }
142  if (!$tutor && !$active && !$visible) {
143  return false;
144  }
145  break;
146 
147  case 'read':
148  $tutor = $rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id);
149  if ($tutor) {
150  return true;
151  }
152  $active = self::_isActivated($a_obj_id);
153  if (!$active) {
154  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
155  return false;
156  }
157  if ($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id)) {
158  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("crs_status_blocked"));
159  return false;
160  }
161  break;
162 
163  case 'join':
164  if (!self::_registrationEnabled($a_obj_id)) {
165  return false;
166  }
167 
168  if ($participants->isAssigned($a_user_id)) {
169  return false;
170  }
171  break;
172 
173  case 'leave':
174  include_once './Modules/Course/classes/class.ilObjCourse.php';
175  return ilObjCourse::mayLeave($a_obj_id, $a_user_id);
176  }
177  return true;
178  }
global $DIC
Definition: saml.php:7
const IL_NO_OBJECT_ACCESS
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
$lng
$ilUser
Definition: imgupload.php:18
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.
static mayLeave($a_course_id, $a_user_id=null, &$a_date=null)
+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjCourseAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Definition at line 233 of file class.ilObjCourseAccess.php.

References $DIC, and $ilUser.

234  {
235  global $DIC;
236 
237  $ilAccess = $DIC['ilAccess'];
238  $ilUser = $DIC['ilUser'];
239 
240  $t_arr = explode("_", $a_target);
241 
242  // registration codes
243  if (substr($t_arr[2], 0, 5) == 'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID) {
244  self::$using_code = true;
245  return true;
246  }
247 
248 
249  if ($t_arr[0] != "crs" || ((int) $t_arr[1]) <= 0) {
250  return false;
251  }
252 
253  // checking for read results in endless loop, if read is given
254  // but visible is not given (-> see bug 5323)
255  if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
256  $ilAccess->checkAccess("visible", "", $t_arr[1])) {
257  //if ($ilAccess->checkAccess("visible", "", $t_arr[1]))
258  return true;
259  }
260  return false;
261  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18

◆ _getCommands()

static ilObjCourseAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Definition at line 192 of file class.ilObjCourseAccess.php.

References ilDAVActivationChecker\_isActive(), ilFMSettings\getInstance(), and ilWebDAVUtil\getInstance().

Referenced by ilObjCourseReferenceAccess\_getCommands(), and ilObjCourseListGUI\init().

193  {
194  $commands = array();
195  $commands[] = array("permission" => "crs_linked", "cmd" => "", "lang_var" => "view", "default" => true);
196 
197  include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
198  if (ilFMSettings::getInstance()->isEnabled()) {
199  $commands[] = array(
200  'permission' => 'read',
201  'cmd' => 'fileManagerLaunch',
202  'lang_var' => 'fm_start',
203  'enable_anonymous' => false
204  );
205  }
206 
207  $commands[] = array("permission" => "join", "cmd" => "join", "lang_var" => "join");
208 
209  // on waiting list
210  $commands[] = array('permission' => "join", "cmd" => "leave", "lang_var" => "leave_waiting_list");
211 
212  // regualar users
213  $commands[] = array('permission' => "leave", "cmd" => "leave", "lang_var" => "crs_unsubscribe");
214 
215  include_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
217  include_once './Services/WebDAV/classes/class.ilWebDAVUtil.php';
218  if (ilWebDAVUtil::getInstance()->isLocalPasswordInstructionRequired()) {
219  $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
220  } else {
221  $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
222  }
223  }
224 
225  $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
226  $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
227  return $commands;
228  }
static _isActive()
Static getter.
static getInstance()
Get singleton instance.
static getInstance()
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

static ilObjCourseAccess::_isActivated (   $a_obj_id,
$a_visible_flag = null,
  $a_mind_member_view = true 
)
static

Is activated?

See also
ilStartupGUI
Parameters
int$a_obj_id
bool&$a_visible_flag
bool$a_mind_member_view
Returns
boolean

Definition at line 292 of file class.ilObjCourseAccess.php.

References ilObject\_getAllReferences(), ilMemberViewSettings\getInstance(), ilObjectActivation\getItem(), and ilObjectActivation\TIMINGS_ACTIVATION.

Referenced by ilObjCourse\_isActivated(), ilPortfolioPageGUI\getCoursesOfUser(), ilObjCourseListGUI\getProperties(), and ilObjCourse\register().

293  {
294  // #7669
295  if ($a_mind_member_view) {
296  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
297  if (ilMemberViewSettings::getInstance()->isActive()) {
298  $a_visible_flag = true;
299  return true;
300  }
301  }
302 
303  $ref_id = ilObject::_getAllReferences($a_obj_id);
304  $ref_id = array_pop($ref_id);
305 
306  $a_visible_flag = true;
307 
308  include_once './Services/Object/classes/class.ilObjectActivation.php';
309  $item = ilObjectActivation::getItem($ref_id);
310  switch ($item['timing_type']) {
312  if (time() < $item['timing_start'] or
313  time() > $item['timing_end']) {
314  $a_visible_flag = $item['visible'];
315  return false;
316  }
317  // fallthrough
318 
319  // no break
320  default:
321  return true;
322  }
323  }
static getItem($a_ref_id)
Get item data.
static _getAllReferences($a_id)
get all reference ids of object
static getInstance()
Get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isOffline()

static ilObjCourseAccess::_isOffline (   $a_obj_id)
static

Type-specific implementation of general status.

Used in ListGUI and Learning Progress

Parameters
int$a_obj_id
Returns
bool

Definition at line 451 of file class.ilObjCourseAccess.php.

Referenced by ilObjCourse\register().

452  {
453  $dummy = null;
454  return !self::_isActivated($a_obj_id, $dummy, false);
455  }
+ Here is the caller graph for this function:

◆ _lookupViewMode()

static ilObjCourseAccess::_lookupViewMode (   $a_id)
static

Lookup view mode.

This is placed here to the need that ilObjFolder must always instantiate a Course object.

Returns
Parameters
object$a_id

Definition at line 269 of file class.ilObjCourseAccess.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilObjFolder\getViewMode(), ilObjGroup\getViewMode(), and ilObjGroupGUI\initForm().

270  {
271  global $DIC;
272 
273  $ilDB = $DIC['ilDB'];
274 
275  $query = "SELECT view_mode FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
276  $res = $ilDB->query($query);
277  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
278  return $row->view_mode;
279  }
280  return false;
281  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _preloadData()

static ilObjCourseAccess::_preloadData (   $a_obj_ids,
  $a_ref_ids 
)
static

Preload data.

Parameters
array$a_obj_idsarray of object ids

Definition at line 462 of file class.ilObjCourseAccess.php.

References $DIC, $ilUser, $lng, and ilWaitingList\_preloadOnListInfo().

463  {
464  global $DIC;
465 
466  $ilUser = $DIC['ilUser'];
467  $lng = $DIC['lng'];
468 
469  $lng->loadLanguageModule("crs");
470 
471  ilCourseWaitingList::_preloadOnListInfo($ilUser->getId(), $a_obj_ids);
472 
473  $repository = new ilUserCertificateRepository();
474  $coursePreload = new ilCertificateObjectsForUserPreloader($repository);
475  $coursePreload->preLoad($ilUser->getId(), $a_obj_ids);
476  }
global $DIC
Definition: saml.php:7
static _preloadOnListInfo($a_usr_ids, $a_obj_ids)
Preload on list info.
$lng
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ _registrationEnabled()

static ilObjCourseAccess::_registrationEnabled (   $a_obj_id)
static
Returns
Parameters
object$a_obj_id

Definition at line 330 of file class.ilObjCourseAccess.php.

References $DIC, $ilDB, $query, $res, $row, $type, ilDBConstants\FETCHMODE_OBJECT, IL_CRS_SUBSCRIPTION_DEACTIVATED, IL_CRS_SUBSCRIPTION_LIMITED, and IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by ilObjCourse\_registrationEnabled().

331  {
332  global $DIC;
333 
334  $ilDB = $DIC['ilDB'];
335 
336  $query = "SELECT * FROM crs_settings " .
337  "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
338 
339  $res = $ilDB->query($query);
340  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
341  $type = $row->sub_limitation_type;
342  $reg_start = $row->sub_start;
343  $reg_end = $row->sub_end;
344  }
345 
346  switch ($type) {
348  return true;
349 
351  return false;
352 
354  if (time() > $reg_start and
355  time() < $reg_end) {
356  return true;
357  }
358  // no break
359  default:
360  return false;
361  }
362  return false;
363  }
const IL_CRS_SUBSCRIPTION_LIMITED
$type
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
const IL_CRS_SUBSCRIPTION_UNLIMITED
$query
$row
global $ilDB
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the caller graph for this function:

◆ _usingRegistrationCode()

static ilObjCourseAccess::_usingRegistrationCode ( )
static

Using Registration code.

Returns
bool

Definition at line 483 of file class.ilObjCourseAccess.php.

Referenced by ilObjCourse\register().

484  {
485  return self::$using_code;
486  }
+ Here is the caller graph for this function:

◆ checkCondition()

static ilObjCourseAccess::checkCondition (   $a_obj_id,
  $a_operator,
  $a_value,
  $a_usr_id 
)
static

ilObjUser $ilUser

Parameters
type$a_obj_id
type$a_operator
type$a_value
type$a_usr_id
Returns
boolean

Implements ilConditionHandling.

Definition at line 43 of file class.ilObjCourseAccess.php.

References ilParticipants\_hasPassed(), and ilConditionHandler\OPERATOR_PASSED.

44  {
45  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
46  include_once './Services/Conditions/classes/class.ilConditionHandler.php';
47 
48  switch ($a_operator) {
50  return ilCourseParticipants::_hasPassed($a_obj_id, $a_usr_id);
51  }
52  return false;
53  }
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
+ Here is the call graph for this function:

◆ getConditionOperators()

static ilObjCourseAccess::getConditionOperators ( )
static

Get operators.

Implements ilConditionHandling.

Definition at line 26 of file class.ilObjCourseAccess.php.

References ilConditionHandler\OPERATOR_PASSED.

27  {
28  include_once './Services/Conditions/classes/class.ilConditionHandler.php';
29  return array(
31  );
32  }

◆ lookupPeriodInfo()

static ilObjCourseAccess::lookupPeriodInfo (   $a_obj_id)
static

Lookup course period info.

Parameters
int$a_obj_id
Returns
array

Definition at line 494 of file class.ilObjCourseAccess.php.

References $DIC, $end, $ilDB, $lng, $query, $row, $start, ilDatePresentation\formatPeriod(), and IL_CAL_UNIX.

Referenced by ilObjCourseListGUI\getProperties().

495  {
496  global $DIC;
497 
498  $ilDB = $DIC['ilDB'];
499  $lng = $DIC['lng'];
500 
501  $start = $end = null;
502 
503  $query = 'SELECT crs_start, crs_end FROM crs_settings' .
504  ' WHERE obj_id = ' . $ilDB->quote($a_obj_id);
505  $set = $ilDB->query($query);
506  while ($row = $ilDB->fetchAssoc($set)) {
507  $start = $row['crs_start']
508  ? new ilDate($row['crs_start'], IL_CAL_UNIX)
509  : null;
510  $end = $row['crs_end']
511  ? new ilDate($row['crs_end'], IL_CAL_UNIX)
512  : null;
513  }
514 
515  if ($start && $end) {
516  $lng->loadLanguageModule('crs');
517 
518  return array(
519  'property' => $lng->txt('crs_period'),
521  );
522  }
523  }
global $DIC
Definition: saml.php:7
const IL_CAL_UNIX
$start
Definition: bench.php:8
Class for single dates.
$lng
$query
$row
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupRegistrationInfo()

static ilObjCourseAccess::lookupRegistrationInfo (   $a_obj_id)
static

Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.

Parameters
int$a_obj_id
Returns
array

Definition at line 373 of file class.ilObjCourseAccess.php.

References $DIC, $ilDB, $ilUser, $info, $lng, $query, $res, $row, ilDateTime\_before(), ilCourseParticipant\_getInstanceByObjId(), ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilWaitingList\lookupListSize(), ilCourseConstants\SUBSCRIPTION_LIMITED, and ilCourseConstants\SUBSCRIPTION_UNLIMITED.

Referenced by ilCourseRegistrationGUI\fillMaxMembers(), ilObjCourseListGUI\getProperties(), and ilObjCourseGUI\infoScreen().

374  {
375  global $DIC;
376 
377  $ilDB = $DIC['ilDB'];
378  $ilUser = $DIC['ilUser'];
379  $lng = $DIC['lng'];
380 
381  $query = 'SELECT sub_limitation_type, sub_start, sub_end, sub_mem_limit, sub_max_members FROM crs_settings ' .
382  'WHERE obj_id = ' . $ilDB->quote($a_obj_id);
383  $res = $ilDB->query($query);
384 
385  $info = array();
386  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
387  $info['reg_info_start'] = new ilDateTime($row->sub_start, IL_CAL_UNIX);
388  $info['reg_info_end'] = new ilDateTime($row->sub_end, IL_CAL_UNIX);
389  $info['reg_info_type'] = $row->sub_limitation_type;
390  $info['reg_info_max_members'] = $row->sub_max_members;
391  $info['reg_info_mem_limit'] = $row->sub_mem_limit;
392  }
393 
394  $registration_possible = true;
395 
396  // Limited registration
397  if ($info['reg_info_type'] == ilCourseConstants::SUBSCRIPTION_LIMITED) {
398  $dt = new ilDateTime(time(), IL_CAL_UNIX);
399  if (ilDateTime::_before($dt, $info['reg_info_start'])) {
400  $info['reg_info_list_prop']['property'] = $lng->txt('crs_list_reg_start');
401  $info['reg_info_list_prop']['value'] = ilDatePresentation::formatDate($info['reg_info_start']);
402  } elseif (ilDateTime::_before($dt, $info['reg_info_end'])) {
403  $info['reg_info_list_prop']['property'] = $lng->txt('crs_list_reg_end');
404  $info['reg_info_list_prop']['value'] = ilDatePresentation::formatDate($info['reg_info_end']);
405  } else {
406  $registration_possible = false;
407  $info['reg_info_list_prop']['property'] = $lng->txt('crs_list_reg_period');
408  $info['reg_info_list_prop']['value'] = $lng->txt('crs_list_reg_noreg');
409  }
410  } elseif ($info['reg_info_type'] == ilCourseConstants::SUBSCRIPTION_UNLIMITED) {
411  $registration_possible = true;
412  } else {
413  $registration_possible = false;
414  $info['reg_info_list_prop']['property'] = $lng->txt('crs_list_reg');
415  $info['reg_info_list_prop']['value'] = $lng->txt('crs_list_reg_noreg');
416  }
417 
418  if ($info['reg_info_mem_limit'] && $info['reg_info_max_members'] && $registration_possible) {
419  // Check for free places
420  include_once './Modules/Course/classes/class.ilCourseParticipant.php';
421  $part = ilCourseParticipant::_getInstanceByObjId($a_obj_id, $ilUser->getId());
422 
423  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
424  $info['reg_info_list_size'] = ilCourseWaitingList::lookupListSize($a_obj_id);
425  if ($info['reg_info_list_size']) {
426  $info['reg_info_free_places'] = 0;
427  } else {
428  $info['reg_info_free_places'] = max(0, $info['reg_info_max_members'] - $part->getNumberOfMembers());
429  }
430 
431  if ($info['reg_info_free_places']) {
432  $info['reg_info_list_prop_limit']['property'] = $lng->txt('crs_list_reg_limit_places');
433  $info['reg_info_list_prop_limit']['value'] = $info['reg_info_free_places'];
434  } else {
435  $info['reg_info_list_prop_limit']['property'] = '';
436  $info['reg_info_list_prop_limit']['value'] = $lng->txt('crs_list_reg_limit_full');
437  }
438  }
439 
440  return $info;
441  }
global $DIC
Definition: saml.php:7
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.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
foreach($_POST as $key=> $value) $res
$lng
Date and time handling
$ilUser
Definition: imgupload.php:18
$query
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
$row
static lookupListSize($a_obj_id)
Lookup waiting lit size.
global $ilDB
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $using_code

ilObjCourseAccess::$using_code = false
staticprotected

Definition at line 21 of file class.ilObjCourseAccess.php.


The documentation for this class was generated from the following file: