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

Class ilObjCourse. More...

+ Inheritance diagram for ilObjCourse:
+ Collaboration diagram for ilObjCourse:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 getShowMembersExport ()
 
 setShowMembersExport ($a_mem_export)
 
 getRegistrationAccessCode ()
 get access code More...
 
 setRegistrationAccessCode ($a_code)
 Set refistration access code. More...
 
 isRegistrationAccessCodeEnabled ()
 Check if access code is enabled. More...
 
 enableRegistrationAccessCode ($a_status)
 En/disable registration access code. More...
 
 getImportantInformation ()
 
 setImportantInformation ($a_info)
 
 getSyllabus ()
 
 setSyllabus ($a_syllabus)
 
 getContactName ()
 
 setContactName ($a_cn)
 
 getContactConsultation ()
 
 setContactConsultation ($a_value)
 
 getContactPhone ()
 
 setContactPhone ($a_value)
 
 getContactEmail ()
 
 setContactEmail ($a_value)
 
 getContactResponsibility ()
 
 setContactResponsibility ($a_value)
 
 getActivationUnlimitedStatus ()
 get activation unlimited no start or no end More...
 
 getActivationStart ()
 
 setActivationStart ($a_value)
 
 getActivationEnd ()
 
 setActivationEnd ($a_value)
 
 setActivationVisibility ($a_value)
 
 getActivationVisibility ()
 
 getSubscriptionLimitationType ()
 
 setSubscriptionLimitationType ($a_type)
 
 getSubscriptionUnlimitedStatus ()
 
 getSubscriptionStart ()
 
 setSubscriptionStart ($a_value)
 
 getSubscriptionEnd ()
 
 setSubscriptionEnd ($a_value)
 
 getSubscriptionType ()
 
 setSubscriptionType ($a_value)
 
 getSubscriptionPassword ()
 
 setSubscriptionPassword ($a_value)
 
 enabledObjectiveView ()
 
 enabledWaitingList ()
 
 enableWaitingList ($a_status)
 
 inSubscriptionTime ()
 
 enableSessionLimit ($a_status)
 en/disable limited number of sessions More...
 
 isSessionLimitEnabled ()
 
 enableSubscriptionMembershipLimitation ($a_status)
 enable max members More...
 
 setNumberOfPreviousSessions ($a_num)
 Set number of previous sessions. More...
 
 getNumberOfPreviousSessions ()
 Set number of previous sessions. More...
 
 setNumberOfNextSessions ($a_num)
 Set number of previous sessions. More...
 
 getNumberOfNextSessions ()
 Set number of previous sessions. More...
 
 isSubscriptionMembershipLimited ()
 is membership limited More...
 
 getSubscriptionMaxMembers ()
 
 setSubscriptionMaxMembers ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 getSubscriptionNotify ()
 
 setSubscriptionNotify ($a_value)
 
 setViewMode ($a_mode)
 
 getViewMode ()
 
 setTimingMode ($a_mode)
 
 getTimingMode ()
 
 getArchiveStart ()
 
 setArchiveStart ($a_value)
 
 getArchiveEnd ()
 
 setArchiveEnd ($a_value)
 
 getArchiveType ()
 
 setArchiveType ($a_value)
 
 setAboStatus ($a_status)
 
 getAboStatus ()
 
 setShowMembers ($a_status)
 
 getShowMembers ()
 
 setMailToMembersType ($a_type)
 Set mail to members type. More...
 
 getMailToMembersType ()
 Get mail to members type. More...
 
 getMessage ()
 
 setMessage ($a_message)
 
 appendMessage ($a_message)
 
 isActivated ()
 Check if course is active and not offline. More...
 
 allowAbo ()
 
 read ()
 
 create ($a_upload=false)
 
 setLatitude ($a_latitude)
 Set Latitude. More...
 
 getLatitude ()
 Get Latitude. More...
 
 setLongitude ($a_longitude)
 Set Longitude. More...
 
 getLongitude ()
 Get Longitude. More...
 
 setLocationZoom ($a_locationzoom)
 Set LocationZoom. More...
 
 getLocationZoom ()
 Get LocationZoom. More...
 
 setEnableCourseMap ($a_enablemap)
 Set Enable Course Map. More...
 
 getEnableMap ()
 Type independent wrapper. More...
 
 getEnableCourseMap ()
 Get Enable Course Map. More...
 
 setCourseStart (ilDate $a_value=null)
 
 getCourseStart ()
 
 setCourseEnd (ilDate $a_value=null)
 
 getCourseEnd ()
 
 setCancellationEnd (ilDate $a_value=null)
 
 getCancellationEnd ()
 
 setSubscriptionMinMembers ($a_value)
 
 getSubscriptionMinMembers ()
 
 setWaitingListAutoFill ($a_value)
 
 hasWaitingListAutoFill ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone course (no member data) More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (start objects, preconditions) More...
 
 cloneAutoGeneratedRoles ($new_obj)
 Clone automatic genrated roles (permissions and template permissions) More...
 
 validate ()
 
 validateInfoSettings ()
 
 hasContactData ()
 
 delete ()
 delete course and all related data More...
 
 update ()
 update complete object More...
 
 updateSettings ()
 
 cloneSettings ($new_obj)
 Clone entries in settings table. More...
 
 __createDefaultSettings ()
 
 __readSettings ()
 
 initWaitingList ()
 
 getMemberObject ()
 Get course member object. More...
 
 getMembersObject ()
 
 initDefaultRoles ()
 
 setParentRolePermissions ($a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 __getCrsNonMemberTemplateId ()
 get course non-member template private More...
 
 getLocalCourseRoles ($a_translate=false)
 get ALL local roles of course, also those created and defined afterwards only fetch data once from database. More...
 
 getDefaultCourseRoles ($a_crs_id="")
 get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member public More...
 
 __getLocalRoles ()
 
 __deleteSettings ()
 
 getDefaultMemberRole ()
 
 getDefaultTutorRole ()
 
 getDefaultAdminRole ()
 
 MDUpdateListener ($a_element)
 Overwriten Metadata update listener for ECS functionalities. More...
 
 addAdditionalSubItemInformation (&$a_item_data)
 Add additional information to sub item, e.g. More...
 
 register ($a_user_id, $a_role=ilCourseConstants::CRS_MEMBER, $a_force_registration=false)
 
 getAutoNotification ()
 Returns automatic notification status from $this->auto_notification. More...
 
 setAutoNotification ($value)
 Sets automatic notification status in $this->auto_notification, using given $status. More...
 
 setStatusDetermination ($a_value)
 Set status determination mode. More...
 
 getStatusDetermination ()
 Get status determination mode. More...
 
 syncMembersStatusWithLP ()
 Set course status for all members by lp status. More...
 
 checkLPStatusSync ($a_member_id)
 sync course status from lp More...
 
 getOrderType ()
 
 handleAutoFill ()
 Handle course auto fill. More...
 
- Public Member Functions inherited from ilContainer
 __construct ($a_id=0, $a_reference=true)
 
 getObjectTranslation ()
 Get object translation. More...
 
 setObjectTranslation (ilObjectTranslation $obj_trans)
 Get object translation. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 setNewsTimeline ($a_val)
 Set news timeline. More...
 
 getNewsTimeline ()
 Get news timeline. More...
 
 setNewsTimelineAutoEntries ($a_val)
 Set news timeline auto entries. More...
 
 getNewsTimelineAutoEntries ()
 Get news timeline auto entries. More...
 
 setNewsTimelineLandingPage ($a_val)
 Set news timline is landing page. More...
 
 getNewsTimelineLandingPage ()
 Get news timline is landing page. More...
 
 isNewsTimelineEffective ()
 Is news timeline effective? More...
 
 isNewsTimelineLandingPageEffective ()
 Is news timeline landing page effective? More...
 
 setNewsBlockActivated ($a_val)
 Set news block activated. More...
 
 getNewsBlockActivated ()
 Get news block activated. More...
 
 setUseNews ($a_val)
 Set use news. More...
 
 getUseNews ()
 Get use news. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false, $a_submode=1)
 clone all objects according to this container More...
 
 delete ()
 delete category and all related data More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 putInTree ($a_parent_ref)
 
 update ()
 Update. More...
 
 read ()
 read More...
 
 readContainerSettings ()
 Read container settings. More...
 
 removeTranslations ()
 Remove all translations of container. More...
 
 deleteTranslation ($a_lang)
 Delete translation. More...
 
 addTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)
 Add translation. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register ($a_user_id)
 Register an user. More...
 

Static Public Member Functions

static lookupShowMembersEnabled ($a_obj_id)
 Check if show member is enabled. More...
 
static _isSubscriptionNotificationEnabled ($a_course_id)
 Check if subscription notification is enabled. More...
 
static lookupTimingMode ($a_obj_id)
 
static _lookupViewMode ($a_id)
 lookup view mode of container More...
 
static _lookupAboStatus ($a_id)
 
static _isActivated ($a_obj_id)
 Is activated. More...
 
static _registrationEnabled ($a_obj_id)
 Registration enabled? Method is in Access class, since it is needed by Access/ListGUI. More...
 
static lookupCourseNonMemberTemplatesId ()
 Lookup course non member id. More...
 
static _deleteUser ($a_usr_id)
 
static lookupObjectsByCode ($a_code)
 
static mayLeave ($a_course_id, $a_user_id=null, &$a_date=null)
 
static findCoursesWithNotEnoughMembers ()
 Minimum members check type $ilDB. More...
 
- Static Public Member Functions inherited from ilContainer
static _getContainerDirectory ($a_id)
 Get the container directory. More...
 
static _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=null)
 Lookup a container setting. More...
 
static _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $a_obj_id)
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const CAL_REG_START = 1
 
const CAL_REG_END = 2
 
const CAL_ACTIVATION_START = 3
 
const CAL_ACTIVATION_END = 4
 
const CAL_COURSE_START = 5
 
const CAL_COURSE_END = 6
 
const CAL_COURSE_TIMING_START = 7
 
const CAL_COURSE_TIMING_END = 8
 
const STATUS_DETERMINATION_LP = 1
 
const STATUS_DETERMINATION_MANUAL = 2
 
 $archives_obj
 
- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Protected Member Functions

 initCourseMemberObject ()
 Init course member object ilObjUser $ilUser. More...
 
 initCourseMembersObject ()
 Init course member object ilObjUser $ilUser. More...
 
 prepareAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 

Protected Attributes

 $course_logger = null
 
 $crs_start
 
 $crs_end
 
 $leave_end
 
 $min_members
 
 $auto_fill_from_waiting
 
 $member_export = false
 
- Protected Attributes inherited from ilContainer
 $db
 
 $log
 
 $access
 
 $error
 
 $rbacsystem
 
 $tree
 
 $user
 
 $obj_definition
 
 $order_type = 0
 
 $hiddenfilesfound = false
 
 $news_timeline = false
 
 $news_timeline_auto_entries = false
 
 $setting
 
 $obj_trans = null
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Private Attributes

 $member_obj = null
 
 $members_obj = null
 
 $latitude = ''
 
 $longitude = ''
 
 $locationzoom = 0
 
 $enablemap = 0
 
 $session_limit = 0
 
 $session_prev = -1
 
 $session_next = -1
 
 $reg_access_code = ''
 
 $reg_access_code_enabled = false
 
 $status_dt = null
 
 $mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
 
 $timing_mode = ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE
 
 $auto_notification = true
 

Additional Inherited Members

- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 

Detailed Description

Class ilObjCourse.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 35 of file class.ilObjCourse.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjCourse::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 105 of file class.ilObjCourse.php.

References $GLOBALS, and setStatusDetermination().

106  {
107 
108  #define("ILIAS_MODULE","course");
109  #define("KEEP_IMAGE_PATH",1);
110 
111  $this->SUBSCRIPTION_DEACTIVATED = 1;
112  $this->SUBSCRIPTION_CONFIRMATION = 2;
113  $this->SUBSCRIPTION_DIRECT = 3;
114  $this->SUBSCRIPTION_PASSWORD = 4;
115  $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
116  $this->ARCHIVE_DISABLED = 1;
117  $this->ARCHIVE_READ = 2;
118  $this->ARCHIVE_DOWNLOAD = 3;
119  $this->ABO_ENABLED = 1;
120  $this->ABO_DISABLED = 0;
121  $this->SHOW_MEMBERS_ENABLED = 1;
122  $this->SHOW_MEMBERS_DISABLED = 0;
123  $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
124 
125  $this->type = "crs";
126 
127  $this->course_logger = $GLOBALS['DIC']->logger()->crs();
128 
129  parent::__construct($a_id, $a_call_by_reference);
130  }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
setStatusDetermination($a_value)
Set status determination mode.
+ Here is the call graph for this function:

Member Function Documentation

◆ __createDefaultSettings()

ilObjCourse::__createDefaultSettings ( )

Definition at line 1394 of file class.ilObjCourse.php.

