5include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
 
    6include_once 
'./Modules/Course/classes/class.ilCourseConstants.php';
 
    7include_once 
'Modules/Course/classes/class.ilCourseParticipants.php';
 
    8include_once 
'Modules/Course/classes/class.ilCourseParticipant.php';
 
    9include_once 
'./Services/Conditions/interfaces/interface.ilConditionHandling.php';
 
   33        include_once 
'./Services/Conditions/classes/class.ilConditionHandler.php';
 
   48    public static function checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
 
   50        include_once 
"./Modules/Course/classes/class.ilCourseParticipants.php";
 
   51        include_once 
'./Services/Conditions/classes/class.ilConditionHandler.php';
 
   53        switch ($a_operator) {
 
   72    public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = 
"")
 
   78        $rbacsystem = 
$DIC[
'rbacsystem'];
 
   79        $ilAccess = 
$DIC[
'ilAccess'];
 
   80        $ilias = 
$DIC[
'ilias'];
 
   82        if ($a_user_id == 
"") {
 
   86        if (
$ilUser->getId() == $a_user_id) {
 
   95                if ($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id)) {
 
  104                if ($a_permission == 
'leave') {
 
  105                    include_once 
'./Modules/Course/classes/class.ilObjCourse.php';
 
  108                        $ilAccess->addInfoItem(
 
  115                    include_once 
'./Modules/Course/classes/class.ilCourseParticipants.php';
 
  116                    if (!$participants->isAssigned($a_user_id)) {
 
  121                if ($a_permission == 
'join') {
 
  122                    include_once 
'./Modules/Course/classes/class.ilCourseWaitingList.php';
 
  132                include_once 
'./Modules/Course/classes/class.ilCourseWaitingList.php';
 
  139        switch ($a_permission) {
 
  143                $tutor = $rbacsystem->checkAccessOfUser($a_user_id, 
'write', $a_ref_id);
 
  147                if (!$tutor && !$active && !$visible) {
 
  153                $tutor = $rbacsystem->checkAccessOfUser($a_user_id, 
'write', $a_ref_id);
 
  162                if ($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id)) {
 
  169                if (!self::_registrationEnabled($a_obj_id)) {
 
  173                if ($participants->isAssigned($a_user_id)) {
 
  179                include_once 
'./Modules/Course/classes/class.ilObjCourse.php';
 
  200        $commands[] = array(
"permission" => 
"crs_linked", 
"cmd" => 
"", 
"lang_var" => 
"view", 
"default" => 
true);
 
  202        include_once 
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
 
  205                'permission' => 
'read',
 
  206                'cmd' => 
'fileManagerLaunch',
 
  207                'lang_var' => 
'fm_start',
 
  208                'enable_anonymous' => 
false 
  212        $commands[] = array(
"permission" => 
"join", 
"cmd" => 
"join", 
"lang_var" => 
"join");
 
  215        $commands[] = array(
'permission' => 
"join", 
"cmd" => 
"leave", 
"lang_var" => 
"leave_waiting_list");
 
  218        $commands[] = array(
'permission' => 
"leave", 
"cmd" => 
"leave", 
"lang_var" => 
"crs_unsubscribe");
 
  220        include_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
 
  222            include_once 
'./Services/WebDAV/classes/class.ilWebDAVUtil.php';
 
  224                $commands[] = array(
'permission' => 
'read', 
'cmd' => 
'showPasswordInstruction', 
'lang_var' => 
'mount_webfolder', 
'enable_anonymous' => 
'false');
 
  226                $commands[] = array(
"permission" => 
"read", 
"cmd" => 
"mount_webfolder", 
"lang_var" => 
"mount_webfolder", 
"enable_anonymous" => 
"false");
 
  230        $commands[] = array(
"permission" => 
"write", 
"cmd" => 
"enableAdministrationPanel", 
"lang_var" => 
"edit_content");
 
  231        $commands[] = array(
"permission" => 
"write", 
"cmd" => 
"edit", 
"lang_var" => 
"settings");
 
  242        $ilAccess = 
$DIC[
'ilAccess'];
 
  245        $t_arr = explode(
"_", $a_target);
 
  248        if (substr($t_arr[2], 0, 5) == 
'rcode' and 
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
  249            self::$using_code = 
true;
 
  254        if ($t_arr[0] != 
"crs" || ((
int) $t_arr[1]) <= 0) {
 
  260        if ($ilAccess->checkAccess(
"read", 
"", $t_arr[1]) ||
 
  261            $ilAccess->checkAccess(
"visible", 
"", $t_arr[1])) {
 
  280        $query = 
"SELECT view_mode FROM crs_settings WHERE obj_id = " . 
$ilDB->quote($a_id, 
'integer') . 
" ";
 
  283            return $row->view_mode;
 
  297    public static function _isActivated($a_obj_id, &$a_visible_flag = 
null, $a_mind_member_view = 
true)
 
  300        if ($a_mind_member_view) {
 
  301            include_once 
'./Services/Container/classes/class.ilMemberViewSettings.php';
 
  303                $a_visible_flag = 
true;
 
  309        $ref_id = array_pop($ref_id);
 
  311        $a_visible_flag = 
true;
 
  313        include_once 
'./Services/Object/classes/class.ilObjectActivation.php';
 
  315        switch ($item[
'timing_type']) {
 
  317                if (time() < $item[
'timing_start'] or
 
  318                   time() > $item[
'timing_end']) {
 
  319                    $a_visible_flag = $item[
'visible'];
 
  341        $query = 
"SELECT * FROM crs_settings " .
 
  342            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" ";
 
  346            $type = $row->sub_limitation_type;
 
  347            $reg_start = $row->sub_start;
 
  348            $reg_end = $row->sub_end;
 
  359                if (time() > $reg_start and
 
  386        $query = 
'SELECT sub_limitation_type, sub_start, sub_end, sub_mem_limit, sub_max_members FROM crs_settings ' .
 
  387            'WHERE obj_id = ' . 
$ilDB->quote($a_obj_id);
 
  394            $info[
'reg_info_type'] = $row->sub_limitation_type;
 
  395            $info[
'reg_info_max_members'] = $row->sub_max_members;
 
  396            $info[
'reg_info_mem_limit'] = $row->sub_mem_limit;
 
  399        $registration_possible = 
true;
 
  405                $info[
'reg_info_list_prop'][
'property'] = 
$lng->txt(
'crs_list_reg_start');
 
  408                $info[
'reg_info_list_prop'][
'property'] = 
$lng->txt(
'crs_list_reg_end');
 
  411                $registration_possible = 
false;
 
  412                $info[
'reg_info_list_prop'][
'property'] = 
$lng->txt(
'crs_list_reg_period');
 
  413                $info[
'reg_info_list_prop'][
'value'] = 
$lng->txt(
'crs_list_reg_noreg');
 
  416            $registration_possible = 
true;
 
  418            $registration_possible = 
false;
 
  419            $info[
'reg_info_list_prop'][
'property'] = 
$lng->txt(
'crs_list_reg');
 
  420            $info[
'reg_info_list_prop'][
'value'] = 
$lng->txt(
'crs_list_reg_noreg');
 
  423        if ($info[
'reg_info_mem_limit'] && $info[
'reg_info_max_members'] && $registration_possible) {
 
  425            include_once 
'./Modules/Course/classes/class.ilCourseParticipant.php';
 
  428            include_once 
'./Modules/Course/classes/class.ilCourseWaitingList.php';
 
  430            if ($info[
'reg_info_list_size']) {
 
  431                $info[
'reg_info_free_places'] = 0;
 
  433                $info[
'reg_info_free_places'] = max(0, $info[
'reg_info_max_members'] - $part->getNumberOfMembers());
 
  436            if ($info[
'reg_info_free_places']) {
 
  437                $info[
'reg_info_list_prop_limit'][
'property'] = 
$lng->txt(
'crs_list_reg_limit_places');
 
  438                $info[
'reg_info_list_prop_limit'][
'value'] = $info[
'reg_info_free_places'];
 
  440                $info[
'reg_info_list_prop_limit'][
'property'] = 
'';
 
  441                $info[
'reg_info_list_prop_limit'][
'value'] = 
$lng->txt(
'crs_list_reg_limit_full');
 
  474        $lng->loadLanguageModule(
"crs");
 
  480        $coursePreload->preLoad(
$ilUser->getId(), $a_obj_ids);
 
  483        self::$booking_repo = 
$f->getRepoWithContextObjCache($a_obj_ids);
 
  519        $start = $end = 
null;
 
  520        $query = 
'SELECT period_start, period_end, period_time_indication FROM crs_settings ' .
 
  521            'WHERE obj_id = ' . 
$ilDB->quote($a_obj_id);
 
  525            if (!$row->period_time_indication) {
 
  526                $start = ($row->period_start
 
  529                $end = ($row->period_end
 
  533                $start = ($row->period_start
 
  536                $end = ($row->period_end
 
  541        if ($start && $end) {
 
  542            $lng->loadLanguageModule(
'crs');
 
  546                    'crs_start' => $start,
 
  548                    'property' => 
$lng->txt(
'crs_period'),
 
An exception for terminatinating execution or to throw for unit testing.
const IL_NO_OBJECT_ACCESS
const IL_CRS_SUBSCRIPTION_LIMITED
const IL_CRS_SUBSCRIPTION_UNLIMITED
const IL_CRS_SUBSCRIPTION_DEACTIVATED
Factory for reservation repo.
const SUBSCRIPTION_LIMITED
const SUBSCRIPTION_UNLIMITED
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _isActive()
Static getter.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
@classDescription Date and time handling
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 getInstance()
Get singleton instance.
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)
@global ilObjUser $ilUser
static _registrationEnabled($a_obj_id)
static _checkGoto($a_target)
check whether goto script will succeed
static _usingRegistrationCode()
Using Registration code.
static _lookupViewMode($a_id)
Lookup view mode.
_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 _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
static _getCommands()
get commands
static lookupRegistrationInfo($a_obj_id)
Lookup registration info @global ilDB $ilDB @global ilObjUser $ilUser @global ilLanguage $lng.
static getBookingInfoRepo()
Get booking info repo.
static _isOffline($a_obj_id)
Type-specific implementation of general status.
static mayLeave($a_course_id, $a_user_id=null, &$a_date=null)
static getItem($a_ref_id)
Get item data.
static _getAllReferences($a_id)
get all reference ids of object
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
static _preloadOnListInfo($a_usr_ids, $a_obj_ids)
Preload on list info.
static lookupListSize($a_obj_id)
Lookup waiting lit size.
static getInstance()
Get singleton instance.
Interface for condition handling.
foreach($_POST as $key=> $value) $res