ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjCourse Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 getShowMembersExport ()
 
 setShowMembersExport (bool $a_mem_export)
 
 getRegistrationAccessCode ()
 
 setRegistrationAccessCode (string $a_code)
 
 isRegistrationAccessCodeEnabled ()
 
 enableRegistrationAccessCode (bool $a_status)
 
 getImportantInformation ()
 
 setImportantInformation (string $a_info)
 
 getSyllabus ()
 
 setSyllabus (string $a_syllabus)
 
 getTargetGroup ()
 
 setTargetGroup (?string $a_tg)
 
 getContactName ()
 
 setContactName (string $a_cn)
 
 getContactConsultation ()
 
 setContactConsultation (string $a_value)
 
 getContactPhone ()
 
 setContactPhone (string $a_value)
 
 getContactEmail ()
 
 setContactEmail (string $a_value)
 
 getContactResponsibility ()
 
 setContactResponsibility (string $a_value)
 
 getActivationUnlimitedStatus ()
 
 getActivationStart ()
 
 setActivationStart (int $a_value)
 
 getActivationEnd ()
 
 setActivationEnd (int $a_value)
 
 setActivationVisibility (bool $a_value)
 
 getActivationVisibility ()
 
 getSubscriptionLimitationType ()
 
 setSubscriptionLimitationType (int $a_type)
 
 getSubscriptionUnlimitedStatus ()
 
 getSubscriptionStart ()
 
 setSubscriptionStart (int $a_value)
 
 getSubscriptionEnd ()
 
 setSubscriptionEnd (int $a_value)
 
 getSubscriptionType ()
 
 setSubscriptionType (int $a_value)
 
 getSubscriptionPassword ()
 
 setSubscriptionPassword (string $a_value)
 
 enabledObjectiveView ()
 
 enabledWaitingList ()
 
 enableWaitingList (bool $a_status)
 
 inSubscriptionTime ()
 
 enableSessionLimit (int $a_status)
 
 isSessionLimitEnabled ()
 
 enableSubscriptionMembershipLimitation (bool $a_status)
 
 setNumberOfPreviousSessions (int $a_num)
 
 getNumberOfPreviousSessions ()
 
 setNumberOfNextSessions (int $a_num)
 
 getNumberOfNextSessions ()
 
 isSubscriptionMembershipLimited ()
 
 getSubscriptionMaxMembers ()
 
 setSubscriptionMaxMembers (int $a_value)
 
 getSubscriptionNotify ()
 
 setViewMode (int $a_mode)
 
 getViewMode ()
 
 setTimingMode (int $a_mode)
 
 getTimingMode ()
 
 setAboStatus (bool $a_status)
 
 getAboStatus ()
 
 setShowMembers (bool $a_status)
 
 getShowMembers ()
 
 setMailToMembersType (int $a_type)
 
 getMailToMembersType ()
 
 getMessage ()
 
 setMessage (string $a_message)
 
 appendMessage (string $a_message)
 
 isActivated ()
 
 read ()
 
 create ($a_upload=false)
 
 setLatitude (string $a_latitude)
 
 getLatitude ()
 
 setLongitude (string $a_longitude)
 
 getLongitude ()
 
 setLocationZoom (int $a_locationzoom)
 
 getLocationZoom ()
 
 setEnableCourseMap (bool $a_enablemap)
 
 getEnableMap ()
 
 getEnableCourseMap ()
 
 setCoursePeriod (?ilDateTime $start=null, ?ilDateTime $end=null)
 
 getCourseStartTimeIndication ()
 
 getCourseStart ()
 
 getCourseEnd ()
 
 setCancellationEnd (?ilDate $a_value=null)
 
 getCancellationEnd ()
 
 setSubscriptionMinMembers (int $a_value)
 
 getSubscriptionMinMembers ()
 
 setWaitingListAutoFill (bool $a_value)
 
 hasWaitingListAutoFill ()
 
 cloneObject (int $a_target_id, int $a_copy_id=0, bool $a_omit_tree=false)
 Clone course (no member data) More...
 
 cloneDependencies (int $a_target_id, int $a_copy_id)
 
 cloneAutoGeneratedRoles (ilObject $new_obj)
 Clone automatic genrated roles (permissions and template permissions) More...
 
 validate ()
 
 validateInfoSettings ()
 
 hasContactData ()
 
 delete ()
 delete course and all related data More...
 
 update ()
 
 updateSettings ()
 
 cloneSettings (ilObject $new_obj)
 
 __createDefaultSettings ()
 
 __readSettings ()
 
 initWaitingList ()
 
 getMemberObject ()
 
 getMembersObject ()
 
 initDefaultRoles ()
 
 setParentRolePermissions (int $a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 __getCrsNonMemberTemplateId ()
 
 getLocalCourseRoles ($a_translate=false)
 get ALL local roles of course, also those created and defined afterwards only fetch data once from database. More...
 
 getDefaultCourseRoles (string $a_crs_id="")
 get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member Returns the obj_ids of course specific roles in an associative array. More...
 
 __getLocalRoles ()
 
 __deleteSettings ()
 
 getDefaultMemberRole ()
 
 getDefaultTutorRole ()
 
 getDefaultAdminRole ()
 
 addAdditionalSubItemInformation (array &$object)
 
 register (int $a_user_id, int $a_role=ilCourseConstants::CRS_MEMBER, bool $a_force_registration=false)
 
 getAutoNotification ()
 Returns automatic notification status from $this->auto_notification. More...
 
 setAutoNotification (bool $value)
 Sets automatic notification status in $this->auto_notification, using given $status. More...
 
 setStatusDetermination (int $a_value)
 Set status determination mode. More...
 
 getStatusDetermination ()
 Get status determination mode. More...
 
 syncMembersStatusWithLP ()
 
 checkLPStatusSync (int $a_member_id)
 sync course status from lp as lp data is not deleted on course exit new members may already have lp completed More...
 
 getOrderType ()
 
 handleAutoFill ()
 Handle course auto fill. More...
 
- Public Member Functions inherited from ilContainer
 getTileSizes ()
 
 getObjectTranslation ()
 
 setObjectTranslation (?ilObjectTranslation $obj_trans)
 
 createContainerDirectory ()
 
 getContainerDirectory ()
 
 setHiddenFilesFound (bool $a_hiddenfilesfound)
 
 getHiddenFilesFound ()
 
 getStyleSheetId ()
 
 setStyleSheetId (int $a_style_id)
 
 setNewsTimeline (bool $a_val)
 
 getNewsTimeline ()
 
 setNewsTimelineAutoEntries (bool $a_val)
 
 getNewsTimelineAutoEntries ()
 
 setNewsTimelineLandingPage (bool $a_val)
 
 getNewsTimelineLandingPage ()
 
 isNewsTimelineEffective ()
 
 isNewsTimelineLandingPageEffective ()
 
 setNewsBlockActivated (bool $a_val)
 
 getNewsBlockActivated ()
 
 setUseNews (bool $a_val)
 
 getUseNews ()
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject (string $session_id, string $client_id, string $new_type, int $ref_id, int $clone_source, array $options, bool $soap_call=false, int $a_submode=1)
 
 delete ()
 delete category and all related data More...
 
 getViewMode ()
 
 getOrderType ()
 
 setOrderType (int $a_value)
 
 isClassificationFilterActive ()
 
 filteredSubtree ()
 Note grp/crs currently allow to filter in their whole subtrees Catetories only their direct childs. More...
 
 getSubItems (bool $a_admin_panel_enabled=false, bool $a_include_side_block=false, int $a_get_single=0, ilContainerUserFilter $container_user_filter=null)
 
 gotItems ()
 
 addAdditionalSubItemInformation (array &$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 
 enablePageEditing ()
 
 create ()
 
 putInTree (int $parent_ref_id)
 
 update ()
 
 read ()
 
 readContainerSettings ()
 
 removeTranslations ()
 
 deleteTranslation (string $a_lang)
 
 addTranslation (string $a_title, string $a_desc, string $a_lang, string $a_lang_default)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register (int $a_user_id)
 Register an user. More...
 

Static Public Member Functions

static lookupShowMembersEnabled (int $a_obj_id)
 
static _isSubscriptionNotificationEnabled (int $a_course_id)
 
static lookupTimingMode (int $a_obj_id)
 
static _lookupViewMode (int $a_id)
 
static _lookupAboStatus (int $a_id)
 
static _isActivated (int $a_obj_id)
 Is activated. More...
 
static _registrationEnabled (int $a_obj_id)
 Registration enabled? Method is in Access class, since it is needed by Access/ListGUI. More...
 
static lookupCourseNonMemberTemplatesId ()
 
static _deleteUser (int $a_usr_id)
 
static lookupObjectsByCode (string $a_code)
 
static mayLeave (int $a_course_id, int $a_user_id=0, &$a_date=null)
 
static findCoursesWithNotEnoughMembers ()
 
- Static Public Member Functions inherited from ilContainer
static _getContainerDirectory (int $a_id)
 
static _lookupContainerSetting (int $a_id, string $a_keyword, string $a_default_value=null)
 
static _hasContainerSetting (int $a_id, string $a_keyword)
 
static _writeContainerSetting (int $a_id, string $a_keyword, string $a_value)
 
static _getContainerSettings (int $a_id)
 
static _deleteContainerSettings (int $a_id, string $a_keyword="", bool $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, int $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 (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

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
 
- 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
 
const TILE_NORMAL = 0
 
const TILE_SMALL = 1
 
const TILE_LARGE = 2
 
const TILE_EXTRA_LARGE = 3
 
const TILE_FULL = 4
 
array $items = []
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Protected Member Functions

 toggleCourseStartTimeIndication (bool $time_indication)
 
 setCourseStart (?ilDateTime $a_value=null)
 
 setCourseEnd (?ilDateTime $a_value=null)
 
 initCourseMemberObject ()
 
 initCourseMembersObject ()
 
 doMDUpdateListener (string $a_element)
 
 prepareAppointments (string $a_mode='create')
 Prepare calendar appointments. More...
 
- Protected Member Functions inherited from ilContainer
 getInitialSubitems ()
 
 applyContainerUserFilter (array $objects, ilContainerUserFilter $container_user_filter=null)
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Private Attributes

string $contact_consultation = ''
 
string $contact_phone = ''
 
string $contact_email = ''
 
string $contact_name = ''
 
string $contact_responsibility = ''
 
int $subscription_limitation_type = 0
 
int $subscription_start = 0
 
int $subscription_end = 0
 
int $subscription_type = 0
 
string $subscription_password = ''
 
int $view_mode = 0
 
bool $waiting_list = false
 
bool $subscription_membership_limitation = false
 
int $subscription_max_members = 0
 
bool $abo = true
 
bool $show_members = true
 
string $message = ''
 
bool $course_start_time_indication = true
 
ilCourseWaitingList $waiting_list_obj = null
 
string $important = ''
 
string $syllabus = ''
 
ilLogger $course_logger
 
string $latitude = ''
 
string $longitude = ''
 
int $locationzoom = 0
 
bool $enablemap = false
 
int $session_limit = 0
 
int $session_prev = -1
 
int $session_next = -1
 
string $reg_access_code = ''
 
bool $reg_access_code_enabled = false
 
int $status_dt = 0
 
int $mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
 
bool $crs_start_time_indication = false
 
ilDateTime $crs_start = null
 
ilDateTime $crs_end = null
 
ilDate $leave_end = null
 
int $min_members = 0
 
bool $auto_fill_from_waiting = false
 
bool $member_export = false
 
int $timing_mode = ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE
 
bool $auto_notification = true
 
string $target_group = null
 
int $activation_start = 0
 
int $activation_end = 0
 
bool $activation_visibility = false
 
ilCourseParticipant $member_obj = null
 
ilCourseParticipants $members_obj = null
 
array $local_roles = []
 

Additional Inherited Members

- Static Public Attributes inherited from ilContainer
static bool $data_preloaded = false
 
- Protected Attributes inherited from ilContainer
News $news
 
ILIAS Style Content DomainService $content_style_domain
 
ILIAS Container InternalDomainService $domain
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
ilObjectDefinition $obj_definition
 
int $order_type = 0
 
bool $hiddenfilesfound = false
 
bool $news_timeline = false
 
bool $news_timeline_auto_entries = false
 
ilSetting $setting
 
ilObjectTranslation $obj_trans = null
 
int $style_id = 0
 
bool $news_timeline_landing_page = false
 
bool $news_block_activated = false
 
bool $use_news = false
 
ilRecommendedContentManager $recommended_content_manager
 
array $type_grps = null
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjCourse

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), and setStatusDetermination().

95  {
96  global $DIC;
97 
98  $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
99 
100  $this->type = "crs";
101  $this->course_logger = $DIC->logger()->crs();
102  parent::__construct($a_id, $a_call_by_reference);
103  }
setStatusDetermination(int $a_value)
Set status determination mode.
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ __createDefaultSettings()

ilObjCourse::__createDefaultSettings ( )

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

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

Referenced by create(), and updateSettings().

1087  : void
1088  {
1090 
1091  $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
1092  "contact_phone,contact_email,contact_consultation," .
1093  "sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
1094  "sub_max_members,sub_notify,view_mode,timing_mode,abo," .
1095  "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
1096  "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
1097  "VALUES( " .
1098  $this->db->quote($this->getId(), 'integer') . ", " .
1099  $this->db->quote($this->getSyllabus(), 'text') . ", " .
1100  $this->db->quote($this->getContactName(), 'text') . ", " .
1101  $this->db->quote($this->getContactResponsibility(), 'text') . ", " .
1102  $this->db->quote($this->getContactPhone(), 'text') . ", " .
1103  $this->db->quote($this->getContactEmail(), 'text') . ", " .
1104  $this->db->quote($this->getContactConsultation(), 'text') . ", " .
1105  $this->db->quote(ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED, 'integer') . ", " .
1106  $this->db->quote($this->getSubscriptionStart(), 'integer') . ", " .
1107  $this->db->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1108  $this->db->quote(ilCourseConstants::IL_CRS_SUBSCRIPTION_DIRECT, 'integer') . ", " .
1109  $this->db->quote($this->getSubscriptionPassword(), 'text') . ", " .
1110  "0, " .
1111  $this->db->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1112  "1, " .
1113  "0, " .
1114  $this->db->quote(ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE, 'integer') . ', ' .
1115  $this->db->quote($this->getAboStatus(), 'integer') . ", " .
1116  $this->db->quote($this->getLatitude(), 'text') . ", " .
1117  $this->db->quote($this->getLongitude(), 'text') . ", " .
1118  $this->db->quote($this->getLocationZoom(), 'integer') . ", " .
1119  $this->db->quote($this->getEnableCourseMap(), 'integer') . ", " .
1120  #"objective_view = '0', ".
1121  "1, " .
1122  "1," .
1123  '0,' .
1124  $this->db->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1125  $this->db->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1126  $this->db->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1127  $this->db->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1128  $this->db->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1129  $this->db->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1130  $this->db->quote($this->getStatusDetermination(), 'integer') . ', ' .
1131  $this->db->quote($this->getMailToMembersType(), 'integer') . ' ' .
1132  ")";
1133 
1134  $res = $this->db->manipulate($query);
1135  $this->__readSettings();
1136 
1137  $sorting = new ilContainerSortingSettings($this->getId());
1138  $sorting->setSortMode(ilContainer::SORT_MANUAL);
1139  $sorting->update();
1140  }
$res
Definition: ltiservices.php:69
getStatusDetermination()
Get status determination mode.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
static generateCode()
Generate new registration key.
setRegistrationAccessCode(string $a_code)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __deleteSettings()

ilObjCourse::__deleteSettings ( )

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

References ilObject\getId().

Referenced by delete().

1395  : void
1396  {
1397  $query = "DELETE FROM crs_settings " .
1398  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
1399  $this->db->manipulate($query);
1400  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getCrsNonMemberTemplateId()

ilObjCourse::__getCrsNonMemberTemplateId ( )

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

References $q, $res, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by setParentRolePermissions().

1295  : int
1296  {
1297  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1298  $res = $this->ilias->db->query($q);
1299  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
1300  return (int) $row["obj_id"];
1301  }
$res
Definition: ltiservices.php:69
header include for all ilias files.
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )
Returns
int[]

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

References ilObject\getRefId().

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

1390  : array
1391  {
1392  return $this->rbac_review->getRolesOfRoleFolder($this->getRefId(), false);
1393  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __readSettings()

ilObjCourse::__readSettings ( )

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

References $res, enableRegistrationAccessCode(), enableSessionLimit(), enableSubscriptionMembershipLimitation(), enableWaitingList(), ilDBConstants\FETCHMODE_OBJECT, ilObject\getId(), ilPrivacySettings\getInstance(), ilObjectActivation\getItem(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, setAboStatus(), setActivationEnd(), setActivationStart(), setActivationVisibility(), setAutoNotification(), setCancellationEnd(), setContactConsultation(), setContactEmail(), setContactName(), setContactPhone(), setContactResponsibility(), setCoursePeriod(), setEnableCourseMap(), setImportantInformation(), setLatitude(), setLocationZoom(), setLongitude(), setMailToMembersType(), setNumberOfNextSessions(), setNumberOfPreviousSessions(), setRegistrationAccessCode(), setShowMembers(), setShowMembersExport(), setStatusDetermination(), setSubscriptionEnd(), setSubscriptionLimitationType(), setSubscriptionMaxMembers(), setSubscriptionMinMembers(), setSubscriptionPassword(), setSubscriptionStart(), setSubscriptionType(), setSyllabus(), setTargetGroup(), setTimingMode(), setViewMode(), setWaitingListAutoFill(), ilObjectActivation\TIMINGS_ACTIVATION, toggleCourseStartTimeIndication(), and ilTimeZone\UTC.

Referenced by __createDefaultSettings(), and read().

1142  : void
1143  {
1144  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
1145  $res = $this->db->query($query);
1146  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1147  $this->setSyllabus((string) $row->syllabus);
1148  $this->setTargetGroup($row->target_group);
1149  $this->setContactName((string) $row->contact_name);
1150  $this->setContactResponsibility((string) $row->contact_responsibility);
1151  $this->setContactPhone((string) $row->contact_phone);
1152  $this->setContactEmail((string) $row->contact_email);
1153  $this->setContactConsultation((string) $row->contact_consultation);
1154  $this->setSubscriptionLimitationType((int) $row->sub_limitation_type);
1155  $this->setSubscriptionStart((int) $row->sub_start);
1156  $this->setSubscriptionEnd((int) $row->sub_end);
1157  $this->setSubscriptionType((int) $row->sub_type);
1158  $this->setSubscriptionPassword((string) $row->sub_password);
1159  $this->enableSubscriptionMembershipLimitation((bool) $row->sub_mem_limit);
1160  $this->setSubscriptionMaxMembers((int) $row->sub_max_members);
1161  $this->setViewMode((int) $row->view_mode);
1162  $this->setTimingMode((int) $row->timing_mode);
1163  $this->setAboStatus((bool) $row->abo);
1164  $this->enableWaitingList((bool) $row->waiting_list);
1165  $this->setImportantInformation((string) $row->important);
1166  $this->setShowMembers((bool) $row->show_members);
1167 
1168  if (\ilPrivacySettings::getInstance()->participantsListInCoursesEnabled()) {
1169  $this->setShowMembersExport((bool) $row->show_members_export);
1170  } else {
1171  $this->setShowMembersExport(false);
1172  }
1173  $this->setLatitude((string) $row->latitude);
1174  $this->setLongitude((string) $row->longitude);
1175  $this->setLocationZoom((int) $row->location_zoom);
1176  $this->setEnableCourseMap((bool) $row->enable_course_map);
1177  $this->enableSessionLimit((int) $row->session_limit);
1178  $this->setNumberOfPreviousSessions((int) $row->session_prev);
1179  $this->setNumberOfNextSessions((int) $row->session_next);
1180  $this->enableRegistrationAccessCode((bool) $row->reg_ac_enabled);
1181  $this->setRegistrationAccessCode((string) $row->reg_ac);
1182  $this->setAutoNotification((bool) $row->auto_notification);
1183  $this->setStatusDetermination((int) $row->status_dt);
1184  $this->setMailToMembersType((int) $row->mail_members_type);
1185 
1186  if ($row->period_time_indication) {
1187  $this->setCoursePeriod(
1188  new \ilDateTime($row->period_start, IL_CAL_DATETIME, \ilTimeZone::UTC),
1189  new \ilDateTime($row->period_end, IL_CAL_DATETIME, \ilTimeZone::UTC)
1190  );
1191  } elseif (!is_null($row->period_start) && !is_null($row->period_end)) {
1192  $this->setCoursePeriod(
1193  new \ilDate($row->period_start, IL_CAL_DATE),
1194  new \ilDate($row->period_end, IL_CAL_DATE)
1195  );
1196  }
1197  $this->toggleCourseStartTimeIndication((bool) $row->period_time_indication);
1198  $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
1199  $this->setWaitingListAutoFill((bool) $row->auto_wait);
1200  $this->setSubscriptionMinMembers((int) $row->min_members);
1201  }
1202 
1203  // moved activation to ilObjectActivation
1204  if ($this->ref_id ?? false) {
1205  $activation = ilObjectActivation::getItem($this->ref_id);
1206  switch ($activation["timing_type"]) {
1208  $this->setActivationStart((int) $activation["timing_start"]);
1209  $this->setActivationEnd((int) $activation["timing_end"]);
1210  $this->setActivationVisibility((bool) $activation["visible"]);
1211  break;
1212  }
1213  }
1214  }
$res
Definition: ltiservices.php:69
setSubscriptionLimitationType(int $a_type)
setSubscriptionStart(int $a_value)
setLongitude(string $a_longitude)
const IL_CAL_DATETIME
setActivationEnd(int $a_value)
setAboStatus(bool $a_status)
setActivationVisibility(bool $a_value)
setContactResponsibility(string $a_value)
setCoursePeriod(?ilDateTime $start=null, ?ilDateTime $end=null)
setNumberOfNextSessions(int $a_num)
enableRegistrationAccessCode(bool $a_status)
setNumberOfPreviousSessions(int $a_num)
setSubscriptionMinMembers(int $a_value)
setShowMembers(bool $a_status)
setViewMode(int $a_mode)
setTimingMode(int $a_mode)
setLocationZoom(int $a_locationzoom)
setActivationStart(int $a_value)
setStatusDetermination(int $a_value)
Set status determination mode.
const IL_CAL_UNIX
setCancellationEnd(?ilDate $a_value=null)
setEnableCourseMap(bool $a_enablemap)
setSubscriptionMaxMembers(int $a_value)
setSyllabus(string $a_syllabus)
setContactConsultation(string $a_value)
setSubscriptionType(int $a_value)
enableSessionLimit(int $a_status)
enableSubscriptionMembershipLimitation(bool $a_status)
setSubscriptionEnd(int $a_value)
setContactEmail(string $a_value)
setImportantInformation(string $a_info)
setMailToMembersType(int $a_type)
setWaitingListAutoFill(bool $a_value)
setSubscriptionPassword(string $a_value)
setTargetGroup(?string $a_tg)
setContactName(string $a_cn)
const IL_CAL_DATE
static getItem(int $ref_id)
enableWaitingList(bool $a_status)
toggleCourseStartTimeIndication(bool $time_indication)
setRegistrationAccessCode(string $a_code)
setShowMembersExport(bool $a_mem_export)
setContactPhone(string $a_value)
setLatitude(string $a_latitude)
setAutoNotification(bool $value)
Sets automatic notification status in $this->auto_notification, using given $status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteUser()

static ilObjCourse::_deleteUser ( int  $a_usr_id)
static

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

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

Referenced by ilObjUser\delete().

1440  : void
1441  {
1442  ilCourseLMHistory::_deleteUser($a_usr_id);
1445  }
static _deleteUser(int $a_usr_id)
Delete user data.
static deleteResultsForUser(int $a_user_id)
static _deleteUser(int $a_usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

static ilObjCourse::_isActivated ( int  $a_obj_id)
static

Is activated.

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

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

References ilObjCourseAccess\_isActivated().

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

539  : bool
540  {
541  return ilObjCourseAccess::_isActivated($a_obj_id);
542  }
static _isActivated(int $a_obj_id, ?bool &$a_visible_flag=null, bool $a_mind_member_view=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isSubscriptionNotificationEnabled()

static ilObjCourse::_isSubscriptionNotificationEnabled ( int  $a_course_id)
static

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

References $DIC, $ilDB, and $res.

392  : bool
393  {
394  global $DIC;
395 
396  $ilDB = $DIC->database();
397  $query = "SELECT * FROM crs_settings " .
398  "WHERE obj_id = " . $ilDB->quote($a_course_id, 'integer') . " " .
399  "AND sub_notify = 1";
400  $res = $ilDB->query($query);
401  return (bool) $res->numRows();
402  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _lookupAboStatus()

static ilObjCourse::_lookupAboStatus ( int  $a_id)
static

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

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

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

459  : bool
460  {
461  global $DIC;
462 
463  $ilDB = $DIC['ilDB'];
464 
465  $query = "SELECT abo FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
466  $res = $ilDB->query($query);
467  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
468  return $row->abo;
469  }
470  return false;
471  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupViewMode()

static ilObjCourse::_lookupViewMode ( int  $a_id)
static

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

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

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

445  : int
446  {
447  global $DIC;
448 
449  $ilDB = $DIC['ilDB'];
450 
451  $query = "SELECT view_mode FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
452  $res = $ilDB->query($query);
453  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
454  return $row->view_mode;
455  }
456  return false;
457  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _registrationEnabled()

static ilObjCourse::_registrationEnabled ( int  $a_obj_id)
static

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

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

References ilObjCourseAccess\_registrationEnabled().

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

547  : bool
548  {
549  return ilObjCourseAccess::_registrationEnabled($a_obj_id);
550  }
static _registrationEnabled(int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjCourse::addAdditionalSubItemInformation ( array &  $object)

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

References ilObjectActivation\addAdditionalSubItemInformation().

1458  : void
1459  {
1461  }
static addAdditionalSubItemInformation(array &$item)
Parse item data for list entries.
+ Here is the call graph for this function:

◆ appendMessage()

ilObjCourse::appendMessage ( string  $a_message)

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

References getMessage().

Referenced by validate().

513  : void
514  {
515  if ($this->getMessage()) {
516  $this->message .= "<br /> ";
517  }
518  $this->message .= $a_message;
519  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLPStatusSync()

ilObjCourse::checkLPStatusSync ( int  $a_member_id)

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

Definition at line 1724 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().

1724  : void
1725  {
1726  // #11113
1729  // #13811 - we need to suppress creation if status entry
1730  $has_completed = (ilLPStatus::_lookupStatus(
1731  $this->getId(),
1732  $a_member_id,
1733  false
1735  $this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
1736  }
1737  }
const LP_STATUS_COMPLETED_NUM
getStatusDetermination()
Get status determination mode.
const STATUS_DETERMINATION_LP
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjCourse::cloneAutoGeneratedRoles ( ilObject  $new_obj)

Clone automatic genrated roles (permissions and template permissions)

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

References getDefaultAdminRole(), getDefaultMemberRole(), getDefaultTutorRole(), and ilObject\getRefId().

Referenced by cloneObject().

797  : void
798  {
799  $admin = $this->getDefaultAdminRole();
800  $new_admin = $new_obj->getDefaultAdminRole();
801 
802  if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
803  $this->course_logger->debug('Error cloning auto generated role: il_crs_admin');
804  }
805  $this->rbac_admin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
806  $this->course_logger->debug('Finished copying of role crs_admin.');
807 
808  $tutor = $this->getDefaultTutorRole();
809  $new_tutor = $new_obj->getDefaultTutorRole();
810  if (!$tutor || !$new_tutor) {
811  $this->course_logger->info('Error cloning auto generated role: il_crs_tutor');
812  }
813  $this->rbac_admin->copyRolePermissions($tutor, $this->getRefId(), $new_obj->getRefId(), $new_tutor, true);
814  $this->course_logger->info('Finished copying of role crs_tutor.');
815 
816  $member = $this->getDefaultMemberRole();
817  $new_member = $new_obj->getDefaultMemberRole();
818  if (!$member || !$new_member) {
819  $this->course_logger->debug('Error cloning auto generated role: il_crs_member');
820  }
821  $this->rbac_admin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
822  $this->course_logger->debug('Finished copying of role crs_member.');
823  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjCourse::cloneDependencies ( int  $a_target_id,
int  $a_copy_id 
)

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

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

767  : bool
768  {
769  parent::cloneDependencies($a_target_id, $a_copy_id);
770 
771  // Clone course start objects
772  $start = new ilContainerStartObjects($this->getRefId(), $this->getId());
773  $start->cloneDependencies($a_target_id, $a_copy_id);
774 
775  // Clone course item settings
776  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
777 
778  // clone objective settings
779  ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
780 
781  // Clone course learning objectives
782  $crs_objective = new ilCourseObjective($this);
783  $crs_objective->ilClone($a_target_id, $a_copy_id);
784 
785  // clone membership limitation
786  foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
787  $this->course_logger->info('Handling grouping id: ' . $grouping_id);
788  $grouping = new \ilObjCourseGrouping($grouping_id);
789  $grouping->cloneGrouping($a_target_id, $a_copy_id);
790  }
791  return true;
792  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static cloneDependencies(int $ref_id, int $target_id, int $copy_id)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getGroupings(int $a_course_id)
static cloneSettings(int $a_copy_id, int $a_container_id, int $a_new_container_id)
+ Here is the call graph for this function:

◆ cloneObject()

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

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

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

References $DIC, ilCourseDefinedFieldDefinition\_clone(), ilCourseFile\_cloneFiles(), ilCopyWizardOptions\_getInstance(), CLIENT_WEB_DIR, cloneAutoGeneratedRoles(), ilObject\cloneMetaData(), cloneSettings(), ilObject\getId(), ilBadge\getInstancesByParentId(), ilParticipants\IL_CRS_ADMIN, ilObject\setOfflineStatus(), and ILIAS\Repository\user().

717  : ?ilObject
718  {
719  global $DIC;
720 
721  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
722 
723  $this->cloneAutoGeneratedRoles($new_obj);
724  $this->cloneMetaData($new_obj);
725 
726  $new_obj->getMemberObject()->add($this->user->getId(), ilParticipants::IL_CRS_ADMIN);
727  $new_obj->getMemberObject()->updateContact($this->user->getId(), 1);
728 
729  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
730  if ($cwo->isRootNode($this->getRefId())) {
731  $this->setOfflineStatus(true);
732  }
733 
734  $this->cloneSettings($new_obj);
735  ilCourseDefinedFieldDefinition::_clone($this->getId(), $new_obj->getId());
736  ilCourseFile::_cloneFiles($this->getId(), $new_obj->getId());
737  $obj_settings = new ilLPObjSettings($this->getId());
738  $obj_settings->cloneSettings($new_obj->getId());
739  unset($obj_settings);
740  $pathFactory = new ilCertificatePathFactory();
741  $templateRepository = new ilCertificateTemplateDatabaseRepository($this->db);
742 
743  $cloneAction = new ilCertificateCloneAction(
744  $this->db,
745  $pathFactory,
746  $templateRepository,
748  $DIC->filesystem()->web(),
750  );
751  $cloneAction->cloneCertificate($this, $new_obj);
752 
753  $book_service = new ilBookingService();
754  $book_service->cloneSettings($this->getId(), $new_obj->getId());
755 
756  $badges = ilBadge::getInstancesByParentId($this->getId());
757  foreach ($badges as $badge) {
758  $badge->clone($new_obj->getId());
759  }
760 
761  return $new_obj;
762  }
global $DIC
Definition: feed.php:28
cloneMetaData(ilObject $target_obj)
Copy meta data.
cloneSettings(ilObject $new_obj)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _clone(int $a_source_id, int $a_target_id)
static getInstancesByParentId(int $a_parent_id, array $a_filter=null)
const CLIENT_WEB_DIR
Definition: constants.php:47
setOfflineStatus(bool $status)
static _cloneFiles(int $a_source_id, int $a_target_id)
static _getInstance(int $a_copy_id)
cloneAutoGeneratedRoles(ilObject $new_obj)
Clone automatic genrated roles (permissions and template permissions)
+ Here is the call graph for this function:

◆ cloneSettings()

ilObjCourse::cloneSettings ( ilObject  $new_obj)

Definition at line 1032 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(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSyllabus(), getTargetGroup(), getTimingMode(), getViewMode(), hasWaitingListAutoFill(), isRegistrationAccessCodeEnabled(), isSessionLimitEnabled(), isSubscriptionMembershipLimited(), ilObject\setOfflineStatus(), and ilObject\update().

Referenced by cloneObject().

1032  : void
1033  {
1034  $new_obj->setSyllabus($this->getSyllabus());
1035  $new_obj->setContactName($this->getContactName());
1036  $new_obj->setContactResponsibility($this->getContactResponsibility());
1037  $new_obj->setContactPhone($this->getContactPhone());
1038  $new_obj->setContactEmail($this->getContactEmail());
1039  $new_obj->setContactConsultation($this->getContactConsultation());
1040  $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1041  $new_obj->setActivationStart($this->getActivationStart());
1042  $new_obj->setActivationEnd($this->getActivationEnd());
1043  $new_obj->setActivationVisibility($this->getActivationVisibility());
1044  $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1045  $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1046  $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1047  $new_obj->setSubscriptionType($this->getSubscriptionType());
1048  $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1049  $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1050  $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1051  $new_obj->setViewMode($this->getViewMode());
1052  $new_obj->setTimingMode($this->getTimingMode());
1053  $new_obj->setOrderType($this->getOrderType());
1054  $new_obj->setAboStatus($this->getAboStatus());
1055  $new_obj->enableWaitingList($this->enabledWaitingList());
1056  $new_obj->setImportantInformation($this->getImportantInformation());
1057  $new_obj->setTargetGroup($this->getTargetGroup());
1058  $new_obj->setShowMembers($this->getShowMembers());
1059  // patch mem_exp
1060  $new_obj->setShowMembersExport($this->getShowMembersExport());
1061  // patch mem_exp
1062  $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1063  $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1064  $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1065  $new_obj->setAutoNotification($this->getAutoNotification());
1066  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1067  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1068  $new_obj->setStatusDetermination($this->getStatusDetermination());
1069  $new_obj->setMailToMembersType($this->getMailToMembersType());
1070  $new_obj->setCoursePeriod(
1071  $this->getCourseStart(),
1072  $this->getCourseEnd()
1073  );
1074  $new_obj->setCancellationEnd($this->getCancellationEnd());
1075  $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
1076  $new_obj->setSubscriptionMinMembers($this->getSubscriptionMinMembers());
1077 
1078  // #10271
1079  $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1080  $new_obj->setLatitude($this->getLatitude());
1081  $new_obj->setLongitude($this->getLongitude());
1082  $new_obj->setLocationZoom($this->getLocationZoom());
1083 
1084  $new_obj->update();
1085  }
getStatusDetermination()
Get status determination mode.
setOfflineStatus(bool $status)
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
static generateCode()
Generate new registration key.
+ 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 559 of file class.ilObjCourse.php.

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

559  : int
560  {
561  global $DIC;
562 
563  $ilAppEventHandler = $DIC['ilAppEventHandler'];
564 
565  $id = parent::create($a_upload);
566 
567  if (!$a_upload) {
568  $this->createMetaData();
569  }
570  $this->__createDefaultSettings();
571  $this->app_event_handler->raise(
572  'Modules/Course',
573  'create',
574  array('object' => $this,
575  'obj_id' => $this->getId(),
576  'appointments' => $this->prepareAppointments('create')
577  )
578  );
579 
580  return $id;
581  }
prepareAppointments(string $a_mode='create')
Prepare calendar appointments.
global $DIC
Definition: feed.php:28
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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 887 of file class.ilObjCourse.php.

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

887  : bool
888  {
889  // always call parent delete function first!!
890  if (!parent::delete()) {
891  return false;
892  }
893 
894  // delete meta data
895  $this->deleteMetaData();
896 
897  // put here course specific stuff
898 
899  $this->__deleteSettings();
900 
902 
904 
906 
908 
910 
911  $this->app_event_handler->raise(
912  'Modules/Course',
913  'delete',
914  array('object' => $this,
915  'obj_id' => $this->getId(),
916  'appointments' => $this->prepareAppointments('delete')
917  )
918  );
919  return true;
920  }
prepareAppointments(string $a_mode='create')
Prepare calendar appointments.
static _deleteAll(int $course_id)
static _deleteByCourse(int $a_course_id)
static _deleteAll(int $a_course_id)
static _deleteAllEntries(int $a_obj_id)
Delete all entries Normally called in case of object deletion.
+ Here is the call graph for this function:

◆ doMDUpdateListener()

ilObjCourse::doMDUpdateListener ( string  $a_element)
protected

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

1447  : void
1448  {
1449  switch ($a_element) {
1450  case 'General':
1451  // Update ecs content
1452  $ecs = new ilECSCourseSettings($this);
1453  $ecs->handleContentUpdate();
1454  break;
1455  }
1456  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ enabledObjectiveView()

ilObjCourse::enabledObjectiveView ( )

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

References ilCourseConstants\IL_CRS_VIEW_OBJECTIVE.

Referenced by getOrderType().

316  : bool
317  {
318  return $this->view_mode == ilCourseConstants::IL_CRS_VIEW_OBJECTIVE;
319  }
+ Here is the caller graph for this function:

◆ enabledWaitingList()

ilObjCourse::enabledWaitingList ( )

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

References $waiting_list.

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

321  : bool
322  {
323  return $this->waiting_list;
324  }
+ Here is the caller graph for this function:

◆ enableRegistrationAccessCode()

ilObjCourse::enableRegistrationAccessCode ( bool  $a_status)

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

Referenced by __readSettings().

141  : void
142  {
143  $this->reg_access_code_enabled = $a_status;
144  }
+ Here is the caller graph for this function:

◆ enableSessionLimit()

ilObjCourse::enableSessionLimit ( int  $a_status)

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

Referenced by __readSettings().

342  : void
343  {
344  $this->session_limit = $a_status;
345  }
+ Here is the caller graph for this function:

◆ enableSubscriptionMembershipLimitation()

ilObjCourse::enableSubscriptionMembershipLimitation ( bool  $a_status)

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

Referenced by __readSettings().

352  : void
353  {
354  $this->subscription_membership_limitation = $a_status;
355  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjCourse::enableWaitingList ( bool  $a_status)

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

Referenced by __readSettings().

326  : void
327  {
328  $this->waiting_list = $a_status;
329  }
+ Here is the caller graph for this function:

◆ findCoursesWithNotEnoughMembers()

static ilObjCourse::findCoursesWithNotEnoughMembers ( )
static

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

References $GLOBALS, $ilDB, $res, ilObject\$tree, ilObject\_getAllReferences(), IL_CAL_DATETIME, IL_CAL_UNIX, ILIAS\Repository\int(), ilTree\isDeleted(), ilDBConstants\T_TEXT, and ilTimeZone\UTC.

Referenced by ilMembershipCronMinMembers\getCourses().

1820  : array
1821  {
1822  $ilDB = $GLOBALS['DIC']->database();
1823  $tree = $GLOBALS['DIC']->repositoryTree();
1824 
1825  $res = array();
1826 
1827  $before = new ilDateTime(time(), IL_CAL_UNIX);
1828  $now = $before->get(IL_CAL_UNIX);
1829  $now_dt = $before->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
1830 
1831  $set = $ilDB->query("SELECT obj_id, min_members" .
1832  " FROM crs_settings" .
1833  " WHERE min_members > " . $ilDB->quote(0, "integer") .
1834  " AND sub_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
1835  " AND ((leave_end IS NOT NULL" .
1836  " AND leave_end < " . $ilDB->quote($now, "text") . ")" .
1837  " OR (leave_end IS NULL" .
1838  " AND sub_end IS NOT NULL" .
1839  " AND sub_end < " . $ilDB->quote($now, "text") . "))" .
1840  " AND (period_start IS NULL OR period_start > " . $ilDB->quote($now_dt, ilDBConstants::T_TEXT) . ")");
1841  while ($row = $ilDB->fetchAssoc($set)) {
1842  $refs = ilObject::_getAllReferences((int) $row['obj_id']);
1843  $ref = end($refs);
1844 
1845  if ($tree->isDeleted($ref)) {
1846  continue;
1847  }
1848 
1849  $part = new ilCourseParticipants((int) $row["obj_id"]);
1850  $reci = $part->getNotificationRecipients();
1851  if ($reci !== []) {
1852  $missing = (int) $row["min_members"] - $part->getCountMembers();
1853  if ($missing > 0) {
1854  $res[(int) $row["obj_id"]] = array($missing, $reci);
1855  }
1856  }
1857  }
1858 
1859  return $res;
1860  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
static _getAllReferences(int $id)
get all reference ids for object ID
ilTree $tree
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
const IL_CAL_UNIX
$GLOBALS["DIC"]
Definition: wac.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAboStatus()

ilObjCourse::getAboStatus ( )

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

References $abo.

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

478  : bool
479  {
480  return $this->abo;
481  }
+ Here is the caller graph for this function:

◆ getActivationEnd()

ilObjCourse::getActivationEnd ( )

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

References $activation_end.

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

241  : int
242  {
243  return $this->activation_end;
244  }
+ Here is the caller graph for this function:

◆ getActivationStart()

ilObjCourse::getActivationStart ( )

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

References $activation_start.

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

231  : int
232  {
234  }
+ Here is the caller graph for this function:

◆ getActivationUnlimitedStatus()

ilObjCourse::getActivationUnlimitedStatus ( )

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

References getActivationEnd(), and getActivationStart().

Referenced by isActivated(), and prepareAppointments().

226  : bool
227  {
228  return !$this->getActivationStart() || !$this->getActivationEnd();
229  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjCourse::getActivationVisibility ( )

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

References $activation_visibility.

Referenced by cloneSettings(), and updateSettings().

256  : bool
257  {
259  }
bool $activation_visibility
+ Here is the caller graph for this function:

◆ getAutoNotification()

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

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

References $auto_notification.

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

1673  : bool
1674  {
1675  return $this->auto_notification;
1676  }
+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjCourse::getCancellationEnd ( )

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

References $leave_end.

Referenced by cloneSettings(), and updateSettings().

681  : ?ilDate
682  {
683  return $this->leave_end;
684  }
+ Here is the caller graph for this function:

◆ getContactConsultation()

ilObjCourse::getContactConsultation ( )

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

References $contact_consultation.

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

186  : string
187  {
189  }
string $contact_consultation
+ Here is the caller graph for this function:

◆ getContactEmail()

ilObjCourse::getContactEmail ( )

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

References $contact_email.

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

206  : string
207  {
208  return $this->contact_email;
209  }
+ Here is the caller graph for this function:

◆ getContactName()

ilObjCourse::getContactName ( )

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

References $contact_name.

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

176  : string
177  {
178  return $this->contact_name;
179  }
+ Here is the caller graph for this function:

◆ getContactPhone()

ilObjCourse::getContactPhone ( )

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

References $contact_phone.

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

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

◆ getContactResponsibility()

ilObjCourse::getContactResponsibility ( )

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

References $contact_responsibility.

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

216  : string
217  {
219  }
string $contact_responsibility
+ Here is the caller graph for this function:

◆ getCourseEnd()

ilObjCourse::getCourseEnd ( )

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

References $crs_end.

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

671  : ?ilDateTime
672  {
673  return $this->crs_end;
674  }
ilDateTime $crs_end
+ Here is the caller graph for this function:

◆ getCourseStart()

ilObjCourse::getCourseStart ( )

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

References $crs_start.

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

661  : ?ilDateTime
662  {
663  return $this->crs_start;
664  }
ilDateTime $crs_start
+ Here is the caller graph for this function:

◆ getCourseStartTimeIndication()

ilObjCourse::getCourseStartTimeIndication ( )

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

References $course_start_time_indication.

Referenced by prepareAppointments(), and updateSettings().

651  : bool
652  {
654  }
bool $course_start_time_indication
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjCourse::getDefaultAdminRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1427  : int
1428  {
1429  $local_roles = $this->__getLocalRoles();
1430  foreach ($local_roles as $role_id) {
1431  if ($tmp_role = ilObjectFactory::getInstanceByObjId($role_id, false)) {
1432  if (!strcmp($tmp_role->getTitle(), "il_crs_admin_" . $this->getRefId())) {
1433  return $role_id;
1434  }
1435  }
1436  }
1437  return 0;
1438  }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultCourseRoles()

ilObjCourse::getDefaultCourseRoles ( string  $a_crs_id = "")

get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member Returns the 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 1353 of file class.ilObjCourse.php.

References ilObject\getRefId().

1353  : array
1354  {
1355  if (strlen($a_crs_id) > 0) {
1356  $crs_id = $a_crs_id;
1357  } else {
1358  $crs_id = $this->getRefId();
1359  }
1360 
1361  $role_arr = $this->rbac_review->getRolesOfRoleFolder($crs_id);
1362 
1363  $arr_crsDefaultRoles = [];
1364  foreach ($role_arr as $role_id) {
1365  $role_Obj = &$this->ilias->obj_factory->getInstanceByObjId($role_id);
1366 
1367  $crs_Member = "il_crs_member_" . $crs_id;
1368  $crs_Admin = "il_crs_admin_" . $crs_id;
1369  $crs_Tutor = "il_crs_tutor_" . $crs_id;
1370 
1371  if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
1372  $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1373  }
1374 
1375  if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
1376  $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1377  }
1378 
1379  if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
1380  $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1381  }
1382  }
1383 
1384  return $arr_crsDefaultRoles;
1385  }
header include for all ilias files.
+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjCourse::getDefaultMemberRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1402  : int
1403  {
1404  $local_roles = $this->__getLocalRoles();
1405  foreach ($local_roles as $role_id) {
1406  $title = ilObject::_lookupTitle($role_id);
1407  if (substr($title, 0, 8) == 'il_crs_m') {
1408  return $role_id;
1409  }
1410  }
1411  return 0;
1412  }
string $title
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultTutorRole()

ilObjCourse::getDefaultTutorRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1414  : int
1415  {
1416  $local_roles = $this->__getLocalRoles();
1417  foreach ($local_roles as $role_id) {
1418  if ($tmp_role = ilObjectFactory::getInstanceByObjId($role_id, false)) {
1419  if (!strcmp($tmp_role->getTitle(), "il_crs_tutor_" . $this->getRefId())) {
1420  return $role_id;
1421  }
1422  }
1423  }
1424  return 0;
1425  }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableCourseMap()

ilObjCourse::getEnableCourseMap ( )

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

References $enablemap.

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

623  : bool
624  {
625  return $this->enablemap;
626  }
+ Here is the caller graph for this function:

◆ getEnableMap()

ilObjCourse::getEnableMap ( )

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

References getEnableCourseMap().

618  : bool
619  {
620  return $this->getEnableCourseMap();
621  }
+ Here is the call graph for this function:

◆ getImportantInformation()

ilObjCourse::getImportantInformation ( )

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

References $important.

Referenced by cloneSettings(), and updateSettings().

146  : string
147  {
148  return $this->important;
149  }
+ Here is the caller graph for this function:

◆ getLatitude()

ilObjCourse::getLatitude ( )

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

References $latitude.

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

588  : string
589  {
590  return $this->latitude;
591  }
+ 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
array [title|id] of roles...

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

References $local_roles, ilObjRole\_getTranslation(), ilObjectFactory\getInstanceByObjId(), and ilObject\getRefId().

1324  : array
1325  {
1326  if (empty($this->local_roles)) {
1327  $this->local_roles = array();
1328  $role_arr = $this->rbac_review->getRolesOfRoleFolder($this->getRefId());
1329 
1330  foreach ($role_arr as $role_id) {
1331  if ($this->rbac_review->isAssignable($role_id, $this->getRefId()) == true) {
1332  $role_Obj = ilObjectFactory::getInstanceByObjId($role_id);
1333  if ($a_translate) {
1334  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1335  } else {
1336  $role_name = $role_Obj->getTitle();
1337  }
1338  $this->local_roles[$role_name] = $role_Obj->getId();
1339  }
1340  }
1341  }
1342  return $this->local_roles;
1343  }
static _getTranslation(string $a_role_title)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ getLocationZoom()

ilObjCourse::getLocationZoom ( )

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

References $locationzoom.

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

608  : int
609  {
610  return $this->locationzoom;
611  }
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjCourse::getLongitude ( )

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

References $longitude.

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

598  : string
599  {
600  return $this->longitude;
601  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

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

References $mail_members.

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

498  : int
499  {
500  return $this->mail_members;
501  }
+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

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

References $member_obj, and initCourseMemberObject().

1234  {
1235  if (!$this->member_obj instanceof ilCourseParticipant) {
1236  $this->initCourseMemberObject();
1237  }
1238  return $this->member_obj;
1239  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilCourseParticipant $member_obj
+ Here is the call graph for this function:

◆ getMembersObject()

ilObjCourse::getMembersObject ( )

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

References $members_obj, and initCourseMembersObject().

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

1242  {
1243  if (!$this->members_obj instanceof ilCourseParticipants) {
1244  $this->initCourseMembersObject();
1245  }
1246  return $this->members_obj;
1247  }
ilCourseParticipants $members_obj
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjCourse::getMessage ( )

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

References $message.

Referenced by appendMessage(), and validate().

503  : string
504  {
505  return $this->message;
506  }
+ Here is the caller graph for this function:

◆ getNumberOfNextSessions()

ilObjCourse::getNumberOfNextSessions ( )

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

References $session_next.

Referenced by cloneSettings(), and updateSettings().

372  : int
373  {
374  return $this->session_next;
375  }
+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjCourse::getNumberOfPreviousSessions ( )

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

References $session_prev.

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

362  : int
363  {
364  return $this->session_prev;
365  }
+ Here is the caller graph for this function:

◆ getOrderType()

ilObjCourse::getOrderType ( )

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

References enabledObjectiveView(), and ilContainer\SORT_MANUAL.

Referenced by cloneSettings(), and update().

1739  : int
1740  {
1741  if ($this->enabledObjectiveView()) {
1742  return ilContainer::SORT_MANUAL;
1743  }
1744  return parent::getOrderType();
1745  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjCourse::getRegistrationAccessCode ( )

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

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

126  : string
127  {
128  return $this->reg_access_code;
129  }
string $reg_access_code
+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjCourse::getShowMembers ( )

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

References $show_members.

Referenced by cloneSettings(), and updateSettings().

488  : bool
489  {
490  return $this->show_members;
491  }
+ Here is the caller graph for this function:

◆ getShowMembersExport()

ilObjCourse::getShowMembersExport ( )

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

References $member_export.

Referenced by cloneSettings(), and updateSettings().

116  : bool
117  {
118  return $this->member_export;
119  }
+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

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

References $status_dt.

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

1707  : int
1708  {
1709  return $this->status_dt;
1710  }
+ Here is the caller graph for this function:

◆ getSubscriptionEnd()

ilObjCourse::getSubscriptionEnd ( )

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

References $subscription_end.

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

286  : int
287  {
289  }
+ Here is the caller graph for this function:

◆ getSubscriptionLimitationType()

ilObjCourse::getSubscriptionLimitationType ( )

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

References $subscription_limitation_type.

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

261  : int
262  {
264  }
int $subscription_limitation_type
+ Here is the caller graph for this function:

◆ getSubscriptionMaxMembers()

ilObjCourse::getSubscriptionMaxMembers ( )

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

References $subscription_max_members.

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

382  : int
383  {
385  }
int $subscription_max_members
+ Here is the caller graph for this function:

◆ getSubscriptionMinMembers()

ilObjCourse::getSubscriptionMinMembers ( )

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

References $min_members.

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

694  : int
695  {
696  return $this->min_members;
697  }
+ Here is the caller graph for this function:

◆ getSubscriptionNotify()

ilObjCourse::getSubscriptionNotify ( )

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

Referenced by updateSettings().

404  : bool
405  {
406  return true;
407  }
+ Here is the caller graph for this function:

◆ getSubscriptionPassword()

ilObjCourse::getSubscriptionPassword ( )

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

References $subscription_password.

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

306  : string
307  {
309  }
string $subscription_password
+ Here is the caller graph for this function:

◆ getSubscriptionStart()

ilObjCourse::getSubscriptionStart ( )

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

References $subscription_start.

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

276  : int
277  {
279  }
+ Here is the caller graph for this function:

◆ getSubscriptionType()

ilObjCourse::getSubscriptionType ( )

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

References ilCourseConstants\IL_CRS_SUBSCRIPTION_DIRECT.

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

296  : int
297  {
298  return $this->subscription_type ?: ilCourseConstants::IL_CRS_SUBSCRIPTION_DIRECT;
299  }
+ Here is the caller graph for this function:

◆ getSubscriptionUnlimitedStatus()

ilObjCourse::getSubscriptionUnlimitedStatus ( )

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

References ilCourseConstants\IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

271  : bool
272  {
273  return $this->subscription_limitation_type == ilCourseConstants::IL_CRS_SUBSCRIPTION_UNLIMITED;
274  }
+ Here is the caller graph for this function:

◆ getSyllabus()

ilObjCourse::getSyllabus ( )

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

References $syllabus.

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

156  : string
157  {
158  return $this->syllabus;
159  }
+ Here is the caller graph for this function:

◆ getTargetGroup()

ilObjCourse::getTargetGroup ( )

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

References $target_group.

Referenced by cloneSettings(), and updateSettings().

166  : ?string
167  {
168  return $this->target_group;
169  }
+ Here is the caller graph for this function:

◆ getTimingMode()

ilObjCourse::getTimingMode ( )

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

References $timing_mode.

Referenced by cloneSettings(), and updateSettings().

440  : int
441  {
442  return $this->timing_mode;
443  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilObjCourse::getViewMode ( )

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

References $view_mode.

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

414  : int
415  {
416  return $this->view_mode;
417  }
+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjCourse::handleAutoFill ( )

Handle course auto fill.

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

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

1750  : void
1751  {
1752  if (
1753  !$this->enabledWaitingList() || !$this->hasWaitingListAutoFill()
1754  ) {
1755  $this->course_logger->debug('Waiting list or auto fill disabled.');
1756  return;
1757  }
1758 
1759  $max = $this->getSubscriptionMaxMembers();
1761 
1762  $this->course_logger->debug('Max members: ' . $max);
1763  $this->course_logger->debug('Current members: ' . $now);
1764 
1765  if ($max <= $now) {
1766  return;
1767  }
1768 
1769  // see assignFromWaitingListObject()
1770  $waiting_list = new ilCourseWaitingList($this->getId());
1771 
1772  foreach ($waiting_list->getUserIds() as $user_id) {
1773  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1774  $this->course_logger->warning('Cannot create user instance for id: ' . $user_id);
1775  continue;
1776  }
1777  if ($this->getMembersObject()->isAssigned($user_id)) {
1778  $this->course_logger->warning('User is already assigned to course. uid: ' . $user_id . ' course_id: ' . $this->getRefId());
1779  continue;
1780  }
1781  $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1782  $this->getMembersObject()->sendNotification(ilCourseMembershipMailNotification::TYPE_ADMISSION_MEMBER, $user_id, true);
1783  $waiting_list->removeFromList($user_id);
1784  $this->checkLPStatusSync($user_id);
1785 
1786  $this->course_logger->info('Assigned user from waiting list to course: ' . $this->getTitle());
1787  $now++;
1788  if ($now >= $max) {
1789  break;
1790  }
1791  }
1792  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkLPStatusSync(int $a_member_id)
sync course status from lp as lp data is not deleted on course exit new members may already have lp c...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static lookupNumberOfMembers(int $a_ref_id)
Lookup number of members.
+ Here is the call graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

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

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

876  : bool
877  {
878  return strlen($this->getContactName()) || strlen($this->getContactResponsibility()) || strlen($this->getContactEmail()) || strlen($this->getContactPhone()) || strlen($this->getContactConsultation());
879  }
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjCourse::hasWaitingListAutoFill ( )

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

References $auto_fill_from_waiting.

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

704  : bool
705  {
707  }
bool $auto_fill_from_waiting
+ Here is the caller graph for this function:

◆ initCourseMemberObject()

ilObjCourse::initCourseMemberObject ( )
protected

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

References ilCourseParticipant\_getInstanceByObjId(), ilObject\getId(), and ILIAS\Repository\user().

Referenced by getMemberObject().

1223  : void
1224  {
1225  $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(), $this->user->getId());
1226  }
static _getInstanceByObjId(int $a_obj_id, int $a_usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCourseMembersObject()

ilObjCourse::initCourseMembersObject ( )
protected

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

References ilCourseParticipants\_getInstanceByObjId(), and ilObject\getId().

Referenced by getMembersObject().

1228  : void
1229  {
1230  $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1231  }
static _getInstanceByObjId(int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjCourse::initDefaultRoles ( )

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

References ilObjRole\createDefaultRole(), ilObject\getId(), and ilObject\getRefId().

1251  : void
1252  {
1254  'il_crs_admin_' . $this->getRefId(),
1255  "Admin of crs obj_no." . $this->getId(),
1256  'il_crs_admin',
1257  $this->getRefId()
1258  );
1260  'il_crs_tutor_' . $this->getRefId(),
1261  "Tutor of crs obj_no." . $this->getId(),
1262  'il_crs_tutor',
1263  $this->getRefId()
1264  );
1266  'il_crs_member_' . $this->getRefId(),
1267  "Member of crs obj_no." . $this->getId(),
1268  'il_crs_member',
1269  $this->getRefId()
1270  );
1271  }
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

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

References ilObject\getId().

1216  : void
1217  {
1218  if (!$this->waiting_list_obj instanceof ilCourseWaitingList) {
1219  $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1220  }
1221  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ inSubscriptionTime()

ilObjCourse::inSubscriptionTime ( )

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

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

Referenced by register().

331  : bool
332  {
333  if ($this->getSubscriptionUnlimitedStatus()) {
334  return true;
335  }
336  if (time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd()) {
337  return true;
338  }
339  return false;
340  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

ilObjCourse::isActivated ( )

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

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

521  : bool
522  {
523  if ($this->getOfflineStatus()) {
524  return false;
525  }
526  if ($this->getActivationUnlimitedStatus()) {
527  return true;
528  }
529  if (time() < $this->getActivationStart() or
530  time() > $this->getActivationEnd()) {
531  return false;
532  }
533  return true;
534  }
+ Here is the call graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjCourse::isRegistrationAccessCodeEnabled ( )

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

References $reg_access_code_enabled.

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

136  : bool
137  {
139  }
bool $reg_access_code_enabled
+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjCourse::isSessionLimitEnabled ( )

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

References $session_limit.

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

347  : bool
348  {
349  return (bool) $this->session_limit;
350  }
+ Here is the caller graph for this function:

◆ isSubscriptionMembershipLimited()

ilObjCourse::isSubscriptionMembershipLimited ( )

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

References $subscription_membership_limitation.

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

377  : bool
378  {
380  }
bool $subscription_membership_limitation
+ Here is the caller graph for this function:

◆ lookupCourseNonMemberTemplatesId()

static ilObjCourse::lookupCourseNonMemberTemplatesId ( )
static

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

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

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

1303  : int
1304  {
1305  global $DIC;
1306 
1307  $ilDB = $DIC->database();
1308 
1309  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote(
1310  'rolt',
1311  'text'
1312  ) . ' AND title = ' . $ilDB->quote('il_crs_non_member', 'text');
1313  $res = $ilDB->query($query);
1314  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
1315  return (int) $row['obj_id'];
1316  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

static ilObjCourse::lookupObjectsByCode ( string  $a_code)
static
See also
interface.ilMembershipRegistrationCodes
Returns
int[]

Implements ilMembershipRegistrationCodes.

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

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1565  : array
1566  {
1567  global $DIC;
1568 
1569  $ilDB = $DIC->database();
1570 
1571  $query = "SELECT obj_id FROM crs_settings " .
1572  "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
1573  "AND reg_ac = " . $ilDB->quote($a_code, 'text');
1574  $res = $ilDB->query($query);
1575 
1576  $obj_ids = array();
1577  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1578  $obj_ids[] = (int) $row->obj_id;
1579  }
1580  return $obj_ids;
1581  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupShowMembersEnabled()

static ilObjCourse::lookupShowMembersEnabled ( int  $a_obj_id)
static

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

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

Referenced by ILIAS\Awareness\User\ProviderCurrentCourse\getInitialUserSet(), and ilParticipants\hasParticipantListAccess().

105  : bool
106  {
107  $query = 'SELECT show_members FROM crs_settings ' .
108  'WHERE obj_id = ' . $GLOBALS['DIC']['ilDB']->quote($a_obj_id, 'integer');
109  $res = $GLOBALS['DIC']['ilDB']->query($query);
110  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
111  return (bool) $row->show_members;
112  }
113  return false;
114  }
$res
Definition: ltiservices.php:69
$GLOBALS["DIC"]
Definition: wac.php:31
+ Here is the caller graph for this function:

◆ lookupTimingMode()

static ilObjCourse::lookupTimingMode ( int  $a_obj_id)
static

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

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

Referenced by ilObjectActivation\addAdditionalSubItemInformation(), ilCalendarScheduleFilterTimings\addCustomEvents(), ilCourseAppEventListener\initializeTimings(), and ilCalendarScheduleFilterTimings\modifyEvent().

419  : int
420  {
421  global $DIC;
422 
423  $ilDB = $DIC['ilDB'];
424 
425  $query = 'SELECT timing_mode FROM crs_settings ' .
426  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
427  $res = $ilDB->query($query);
428 
429  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
430  return (int) $row->timing_mode;
431  }
433  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ mayLeave()

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

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

References $DIC, $ilDB, and IL_CAL_DATE.

Referenced by ilObjCourseAccess\_checkAccess().

1794  : bool
1795  {
1796  global $DIC;
1797 
1798  $ilUser = $DIC['ilUser'];
1799  $ilDB = $DIC['ilDB'];
1800 
1801  if (!$a_user_id) {
1802  $a_user_id = $ilUser->getId();
1803  }
1804 
1805  $set = $ilDB->query("SELECT leave_end" .
1806  " FROM crs_settings" .
1807  " WHERE obj_id = " . $ilDB->quote($a_course_id, "integer"));
1808  $row = $ilDB->fetchAssoc($set);
1809  if ($row && $row["leave_end"]) {
1810  // timestamp to date
1811  $limit = date("Ymd", $row["leave_end"]);
1812  if ($limit < date("Ymd")) {
1813  $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
1814  return false;
1815  }
1816  }
1817  return true;
1818  }
global $DIC
Definition: feed.php:28
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ prepareAppointments()

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

Prepare calendar appointments.

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

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

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

1466  : array
1467  {
1468  switch ($a_mode) {
1469  case 'create':
1470  case 'update':
1471  $apps = [];
1472  if (!$this->getActivationUnlimitedStatus() && !$this->getOfflineStatus()) {
1473  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1474  $app->setTitle($this->getTitle());
1475  $app->setSubtitle('crs_cal_activation_start');
1476  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1477  $app->setDescription($this->getLongDescription());
1478  $app->setStart(new ilDateTime($this->getActivationStart(), IL_CAL_UNIX));
1479  $apps[] = $app;
1480 
1481  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1482  $app->setTitle($this->getTitle());
1483  $app->setSubtitle('crs_cal_activation_end');
1484  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1485  $app->setDescription($this->getLongDescription());
1486  $app->setStart(new ilDateTime($this->getActivationEnd(), IL_CAL_UNIX));
1487  $apps[] = $app;
1488  }
1490  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1491  $app->setTitle($this->getTitle());
1492  $app->setSubtitle('crs_cal_reg_start');
1493  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1494  $app->setDescription($this->getLongDescription());
1495  $app->setStart(new ilDateTime($this->getSubscriptionStart(), IL_CAL_UNIX));
1496  $apps[] = $app;
1497 
1498  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1499  $app->setTitle($this->getTitle());
1500  $app->setSubtitle('crs_cal_reg_end');
1501  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1502  $app->setDescription($this->getLongDescription());
1503  $app->setStart(new ilDateTime($this->getSubscriptionEnd(), IL_CAL_UNIX));
1504  $apps[] = $app;
1505  }
1506  if ($this->getCourseStart() && $this->getCourseEnd()) {
1507  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_START);
1508  $app->setTitle($this->getTitle());
1509  $app->setSubtitle('crs_cal_start');
1510  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1511  $app->setDescription($this->getLongDescription());
1512  $app->setStart($this->getCourseStart());
1513  $app->setFullday(!$this->getCourseStartTimeIndication());
1514  $apps[] = $app;
1515 
1516  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_END);
1517  $app->setTitle($this->getTitle());
1518  $app->setSubtitle('crs_cal_end');
1519  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1520  $app->setDescription($this->getLongDescription());
1521  $app->setStart($this->getCourseEnd());
1522  $app->setFullday(!$this->getCourseStartTimeIndication());
1523  $apps[] = $app;
1524  }
1525  if (
1527  ) {
1528  $active = ilObjectActivation::getTimingsItems($this->getRefId());
1529  foreach ($active as $null => $item) {
1530  if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) {
1531  // create calendar entry for fixed types
1532  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_START);
1533  $app->setContextInfo($item['ref_id']);
1534  $app->setTitle($item['title']);
1535  $app->setSubtitle('cal_crs_timing_start');
1536  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1537  $app->setStart(new ilDate($item['suggestion_start'], IL_CAL_UNIX));
1538  $app->setFullday(true);
1539  $apps[] = $app;
1540 
1541  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_END);
1542  $app->setContextInfo($item['ref_id']);
1543  $app->setTitle($item['title']);
1544  $app->setSubtitle('cal_crs_timing_end');
1545  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1546  $app->setStart(new ilDate($item['suggestion_end'], IL_CAL_UNIX));
1547  $app->setFullday(true);
1548  $apps[] = $app;
1549  }
1550  }
1551  }
1552  return $apps;
1553 
1554  case 'delete':
1555  // Nothing to do: The category and all assigned appointments will be deleted.
1556  return array();
1557  }
1558  return [];
1559  }
$app
Definition: cli.php:39
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
static getTimingsItems(int $container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourse::read ( )

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

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

552  : void
553  {
554  parent::read();
556  $this->__readSettings();
557  }
setOrderType(int $a_value)
+ Here is the call graph for this function:

◆ register()

ilObjCourse::register ( int  $a_user_id,
int  $a_role = ilCourseConstants::CRS_MEMBER,
bool  $a_force_registration = false 
)
Exceptions
ilMembershipRegistrationException
See also
ilMembershipRegistrationCodes::register()

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

References ilCourseParticipants\_getInstanceByObjId(), ilObjCourseAccess\_isActivated(), ilObjCourseAccess\_isOffline(), ilObjCourseAccess\_usingRegistrationCode(), ilMembershipRegistrationException\ADDED_TO_WAITINGLIST, ilForumNotification\checkForumsExistsInsert(), enabledWaitingList(), ilObject\getId(), getMembersObject(), ilObject\getRefId(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), ilCourseConstants\IL_CRS_SUBSCRIPTION_DEACTIVATED, ilCourseConstants\IL_CRS_SUBSCRIPTION_LIMITED, inSubscriptionTime(), isSubscriptionMembershipLimited(), ILIAS\Repository\lng(), ilMembershipRegistrationException\OBJECT_IS_FULL, ilMembershipRegistrationException\OUT_OF_REGISTRATION_PERIOD, ilMembershipRegistrationException\REGISTRATION_CODE_DISABLED, ilMembershipRegistrationException\REGISTRATION_INVALID_AVAILABILITY, ilMembershipRegistrationException\REGISTRATION_INVALID_OFFLINE, ilCourseMembershipMailNotification\TYPE_ADMISSION_MEMBER, ilCourseMembershipMailNotification\TYPE_NOTIFICATION_ADMINS, and ilCourseMembershipMailNotification\TYPE_WAITING_LIST_MEMBER.

1591  : void {
1592  if ($this->getMembersObject()->isAssigned($a_user_id)) {
1593  return;
1594  }
1595 
1596  if (!$a_force_registration) {
1597  // offline
1598  if (ilObjCourseAccess::_isOffline($this->getId())) {
1600  "Can't register to course, course is offline.",
1602  );
1603  }
1604  // activation
1605  if (!ilObjCourseAccess::_isActivated($this->getId())) {
1607  "Can't register to course, course is not activated.",
1609  );
1610  }
1611 
1615  'Cant registrate to course ' . $this->getId() .
1616  ', course subscription is deactivated.',
1618  );
1619  }
1620  }
1621 
1622  // Time Limitation
1624  if (!$this->inSubscriptionTime()) {
1626  'Cant registrate to course ' . $this->getId() .
1627  ', course is out of registration time.',
1629  );
1630  }
1631  }
1632 
1633  // Max members
1634  if ($this->isSubscriptionMembershipLimited()) {
1635  $free = max(0, $this->getSubscriptionMaxMembers() - $this->getMembersObject()->getCountMembers());
1636  $waiting_list = new ilCourseWaitingList($this->getId());
1637  if ($this->enabledWaitingList() && (!$free || $waiting_list->getCountUsers())) {
1638  $waiting_list->addToList($a_user_id);
1639  $this->lng->loadLanguageModule("crs");
1640  $info = sprintf(
1641  $this->lng->txt('crs_added_to_list'),
1642  $waiting_list->getPosition($a_user_id)
1643  );
1644  $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
1645  $participants->sendNotification(
1647  $a_user_id
1648  );
1649 
1651  $info,
1653  );
1654  }
1655 
1656  if (!$this->enabledWaitingList() && !$free) {
1657  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
1658  ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
1659  }
1660  }
1661  }
1662 
1663  $this->getMembersObject()->add($a_user_id, $a_role);
1664  $this->getMembersObject()->sendNotification(ilCourseMembershipMailNotification::TYPE_ADMISSION_MEMBER, $a_user_id);
1667  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByObjId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _isOffline(int $obj_id)
static _isActivated(int $a_obj_id, ?bool &$a_visible_flag=null, bool $a_mind_member_view=true)
static checkForumsExistsInsert(int $ref_id, int $user_id)
+ Here is the call graph for this function:

◆ setAboStatus()

ilObjCourse::setAboStatus ( bool  $a_status)

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

Referenced by __readSettings().

473  : void
474  {
475  $this->abo = $a_status;
476  }
+ Here is the caller graph for this function:

◆ setActivationEnd()

ilObjCourse::setActivationEnd ( int  $a_value)

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

Referenced by __readSettings().

246  : void
247  {
248  $this->activation_end = $a_value;
249  }
+ Here is the caller graph for this function:

◆ setActivationStart()

ilObjCourse::setActivationStart ( int  $a_value)

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

Referenced by __readSettings().

236  : void
237  {
238  $this->activation_start = $a_value;
239  }
+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjCourse::setActivationVisibility ( bool  $a_value)

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

Referenced by __readSettings().

251  : void
252  {
253  $this->activation_visibility = $a_value;
254  }
+ Here is the caller graph for this function:

◆ setAutoNotification()

ilObjCourse::setAutoNotification ( bool  $value)

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

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

Referenced by __readSettings().

1682  : void
1683  {
1684  $this->auto_notification = $value;
1685  }
+ Here is the caller graph for this function:

◆ setCancellationEnd()

ilObjCourse::setCancellationEnd ( ?ilDate  $a_value = null)

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

Referenced by __readSettings().

676  : void
677  {
678  $this->leave_end = $a_value;
679  }
+ Here is the caller graph for this function:

◆ setContactConsultation()

ilObjCourse::setContactConsultation ( string  $a_value)

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

Referenced by __readSettings().

191  : void
192  {
193  $this->contact_consultation = $a_value;
194  }
+ Here is the caller graph for this function:

◆ setContactEmail()

ilObjCourse::setContactEmail ( string  $a_value)

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

Referenced by __readSettings().

211  : void
212  {
213  $this->contact_email = $a_value;
214  }
+ Here is the caller graph for this function:

◆ setContactName()

ilObjCourse::setContactName ( string  $a_cn)

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

Referenced by __readSettings().

181  : void
182  {
183  $this->contact_name = $a_cn;
184  }
+ Here is the caller graph for this function:

◆ setContactPhone()

ilObjCourse::setContactPhone ( string  $a_value)

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

Referenced by __readSettings().

201  : void
202  {
203  $this->contact_phone = $a_value;
204  }
+ Here is the caller graph for this function:

◆ setContactResponsibility()

ilObjCourse::setContactResponsibility ( string  $a_value)

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

Referenced by __readSettings().

221  : void
222  {
223  $this->contact_responsibility = $a_value;
224  }
+ Here is the caller graph for this function:

◆ setCourseEnd()

ilObjCourse::setCourseEnd ( ?ilDateTime  $a_value = null)
protected

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

Referenced by setCoursePeriod().

666  : void
667  {
668  $this->crs_end = $a_value;
669  }
+ Here is the caller graph for this function:

◆ setCoursePeriod()

ilObjCourse::setCoursePeriod ( ?ilDateTime  $start = null,
?ilDateTime  $end = null 
)

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

References setCourseEnd(), setCourseStart(), and toggleCourseStartTimeIndication().

Referenced by __readSettings().

628  : void
629  {
630  if (
631  ($start instanceof \ilDate && !$end instanceof ilDate) ||
632  ($end instanceof \ilDate && !$start instanceof ilDate)
633  ) {
634  throw new InvalidArgumentException('Different date types not supported.');
635  }
636 
637  if ($start instanceof \ilDate) {
638  $this->toggleCourseStartTimeIndication(false);
639  } else {
640  $this->toggleCourseStartTimeIndication(true);
641  }
642  $this->setCourseStart($start);
643  $this->setCourseEnd($end);
644  }
setCourseStart(?ilDateTime $a_value=null)
setCourseEnd(?ilDateTime $a_value=null)
toggleCourseStartTimeIndication(bool $time_indication)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCourseStart()

ilObjCourse::setCourseStart ( ?ilDateTime  $a_value = null)
protected

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

Referenced by setCoursePeriod().

656  : void
657  {
658  $this->crs_start = $a_value;
659  }
+ Here is the caller graph for this function:

◆ setEnableCourseMap()

ilObjCourse::setEnableCourseMap ( bool  $a_enablemap)

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

Referenced by __readSettings().

613  : void
614  {
615  $this->enablemap = $a_enablemap;
616  }
+ Here is the caller graph for this function:

◆ setImportantInformation()

ilObjCourse::setImportantInformation ( string  $a_info)

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

Referenced by __readSettings().

151  : void
152  {
153  $this->important = $a_info;
154  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjCourse::setLatitude ( string  $a_latitude)

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

Referenced by __readSettings().

583  : void
584  {
585  $this->latitude = $a_latitude;
586  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjCourse::setLocationZoom ( int  $a_locationzoom)

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

Referenced by __readSettings().

603  : void
604  {
605  $this->locationzoom = $a_locationzoom;
606  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjCourse::setLongitude ( string  $a_longitude)

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

Referenced by __readSettings().

593  : void
594  {
595  $this->longitude = $a_longitude;
596  }
+ Here is the caller graph for this function:

◆ setMailToMembersType()

ilObjCourse::setMailToMembersType ( int  $a_type)

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

Referenced by __readSettings().

493  : void
494  {
495  $this->mail_members = $a_type;
496  }
+ Here is the caller graph for this function:

◆ setMessage()

ilObjCourse::setMessage ( string  $a_message)

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

Referenced by validate().

508  : void
509  {
510  $this->message = $a_message;
511  }
+ Here is the caller graph for this function:

◆ setNumberOfNextSessions()

ilObjCourse::setNumberOfNextSessions ( int  $a_num)

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

Referenced by __readSettings().

367  : void
368  {
369  $this->session_next = $a_num;
370  }
+ Here is the caller graph for this function:

◆ setNumberOfPreviousSessions()

ilObjCourse::setNumberOfPreviousSessions ( int  $a_num)

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

Referenced by __readSettings().

357  : void
358  {
359  $this->session_prev = $a_num;
360  }
+ Here is the caller graph for this function:

◆ setParentRolePermissions()

ilObjCourse::setParentRolePermissions ( int  $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.

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

References __getCrsNonMemberTemplateId(), ilObject\getRefId(), and ROLE_FOLDER_ID.

1280  : bool
1281  {
1282  $parent_roles = $this->rbac_review->getParentRoleIds($a_parent_ref);
1283  foreach ($parent_roles as $parent_role) {
1284  $this->rbac_admin->initIntersectionPermissions(
1285  $this->getRefId(),
1286  $parent_role['obj_id'],
1287  $parent_role['parent'],
1288  $this->__getCrsNonMemberTemplateId(),
1290  );
1291  }
1292  return true;
1293  }
const ROLE_FOLDER_ID
Definition: constants.php:34
+ Here is the call graph for this function:

◆ setRegistrationAccessCode()

ilObjCourse::setRegistrationAccessCode ( string  $a_code)

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

Referenced by __createDefaultSettings(), and __readSettings().

131  : void
132  {
133  $this->reg_access_code = $a_code;
134  }
+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjCourse::setShowMembers ( bool  $a_status)

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

Referenced by __readSettings().

483  : void
484  {
485  $this->show_members = $a_status;
486  }
+ Here is the caller graph for this function:

◆ setShowMembersExport()

ilObjCourse::setShowMembersExport ( bool  $a_mem_export)

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

Referenced by __readSettings().

121  : void
122  {
123  $this->member_export = $a_mem_export;
124  }
+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination ( int  $a_value)

Set status determination mode.

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

References ilObjUserTracking\_enabledLearningProgress().

Referenced by __construct(), and __readSettings().

1690  : void
1691  {
1692  $a_value = $a_value;
1693 
1694  // #13905
1695  if ($a_value == self::STATUS_DETERMINATION_LP) {
1697  $a_value = self::STATUS_DETERMINATION_MANUAL;
1698  }
1699  }
1700 
1701  $this->status_dt = $a_value;
1702  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubscriptionEnd()

ilObjCourse::setSubscriptionEnd ( int  $a_value)

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

Referenced by __readSettings().

291  : void
292  {
293  $this->subscription_end = $a_value;
294  }
+ Here is the caller graph for this function:

◆ setSubscriptionLimitationType()

ilObjCourse::setSubscriptionLimitationType ( int  $a_type)

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

Referenced by __readSettings().

266  : void
267  {
268  $this->subscription_limitation_type = $a_type;
269  }
+ Here is the caller graph for this function:

◆ setSubscriptionMaxMembers()

ilObjCourse::setSubscriptionMaxMembers ( int  $a_value)

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

Referenced by __readSettings().

387  : void
388  {
389  $this->subscription_max_members = $a_value;
390  }
+ Here is the caller graph for this function:

◆ setSubscriptionMinMembers()

ilObjCourse::setSubscriptionMinMembers ( int  $a_value)

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

Referenced by __readSettings().

686  : void
687  {
688  if ($a_value !== null) {
689  $a_value = $a_value;
690  }
691  $this->min_members = $a_value;
692  }
+ Here is the caller graph for this function:

◆ setSubscriptionPassword()

ilObjCourse::setSubscriptionPassword ( string  $a_value)

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

Referenced by __readSettings().

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

◆ setSubscriptionStart()

ilObjCourse::setSubscriptionStart ( int  $a_value)

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

Referenced by __readSettings().

281  : void
282  {
283  $this->subscription_start = $a_value;
284  }
+ Here is the caller graph for this function:

◆ setSubscriptionType()

ilObjCourse::setSubscriptionType ( int  $a_value)

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

Referenced by __readSettings().

301  : void
302  {
303  $this->subscription_type = $a_value;
304  }
+ Here is the caller graph for this function:

◆ setSyllabus()

ilObjCourse::setSyllabus ( string  $a_syllabus)

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

Referenced by __readSettings().

161  : void
162  {
163  $this->syllabus = $a_syllabus;
164  }
+ Here is the caller graph for this function:

◆ setTargetGroup()

ilObjCourse::setTargetGroup ( ?string  $a_tg)

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

Referenced by __readSettings().

171  : void
172  {
173  $this->target_group = $a_tg;
174  }
+ Here is the caller graph for this function:

◆ setTimingMode()

ilObjCourse::setTimingMode ( int  $a_mode)

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

Referenced by __readSettings().

435  : void
436  {
437  $this->timing_mode = $a_mode;
438  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjCourse::setViewMode ( int  $a_mode)

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

Referenced by __readSettings().

409  : void
410  {
411  $this->view_mode = $a_mode;
412  }
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjCourse::setWaitingListAutoFill ( bool  $a_value)

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

Referenced by __readSettings().

699  : void
700  {
701  $this->auto_fill_from_waiting = $a_value;
702  }
+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

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

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

1712  : void
1713  {
1714  foreach ($this->getMembersObject()->getParticipants() as $user_id) {
1715  // #15529 - force raise on sync
1716  ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, true);
1717  }
1718  }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ Here is the call graph for this function:

◆ toggleCourseStartTimeIndication()

ilObjCourse::toggleCourseStartTimeIndication ( bool  $time_indication)
protected

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

Referenced by __readSettings(), and setCoursePeriod().

646  : void
647  {
648  $this->course_start_time_indication = $time_indication;
649  }
+ Here is the caller graph for this function:

◆ update()

ilObjCourse::update ( )

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

References ilObject\getId(), getOrderType(), prepareAppointments(), ilObject\updateMetaData(), and updateSettings().

925  : bool
926  {
927  $sorting = new ilContainerSortingSettings($this->getId());
928  $sorting->setSortMode($this->getOrderType());
929  $sorting->update();
930 
931  $this->updateMetaData();
932  $this->updateSettings();
933  parent::update();
934 
935  $this->app_event_handler->raise(
936  'Modules/Course',
937  'update',
938  array('object' => $this,
939  'obj_id' => $this->getId(),
940  'appointments' => $this->prepareAppointments('update')
941  )
942  );
943  return true;
944  }
prepareAppointments(string $a_mode='create')
Prepare calendar appointments.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ updateSettings()

ilObjCourse::updateSettings ( )

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

References $res, __createDefaultSettings(), ilCalendarUtil\convertDateToUtcDBTimestamp(), enabledWaitingList(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationVisibility(), getAutoNotification(), getCancellationEnd(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getCourseEnd(), getCourseStart(), getCourseStartTimeIndication(), 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(), getTargetGroup(), getTimingMode(), getViewMode(), hasWaitingListAutoFill(), IL_CAL_UNIX, isRegistrationAccessCodeEnabled(), isSessionLimitEnabled(), isSubscriptionMembershipLimited(), ilDBConstants\T_INTEGER, ilDBConstants\T_TEXT, ilDBConstants\T_TIMESTAMP, ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by update().

948  : void
949  {
950  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
951  $res = $this->db->query($query);
952 
953  if (!$res->numRows()) {
954  $this->__createDefaultSettings();
955  }
956 
957  $query = "UPDATE crs_settings SET " .
958  "syllabus = " . $this->db->quote($this->getSyllabus(), 'text') . ", " .
959  "contact_name = " . $this->db->quote($this->getContactName(), 'text') . ", " .
960  "contact_responsibility = " . $this->db->quote($this->getContactResponsibility(), 'text') . ", " .
961  "contact_phone = " . $this->db->quote($this->getContactPhone(), 'text') . ", " .
962  "contact_email = " . $this->db->quote($this->getContactEmail(), 'text') . ", " .
963  "contact_consultation = " . $this->db->quote($this->getContactConsultation(), 'text') . ", " .
964  "activation_type = " . $this->db->quote(!$this->getOfflineStatus(), 'integer') . ", " .
965  "sub_limitation_type = " . $this->db->quote($this->getSubscriptionLimitationType(), 'integer') . ", " .
966  "sub_start = " . $this->db->quote($this->getSubscriptionStart(), 'integer') . ", " .
967  "sub_end = " . $this->db->quote($this->getSubscriptionEnd(), 'integer') . ", " .
968  "sub_type = " . $this->db->quote($this->getSubscriptionType(), 'integer') . ", " .
969  "sub_password = " . $this->db->quote($this->getSubscriptionPassword(), 'text') . ", " .
970  "sub_mem_limit = " . $this->db->quote((int) $this->isSubscriptionMembershipLimited(), 'integer') . ", " .
971  "sub_max_members = " . $this->db->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
972  "sub_notify = " . $this->db->quote($this->getSubscriptionNotify(), 'integer') . ", " .
973  "view_mode = " . $this->db->quote($this->getViewMode(), 'integer') . ", " .
974  'timing_mode = ' . $this->db->quote($this->getTimingMode(), 'integer') . ', ' .
975  "abo = " . $this->db->quote($this->getAboStatus(), 'integer') . ", " .
976  "waiting_list = " . $this->db->quote($this->enabledWaitingList(), 'integer') . ", " .
977  "important = " . $this->db->quote($this->getImportantInformation(), 'text') . ", " .
978  'target_group = ' . $this->db->quote($this->getTargetGroup(), \ilDBConstants::T_TEXT) . ', ' .
979  "show_members = " . $this->db->quote($this->getShowMembers(), 'integer') . ", " .
980  "show_members_export = " . $this->db->quote($this->getShowMembersExport(), 'integer') . ", " .
981  "latitude = " . $this->db->quote($this->getLatitude(), 'text') . ", " .
982  "longitude = " . $this->db->quote($this->getLongitude(), 'text') . ", " .
983  "location_zoom = " . $this->db->quote($this->getLocationZoom(), 'integer') . ", " .
984  "enable_course_map = " . $this->db->quote((int) $this->getEnableCourseMap(), 'integer') . ", " .
985  'session_limit = ' . $this->db->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
986  'session_prev = ' . $this->db->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
987  'session_next = ' . $this->db->quote($this->getNumberOfNextSessions(), 'integer') . ', ' .
988  'reg_ac_enabled = ' . $this->db->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
989  'reg_ac = ' . $this->db->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
990  'auto_notification = ' . $this->db->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
991  'status_dt = ' . $this->db->quote($this->getStatusDetermination(), ilDBConstants::T_INTEGER) . ', ' .
992  'mail_members_type = ' . $this->db->quote($this->getMailToMembersType(), 'integer') . ', ' .
993  'period_start = ' . $this->db->quote(
996  ) . ', ' .
997  'period_end = ' . $this->db->quote(
1000  ) . ', ' .
1001  'period_time_indication = ' . $this->db->quote(
1002  $this->getCourseStartTimeIndication() ? 1 : 0,
1004  ) . ', ' .
1005  'auto_wait = ' . $this->db->quote((int) $this->hasWaitingListAutoFill(), 'integer') . ', ' .
1006  'leave_end = ' . $this->db->quote(
1007  ($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null,
1008  'integer'
1009  ) . ', ' .
1010  'min_members = ' . $this->db->quote($this->getSubscriptionMinMembers(), 'integer') . ' ' .
1011  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . "";
1012 
1013  $res = $this->db->manipulate($query);
1014 
1015  // moved activation to ilObjectActivation
1016  if ($this->ref_id ?? false) {
1017  ilObjectActivation::getItem($this->ref_id);
1018 
1019  $item = new ilObjectActivation();
1020  if (!$this->getActivationStart() || !$this->getActivationEnd()) {
1021  $item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);
1022  } else {
1023  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1024  $item->setTimingStart($this->getActivationStart());
1025  $item->setTimingEnd($this->getActivationEnd());
1026  $item->toggleVisible($this->getActivationVisibility());
1027  }
1028  $item->update($this->ref_id);
1029  }
1030  }
$res
Definition: ltiservices.php:69
static convertDateToUtcDBTimestamp(\ilDateTime $date=null)
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
static getItem(int $ref_id)
Class ilObjectActivation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjCourse::validate ( )

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

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

825  : bool
826  {
827  $this->setMessage('');
828 
830  $this->getSubscriptionStart() > $this->getSubscriptionEnd()) {
831  $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
832  }
834  $this->appendMessage($this->lng->txt("crs_password_required"));
835  }
836  if ($this->isSubscriptionMembershipLimited()) {
837  if ($this->getSubscriptionMinMembers() <= 0 && $this->getSubscriptionMaxMembers() <= 0) {
838  $this->appendMessage($this->lng->txt("crs_max_and_min_members_needed"));
839  }
840  if ($this->getSubscriptionMaxMembers() <= 0 && $this->enabledWaitingList()) {
841  $this->appendMessage($this->lng->txt("crs_max_members_needed"));
842  }
843  if ($this->getSubscriptionMaxMembers() > 0 && $this->getSubscriptionMinMembers() > $this->getSubscriptionMaxMembers()) {
844  $this->appendMessage($this->lng->txt("crs_max_and_min_members_invalid"));
845  }
846  }
847  if (!$this->getTitle() || !$this->getStatusDetermination()) {
848  $this->appendMessage($this->lng->txt('err_check_input'));
849  }
850  if (($this->getCourseStart() && !$this->getCourseEnd()) ||
851  (!$this->getCourseStart() && $this->getCourseEnd()) ||
852  ($this->getCourseStart() && $this->getCourseEnd() && $this->getCourseStart()->get(IL_CAL_UNIX) > $this->getCourseEnd()->get(IL_CAL_UNIX))) {
853  $this->appendMessage($this->lng->txt("crs_course_period_not_valid"));
854  }
855 
856  return strlen($this->getMessage()) > 0;
857  }
appendMessage(string $a_message)
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
setMessage(string $a_message)
+ Here is the call graph for this function:

◆ validateInfoSettings()

ilObjCourse::validateInfoSettings ( )

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

References ilObject\$error, getContactEmail(), ilObjUser\getUserIdByLogin(), ilUtil\is_email(), and ILIAS\Repository\lng().

859  : bool
860  {
861  $error = false;
862  if ($this->getContactEmail()) {
863  $emails = explode(",", $this->getContactEmail());
864 
865  foreach ($emails as $email) {
866  $email = trim($email);
867  if (!ilUtil::is_email($email) && !ilObjUser::getUserIdByLogin($email)) {
868  $this->error->appendMessage($this->lng->txt('contact_email_not_valid') . " '" . $email . "'");
869  $error = true;
870  }
871  }
872  }
873  return !$error;
874  }
static is_email(string $a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
static getUserIdByLogin(string $a_login)
ilErrorHandling $error
+ Here is the call graph for this function:

Field Documentation

◆ $abo

bool ilObjCourse::$abo = true
private

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

Referenced by getAboStatus().

◆ $activation_end

int ilObjCourse::$activation_end = 0
private

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

Referenced by getActivationEnd().

◆ $activation_start

int ilObjCourse::$activation_start = 0
private

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

Referenced by getActivationStart().

◆ $activation_visibility

bool ilObjCourse::$activation_visibility = false
private

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

Referenced by getActivationVisibility().

◆ $auto_fill_from_waiting

bool ilObjCourse::$auto_fill_from_waiting = false
private

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

Referenced by hasWaitingListAutoFill().

◆ $auto_notification

bool ilObjCourse::$auto_notification = true
private

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

Referenced by getAutoNotification().

◆ $contact_consultation

string ilObjCourse::$contact_consultation = ''
private

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

Referenced by getContactConsultation().

◆ $contact_email

string ilObjCourse::$contact_email = ''
private

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

Referenced by getContactEmail().

◆ $contact_name

string ilObjCourse::$contact_name = ''
private

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

Referenced by getContactName().

◆ $contact_phone

string ilObjCourse::$contact_phone = ''
private

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

Referenced by getContactPhone().

◆ $contact_responsibility

string ilObjCourse::$contact_responsibility = ''
private

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

Referenced by getContactResponsibility().

◆ $course_logger

ilLogger ilObjCourse::$course_logger
private

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

◆ $course_start_time_indication

bool ilObjCourse::$course_start_time_indication = true
private

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

Referenced by getCourseStartTimeIndication().

◆ $crs_end

ilDateTime ilObjCourse::$crs_end = null
private

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

Referenced by getCourseEnd().

◆ $crs_start

ilDateTime ilObjCourse::$crs_start = null
private

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

Referenced by getCourseStart().

◆ $crs_start_time_indication

bool ilObjCourse::$crs_start_time_indication = false
private

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

◆ $enablemap

bool ilObjCourse::$enablemap = false
private

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

Referenced by getEnableCourseMap().

◆ $important

string ilObjCourse::$important = ''
private

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

Referenced by getImportantInformation().

◆ $latitude

string ilObjCourse::$latitude = ''
private

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

Referenced by getLatitude().

◆ $leave_end

ilDate ilObjCourse::$leave_end = null
private

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

Referenced by getCancellationEnd().

◆ $local_roles

array ilObjCourse::$local_roles = []
private

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

Referenced by getLocalCourseRoles().

◆ $locationzoom

int ilObjCourse::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $longitude

string ilObjCourse::$longitude = ''
private

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

Referenced by getLongitude().

◆ $mail_members

int ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $member_export

bool ilObjCourse::$member_export = false
private

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

Referenced by getShowMembersExport().

◆ $member_obj

ilCourseParticipant ilObjCourse::$member_obj = null
private

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

Referenced by getMemberObject().

◆ $members_obj

ilCourseParticipants ilObjCourse::$members_obj = null
private

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

Referenced by getMembersObject().

◆ $message

string ilObjCourse::$message = ''
private

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

Referenced by getMessage().

◆ $min_members

int ilObjCourse::$min_members = 0
private

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

Referenced by getSubscriptionMinMembers().

◆ $reg_access_code

string ilObjCourse::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

bool ilObjCourse::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $session_limit

int ilObjCourse::$session_limit = 0
private

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

Referenced by isSessionLimitEnabled().

◆ $session_next

int ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

int ilObjCourse::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

◆ $show_members

bool ilObjCourse::$show_members = true
private

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

Referenced by getShowMembers().

◆ $status_dt

int ilObjCourse::$status_dt = 0
private

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

Referenced by getStatusDetermination().

◆ $subscription_end

int ilObjCourse::$subscription_end = 0
private

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

Referenced by getSubscriptionEnd().

◆ $subscription_limitation_type

int ilObjCourse::$subscription_limitation_type = 0
private

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

Referenced by getSubscriptionLimitationType().

◆ $subscription_max_members

int ilObjCourse::$subscription_max_members = 0
private

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

Referenced by getSubscriptionMaxMembers().

◆ $subscription_membership_limitation

bool ilObjCourse::$subscription_membership_limitation = false
private

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

Referenced by isSubscriptionMembershipLimited().

◆ $subscription_password

string ilObjCourse::$subscription_password = ''
private

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

Referenced by getSubscriptionPassword().

◆ $subscription_start

int ilObjCourse::$subscription_start = 0
private

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

Referenced by getSubscriptionStart().

◆ $subscription_type

int ilObjCourse::$subscription_type = 0
private

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

◆ $syllabus

string ilObjCourse::$syllabus = ''
private

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

Referenced by getSyllabus().

◆ $target_group

string ilObjCourse::$target_group = null
private

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

Referenced by getTargetGroup().

◆ $timing_mode

int ilObjCourse::$timing_mode = ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE
private

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

Referenced by getTimingMode().

◆ $view_mode

int ilObjCourse::$view_mode = 0
private

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

Referenced by getViewMode().

◆ $waiting_list

bool ilObjCourse::$waiting_list = false
private

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

Referenced by enabledWaitingList().

◆ $waiting_list_obj

ilCourseWaitingList ilObjCourse::$waiting_list_obj = null
private

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

◆ CAL_ACTIVATION_END

const ilObjCourse::CAL_ACTIVATION_END = 4

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

◆ CAL_ACTIVATION_START

const ilObjCourse::CAL_ACTIVATION_START = 3

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

◆ CAL_COURSE_END

const ilObjCourse::CAL_COURSE_END = 6

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

◆ CAL_COURSE_START

const ilObjCourse::CAL_COURSE_START = 5

Definition at line 29 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 26 of file class.ilObjCourse.php.

◆ CAL_REG_START

const ilObjCourse::CAL_REG_START = 1

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

◆ STATUS_DETERMINATION_LP

◆ STATUS_DETERMINATION_MANUAL

const ilObjCourse::STATUS_DETERMINATION_MANUAL = 2

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

Referenced by ilObjCourseGUI\initEditForm().


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