References $DIC, $ilDB, $query, $res, __readSettings(), ilMembershipRegistrationCodeUtils\generateCode(), getAutoNotification(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getEnableCourseMap(), ilObject\getId(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getNumberOfPreviousSessions(), getRegistrationAccessCode(), getStatusDetermination(), getSubscriptionEnd(), getSubscriptionMaxMembers(), getSubscriptionPassword(), getSubscriptionStart(), getSyllabus(), IL_CRS_SUBSCRIPTION_DEACTIVATED, IL_CRS_SUBSCRIPTION_DIRECT, IL_CRS_VIEW_TIMING_ABSOLUTE, isRegistrationAccessCodeEnabled(), isSessionLimitEnabled(), setRegistrationAccessCode(), and ilContainer\SORT_MANUAL.

Referenced by create(), and updateSettings().

1395  {
1396  global $DIC;
1397 
1398  $ilDB = $DIC['ilDB'];
1399 
1400  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1402 
1403  $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
1404  "contact_phone,contact_email,contact_consultation," .
1405  "sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
1406  "sub_max_members,sub_notify,view_mode,timing_mode,abo," .
1407  "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
1408  "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
1409  "VALUES( " .
1410  $ilDB->quote($this->getId(), 'integer') . ", " .
1411  $ilDB->quote($this->getSyllabus(), 'text') . ", " .
1412  $ilDB->quote($this->getContactName(), 'text') . ", " .
1413  $ilDB->quote($this->getContactResponsibility(), 'text') . ", " .
1414  $ilDB->quote($this->getContactPhone(), 'text') . ", " .
1415  $ilDB->quote($this->getContactEmail(), 'text') . ", " .
1416  $ilDB->quote($this->getContactConsultation(), 'text') . ", " .
1417  $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED, 'integer') . ", " .
1418  $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " .
1419  $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1420  $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT, 'integer') . ", " .
1421  $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " .
1422  "0, " .
1423  $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1424  "1, " .
1425  "0, " .
1426  $ilDB->quote(IL_CRS_VIEW_TIMING_ABSOLUTE, 'integer') . ', ' .
1427  $ilDB->quote($this->ABO_ENABLED, 'integer') . ", " .
1428  $ilDB->quote($this->getLatitude(), 'text') . ", " .
1429  $ilDB->quote($this->getLongitude(), 'text') . ", " .
1430  $ilDB->quote($this->getLocationZoom(), 'integer') . ", " .
1431  $ilDB->quote($this->getEnableCourseMap(), 'integer') . ", " .
1432  #"objective_view = '0', ".
1433  "1, " .
1434  "1," .
1435  '0,' .
1436  $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1437  $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1438  $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1439  $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1440  $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1441  $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1442  $ilDB->quote((int) $this->getStatusDetermination(), 'integer') . ', ' .
1443  $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ' ' .
1444  ")";
1445 
1446  $res = $ilDB->manipulate($query);
1447  $this->__readSettings();
1448 
1449  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1450  $sorting = new ilContainerSortingSettings($this->getId());
1451  $sorting->setSortMode(ilContainer::SORT_MANUAL);
1452  $sorting->update();
1453  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
global $DIC
Definition: saml.php:7
const IL_CRS_VIEW_TIMING_ABSOLUTE
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
setRegistrationAccessCode($a_code)
Set refistration access code.
getLocationZoom()
Get LocationZoom.
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
getRegistrationAccessCode()
get access code
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
static generateCode()
Generate new registration key.
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
const IL_CRS_SUBSCRIPTION_DIRECT
getEnableCourseMap()
Get Enable Course Map.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __deleteSettings()

ilObjCourse::__deleteSettings ( )

Definition at line 1785 of file class.ilObjCourse.php.

References $DIC, $ilDB, $query, $res, and ilObject\getId().

Referenced by delete().

1786  {
1787  global $DIC;
1788 
1789  $ilDB = $DIC['ilDB'];
1790 
1791  $query = "DELETE FROM crs_settings " .
1792  "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
1793  $res = $ilDB->manipulate($query);
1794 
1795  return true;
1796  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getCrsNonMemberTemplateId()

ilObjCourse::__getCrsNonMemberTemplateId ( )

get course non-member template private

Parameters
returnobj_id of roletemplate containing permissionsettings for non-member roles of a course.

Definition at line 1661 of file class.ilObjCourse.php.

References $DIC, $ilDB, $res, $row, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by setParentRolePermissions().

1662  {
1663  global $DIC;
1664 
1665  $ilDB = $DIC['ilDB'];
1666 
1667  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1668  $res = $this->ilias->db->query($q);
1670 
1671  return $row["obj_id"];
1672  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
redirection script todo: (a better solution should control the processing via a xml file) ...
$row
global $ilDB
+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )

Definition at line 1774 of file class.ilObjCourse.php.

References $DIC, ilObject\$rbacreview, and ilObject\getRefId().

Referenced by getDefaultAdminRole(), getDefaultMemberRole(), and getDefaultTutorRole().

1775  {
1776  global $DIC;
1777 
1778  $rbacreview = $DIC['rbacreview'];
1779 
1780  // GET role_objects of predefined roles
1781 
1782  return $rbacreview->getRolesOfRoleFolder($this->getRefId(), false);
1783  }
global $DIC
Definition: saml.php:7
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __readSettings()

ilObjCourse::__readSettings ( )

Definition at line 1456 of file class.ilObjCourse.php.

References $DIC, $ilDB, $query, $res, $row, ilPrivacySettings\_getInstance(), enableRegistrationAccessCode(), enableSessionLimit(), enableSubscriptionMembershipLimitation(), enableWaitingList(), ilDBConstants\FETCHMODE_OBJECT, ilObject\getId(), ilObjectActivation\getItem(), IL_CAL_UNIX, setAboStatus(), setActivationEnd(), setActivationStart(), setActivationVisibility(), setAutoNotification(), setCancellationEnd(), setContactConsultation(), setContactEmail(), setContactName(), setContactPhone(), setContactResponsibility(), setCourseEnd(), setCourseStart(), setEnableCourseMap(), setImportantInformation(), setLatitude(), setLocationZoom(), setLongitude(), setMailToMembersType(), setNumberOfNextSessions(), setNumberOfPreviousSessions(), ilObject\setOfflineStatus(), setRegistrationAccessCode(), setShowMembers(), setShowMembersExport(), setStatusDetermination(), setSubscriptionEnd(), setSubscriptionLimitationType(), setSubscriptionMaxMembers(), setSubscriptionMinMembers(), setSubscriptionNotify(), setSubscriptionPassword(), setSubscriptionStart(), setSubscriptionType(), setSyllabus(), setTimingMode(), setViewMode(), setWaitingListAutoFill(), and ilObjectActivation\TIMINGS_ACTIVATION.

Referenced by __createDefaultSettings(), and read().

1457  {
1458  global $DIC;
1459 
1460  $ilDB = $DIC['ilDB'];
1461 
1462  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . "";
1463 
1464  $res = $ilDB->query($query);
1465  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1466  $this->setSyllabus($row->syllabus);
1467  $this->setContactName($row->contact_name);
1468  $this->setContactResponsibility($row->contact_responsibility);
1469  $this->setContactPhone($row->contact_phone);
1470  $this->setContactEmail($row->contact_email);
1471  $this->setContactConsultation($row->contact_consultation);
1472  $this->setOfflineStatus(!(bool) $row->activation_type); // see below
1473  $this->setSubscriptionLimitationType($row->sub_limitation_type);
1474  $this->setSubscriptionStart($row->sub_start);
1475  $this->setSubscriptionEnd($row->sub_end);
1476  $this->setSubscriptionType($row->sub_type);
1477  $this->setSubscriptionPassword($row->sub_password);
1478  $this->enableSubscriptionMembershipLimitation($row->sub_mem_limit);
1479  $this->setSubscriptionMaxMembers($row->sub_max_members);
1480  $this->setSubscriptionNotify($row->sub_notify);
1481  $this->setViewMode($row->view_mode);
1482  $this->setTimingMode((int) $row->timing_mode);
1483  $this->setAboStatus($row->abo);
1484  $this->enableWaitingList($row->waiting_list);
1485  $this->setImportantInformation($row->important);
1486  $this->setShowMembers($row->show_members);
1487 
1488  if (\ilPrivacySettings::_getInstance()->participantsListInCoursesEnabled()) {
1489  $this->setShowMembersExport($row->show_members_export);
1490  } else {
1491  $this->setShowMembersExport(false);
1492  }
1493  $this->setLatitude($row->latitude);
1494  $this->setLongitude($row->longitude);
1495  $this->setLocationZoom($row->location_zoom);
1496  $this->setEnableCourseMap($row->enable_course_map);
1497  $this->enableSessionLimit($row->session_limit);
1498  $this->setNumberOfPreviousSessions($row->session_prev);
1499  $this->setNumberOfNextSessions($row->session_next);
1500  $this->enableRegistrationAccessCode($row->reg_ac_enabled);
1501  $this->setRegistrationAccessCode($row->reg_ac);
1502  $this->setAutoNotification($row->auto_notification == 1 ? true : false);
1503  $this->setStatusDetermination((int) $row->status_dt);
1504  $this->setMailToMembersType($row->mail_members_type);
1505  $this->setCourseStart($row->crs_start ? new ilDate($row->crs_start, IL_CAL_UNIX) : null);
1506  $this->setCourseEnd($row->crs_end ? new ilDate($row->crs_end, IL_CAL_UNIX) : null);
1507  $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
1508  $this->setWaitingListAutoFill($row->auto_wait);
1509  $this->setSubscriptionMinMembers($row->min_members ? $row->min_members : null);
1510  }
1511 
1512  // moved activation to ilObjectActivation
1513  if ($this->ref_id) {
1514  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1515  $activation = ilObjectActivation::getItem($this->ref_id);
1516  switch ($activation["timing_type"]) {
1518  $this->setActivationStart($activation["timing_start"]);
1519  $this->setActivationEnd($activation["timing_end"]);
1520  $this->setActivationVisibility($activation["visible"]);
1521  break;
1522  }
1523  }
1524  return true;
1525  }
setActivationEnd($a_value)
setSubscriptionNotify($a_value)
setContactResponsibility($a_value)
setSubscriptionStart($a_value)
setSubscriptionEnd($a_value)
setShowMembersExport($a_mem_export)
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
setAutoNotification($value)
Sets automatic notification status in $this->auto_notification, using given $status.
global $DIC
Definition: saml.php:7
setImportantInformation($a_info)
setMailToMembersType($a_type)
Set mail to members type.
static getItem($a_ref_id)
Get item data.
setContactEmail($a_value)
enableSubscriptionMembershipLimitation($a_status)
enable max members
enableSessionLimit($a_status)
en/disable limited number of sessions
setTimingMode($a_mode)
const IL_CAL_UNIX
setSubscriptionPassword($a_value)
setCourseEnd(ilDate $a_value=null)
setRegistrationAccessCode($a_code)
Set refistration access code.
setSyllabus($a_syllabus)
setLatitude($a_latitude)
Set Latitude.
setViewMode($a_mode)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
setAboStatus($a_status)
setLocationZoom($a_locationzoom)
Set LocationZoom.
setActivationStart($a_value)
Class for single dates.
foreach($_POST as $key=> $value) $res
setLongitude($a_longitude)
Set Longitude.
getId()
get object id public
setSubscriptionType($a_value)
setSubscriptionMinMembers($a_value)
setNumberOfNextSessions($a_num)
Set number of previous sessions.
setContactConsultation($a_value)
$query
enableRegistrationAccessCode($a_status)
En/disable registration access code.
$row
setContactPhone($a_value)
setCancellationEnd(ilDate $a_value=null)
setOfflineStatus($a_status)
Set offline status.
global $ilDB
setSubscriptionMaxMembers($a_value)
enableWaitingList($a_status)
setWaitingListAutoFill($a_value)
static _getInstance()
Get instance of ilPrivacySettings.
setShowMembers($a_status)
setCourseStart(ilDate $a_value=null)
setStatusDetermination($a_value)
Set status determination mode.
setSubscriptionLimitationType($a_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteUser()

static ilObjCourse::_deleteUser (   $a_usr_id)
static

Definition at line 1838 of file class.ilObjCourse.php.

References ilCourseLMHistory\_deleteUser(), ilParticipants\_deleteUser(), and ilLOUserResults\deleteResultsForUser().

Referenced by ilObjUser\delete().

1839  {
1840  // Delete all user related data
1841  // delete lm_history
1842  include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
1843  ilCourseLMHistory::_deleteUser($a_usr_id);
1844 
1845  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1847 
1848  // Course objectives
1849  include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1851  }
static _deleteUser($a_usr_id)
Delete user type $ilDB.
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
static _deleteUser($a_usr_id)
Delete user data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

static ilObjCourse::_isActivated (   $a_obj_id)
static

Is activated.

Method is in Access class, since it is needed by Access/ListGUI.

Parameters
intid of user
Returns
boolean

Definition at line 755 of file class.ilObjCourse.php.

References ilObjCourseAccess\_isActivated().

Referenced by ilStartUpGUI\_checkGoto(), and ilObjCourseGUI\executeCommand().

756  {
757  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
758  return ilObjCourseAccess::_isActivated($a_obj_id);
759  }
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isSubscriptionNotificationEnabled()

static ilObjCourse::_isSubscriptionNotificationEnabled (   $a_course_id)
static

Check if subscription notification is enabled.

public

Parameters
intcourse_id

Definition at line 450 of file class.ilObjCourse.php.

References $DIC, $ilDB, $query, and $res.

451  {
452  global $DIC;
453 
454  $ilDB = $DIC['ilDB'];
455 
456  $query = "SELECT * FROM crs_settings " .
457  "WHERE obj_id = " . $ilDB->quote($a_course_id, 'integer') . " " .
458  "AND sub_notify = 1";
459  $res = $ilDB->query($query);
460  return $res->numRows() ? true : false;
461  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB

◆ _lookupAboStatus()

static ilObjCourse::_lookupAboStatus (   $a_id)
static

Definition at line 640 of file class.ilObjCourse.php.

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

Referenced by ilObjSessionGUI\modifyItemGUI(), ilObjGroupGUI\modifyItemGUI(), and ilObjFolderGUI\modifyItemGUI().

641  {
642  global $DIC;
643 
644  $ilDB = $DIC['ilDB'];
645 
646  $query = "SELECT abo FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
647  $res = $ilDB->query($query);
648  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
649  return $row->abo;
650  }
651  return false;
652  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupViewMode()

static ilObjCourse::_lookupViewMode (   $a_id)
static

lookup view mode of container

Parameters
int$a_id
Returns
mixed int | bool

Definition at line 626 of file class.ilObjCourse.php.

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

Referenced by ilObjCourseGUI\_modifyItemGUI(), ilCourseLP\checkObjectives(), ilCalendarScheduleFilterTimings\enabledCourseTimings(), ilObjFolderGUI\forwardToTimingsView(), ilPortfolioPageGUI\getCoursesOfUser(), and ilObjGroup\translateViewMode().

627  {
628  global $DIC;
629 
630  $ilDB = $DIC['ilDB'];
631 
632  $query = "SELECT view_mode FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
633  $res = $ilDB->query($query);
634  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
635  return $row->view_mode;
636  }
637  return false;
638  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _registrationEnabled()

static ilObjCourse::_registrationEnabled (   $a_obj_id)
static

Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.

Parameters
intid of user
Returns
boolean

Definition at line 767 of file class.ilObjCourse.php.

References ilObjCourseAccess\_registrationEnabled().

Referenced by ilStartUpGUI\_checkGoto(), and ilObjCourseGUI\executeCommand().

768  {
769  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
770  return ilObjCourseAccess::_registrationEnabled($a_obj_id);
771  }
static _registrationEnabled($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjCourse::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

Definition at line 1884 of file class.ilObjCourse.php.

References ilObjectActivation\addAdditionalSubItemInformation().

1885  {
1886  include_once './Services/Object/classes/class.ilObjectActivation.php';
1888  }
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.
+ Here is the call graph for this function:

◆ allowAbo()

ilObjCourse::allowAbo ( )

Definition at line 774 of file class.ilObjCourse.php.

775  {
776  return $this->ABO == $this->ABO_ENABLED;
777  }

◆ appendMessage()

ilObjCourse::appendMessage (   $a_message)

Definition at line 722 of file class.ilObjCourse.php.

References getMessage().

Referenced by validate().

723  {
724  if ($this->getMessage()) {
725  $this->message .= "<br /> ";
726  }
727  $this->message .= $a_message;
728  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLPStatusSync()

ilObjCourse::checkLPStatusSync (   $a_member_id)

sync course status from lp

as lp data is not deleted on course exit new members may already have lp completed

Parameters
int$a_member_id

Definition at line 2177 of file class.ilObjCourse.php.

References ilObjUserTracking\_enabledLearningProgress(), ilLPStatus\_lookupStatus(), ilObject\getId(), getMembersObject(), getStatusDetermination(), ilLPStatus\LP_STATUS_COMPLETED_NUM, and STATUS_DETERMINATION_LP.

Referenced by handleAutoFill().

2178  {
2179  // #11113
2180  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2183  include_once("Services/Tracking/classes/class.ilLPStatus.php");
2184  // #13811 - we need to suppress creation if status entry
2185  $has_completed = (ilLPStatus::_lookupStatus($this->getId(), $a_member_id, false) == ilLPStatus::LP_STATUS_COMPLETED_NUM);
2186  $this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
2187  }
2188  }
const LP_STATUS_COMPLETED_NUM
getStatusDetermination()
Get status determination mode.
const STATUS_DETERMINATION_LP
static _enabledLearningProgress()
check wether learing progress is enabled or not
getId()
get object id public
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjCourse::cloneAutoGeneratedRoles (   $new_obj)

Clone automatic genrated roles (permissions and template permissions)

public

Parameters
objectnew course object

Definition at line 1072 of file class.ilObjCourse.php.

References $DIC, $ilLog, ilObject\$rbacadmin, ilObject\$rbacreview, getDefaultAdminRole(), getDefaultMemberRole(), getDefaultTutorRole(), and ilObject\getRefId().

Referenced by cloneObject().

1073  {
1074  global $DIC;
1075 
1076  $ilLog = $DIC['ilLog'];
1077  $rbacadmin = $DIC['rbacadmin'];
1078  $rbacreview = $DIC['rbacreview'];
1079 
1080  $admin = $this->getDefaultAdminRole();
1081  $new_admin = $new_obj->getDefaultAdminRole();
1082 
1083  if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
1084  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_admin');
1085  }
1086  $rbacadmin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
1087  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_admin.');
1088 
1089  $tutor = $this->getDefaultTutorRole();
1090  $new_tutor = $new_obj->getDefaultTutorRole();
1091  if (!$tutor || !$new_tutor) {
1092  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_tutor');
1093  }
1094  $rbacadmin->copyRolePermissions($tutor, $this->getRefId(), $new_obj->getRefId(), $new_tutor, true);
1095  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_tutor.');
1096 
1097  $member = $this->getDefaultMemberRole();
1098  $new_member = $new_obj->getDefaultMemberRole();
1099  if (!$member || !$new_member) {
1100  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_member');
1101  }
1102  $rbacadmin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
1103  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_member.');
1104 
1105  return true;
1106  }
global $DIC
Definition: saml.php:7
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjCourse::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (start objects, preconditions)

public

Parameters
inttarget ref id of new course
intcopy id

Definition at line 1033 of file class.ilObjCourse.php.

References $start, ilObjCourseGrouping\_getGroupings(), ilObject\_lookupObjId(), ilObjectActivation\cloneDependencies(), ilLOSettings\cloneSettings(), ilObject\getId(), ilLoggerFactory\getLogger(), and ilObject\getRefId().

1034  {
1035  parent::cloneDependencies($a_target_id, $a_copy_id);
1036 
1037  // Clone course start objects
1038  include_once('Services/Container/classes/class.ilContainerStartObjects.php');
1039  $start = new ilContainerStartObjects($this->getRefId(), $this->getId());
1040  $start->cloneDependencies($a_target_id, $a_copy_id);
1041 
1042  // Clone course item settings
1043  include_once('Services/Object/classes/class.ilObjectActivation.php');
1044  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
1045 
1046  // clone objective settings
1047  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
1048  ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
1049 
1050  // Clone course learning objectives
1051  include_once('Modules/Course/classes/class.ilCourseObjective.php');
1052  $crs_objective = new ilCourseObjective($this);
1053  $crs_objective->ilClone($a_target_id, $a_copy_id);
1054 
1055  // clone membership limitation
1056  foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
1057  \ilLoggerFactory::getLogger('crs')->info('Handling grouping id: ' . $grouping_id);
1058  $grouping = new \ilObjCourseGrouping($grouping_id);
1059  $grouping->cloneGrouping($a_target_id, $a_copy_id);
1060  }
1061 
1062  return true;
1063  }
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
$start
Definition: bench.php:8
getId()
get object id public
class ilcourseobjective
static _lookupObjId($a_id)
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
getRefId()
get reference id public
static getLogger($a_component_id)
Get component logger.
static _getGroupings($a_course_id)
+ Here is the call graph for this function:

◆ cloneObject()

ilObjCourse::cloneObject (   $a_target_id,
  $a_copy_id = 0,
  $a_omit_tree = false 
)

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

Definition at line 963 of file class.ilObjCourse.php.

References $DIC, $factory, $ilDB, $ilUser, ilCourseDefinedFieldDefinition\_clone(), ilCourseFile\_cloneFiles(), ilCopyWizardOptions\_getInstance(), cloneAutoGeneratedRoles(), ilObject\cloneMetaData(), cloneSettings(), ilObject\getId(), IL_CRS_ADMIN, and ilObject\setOfflineStatus().

964  {
965  global $DIC;
966 
967  $ilDB = $DIC['ilDB'];
968  $ilUser = $DIC['ilUser'];
969  $certificateLogger = $DIC->logger()->cert();
970 
971 
972  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
973 
974  $this->cloneAutoGeneratedRoles($new_obj);
975  $this->cloneMetaData($new_obj);
976 
977  // Assign admin
978  $new_obj->getMemberObject()->add($ilUser->getId(), IL_CRS_ADMIN);
979  // cognos-blu-patch: begin
980  $new_obj->getMemberObject()->updateContact($ilUser->getId(), 1);
981  // cognos-blu-patch: end
982 
983 
984  // #14596
985  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
986  if ($cwo->isRootNode($this->getRefId())) {
987  $this->setOfflineStatus(true);
988  }
989 
990  // Copy settings
991  $this->cloneSettings($new_obj);
992 
993  // Course Defined Fields
994  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
995  ilCourseDefinedFieldDefinition::_clone($this->getId(), $new_obj->getId());
996 
997  // Clone course files
998  include_once('Modules/Course/classes/class.ilCourseFile.php');
999  ilCourseFile::_cloneFiles($this->getId(), $new_obj->getId());
1000 
1001  // Copy learning progress settings
1002  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
1003  $obj_settings = new ilLPObjSettings($this->getId());
1004  $obj_settings->cloneSettings($new_obj->getId());
1005  unset($obj_settings);
1006 
1007  // clone certificate (#11085)
1009  $templateRepository = new ilCertificateTemplateRepository($ilDB);
1010 
1011  $cloneAction = new ilCertificateCloneAction(
1012  $ilDB,
1013  $factory,
1014  $templateRepository,
1015  $DIC->filesystem()->web(),
1016  $certificateLogger,
1018  );
1019 
1020  $cloneAction->cloneCertificate($this, $new_obj);
1021 
1022  return $new_obj;
1023  }
global $DIC
Definition: saml.php:7
$factory
Definition: metadata.php:43
static _clone($a_source_id, $a_target_id)
Clone fields.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
$ilUser
Definition: imgupload.php:18
cloneMetaData($target_obj)
Copy meta data.
const IL_CRS_ADMIN
Base class for course and group participants.
cloneSettings($new_obj)
Clone entries in settings table.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
setOfflineStatus($a_status)
Set offline status.
global $ilDB
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.
+ Here is the call graph for this function:

◆ cloneSettings()

ilObjCourse::cloneSettings (   $new_obj)

Clone entries in settings table.

public

Parameters
ilObjCoursenew course object

Definition at line 1340 of file class.ilObjCourse.php.

References enabledWaitingList(), ilMembershipRegistrationCodeUtils\generateCode(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationVisibility(), getAutoNotification(), getCancellationEnd(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getCourseEnd(), getCourseStart(), getEnableCourseMap(), getImportantInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), ilObject\getOfflineStatus(), getOrderType(), getShowMembers(), getShowMembersExport(), getStatusDetermination(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionMinMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSyllabus(), getTimingMode(), getViewMode(), hasWaitingListAutoFill(), isRegistrationAccessCodeEnabled(), isSessionLimitEnabled(), and isSubscriptionMembershipLimited().

Referenced by cloneObject().

1341  {
1342  $new_obj->setSyllabus($this->getSyllabus());
1343  $new_obj->setContactName($this->getContactName());
1344  $new_obj->setContactResponsibility($this->getContactResponsibility());
1345  $new_obj->setContactPhone($this->getContactPhone());
1346  $new_obj->setContactEmail($this->getContactEmail());
1347  $new_obj->setContactConsultation($this->getContactConsultation());
1348  $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1349  $new_obj->setActivationStart($this->getActivationStart());
1350  $new_obj->setActivationEnd($this->getActivationEnd());
1351  $new_obj->setActivationVisibility($this->getActivationVisibility());
1352  $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1353  $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1354  $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1355  $new_obj->setSubscriptionType($this->getSubscriptionType());
1356  $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1357  $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1358  $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1359  $new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
1360  $new_obj->setViewMode($this->getViewMode());
1361  $new_obj->setTimingMode($this->getTimingMode());
1362  $new_obj->setOrderType($this->getOrderType());
1363  $new_obj->setAboStatus($this->getAboStatus());
1364  $new_obj->enableWaitingList($this->enabledWaitingList());
1365  $new_obj->setImportantInformation($this->getImportantInformation());
1366  $new_obj->setShowMembers($this->getShowMembers());
1367  // patch mem_exp
1368  $new_obj->setShowMembersExport($this->getShowMembersExport());
1369  // patch mem_exp
1370  $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1371  $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1372  $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1373  $new_obj->setAutoNotification($this->getAutoNotification());
1374  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1375  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1376  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1377  $new_obj->setStatusDetermination($this->getStatusDetermination());
1378  $new_obj->setMailToMembersType($this->getMailToMembersType());
1379  $new_obj->setCourseStart($this->getCourseStart());
1380  $new_obj->setCourseEnd($this->getCourseEnd());
1381  $new_obj->setCancellationEnd($this->getCancellationEnd());
1382  $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
1383  $new_obj->setSubscriptionMinMembers($this->getSubscriptionMinMembers());
1384 
1385  // #10271
1386  $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1387  $new_obj->setLatitude($this->getLatitude());
1388  $new_obj->setLongitude($this->getLongitude());
1389  $new_obj->setLocationZoom($this->getLocationZoom());
1390 
1391  $new_obj->update();
1392  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
getOfflineStatus()
Get offline status.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
getLocationZoom()
Get LocationZoom.
getNumberOfNextSessions()
Set number of previous sessions.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
static generateCode()
Generate new registration key.
getNumberOfPreviousSessions()
Set number of previous sessions.
getEnableCourseMap()
Get Enable Course Map.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjCourse::create (   $a_upload = false)

Definition at line 791 of file class.ilObjCourse.php.

References $DIC, __createDefaultSettings(), ilObject\createMetaData(), ilObject\getId(), and prepareAppointments().

792  {
793  global $DIC;
794 
795  $ilAppEventHandler = $DIC['ilAppEventHandler'];
796 
797  parent::create($a_upload);
798 
799  if (!$a_upload) {
800  $this->createMetaData();
801  }
802  $this->__createDefaultSettings();
803 
804  $ilAppEventHandler->raise(
805  'Modules/Course',
806  'create',
807  array('object' => $this,
808  'obj_id' => $this->getId(),
809  'appointments' => $this->prepareAppointments('create'))
810  );
811  }
global $DIC
Definition: saml.php:7
createMetaData()
create meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
+ Here is the call graph for this function:

◆ delete()

ilObjCourse::delete ( )

delete course and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

Definition at line 1181 of file class.ilObjCourse.php.

References $DIC, __deleteSettings(), ilObjCourseGrouping\_deleteAll(), ilCourseObjective\_deleteAll(), ilParticipants\_deleteAllEntries(), ilCourseDefinedFieldDefinition\_deleteByContainer(), ilCourseFile\_deleteByCourse(), ilObject\deleteMetaData(), ilObject\getId(), and prepareAppointments().

1182  {
1183  global $DIC;
1184 
1185  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1186 
1187  // always call parent delete function first!!
1188  if (!parent::delete()) {
1189  return false;
1190  }
1191 
1192  // delete meta data
1193  $this->deleteMetaData();
1194 
1195  // put here course specific stuff
1196 
1197  $this->__deleteSettings();
1198 
1199  include_once('Modules/Course/classes/class.ilCourseParticipants.php');
1201 
1202  include_once './Modules/Course/classes/class.ilCourseObjective.php';
1204 
1205  include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
1207 
1208  include_once './Modules/Course/classes/class.ilCourseFile.php';
1210 
1211  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1213 
1214  $ilAppEventHandler->raise(
1215  'Modules/Course',
1216  'delete',
1217  array('object' => $this,
1218  'obj_id' => $this->getId(),
1219  'appointments' => $this->prepareAppointments('delete'))
1220  );
1221 
1222 
1223  return true;
1224  }
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
global $DIC
Definition: saml.php:7
static _deleteByContainer($a_container_id)
Delete all fields of a container.
static _deleteAll($a_course_id)
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
static _deleteByCourse($a_course_id)
static _deleteAll($course_id)
deleteMetaData()
delete meta data entry
+ Here is the call graph for this function:

◆ enabledObjectiveView()

ilObjCourse::enabledObjectiveView ( )

Definition at line 331 of file class.ilObjCourse.php.

References IL_CRS_VIEW_OBJECTIVE.

Referenced by getOrderType().

332  {
333  return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
334  }
const IL_CRS_VIEW_OBJECTIVE
+ Here is the caller graph for this function:

◆ enabledWaitingList()

ilObjCourse::enabledWaitingList ( )

Definition at line 336 of file class.ilObjCourse.php.

Referenced by cloneSettings(), handleAutoFill(), register(), updateSettings(), and validate().

337  {
338  return (bool) $this->waiting_list;
339  }
+ Here is the caller graph for this function:

◆ enableRegistrationAccessCode()

ilObjCourse::enableRegistrationAccessCode (   $a_status)

En/disable registration access code.

Parameters
object$a_status
Returns

Definition at line 191 of file class.ilObjCourse.php.

Referenced by __readSettings().

192  {
193  $this->reg_access_code_enabled = $a_status;
194  }
+ Here is the caller graph for this function:

◆ enableSessionLimit()

ilObjCourse::enableSessionLimit (   $a_status)

en/disable limited number of sessions

Returns
Parameters
object$a_status

Definition at line 362 of file class.ilObjCourse.php.

Referenced by __readSettings().

363  {
364  $this->session_limit = $a_status;
365  }
+ Here is the caller graph for this function:

◆ enableSubscriptionMembershipLimitation()

ilObjCourse::enableSubscriptionMembershipLimitation (   $a_status)

enable max members

public

Parameters
boolstatus
Returns

Definition at line 379 of file class.ilObjCourse.php.

Referenced by __readSettings().

380  {
381  $this->subscription_membership_limitation = $a_status;
382  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjCourse::enableWaitingList (   $a_status)

Definition at line 341 of file class.ilObjCourse.php.

Referenced by __readSettings().

342  {
343  $this->waiting_list = (bool) $a_status;
344  }
+ Here is the caller graph for this function:

◆ findCoursesWithNotEnoughMembers()

static ilObjCourse::findCoursesWithNotEnoughMembers ( )
static

Minimum members check type $ilDB.

Returns
array

Definition at line 2278 of file class.ilObjCourse.php.

References $GLOBALS, $ilDB, $res, $row, ilContainer\$tree, ilObject\_getAllReferences(), IL_CAL_DAY, and IL_CAL_UNIX.

Referenced by ilMembershipCronMinMembers\getCourses().

2279  {
2280  $ilDB = $GLOBALS['DIC']->database();
2281  $tree = $GLOBALS['DIC']->repositoryTree();
2282 
2283  $res = array();
2284 
2285  $before = new ilDateTime(time(), IL_CAL_UNIX);
2286  $before->increment(IL_CAL_DAY, -1);
2287  $now = $before->get(IL_CAL_UNIX);
2288 
2289  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
2290 
2291  $set = $ilDB->query("SELECT obj_id, min_members" .
2292  " FROM crs_settings" .
2293  " WHERE min_members > " . $ilDB->quote(0, "integer") .
2294  " AND sub_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
2295  " AND ((leave_end IS NOT NULL" .
2296  " AND leave_end < " . $ilDB->quote($now, "text") . ")" .
2297  " OR (leave_end IS NULL" .
2298  " AND sub_end IS NOT NULL" .
2299  " AND sub_end < " . $ilDB->quote($now, "text") . "))" .
2300  " AND (crs_start IS NULL OR crs_start > " . $ilDB->quote($now, "integer") . ")");
2301  while ($row = $ilDB->fetchAssoc($set)) {
2302  $refs = ilObject::_getAllReferences($row['obj_id']);
2303  $ref = end($refs);
2304 
2305  if ($tree->isDeleted($ref)) {
2306  continue;
2307  }
2308 
2309  $part = new ilCourseParticipants($row["obj_id"]);
2310  $reci = $part->getNotificationRecipients();
2311  if (sizeof($reci)) {
2312  $missing = (int) $row["min_members"] - $part->getCountMembers();
2313  if ($missing > 0) {
2314  $res[$row["obj_id"]] = array($missing, $reci);
2315  }
2316  }
2317  }
2318 
2319  return $res;
2320  }
const IL_CAL_UNIX
static _getAllReferences($a_id)
get all reference ids of object
const IL_CAL_DAY
foreach($_POST as $key=> $value) $res
Date and time handling
$row
global $ilDB
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAboStatus()

ilObjCourse::getAboStatus ( )

Definition at line 682 of file class.ilObjCourse.php.

Referenced by cloneSettings(), and updateSettings().

683  {
684  return $this->abo;
685  }
+ Here is the caller graph for this function:

◆ getActivationEnd()

ilObjCourse::getActivationEnd ( )

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

Referenced by cloneSettings(), getActivationUnlimitedStatus(), isActivated(), prepareAppointments(), and updateSettings().

270  {
271  return $this->activation_end;
272  }
+ Here is the caller graph for this function:

◆ getActivationStart()

ilObjCourse::getActivationStart ( )

Definition at line 261 of file class.ilObjCourse.php.

Referenced by cloneSettings(), getActivationUnlimitedStatus(), isActivated(), prepareAppointments(), and updateSettings().

262  {
263  return $this->activation_start;
264  }
+ Here is the caller graph for this function:

◆ getActivationUnlimitedStatus()

ilObjCourse::getActivationUnlimitedStatus ( )

get activation unlimited no start or no end

Returns
bool

Definition at line 257 of file class.ilObjCourse.php.

References getActivationEnd(), and getActivationStart().

Referenced by isActivated(), and prepareAppointments().

258  {
259  return !$this->getActivationStart() || !$this->getActivationEnd();
260  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjCourse::getActivationVisibility ( )

Definition at line 281 of file class.ilObjCourse.php.

Referenced by cloneSettings(), and updateSettings().

282  {
283  return $this->activation_visibility;
284  }
+ Here is the caller graph for this function:

◆ getArchiveEnd()

ilObjCourse::getArchiveEnd ( )

Definition at line 662 of file class.ilObjCourse.php.

663  {
664  return $this->archive_end ? $this->archive_end : mktime(0, 0, 0, 12, 12, date("Y", time()) + 2);
665  }

◆ getArchiveStart()

ilObjCourse::getArchiveStart ( )

Definition at line 654 of file class.ilObjCourse.php.

655  {
656  return $this->archive_start ? $this->archive_start : time();
657  }

◆ getArchiveType()

ilObjCourse::getArchiveType ( )

Definition at line 670 of file class.ilObjCourse.php.

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

671  {
672  return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
673  }
const IL_CRS_ARCHIVE_NONE
const IL_CRS_ARCHIVE_DOWNLOAD

◆ getAutoNotification()

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

Returns
boolean

Definition at line 2111 of file class.ilObjCourse.php.

References $auto_notification.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

2112  {
2113  return $this->auto_notification;
2114  }
+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjCourse::getCancellationEnd ( )

Definition at line 927 of file class.ilObjCourse.php.

References $leave_end.

Referenced by cloneSettings(), and updateSettings().

928  {
929  return $this->leave_end;
930  }
+ Here is the caller graph for this function:

◆ getContactConsultation()

ilObjCourse::getContactConsultation ( )

Definition at line 220 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), hasContactData(), and updateSettings().

221  {
222  return $this->contact_consultation;
223  }
+ Here is the caller graph for this function:

◆ getContactEmail()

ilObjCourse::getContactEmail ( )

Definition at line 236 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), hasContactData(), updateSettings(), and validateInfoSettings().

237  {
238  return $this->contact_email;
239  }
+ Here is the caller graph for this function:

◆ getContactName()

ilObjCourse::getContactName ( )

Definition at line 212 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), hasContactData(), and updateSettings().

213  {
214  return $this->contact_name;
215  }
+ Here is the caller graph for this function:

◆ getContactPhone()

ilObjCourse::getContactPhone ( )

Definition at line 228 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), hasContactData(), and updateSettings().

229  {
230  return $this->contact_phone;
231  }
+ Here is the caller graph for this function:

◆ getContactResponsibility()

ilObjCourse::getContactResponsibility ( )

Definition at line 244 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), hasContactData(), and updateSettings().

245  {
246  return $this->contact_responsibility;
247  }
+ Here is the caller graph for this function:

◆ getCourseEnd()

ilObjCourse::getCourseEnd ( )

Definition at line 917 of file class.ilObjCourse.php.

References $crs_end.

Referenced by cloneSettings(), prepareAppointments(), updateSettings(), and validate().

918  {
919  return $this->crs_end;
920  }
+ Here is the caller graph for this function:

◆ getCourseStart()

ilObjCourse::getCourseStart ( )

Definition at line 907 of file class.ilObjCourse.php.

References $crs_start.

Referenced by cloneSettings(), prepareAppointments(), updateSettings(), and validate().

908  {
909  return $this->crs_start;
910  }
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjCourse::getDefaultAdminRole ( )

Definition at line 1824 of file class.ilObjCourse.php.

References __getLocalRoles(), ilObjectFactory\getInstanceByObjId(), and ilObject\getRefId().

Referenced by cloneAutoGeneratedRoles().

1825  {
1826  $local_roles = $this->__getLocalRoles();
1827 
1828  foreach ($local_roles as $role_id) {
1829  if ($tmp_role = &ilObjectFactory::getInstanceByObjId($role_id, false)) {
1830  if (!strcmp($tmp_role->getTitle(), "il_crs_admin_" . $this->getRefId())) {
1831  return $role_id;
1832  }
1833  }
1834  }
1835  return false;
1836  }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultCourseRoles()

ilObjCourse::getDefaultCourseRoles (   $a_crs_id = "")

get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member public

Parameters
returnsthe obj_ids of course specific roles in an associative array. key=descripiton of the role (i.e. "il_crs_tutor", "il_crs_admin", "il_crs_member". value=obj_id of the role

Definition at line 1736 of file class.ilObjCourse.php.

References $DIC, ilObject\$rbacadmin, ilObject\$rbacreview, and ilObject\getRefId().

1737  {
1738  global $DIC;
1739 
1740  $rbacadmin = $DIC['rbacadmin'];
1741  $rbacreview = $DIC['rbacreview'];
1742 
1743  if (strlen($a_crs_id) > 0) {
1744  $crs_id = $a_crs_id;
1745  } else {
1746  $crs_id = $this->getRefId();
1747  }
1748 
1749  $role_arr = $rbacreview->getRolesOfRoleFolder($crs_id);
1750 
1751  foreach ($role_arr as $role_id) {
1752  $role_Obj = &$this->ilias->obj_factory->getInstanceByObjId($role_id);
1753 
1754  $crs_Member = "il_crs_member_" . $crs_id;
1755  $crs_Admin = "il_crs_admin_" . $crs_id;
1756  $crs_Tutor = "il_crs_tutor_" . $crs_id;
1757 
1758  if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
1759  $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1760  }
1761 
1762  if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
1763  $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1764  }
1765 
1766  if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
1767  $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1768  }
1769  }
1770 
1771  return $arr_crsDefaultRoles;
1772  }
global $DIC
Definition: saml.php:7
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjCourse::getDefaultMemberRole ( )

Definition at line 1799 of file class.ilObjCourse.php.

References ilObject\$title, __getLocalRoles(), and ilObject\_lookupTitle().

Referenced by cloneAutoGeneratedRoles().

1800  {
1801  $local_roles = $this->__getLocalRoles();
1802 
1803  foreach ($local_roles as $role_id) {
1804  $title = ilObject::_lookupTitle($role_id);
1805  if (substr($title, 0, 8) == 'il_crs_m') {
1806  return $role_id;
1807  }
1808  }
1809  return 0;
1810  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultTutorRole()

ilObjCourse::getDefaultTutorRole ( )

Definition at line 1811 of file class.ilObjCourse.php.

References __getLocalRoles(), ilObjectFactory\getInstanceByObjId(), and ilObject\getRefId().

Referenced by cloneAutoGeneratedRoles().

1812  {
1813  $local_roles = $this->__getLocalRoles();
1814 
1815  foreach ($local_roles as $role_id) {
1816  if ($tmp_role = &ilObjectFactory::getInstanceByObjId($role_id, false)) {
1817  if (!strcmp($tmp_role->getTitle(), "il_crs_tutor_" . $this->getRefId())) {
1818  return $role_id;
1819  }
1820  }
1821  }
1822  return false;
1823  }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableCourseMap()

ilObjCourse::getEnableCourseMap ( )

Get Enable Course Map.

Returns
boolean Enable Course Map

Definition at line 897 of file class.ilObjCourse.php.

References $enablemap.

Referenced by __createDefaultSettings(), cloneSettings(), getEnableMap(), and updateSettings().

898  {
899  return $this->enablemap;
900  }
+ Here is the caller graph for this function:

◆ getEnableMap()

ilObjCourse::getEnableMap ( )

Type independent wrapper.

Returns
type

Definition at line 887 of file class.ilObjCourse.php.

References getEnableCourseMap().

888  {
889  return $this->getEnableCourseMap();
890  }
getEnableCourseMap()
Get Enable Course Map.
+ Here is the call graph for this function:

◆ getImportantInformation()

ilObjCourse::getImportantInformation ( )

Definition at line 196 of file class.ilObjCourse.php.

Referenced by cloneSettings(), and updateSettings().

197  {
198  return $this->important;
199  }
+ Here is the caller graph for this function:

◆ getLatitude()

ilObjCourse::getLatitude ( )

Get Latitude.

Returns
string Latitude

Definition at line 828 of file class.ilObjCourse.php.

References $latitude.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

829  {
830  return $this->latitude;
831  }
+ Here is the caller graph for this function:

◆ getLocalCourseRoles()

ilObjCourse::getLocalCourseRoles (   $a_translate = false)

get ALL local roles of course, also those created and defined afterwards only fetch data once from database.

info is stored in object variable public

Returns
return array [title|id] of roles...

Definition at line 1697 of file class.ilObjCourse.php.

References $DIC, ilObject\$rbacadmin, ilObject\$rbacreview, ilObjRole\_getTranslation(), and ilObject\getRefId().

1698  {
1699  global $DIC;
1700 
1701  $rbacadmin = $DIC['rbacadmin'];
1702  $rbacreview = $DIC['rbacreview'];
1703 
1704  if (empty($this->local_roles)) {
1705  $this->local_roles = array();
1706  $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1707 
1708  foreach ($role_arr as $role_id) {
1709  if ($rbacreview->isAssignable($role_id, $this->getRefId()) == true) {
1710  $role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1711 
1712  if ($a_translate) {
1713  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1714  } else {
1715  $role_name = $role_Obj->getTitle();
1716  }
1717  $this->local_roles[$role_name] = $role_Obj->getId();
1718  }
1719  }
1720  }
1721 
1722  return $this->local_roles;
1723  }
global $DIC
Definition: saml.php:7
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getTranslation($a_role_title)
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getLocationZoom()

ilObjCourse::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

Definition at line 868 of file class.ilObjCourse.php.

References $locationzoom.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

869  {
870  return $this->locationzoom;
871  }
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

Definition at line 848 of file class.ilObjCourse.php.

References $longitude.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

849  {
850  return $this->longitude;
851  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

Definition at line 709 of file class.ilObjCourse.php.

References $mail_members.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

710  {
711  return $this->mail_members;
712  }
+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

Definition at line 1574 of file class.ilObjCourse.php.

References $member_obj, and initCourseMemberObject().

1575  {
1576  if (!$this->member_obj instanceof ilCourseParticipant) {
1577  $this->initCourseMemberObject();
1578  }
1579  return $this->member_obj;
1580  }
initCourseMemberObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:

◆ getMembersObject()

ilObjCourse::getMembersObject ( )
Returns
ilCourseParticipants

Definition at line 1585 of file class.ilObjCourse.php.

References $members_obj, and initCourseMembersObject().

Referenced by checkLPStatusSync(), handleAutoFill(), and syncMembersStatusWithLP().

1586  {
1587  if (!$this->members_obj instanceof ilCourseParticipants) {
1588  $this->initCourseMembersObject();
1589  }
1590  return $this->members_obj;
1591  }
initCourseMembersObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjCourse::getMessage ( )

Definition at line 714 of file class.ilObjCourse.php.

References $message.

Referenced by appendMessage(), and validate().

715  {
716  return $this->message;
717  }
catch(Exception $e) $message
+ Here is the caller graph for this function:

◆ getNumberOfNextSessions()

ilObjCourse::getNumberOfNextSessions ( )

Set number of previous sessions.

Returns

Definition at line 417 of file class.ilObjCourse.php.

References $session_next.

Referenced by cloneSettings(), getSubItems(), and updateSettings().

418  {
419  return $this->session_next;
420  }
+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjCourse::getNumberOfPreviousSessions ( )

Set number of previous sessions.

Returns

Definition at line 398 of file class.ilObjCourse.php.

References $session_prev.

Referenced by __createDefaultSettings(), cloneSettings(), getSubItems(), and updateSettings().

399  {
400  return $this->session_prev;
401  }
+ Here is the caller graph for this function:

◆ getOrderType()

ilObjCourse::getOrderType ( )

Definition at line 2190 of file class.ilObjCourse.php.

References enabledObjectiveView(), and ilContainer\SORT_MANUAL.

Referenced by cloneSettings(), and update().

2191  {
2192  if ($this->enabledObjectiveView()) {
2193  return ilContainer::SORT_MANUAL;
2194  }
2195  return parent::getOrderType();
2196  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjCourse::getRegistrationAccessCode ( )

get access code

Returns

Definition at line 162 of file class.ilObjCourse.php.

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

163  {
164  return $this->reg_access_code;
165  }
+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjCourse::getShowMembers ( )

Definition at line 690 of file class.ilObjCourse.php.

Referenced by cloneSettings(), and updateSettings().

691  {
692  return $this->show_members;
693  }
+ Here is the caller graph for this function:

◆ getShowMembersExport()

ilObjCourse::getShowMembersExport ( )

Definition at line 148 of file class.ilObjCourse.php.

References $member_export.

Referenced by cloneSettings(), and updateSettings().

149  {
150  return $this->member_export;
151  }
+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

Definition at line 2153 of file class.ilObjCourse.php.

References $status_dt.

Referenced by __createDefaultSettings(), checkLPStatusSync(), cloneSettings(), updateSettings(), and validate().

2154  {
2155  return $this->status_dt;
2156  }
+ Here is the caller graph for this function:

◆ getSubItems()

ilObjCourse::getSubItems (   $a_admin_panel_enabled = false,
  $a_include_side_block = false,
  $a_get_single = 0 
)

Get subitems of container.

Parameters
bool$a_admin_panel_enabled,[optional]
bool$a_include_side_block,[optional]
Returns
array

Definition at line 469 of file class.ilObjCourse.php.

References $_GET, ilContainer\$access, $current, $DIC, $end, $ilUser, $key, $start, ilDateTime\_after(), ilDateTime\_before(), ilContainerSorting\_getInstance(), ilDateTime\_within(), ilObject\getId(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), getViewMode(), IL_CAL_DATE, IL_CAL_DAY, IL_CAL_UNIX, isSessionLimitEnabled(), ilUtil\sortArray(), and ilContainer\VIEW_SESSIONS.

470  {
471  global $DIC;
472 
473  $ilUser = $DIC['ilUser'];
474  $access = $DIC->access();
475 
476  // Caching
477  if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block])) {
478  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
479  }
480 
481  // Results are stored in $this->items
482  parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
483 
484  $limit_sess = false;
485  if (!$a_admin_panel_enabled &&
486  !$a_include_side_block &&
487  $this->items['sess'] &&
488  is_array($this->items['sess']) &&
489  $this->isSessionLimitEnabled() &&
490  $this->getViewMode() == ilContainer::VIEW_SESSIONS) { // #16686
491  $limit_sess = true;
492  }
493 
494  if (!$limit_sess) {
495  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
496  }
497 
498 
499  // do session limit
500 
501  // @todo move to gui class
502  if (isset($_GET['crs_prev_sess'])) {
503  $ilUser->writePref('crs_sess_show_prev_' . $this->getId(), (string) (int) $_GET['crs_prev_sess']);
504  }
505  if (isset($_GET['crs_next_sess'])) {
506  $ilUser->writePref('crs_sess_show_next_' . $this->getId(), (string) (int) $_GET['crs_next_sess']);
507  }
508 
509  $session_rbac_checked = [];
510  foreach ($this->items['sess'] as $session_tree_info) {
511  if ($access->checkAccess('visible', '', $session_tree_info['ref_id'])) {
512  $session_rbac_checked[] = $session_tree_info;
513  }
514  }
515  $sessions = ilUtil::sortArray($session_rbac_checked, 'start', 'ASC', true, false);
516  //$sessions = ilUtil::sortArray($this->items['sess'],'start','ASC',true,false);
517  $today = new ilDate(date('Ymd', time()), IL_CAL_DATE);
518  $previous = $current = $next = array();
519  foreach ($sessions as $key => $item) {
520  $start = new ilDateTime($item['start'], IL_CAL_UNIX);
521  $end = new ilDateTime($item['end'], IL_CAL_UNIX);
522 
523  if (ilDateTime::_within($today, $start, $end, IL_CAL_DAY)) {
524  $current[] = $item;
525  } elseif (ilDateTime::_before($start, $today, IL_CAL_DAY)) {
526  $previous[] = $item;
527  } elseif (ilDateTime::_after($start, $today, IL_CAL_DAY)) {
528  $next[] = $item;
529  }
530  }
531  $num_previous_remove = max(
532  count($previous) - $this->getNumberOfPreviousSessions(),
533  0
534  );
535  while ($num_previous_remove--) {
536  if (!$ilUser->getPref('crs_sess_show_prev_' . $this->getId())) {
537  array_shift($previous);
538  }
539  $this->items['sess_link']['prev']['value'] = 1;
540  }
541 
542  $num_next_remove = max(
543  count($next) - $this->getNumberOfNextSessions(),
544  0
545  );
546  while ($num_next_remove--) {
547  if (!$ilUser->getPref('crs_sess_show_next_' . $this->getId())) {
548  array_pop($next);
549  }
550  // @fixme
551  $this->items['sess_link']['next']['value'] = 1;
552  }
553 
554  $sessions = array_merge($previous, $current, $next);
555  $this->items['sess'] = $sessions;
556 
557  // #15389 - see ilContainer::getSubItems()
558  include_once('Services/Container/classes/class.ilContainerSorting.php');
559  $sort = ilContainerSorting::_getInstance($this->getId());
560  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
561 
562  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
563  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
global $DIC
Definition: saml.php:7
$_GET["client_id"]
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 _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
$start
Definition: bench.php:8
const IL_CAL_DAY
Class for single dates.
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
Date and time handling
$ilUser
Definition: imgupload.php:18
const IL_CAL_DATE
getNumberOfPreviousSessions()
Set number of previous sessions.
static _getInstance($a_obj_id)
get instance by obj_id
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check whether an date is within a date duration given by start and end.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ getSubscriptionEnd()

ilObjCourse::getSubscriptionEnd ( )

Definition at line 306 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), inSubscriptionTime(), prepareAppointments(), updateSettings(), and validate().

307  {
308  return $this->subscription_end;
309  }
+ Here is the caller graph for this function:

◆ getSubscriptionLimitationType()

ilObjCourse::getSubscriptionLimitationType ( )

Definition at line 286 of file class.ilObjCourse.php.

Referenced by cloneSettings(), prepareAppointments(), register(), updateSettings(), and validate().

287  {
288  return $this->subscription_limitation_type;
289  }
+ Here is the caller graph for this function:

◆ getSubscriptionMaxMembers()

ilObjCourse::getSubscriptionMaxMembers ( )

Definition at line 433 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), handleAutoFill(), register(), updateSettings(), and validate().

434  {
435  return $this->subscription_max_members;
436  }
+ Here is the caller graph for this function:

◆ getSubscriptionMinMembers()

ilObjCourse::getSubscriptionMinMembers ( )

Definition at line 940 of file class.ilObjCourse.php.

References $min_members.

Referenced by cloneSettings(), updateSettings(), and validate().

941  {
942  return $this->min_members;
943  }
+ Here is the caller graph for this function:

◆ getSubscriptionNotify()

ilObjCourse::getSubscriptionNotify ( )

Definition at line 565 of file class.ilObjCourse.php.

Referenced by cloneSettings(), and updateSettings().

566  {
567  return true;
568  return $this->subscription_notify ? true : false;
569  }
+ Here is the caller graph for this function:

◆ getSubscriptionPassword()

ilObjCourse::getSubscriptionPassword ( )

Definition at line 323 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), updateSettings(), and validate().

324  {
325  return $this->subscription_password;
326  }
+ Here is the caller graph for this function:

◆ getSubscriptionStart()

ilObjCourse::getSubscriptionStart ( )

Definition at line 298 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), inSubscriptionTime(), prepareAppointments(), updateSettings(), and validate().

299  {
300  return $this->subscription_start;
301  }
+ Here is the caller graph for this function:

◆ getSubscriptionType()

ilObjCourse::getSubscriptionType ( )

Definition at line 314 of file class.ilObjCourse.php.

References IL_CRS_SUBSCRIPTION_DIRECT.

Referenced by cloneSettings(), updateSettings(), and validate().

315  {
316  return $this->subscription_type ? $this->subscription_type : IL_CRS_SUBSCRIPTION_DIRECT;
317  #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
318  }
const IL_CRS_SUBSCRIPTION_DIRECT
+ Here is the caller graph for this function:

◆ getSubscriptionUnlimitedStatus()

ilObjCourse::getSubscriptionUnlimitedStatus ( )

Definition at line 294 of file class.ilObjCourse.php.

References IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

295  {
296  return $this->subscription_limitation_type == IL_CRS_SUBSCRIPTION_UNLIMITED;
297  }
const IL_CRS_SUBSCRIPTION_UNLIMITED
+ Here is the caller graph for this function:

◆ getSyllabus()

ilObjCourse::getSyllabus ( )

Definition at line 204 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

205  {
206  return $this->syllabus;
207  }
+ Here is the caller graph for this function:

◆ getTimingMode()

ilObjCourse::getTimingMode ( )
Returns
int

Definition at line 615 of file class.ilObjCourse.php.

References $timing_mode.

Referenced by cloneSettings(), and updateSettings().

616  {
617  return $this->timing_mode;
618  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilObjCourse::getViewMode ( )

Definition at line 579 of file class.ilObjCourse.php.

Referenced by cloneSettings(), getSubItems(), prepareAppointments(), and updateSettings().

580  {
581  return $this->view_mode;
582  }
+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjCourse::handleAutoFill ( )

Handle course auto fill.

Definition at line 2201 of file class.ilObjCourse.php.

References checkLPStatusSync(), enabledWaitingList(), ilObject\getId(), ilObjectFactory\getInstanceByObjId(), getMembersObject(), ilObject\getRefId(), getSubscriptionMaxMembers(), ilObject\getTitle(), hasWaitingListAutoFill(), IL_CRS_MEMBER, and ilParticipants\lookupNumberOfMembers().

2202  {
2203  if (
2204  !$this->enabledWaitingList() or
2205  !$this->hasWaitingListAutoFill()
2206  ) {
2207  $this->course_logger->debug('Waiting list or auto fill disabled.');
2208  return;
2209  }
2210 
2211  $max = $this->getSubscriptionMaxMembers();
2213 
2214  $this->course_logger->debug('Max members: ' . $max);
2215  $this->course_logger->debug('Current members: ' . $now);
2216 
2217  if ($max <= $now) {
2218  return;
2219  }
2220 
2221  // see assignFromWaitingListObject()
2222  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2223  $waiting_list = new ilCourseWaitingList($this->getId());
2224 
2225  foreach ($waiting_list->getUserIds() as $user_id) {
2226  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
2227  $this->course_logger->warning('Cannot create user instance for id: ' . $user_id);
2228  continue;
2229  }
2230  if ($this->getMembersObject()->isAssigned($user_id)) {
2231  $this->course_logger->warning('User is already assigned to course. uid: ' . $user_id . ' course_id: ' . $this->getRefId());
2232  continue;
2233  }
2234  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
2235  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id, true);
2236  $waiting_list->removeFromList($user_id);
2237  $this->checkLPStatusSync($user_id);
2238 
2239  $this->course_logger->info('Assigned user from waiting list to course: ' . $this->getTitle());
2240  $now++;
2241  if ($now >= $max) {
2242  break;
2243  }
2244  }
2245  }
static lookupNumberOfMembers($a_ref_id)
Lookup number of members ilRbacReview $rbacreview <type> $ilObjDataCache.
const IL_CRS_MEMBER
getId()
get object id public
getTitle()
get object title public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
checkLPStatusSync($a_member_id)
sync course status from lp
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

Definition at line 1165 of file class.ilObjCourse.php.

References getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), and getContactResponsibility().

1166  {
1167  return strlen($this->getContactName()) or
1168  strlen($this->getContactResponsibility()) or
1169  strlen($this->getContactEmail()) or
1170  strlen($this->getContactPhone()) or
1171  strlen($this->getContactConsultation());
1172  }
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjCourse::hasWaitingListAutoFill ( )

Definition at line 950 of file class.ilObjCourse.php.

References $auto_fill_from_waiting.

Referenced by cloneSettings(), handleAutoFill(), and updateSettings().

951  {
952  return (bool) $this->auto_fill_from_waiting;
953  }
+ Here is the caller graph for this function:

◆ initCourseMemberObject()

ilObjCourse::initCourseMemberObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

Definition at line 1543 of file class.ilObjCourse.php.

References $DIC, $ilUser, ilCourseParticipant\_getInstanceByObjId(), and ilObject\getId().

Referenced by getMemberObject().

1544  {
1545  global $DIC;
1546 
1547  $ilUser = $DIC['ilUser'];
1548 
1549  include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
1550  $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(), $ilUser->getId());
1551  return true;
1552  }
global $DIC
Definition: saml.php:7
getId()
get object id public
$ilUser
Definition: imgupload.php:18
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCourseMembersObject()

ilObjCourse::initCourseMembersObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

Definition at line 1559 of file class.ilObjCourse.php.

References $DIC, $ilUser, ilCourseParticipants\_getInstanceByObjId(), and ilObject\getId().

Referenced by getMembersObject().

1560  {
1561  global $DIC;
1562 
1563  $ilUser = $DIC['ilUser'];
1564 
1565  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1566  $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1567  return true;
1568  }
global $DIC
Definition: saml.php:7
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
getId()
get object id public
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjCourse::initDefaultRoles ( )

Definition at line 1596 of file class.ilObjCourse.php.

References $DIC, $ilDB, ilObject\$rbacadmin, ilObject\$rbacreview, ilObjRole\createDefaultRole(), ilObject\getId(), and ilObject\getRefId().

1597  {
1598  global $DIC;
1599 
1600  $rbacadmin = $DIC['rbacadmin'];
1601  $rbacreview = $DIC['rbacreview'];
1602  $ilDB = $DIC['ilDB'];
1603 
1604  include_once './Services/AccessControl/classes/class.ilObjRole.php';
1606  'il_crs_admin_' . $this->getRefId(),
1607  "Admin of crs obj_no." . $this->getId(),
1608  'il_crs_admin',
1609  $this->getRefId()
1610  );
1612  'il_crs_tutor_' . $this->getRefId(),
1613  "Tutor of crs obj_no." . $this->getId(),
1614  'il_crs_tutor',
1615  $this->getRefId()
1616  );
1618  'il_crs_member_' . $this->getRefId(),
1619  "Member of crs obj_no." . $this->getId(),
1620  'il_crs_member',
1621  $this->getRefId()
1622  );
1623 
1624  return array();
1625  }
global $DIC
Definition: saml.php:7
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
global $ilDB
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

Definition at line 1527 of file class.ilObjCourse.php.

References ilObject\getId().

1528  {
1529  include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
1530 
1531  if (!is_object($this->waiting_list_obj)) {
1532  $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1533  }
1534  return true;
1535  }
getId()
get object id public
+ Here is the call graph for this function:

◆ inSubscriptionTime()

ilObjCourse::inSubscriptionTime ( )

Definition at line 346 of file class.ilObjCourse.php.

References getSubscriptionEnd(), getSubscriptionStart(), and getSubscriptionUnlimitedStatus().

Referenced by register().

347  {
348  if ($this->getSubscriptionUnlimitedStatus()) {
349  return true;
350  }
351  if (time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd()) {
352  return true;
353  }
354  return false;
355  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

ilObjCourse::isActivated ( )

Check if course is active and not offline.

Returns
bool

Definition at line 734 of file class.ilObjCourse.php.

References getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), and ilObject\getOfflineStatus().

735  {
736  if ($this->getOfflineStatus()) {
737  return false;
738  }
739  if ($this->getActivationUnlimitedStatus()) {
740  return true;
741  }
742  if (time() < $this->getActivationStart() or
743  time() > $this->getActivationEnd()) {
744  return false;
745  }
746  return true;
747  }
getOfflineStatus()
Get offline status.
getActivationUnlimitedStatus()
get activation unlimited no start or no end
+ Here is the call graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjCourse::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

Definition at line 181 of file class.ilObjCourse.php.

References $reg_access_code_enabled.

Referenced by __createDefaultSettings(), cloneSettings(), and updateSettings().

182  {
183  return (bool) $this->reg_access_code_enabled;
184  }
+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjCourse::isSessionLimitEnabled ( )

Definition at line 367 of file class.ilObjCourse.php.

References $session_limit.

Referenced by __createDefaultSettings(), cloneSettings(), getSubItems(), and updateSettings().

368  {
369  return (bool) $this->session_limit;
370  }
+ Here is the caller graph for this function:

◆ isSubscriptionMembershipLimited()

ilObjCourse::isSubscriptionMembershipLimited ( )

is membership limited

public

Parameters

Definition at line 428 of file class.ilObjCourse.php.

Referenced by cloneSettings(), register(), updateSettings(), and validate().

429  {
430  return (bool) $this->subscription_membership_limitation;
431  }
+ Here is the caller graph for this function:

◆ lookupCourseNonMemberTemplatesId()

static ilObjCourse::lookupCourseNonMemberTemplatesId ( )
static

Lookup course non member id.

Returns
int

Definition at line 1678 of file class.ilObjCourse.php.

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

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

1679  {
1680  global $DIC;
1681 
1682  $ilDB = $DIC['ilDB'];
1683 
1684  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_crs_non_member', 'text');
1685  $res = $ilDB->query($query);
1687 
1688  return isset($row['obj_id']) ? $row['obj_id'] : 0;
1689  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

static ilObjCourse::lookupObjectsByCode (   $a_code)
static
See also
interface.ilMembershipRegistrationCodes
Returns
array obj ids

Implements ilMembershipRegistrationCodes.

Definition at line 1998 of file class.ilObjCourse.php.

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1999  {
2000  global $DIC;
2001 
2002  $ilDB = $DIC['ilDB'];
2003 
2004  $query = "SELECT obj_id FROM crs_settings " .
2005  "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
2006  "AND reg_ac = " . $ilDB->quote($a_code, 'text');
2007  $res = $ilDB->query($query);
2008 
2009  $obj_ids = array();
2010  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
2011  $obj_ids[] = $row->obj_id;
2012  }
2013  return $obj_ids;
2014  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ lookupShowMembersEnabled()

static ilObjCourse::lookupShowMembersEnabled (   $a_obj_id)
static

Check if show member is enabled.

Parameters
int$a_obj_id
Returns
bool

Definition at line 137 of file class.ilObjCourse.php.

References $GLOBALS, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilAwarenessUserProviderCurrentCourse\getInitialUserSet(), and ilParticipants\hasParticipantListAccess().

138  {
139  $query = 'SELECT show_members FROM crs_settings ' .
140  'WHERE obj_id = ' . $GLOBALS['DIC']['ilDB']->quote($a_obj_id, 'integer');
141  $res = $GLOBALS['DIC']['ilDB']->query($query);
142  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
143  return (bool) $row->show_members;
144  }
145  return false;
146  }
foreach($_POST as $key=> $value) $res
$query
$row
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the caller graph for this function:

◆ lookupTimingMode()

static ilObjCourse::lookupTimingMode (   $a_obj_id)
static
Parameters
$a_obj_id
Returns
int

Definition at line 588 of file class.ilObjCourse.php.

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

Referenced by ilCalendarScheduleFilterTimings\addCustomEvents(), ilCourseAppEventListener\initializeTimings(), ilObjectActivationGUI\initTimingMode(), and ilCalendarScheduleFilterTimings\modifyEvent().

589  {
590  global $DIC;
591 
592  $ilDB = $DIC['ilDB'];
593 
594  $query = 'SELECT timing_mode FROM crs_settings ' .
595  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
596  $res = $ilDB->query($query);
597 
598  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
599  return (int) $row->timing_mode;
600  }
602  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ mayLeave()

static ilObjCourse::mayLeave (   $a_course_id,
  $a_user_id = null,
$a_date = null 
)
static

Definition at line 2247 of file class.ilObjCourse.php.

References $DIC, $ilDB, $ilUser, $row, and IL_CAL_DATE.

Referenced by ilObjCourseAccess\_checkAccess().

2248  {
2249  global $DIC;
2250 
2251  $ilUser = $DIC['ilUser'];
2252  $ilDB = $DIC['ilDB'];
2253 
2254  if (!$a_user_id) {
2255  $a_user_id = $ilUser->getId();
2256  }
2257 
2258  $set = $ilDB->query("SELECT leave_end" .
2259  " FROM crs_settings" .
2260  " WHERE obj_id = " . $ilDB->quote($a_course_id, "integer"));
2261  $row = $ilDB->fetchAssoc($set);
2262  if ($row && $row["leave_end"]) {
2263  // timestamp to date
2264  $limit = date("Ymd", $row["leave_end"]);
2265  if ($limit < date("Ymd")) {
2266  $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
2267  return false;
2268  }
2269  }
2270  return true;
2271  }
global $DIC
Definition: saml.php:7
Class for single dates.
$ilUser
Definition: imgupload.php:18
$row
const IL_CAL_DATE
global $ilDB
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjCourse::MDUpdateListener (   $a_element)

Overwriten Metadata update listener for ECS functionalities.

public

Definition at line 1859 of file class.ilObjCourse.php.

References $DIC, and $ilLog.

1860  {
1861  global $DIC;
1862 
1863  $ilLog = $DIC['ilLog'];
1864 
1865  parent::MDUpdateListener($a_element);
1866 
1867  switch ($a_element) {
1868  case 'General':
1869  // Update ecs content
1870  include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
1871  $ecs = new ilECSCourseSettings($this);
1872  $ecs->handleContentUpdate();
1873  break;
1874 
1875  default:
1876  return true;
1877  }
1878  }
global $DIC
Definition: saml.php:7
Class ilECSCourseSettings.

◆ prepareAppointments()

ilObjCourse::prepareAppointments (   $a_mode = 'create')
protected

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

Definition at line 1897 of file class.ilObjCourse.php.

References getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), getCourseEnd(), getCourseStart(), ilObject\getLongDescription(), ilObject\getOfflineStatus(), ilObject\getRefId(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionStart(), ilObjectActivation\getTimingsItems(), ilObject\getTitle(), getViewMode(), IL_CAL_TRANSLATION_SYSTEM, IL_CAL_UNIX, IL_CRS_SUBSCRIPTION_LIMITED, ilCourseConstants\IL_CRS_VIEW_TIMING, and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by create(), delete(), and update().

1898  {
1899  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1900  include_once('./Services/Calendar/classes/class.ilDateTime.php');
1901 
1902  switch ($a_mode) {
1903  case 'create':
1904  case 'update':
1905  if (!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus()) {
1906  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1907  $app->setTitle($this->getTitle());
1908  $app->setSubtitle('crs_cal_activation_start');
1909  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1910  $app->setDescription($this->getLongDescription());
1911  $app->setStart(new ilDateTime($this->getActivationStart(), IL_CAL_UNIX));
1912  $apps[] = $app;
1913 
1914  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1915  $app->setTitle($this->getTitle());
1916  $app->setSubtitle('crs_cal_activation_end');
1917  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1918  $app->setDescription($this->getLongDescription());
1919  $app->setStart(new ilDateTime($this->getActivationEnd(), IL_CAL_UNIX));
1920  $apps[] = $app;
1921  }
1923  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1924  $app->setTitle($this->getTitle());
1925  $app->setSubtitle('crs_cal_reg_start');
1926  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1927  $app->setDescription($this->getLongDescription());
1928  $app->setStart(new ilDateTime($this->getSubscriptionStart(), IL_CAL_UNIX));
1929  $apps[] = $app;
1930 
1931  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1932  $app->setTitle($this->getTitle());
1933  $app->setSubtitle('crs_cal_reg_end');
1934  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1935  $app->setDescription($this->getLongDescription());
1936  $app->setStart(new ilDateTime($this->getSubscriptionEnd(), IL_CAL_UNIX));
1937  $apps[] = $app;
1938  }
1939  if ($this->getCourseStart() && $this->getCourseEnd()) {
1940  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_START);
1941  $app->setTitle($this->getTitle());
1942  $app->setSubtitle('crs_cal_start');
1943  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1944  $app->setDescription($this->getLongDescription());
1945  $app->setStart($this->getCourseStart());
1946  $app->setFullday(true);
1947  $apps[] = $app;
1948 
1949  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_END);
1950  $app->setTitle($this->getTitle());
1951  $app->setSubtitle('crs_cal_end');
1952  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1953  $app->setDescription($this->getLongDescription());
1954  $app->setStart($this->getCourseEnd());
1955  $app->setFullday(true);
1956  $apps[] = $app;
1957  }
1958  if (
1960  ) {
1961  $active = ilObjectActivation::getTimingsItems($this->getRefId());
1962  foreach ($active as $null => $item) {
1963  if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) {
1964  // create calendar entry for fixed types
1965  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_START);
1966  $app->setContextInfo($item['ref_id']);
1967  $app->setTitle($item['title']);
1968  $app->setSubtitle('cal_crs_timing_start');
1969  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1970  $app->setStart(new ilDate($item['suggestion_start'], IL_CAL_UNIX));
1971  $app->setFullday(true);
1972  $apps[] = $app;
1973 
1974  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_END);
1975  $app->setContextInfo($item['ref_id']);
1976  $app->setTitle($item['title']);
1977  $app->setSubtitle('cal_crs_timing_end');
1978  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1979  $app->setStart(new ilDate($item['suggestion_end'], IL_CAL_UNIX));
1980  $app->setFullday(true);
1981  $apps[] = $app;
1982  }
1983  }
1984  }
1985  return $apps ? $apps : array();
1986 
1987  case 'delete':
1988  // Nothing to do: The category and all assigned appointments will be deleted.
1989  return array();
1990  }
1991  }
const IL_CRS_SUBSCRIPTION_LIMITED
const IL_CAL_TRANSLATION_SYSTEM
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
getOfflineStatus()
Get offline status.
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
Class for single dates.
getTitle()
get object title public
Date and time handling
getActivationUnlimitedStatus()
get activation unlimited no start or no end
getLongDescription()
get object long description (stored in object_description)
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourse::read ( )

Definition at line 782 of file class.ilObjCourse.php.

References __readSettings(), ilContainerSortingSettings\_lookupSortMode(), ilObject\getId(), and ilContainer\setOrderType().

783  {
784  parent::read();
785 
786  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
788 
789  $this->__readSettings();
790  }
getId()
get object id public
setOrderType($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:

◆ register()

ilObjCourse::register (   $a_user_id,
  $a_role = ilCourseConstants::CRS_MEMBER,
  $a_force_registration = false 
)
See also
ilMembershipRegistrationCodes::register()
Parameters
intuser_id
introle
boolforce registration and do not check registration constraints.
Exceptions
ilMembershipRegistrationException

Definition at line 2023 of file class.ilObjCourse.php.

References $DIC, $ilCtrl, $info, ilContainer\$tree, ilCourseParticipants\_getInstanceByObjId(), ilObjCourseAccess\_isActivated(), ilObjCourseAccess\_isOffline(), ilObjCourseAccess\_usingRegistrationCode(), ilMembershipRegistrationException\ADDED_TO_WAITINGLIST, ilForumNotification\checkForumsExistsInsert(), enabledWaitingList(), ilObject\getId(), ilObject\getRefId(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), IL_CRS_SUBSCRIPTION_DEACTIVATED, IL_CRS_SUBSCRIPTION_LIMITED, inSubscriptionTime(), isSubscriptionMembershipLimited(), ilMembershipRegistrationException\OBJECT_IS_FULL, ilMembershipRegistrationException\OUT_OF_REGISTRATION_PERIOD, ilMembershipRegistrationException\REGISTRATION_CODE_DISABLED, ilMembershipRegistrationException\REGISTRATION_INVALID_AVAILABILITY, and ilMembershipRegistrationException\REGISTRATION_INVALID_OFFLINE.

2024  {
2025  global $DIC;
2026 
2027  $ilCtrl = $DIC['ilCtrl'];
2028  $tree = $DIC['tree'];
2029  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
2030  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
2032 
2033  if ($part->isAssigned($a_user_id)) {
2034  return true;
2035  }
2036 
2037  if (!$a_force_registration) {
2038  // offline
2039  if (ilObjCourseAccess::_isOffline($this->getId())) {
2041  "Can't register to course, course is offline.",
2043  );
2044  }
2045  // activation
2046  if (!ilObjCourseAccess::_isActivated($this->getId())) {
2048  "Can't register to course, course is not activated.",
2050  );
2051  }
2052 
2055  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
2056  ', course subscription is deactivated.', ilMembershipRegistrationException::REGISTRATION_CODE_DISABLED);
2057  }
2058  }
2059 
2060  // Time Limitation
2062  if (!$this->inSubscriptionTime()) {
2063  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
2064  ', course is out of registration time.', ilMembershipRegistrationException::OUT_OF_REGISTRATION_PERIOD);
2065  }
2066  }
2067 
2068  // Max members
2069  if ($this->isSubscriptionMembershipLimited()) {
2070  $free = max(0, $this->getSubscriptionMaxMembers() - $part->getCountMembers());
2071  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2072  $waiting_list = new ilCourseWaitingList($this->getId());
2073  if ($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers())) {
2074  $waiting_list->addToList($a_user_id);
2075  $this->lng->loadLanguageModule("crs");
2076  $info = sprintf(
2077  $this->lng->txt('crs_added_to_list'),
2078  $waiting_list->getPosition($a_user_id)
2079  );
2080  include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
2081  $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
2082  $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
2083 
2085  }
2086 
2087  if (!$this->enabledWaitingList() && !$free) {
2088  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
2089  ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
2090  }
2091  }
2092  }
2093 
2094  $part->add($a_user_id, $a_role);
2095  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2096  $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
2097 
2098 
2099  include_once './Modules/Forum/classes/class.ilForumNotification.php';
2101 
2102  return true;
2103  }
const IL_CRS_SUBSCRIPTION_LIMITED
global $DIC
Definition: saml.php:7
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _usingRegistrationCode()
Using Registration code.
global $ilCtrl
Definition: ilias.php:18
getId()
get object id public
static _isOffline($a_obj_id)
Type-specific implementation of general status.
isSubscriptionMembershipLimited()
is membership limited
getRefId()
get reference id public
static checkForumsExistsInsert($ref_id, $user_id=0)
$info
Definition: index.php:5
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:

◆ setAboStatus()

ilObjCourse::setAboStatus (   $a_status)

Definition at line 678 of file class.ilObjCourse.php.

Referenced by __readSettings().

679  {
680  $this->abo = $a_status;
681  }
+ Here is the caller graph for this function:

◆ setActivationEnd()

ilObjCourse::setActivationEnd (   $a_value)

Definition at line 273 of file class.ilObjCourse.php.

Referenced by __readSettings().

274  {
275  $this->activation_end = $a_value;
276  }
+ Here is the caller graph for this function:

◆ setActivationStart()

ilObjCourse::setActivationStart (   $a_value)

Definition at line 265 of file class.ilObjCourse.php.

Referenced by __readSettings().

266  {
267  $this->activation_start = $a_value;
268  }
+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjCourse::setActivationVisibility (   $a_value)

Definition at line 277 of file class.ilObjCourse.php.

Referenced by __readSettings().

278  {
279  $this->activation_visibility = (bool) $a_value;
280  }
+ Here is the caller graph for this function:

◆ setArchiveEnd()

ilObjCourse::setArchiveEnd (   $a_value)

Definition at line 666 of file class.ilObjCourse.php.

667  {
668  $this->archive_end = $a_value;
669  }

◆ setArchiveStart()

ilObjCourse::setArchiveStart (   $a_value)

Definition at line 658 of file class.ilObjCourse.php.

659  {
660  $this->archive_start = $a_value;
661  }

◆ setArchiveType()

ilObjCourse::setArchiveType (   $a_value)

Definition at line 674 of file class.ilObjCourse.php.

675  {
676  $this->archive_type = $a_value;
677  }

◆ setAutoNotification()

ilObjCourse::setAutoNotification (   $value)

Sets automatic notification status in $this->auto_notification, using given $status.

Parameters
mixedboolean

Definition at line 2123 of file class.ilObjCourse.php.

Referenced by __readSettings().

2124  {
2125  $this->auto_notification = $value;
2126  }
+ Here is the caller graph for this function:

◆ setCancellationEnd()

ilObjCourse::setCancellationEnd ( ilDate  $a_value = null)

Definition at line 922 of file class.ilObjCourse.php.

Referenced by __readSettings().

923  {
924  $this->leave_end = $a_value;
925  }
+ Here is the caller graph for this function:

◆ setContactConsultation()

ilObjCourse::setContactConsultation (   $a_value)

Definition at line 224 of file class.ilObjCourse.php.

Referenced by __readSettings().

225  {
226  $this->contact_consultation = $a_value;
227  }
+ Here is the caller graph for this function:

◆ setContactEmail()

ilObjCourse::setContactEmail (   $a_value)

Definition at line 240 of file class.ilObjCourse.php.

Referenced by __readSettings().

241  {
242  $this->contact_email = $a_value;
243  }
+ Here is the caller graph for this function:

◆ setContactName()

ilObjCourse::setContactName (   $a_cn)

Definition at line 216 of file class.ilObjCourse.php.

Referenced by __readSettings().

217  {
218  $this->contact_name = $a_cn;
219  }
+ Here is the caller graph for this function:

◆ setContactPhone()

ilObjCourse::setContactPhone (   $a_value)

Definition at line 232 of file class.ilObjCourse.php.

Referenced by __readSettings().

233  {
234  $this->contact_phone = $a_value;
235  }
+ Here is the caller graph for this function:

◆ setContactResponsibility()

ilObjCourse::setContactResponsibility (   $a_value)

Definition at line 248 of file class.ilObjCourse.php.

Referenced by __readSettings().

249  {
250  $this->contact_responsibility = $a_value;
251  }
+ Here is the caller graph for this function:

◆ setCourseEnd()

ilObjCourse::setCourseEnd ( ilDate  $a_value = null)

Definition at line 912 of file class.ilObjCourse.php.

Referenced by __readSettings().

913  {
914  $this->crs_end = $a_value;
915  }
+ Here is the caller graph for this function:

◆ setCourseStart()

ilObjCourse::setCourseStart ( ilDate  $a_value = null)

Definition at line 902 of file class.ilObjCourse.php.

Referenced by __readSettings().

903  {
904  $this->crs_start = $a_value;
905  }
+ Here is the caller graph for this function:

◆ setEnableCourseMap()

ilObjCourse::setEnableCourseMap (   $a_enablemap)

Set Enable Course Map.

Parameters
boolean$a_enablemapEnable Course Map

Definition at line 878 of file class.ilObjCourse.php.

Referenced by __readSettings().

879  {
880  $this->enablemap = $a_enablemap;
881  }
+ Here is the caller graph for this function:

◆ setImportantInformation()

ilObjCourse::setImportantInformation (   $a_info)

Definition at line 200 of file class.ilObjCourse.php.

Referenced by __readSettings().

201  {
202  $this->important = $a_info;
203  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjCourse::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

Definition at line 818 of file class.ilObjCourse.php.

Referenced by __readSettings().

819  {
820  $this->latitude = $a_latitude;
821  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

Definition at line 858 of file class.ilObjCourse.php.

Referenced by __readSettings().

859  {
860  $this->locationzoom = $a_locationzoom;
861  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

Definition at line 838 of file class.ilObjCourse.php.

Referenced by __readSettings().

839  {
840  $this->longitude = $a_longitude;
841  }
+ Here is the caller graph for this function:

◆ setMailToMembersType()

ilObjCourse::setMailToMembersType (   $a_type)

Set mail to members type.

See also
ilCourseConstants
Parameters
type$a_type

Definition at line 700 of file class.ilObjCourse.php.

References $a_type.

Referenced by __readSettings().

701  {
702  $this->mail_members = $a_type;
703  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ setMessage()

ilObjCourse::setMessage (   $a_message)

Definition at line 718 of file class.ilObjCourse.php.

Referenced by validate().

719  {
720  $this->message = $a_message;
721  }
+ Here is the caller graph for this function:

◆ setNumberOfNextSessions()

ilObjCourse::setNumberOfNextSessions (   $a_num)

Set number of previous sessions.

Returns
Parameters
int$a_num

Definition at line 408 of file class.ilObjCourse.php.

Referenced by __readSettings().

409  {
410  $this->session_next = $a_num;
411  }
+ Here is the caller graph for this function:

◆ setNumberOfPreviousSessions()

ilObjCourse::setNumberOfPreviousSessions (   $a_num)

Set number of previous sessions.

Returns
Parameters
int$a_num

Definition at line 389 of file class.ilObjCourse.php.

Referenced by __readSettings().

390  {
391  $this->session_prev = $a_num;
392  }
+ Here is the caller graph for this function:

◆ setParentRolePermissions()

ilObjCourse::setParentRolePermissions (   $a_parent_ref)

This method is called before "initDefaultRoles".

Therefore now local course roles are created.

Grants permissions on the course object for all parent roles. Each permission is granted by computing the intersection of the template il_crs_non_member and the permission template of the parent role.

Parameters
type$a_parent_ref

Definition at line 1636 of file class.ilObjCourse.php.

References $DIC, ilObject\$rbacadmin, ilObject\$rbacreview, __getCrsNonMemberTemplateId(), and ilObject\getRefId().

1637  {
1638  global $DIC;
1639 
1640  $rbacadmin = $DIC['rbacadmin'];
1641  $rbacreview = $DIC['rbacreview'];
1642 
1643  $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1644  foreach ((array) $parent_roles as $parent_role) {
1645  $rbacadmin->initIntersectionPermissions(
1646  $this->getRefId(),
1647  $parent_role['obj_id'],
1648  $parent_role['parent'],
1649  $this->__getCrsNonMemberTemplateId(),
1650  ROLE_FOLDER_ID
1651  );
1652  }
1653  }
global $DIC
Definition: saml.php:7
__getCrsNonMemberTemplateId()
get course non-member template private
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ setRegistrationAccessCode()

ilObjCourse::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

Definition at line 172 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), and __readSettings().

173  {
174  $this->reg_access_code = $a_code;
175  }
+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjCourse::setShowMembers (   $a_status)

Definition at line 686 of file class.ilObjCourse.php.

Referenced by __readSettings().

687  {
688  $this->show_members = $a_status;
689  }
+ Here is the caller graph for this function:

◆ setShowMembersExport()

ilObjCourse::setShowMembersExport (   $a_mem_export)

Definition at line 153 of file class.ilObjCourse.php.

Referenced by __readSettings().

154  {
155  $this->member_export = $a_mem_export;
156  }
+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

Definition at line 2133 of file class.ilObjCourse.php.

References ilObjUserTracking\_enabledLearningProgress().

Referenced by __construct(), and __readSettings().

2134  {
2135  $a_value = (int) $a_value;
2136 
2137  // #13905
2138  if ($a_value == self::STATUS_DETERMINATION_LP) {
2139  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2141  $a_value = self::STATUS_DETERMINATION_MANUAL;
2142  }
2143  }
2144 
2145  $this->status_dt = $a_value;
2146  }
static _enabledLearningProgress()
check wether learing progress is enabled or not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubscriptionEnd()

ilObjCourse::setSubscriptionEnd (   $a_value)

Definition at line 310 of file class.ilObjCourse.php.

Referenced by __readSettings().

311  {
312  $this->subscription_end = $a_value;
313  }
+ Here is the caller graph for this function:

◆ setSubscriptionLimitationType()

ilObjCourse::setSubscriptionLimitationType (   $a_type)

Definition at line 290 of file class.ilObjCourse.php.

References $a_type.

Referenced by __readSettings().

291  {
292  $this->subscription_limitation_type = $a_type;
293  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ setSubscriptionMaxMembers()

ilObjCourse::setSubscriptionMaxMembers (   $a_value)

Definition at line 437 of file class.ilObjCourse.php.

Referenced by __readSettings().

438  {
439  $this->subscription_max_members = $a_value;
440  }
+ Here is the caller graph for this function:

◆ setSubscriptionMinMembers()

ilObjCourse::setSubscriptionMinMembers (   $a_value)

Definition at line 932 of file class.ilObjCourse.php.

Referenced by __readSettings().

933  {
934  if ($a_value !== null) {
935  $a_value = (int) $a_value;
936  }
937  $this->min_members = $a_value;
938  }
+ Here is the caller graph for this function:

◆ setSubscriptionNotify()

ilObjCourse::setSubscriptionNotify (   $a_value)

Definition at line 570 of file class.ilObjCourse.php.

Referenced by __readSettings().

571  {
572  $this->subscription_notify = $a_value ? true : false;
573  }
+ Here is the caller graph for this function:

◆ setSubscriptionPassword()

ilObjCourse::setSubscriptionPassword (   $a_value)

Definition at line 327 of file class.ilObjCourse.php.

Referenced by __readSettings().

328  {
329  $this->subscription_password = $a_value;
330  }
+ Here is the caller graph for this function:

◆ setSubscriptionStart()

ilObjCourse::setSubscriptionStart (   $a_value)

Definition at line 302 of file class.ilObjCourse.php.

Referenced by __readSettings().

303  {
304  $this->subscription_start = $a_value;
305  }
+ Here is the caller graph for this function:

◆ setSubscriptionType()

ilObjCourse::setSubscriptionType (   $a_value)

Definition at line 319 of file class.ilObjCourse.php.

Referenced by __readSettings().

320  {
321  $this->subscription_type = $a_value;
322  }
+ Here is the caller graph for this function:

◆ setSyllabus()

ilObjCourse::setSyllabus (   $a_syllabus)

Definition at line 208 of file class.ilObjCourse.php.

Referenced by __readSettings().

209  {
210  $this->syllabus = $a_syllabus;
211  }
+ Here is the caller graph for this function:

◆ setTimingMode()

ilObjCourse::setTimingMode (   $a_mode)
Parameters
int$a_mode

Definition at line 607 of file class.ilObjCourse.php.

Referenced by __readSettings().

608  {
609  $this->timing_mode = $a_mode;
610  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjCourse::setViewMode (   $a_mode)

Definition at line 575 of file class.ilObjCourse.php.

Referenced by __readSettings().

576  {
577  $this->view_mode = $a_mode;
578  }
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjCourse::setWaitingListAutoFill (   $a_value)

Definition at line 945 of file class.ilObjCourse.php.

Referenced by __readSettings().

946  {
947  $this->auto_fill_from_waiting = (bool) $a_value;
948  }
+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

Definition at line 2161 of file class.ilObjCourse.php.

References ilLPStatusWrapper\_updateStatus(), ilObject\getId(), and getMembersObject().

2162  {
2163  include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
2164  foreach ($this->getMembersObject()->getParticipants() as $user_id) {
2165  // #15529 - force raise on sync
2166  ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, true);
2167  }
2168  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
getId()
get object id public
+ Here is the call graph for this function:

◆ update()

ilObjCourse::update ( )

update complete object

Definition at line 1230 of file class.ilObjCourse.php.

References $DIC, $ilLog, ilObject\getId(), getOrderType(), prepareAppointments(), League\Flysystem\Adapter\Polyfill\update(), ilObject\updateMetaData(), and updateSettings().

1231  {
1232  global $DIC;
1233 
1234  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1235  $ilLog = $DIC->logger()->crs();
1236 
1237  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1238  $sorting = new ilContainerSortingSettings($this->getId());
1239  $sorting->setSortMode($this->getOrderType());
1240  $sorting->update();
1241 
1242  $this->updateMetaData();
1243  $this->updateSettings();
1244  parent::update();
1245 
1246  $ilAppEventHandler->raise(
1247  'Modules/Course',
1248  'update',
1249  array('object' => $this,
1250  'obj_id' => $this->getId(),
1251  'appointments' => $this->prepareAppointments('update'))
1252  );
1253  }
global $DIC
Definition: saml.php:7
updateMetaData()
update meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

◆ updateSettings()

ilObjCourse::updateSettings ( )

Definition at line 1255 of file class.ilObjCourse.php.

References $DIC, $ilDB, $query, $res, __createDefaultSettings(), enabledWaitingList(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationVisibility(), getAutoNotification(), getCancellationEnd(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getCourseEnd(), getCourseStart(), getEnableCourseMap(), ilObject\getId(), getImportantInformation(), ilObjectActivation\getItem(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), ilObject\getOfflineStatus(), getRegistrationAccessCode(), getShowMembers(), getShowMembersExport(), getStatusDetermination(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionMinMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSyllabus(), getTimingMode(), getViewMode(), hasWaitingListAutoFill(), IL_CAL_UNIX, isRegistrationAccessCodeEnabled(), isSessionLimitEnabled(), isSubscriptionMembershipLimited(), ilObjectActivation\setTimingType(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by update().

1256  {
1257  global $DIC;
1258 
1259  $ilDB = $DIC['ilDB'];
1260 
1261  // Due to a bug 3.5.alpha maybe no settings exist. => create default settings
1262 
1263  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
1264  $res = $ilDB->query($query);
1265 
1266  if (!$res->numRows()) {
1267  $this->__createDefaultSettings();
1268  }
1269 
1270  $query = "UPDATE crs_settings SET " .
1271  "syllabus = " . $ilDB->quote($this->getSyllabus(), 'text') . ", " .
1272  "contact_name = " . $ilDB->quote($this->getContactName(), 'text') . ", " .
1273  "contact_responsibility = " . $ilDB->quote($this->getContactResponsibility(), 'text') . ", " .
1274  "contact_phone = " . $ilDB->quote($this->getContactPhone(), 'text') . ", " .
1275  "contact_email = " . $ilDB->quote($this->getContactEmail(), 'text') . ", " .
1276  "contact_consultation = " . $ilDB->quote($this->getContactConsultation(), 'text') . ", " .
1277  "activation_type = " . $ilDB->quote(!$this->getOfflineStatus(), 'integer') . ", " .
1278  "sub_limitation_type = " . $ilDB->quote($this->getSubscriptionLimitationType(), 'integer') . ", " .
1279  "sub_start = " . $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " .
1280  "sub_end = " . $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1281  "sub_type = " . $ilDB->quote($this->getSubscriptionType(), 'integer') . ", " .
1282  "sub_password = " . $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " .
1283  "sub_mem_limit = " . $ilDB->quote((int) $this->isSubscriptionMembershipLimited(), 'integer') . ", " .
1284  "sub_max_members = " . $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1285  "sub_notify = " . $ilDB->quote($this->getSubscriptionNotify(), 'integer') . ", " .
1286  "view_mode = " . $ilDB->quote($this->getViewMode(), 'integer') . ", " .
1287  'timing_mode = ' . $ilDB->quote($this->getTimingMode(), 'integer') . ', ' .
1288  "abo = " . $ilDB->quote($this->getAboStatus(), 'integer') . ", " .
1289  "waiting_list = " . $ilDB->quote($this->enabledWaitingList(), 'integer') . ", " .
1290  "important = " . $ilDB->quote($this->getImportantInformation(), 'text') . ", " .
1291  "show_members = " . $ilDB->quote($this->getShowMembers(), 'integer') . ", " .
1292  "show_members_export = " . $ilDB->quote($this->getShowMembersExport(), 'integer') . ", " .
1293  "latitude = " . $ilDB->quote($this->getLatitude(), 'text') . ", " .
1294  "longitude = " . $ilDB->quote($this->getLongitude(), 'text') . ", " .
1295  "location_zoom = " . $ilDB->quote($this->getLocationZoom(), 'integer') . ", " .
1296  "enable_course_map = " . $ilDB->quote((int) $this->getEnableCourseMap(), 'integer') . ", " .
1297  'session_limit = ' . $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1298  'session_prev = ' . $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1299  'session_next = ' . $ilDB->quote($this->getNumberOfNextSessions(), 'integer') . ', ' .
1300  'reg_ac_enabled = ' . $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1301  'reg_ac = ' . $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1302  'auto_notification = ' . $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1303  'status_dt = ' . $ilDB->quote((int) $this->getStatusDetermination()) . ', ' .
1304  'mail_members_type = ' . $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ', ' .
1305  'crs_start = ' . $ilDB->quote(($this->getCourseStart() && !$this->getCourseStart()->isNull()) ? $this->getCourseStart()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1306  'crs_end = ' . $ilDB->quote(($this->getCourseEnd() && !$this->getCourseEnd()->isNull()) ? $this->getCourseEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1307  'auto_wait = ' . $ilDB->quote((int) $this->hasWaitingListAutoFill(), 'integer') . ', ' .
1308  'leave_end = ' . $ilDB->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1309  'min_members = ' . $ilDB->quote((int) $this->getSubscriptionMinMembers(), 'integer') . ' ' .
1310  "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . "";
1311 
1312  $res = $ilDB->manipulate($query);
1313 
1314  // moved activation to ilObjectActivation
1315  if ($this->ref_id) {
1316  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1317  ilObjectActivation::getItem($this->ref_id);
1318 
1319  $item = new ilObjectActivation;
1320  if (!$this->getActivationStart() || !$this->getActivationEnd()) {
1322  } else {
1323  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1324  $item->setTimingStart($this->getActivationStart());
1325  $item->setTimingEnd($this->getActivationEnd());
1326  $item->toggleVisible($this->getActivationVisibility());
1327  }
1328 
1329  $item->update($this->ref_id);
1330  }
1331  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
global $DIC
Definition: saml.php:7
static getItem($a_ref_id)
Get item data.
getOfflineStatus()
Get offline status.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
getLocationZoom()
Get LocationZoom.
foreach($_POST as $key=> $value) $res
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
$query
getRegistrationAccessCode()
get access code
setTimingType($a_type)
Set timing type.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
getEnableCourseMap()
Get Enable Course Map.
Class ilObjectActivation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjCourse::validate ( )

Definition at line 1109 of file class.ilObjCourse.php.

References appendMessage(), enabledWaitingList(), getCourseEnd(), getCourseStart(), getMessage(), getStatusDetermination(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionMinMembers(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), ilObject\getTitle(), IL_CAL_UNIX, IL_CRS_SUBSCRIPTION_LIMITED, IL_CRS_SUBSCRIPTION_PASSWORD, isSubscriptionMembershipLimited(), and setMessage().

1110  {
1111  $this->setMessage('');
1112 
1114  $this->getSubscriptionStart() > $this->getSubscriptionEnd()) {
1115  $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
1116  }
1118  $this->appendMessage($this->lng->txt("crs_password_required"));
1119  }
1120  if ($this->isSubscriptionMembershipLimited()) {
1121  if ($this->getSubscriptionMinMembers() <= 0 && $this->getSubscriptionMaxMembers() <= 0) {
1122  $this->appendMessage($this->lng->txt("crs_max_and_min_members_needed"));
1123  }
1124  if ($this->getSubscriptionMaxMembers() <= 0 && $this->enabledWaitingList()) {
1125  $this->appendMessage($this->lng->txt("crs_max_members_needed"));
1126  }
1127  if ($this->getSubscriptionMaxMembers() > 0 && $this->getSubscriptionMinMembers() > $this->getSubscriptionMaxMembers()) {
1128  $this->appendMessage($this->lng->txt("crs_max_and_min_members_invalid"));
1129  }
1130  }
1131  if (!$this->getTitle() || !$this->getStatusDetermination()) {
1132  $this->appendMessage($this->lng->txt('err_check_input'));
1133  }
1134 
1135  // :TODO: checkInput() is not used properly
1136  if (($this->getCourseStart() && !$this->getCourseEnd()) ||
1137  (!$this->getCourseStart() && $this->getCourseEnd()) ||
1138  ($this->getCourseStart() && $this->getCourseEnd() && $this->getCourseStart()->get(IL_CAL_UNIX) > $this->getCourseEnd()->get(IL_CAL_UNIX))) {
1139  $this->appendMessage($this->lng->txt("crs_course_period_not_valid"));
1140  }
1141 
1142  return $this->getMessage() ? false : true;
1143  }
const IL_CRS_SUBSCRIPTION_LIMITED
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
const IL_CRS_SUBSCRIPTION_PASSWORD
getTitle()
get object title public
setMessage($a_message)
isSubscriptionMembershipLimited()
is membership limited
appendMessage($a_message)
+ Here is the call graph for this function:

◆ validateInfoSettings()

ilObjCourse::validateInfoSettings ( )

Definition at line 1145 of file class.ilObjCourse.php.

References $DIC, $email, ilContainer\$error, $ilErr, getContactEmail(), ilObjUser\getUserIdByLogin(), and ilUtil\is_email().

1146  {
1147  global $DIC;
1148 
1149  $ilErr = $DIC['ilErr'];
1150  $error = false;
1151  if ($this->getContactEmail()) {
1152  $emails = explode(",", $this->getContactEmail());
1153 
1154  foreach ($emails as $email) {
1155  $email = trim($email);
1156  if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email))) {
1157  $ilErr->appendMessage($this->lng->txt('contact_email_not_valid') . " '" . $email . "'");
1158  $error = true;
1159  }
1160  }
1161  }
1162  return !$error;
1163  }
static getUserIdByLogin($a_login)
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:201
global $DIC
Definition: saml.php:7
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
$ilErr
Definition: raiseError.php:18
+ Here is the call graph for this function:

Field Documentation

◆ $archives_obj

ilObjCourse::$archives_obj

Definition at line 58 of file class.ilObjCourse.php.

◆ $auto_fill_from_waiting

ilObjCourse::$auto_fill_from_waiting
protected

Definition at line 79 of file class.ilObjCourse.php.

Referenced by hasWaitingListAutoFill().

◆ $auto_notification

ilObjCourse::$auto_notification = true
private

Definition at line 96 of file class.ilObjCourse.php.

Referenced by getAutoNotification().

◆ $course_logger

ilObjCourse::$course_logger = null
protected

Definition at line 40 of file class.ilObjCourse.php.

◆ $crs_end

ilObjCourse::$crs_end
protected

Definition at line 76 of file class.ilObjCourse.php.

Referenced by getCourseEnd().

◆ $crs_start

ilObjCourse::$crs_start
protected

Definition at line 75 of file class.ilObjCourse.php.

Referenced by getCourseStart().

◆ $enablemap

ilObjCourse::$enablemap = 0
private

Definition at line 63 of file class.ilObjCourse.php.

Referenced by getEnableCourseMap().

◆ $latitude

ilObjCourse::$latitude = ''
private

Definition at line 60 of file class.ilObjCourse.php.

Referenced by getLatitude().

◆ $leave_end

ilObjCourse::$leave_end
protected

Definition at line 77 of file class.ilObjCourse.php.

Referenced by getCancellationEnd().

◆ $locationzoom

ilObjCourse::$locationzoom = 0
private

Definition at line 62 of file class.ilObjCourse.php.

Referenced by getLocationZoom().

◆ $longitude

ilObjCourse::$longitude = ''
private

Definition at line 61 of file class.ilObjCourse.php.

Referenced by getLongitude().

◆ $mail_members

ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

Definition at line 73 of file class.ilObjCourse.php.

Referenced by getMailToMembersType().

◆ $member_export

ilObjCourse::$member_export = false
protected

Definition at line 84 of file class.ilObjCourse.php.

Referenced by getShowMembersExport().

◆ $member_obj

ilObjCourse::$member_obj = null
private

Definition at line 56 of file class.ilObjCourse.php.

Referenced by getMemberObject().

◆ $members_obj

ilObjCourse::$members_obj = null
private

Definition at line 57 of file class.ilObjCourse.php.

Referenced by getMembersObject().

◆ $min_members

ilObjCourse::$min_members
protected

Definition at line 78 of file class.ilObjCourse.php.

Referenced by getSubscriptionMinMembers().

◆ $reg_access_code

ilObjCourse::$reg_access_code = ''
private

Definition at line 69 of file class.ilObjCourse.php.

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjCourse::$reg_access_code_enabled = false
private

Definition at line 70 of file class.ilObjCourse.php.

Referenced by isRegistrationAccessCodeEnabled().

◆ $session_limit

ilObjCourse::$session_limit = 0
private

Definition at line 65 of file class.ilObjCourse.php.

Referenced by isSessionLimitEnabled().

◆ $session_next

ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

ilObjCourse::$session_prev = -1
private

Definition at line 66 of file class.ilObjCourse.php.

Referenced by getNumberOfPreviousSessions().

◆ $status_dt

ilObjCourse::$status_dt = null
private

Definition at line 71 of file class.ilObjCourse.php.

Referenced by getStatusDetermination().

◆ $timing_mode

ilObjCourse::$timing_mode = ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE
private

Definition at line 89 of file class.ilObjCourse.php.

Referenced by getTimingMode().

◆ CAL_ACTIVATION_END

const ilObjCourse::CAL_ACTIVATION_END = 4

Definition at line 46 of file class.ilObjCourse.php.

◆ CAL_ACTIVATION_START

const ilObjCourse::CAL_ACTIVATION_START = 3

Definition at line 45 of file class.ilObjCourse.php.

◆ CAL_COURSE_END

const ilObjCourse::CAL_COURSE_END = 6

Definition at line 48 of file class.ilObjCourse.php.

◆ CAL_COURSE_START

const ilObjCourse::CAL_COURSE_START = 5

Definition at line 47 of file class.ilObjCourse.php.

◆ CAL_COURSE_TIMING_END

◆ CAL_COURSE_TIMING_START

◆ CAL_REG_END

const ilObjCourse::CAL_REG_END = 2

Definition at line 44 of file class.ilObjCourse.php.

◆ CAL_REG_START

const ilObjCourse::CAL_REG_START = 1

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

◆ STATUS_DETERMINATION_LP

◆ STATUS_DETERMINATION_MANUAL

const ilObjCourse::STATUS_DETERMINATION_MANUAL = 2

Definition at line 54 of file class.ilObjCourse.php.

Referenced by ilObjCourseGUI\initEditForm().


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