ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjCourse Class Reference

Class ilObjCourse. More...

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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

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

Protected Member Functions

 toggleCourseStartTimeIndication (bool $time_indication)
 
 setCourseStart (ilDateTime $a_value=null)
 
 setCourseEnd (ilDateTime $a_value=null)
 
 initCourseMemberObject ()
 Init course member object ilObjUser $ilUser. More...
 
 initCourseMembersObject ()
 Init course member object ilObjUser $ilUser. More...
 
 prepareAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 
- Protected Member Functions inherited from ilContainer
 getInitialSubitems ()
 Get initial subitems. More...
 
 applyContainerUserFilter ($objects, ilContainerUserFilter $container_user_filter=null)
 Apply container user filter on objects. More...
 
 legacyOnlineFilter ($obj_ids, $objects, $val)
 Legacy online filter. More...
 

Protected Attributes

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Class ilObjCourse.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

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

References $GLOBALS, ILIAS\GlobalScreen\Provider\__construct(), and setStatusDetermination().

126  {
127 
128  #define("ILIAS_MODULE","course");
129  #define("KEEP_IMAGE_PATH",1);
130 
131  $this->SUBSCRIPTION_DEACTIVATED = 1;
132  $this->SUBSCRIPTION_CONFIRMATION = 2;
133  $this->SUBSCRIPTION_DIRECT = 3;
134  $this->SUBSCRIPTION_PASSWORD = 4;
135  $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
136  $this->ARCHIVE_DISABLED = 1;
137  $this->ARCHIVE_READ = 2;
138  $this->ARCHIVE_DOWNLOAD = 3;
139  $this->ABO_ENABLED = 1;
140  $this->ABO_DISABLED = 0;
141  $this->SHOW_MEMBERS_ENABLED = 1;
142  $this->SHOW_MEMBERS_DISABLED = 0;
143  $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
144 
145  $this->type = "crs";
146 
147  $this->course_logger = $GLOBALS['DIC']->logger()->crs();
148 
149  parent::__construct($a_id, $a_call_by_reference);
150  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
__construct(Container $dic, ilPlugin $plugin)
setStatusDetermination($a_value)
Set status determination mode.
+ Here is the call graph for this function:

Member Function Documentation

◆ __createDefaultSettings()

ilObjCourse::__createDefaultSettings ( )

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

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

Referenced by create(), and updateSettings().

1501  {
1502  global $DIC;
1503 
1504  $ilDB = $DIC['ilDB'];
1505 
1506  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1508 
1509  $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
1510  "contact_phone,contact_email,contact_consultation," .
1511  "sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
1512  "sub_max_members,sub_notify,view_mode,timing_mode,abo," .
1513  "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
1514  "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
1515  "VALUES( " .
1516  $ilDB->quote($this->getId(), 'integer') . ", " .
1517  $ilDB->quote($this->getSyllabus(), 'text') . ", " .
1518  $ilDB->quote($this->getContactName(), 'text') . ", " .
1519  $ilDB->quote($this->getContactResponsibility(), 'text') . ", " .
1520  $ilDB->quote($this->getContactPhone(), 'text') . ", " .
1521  $ilDB->quote($this->getContactEmail(), 'text') . ", " .
1522  $ilDB->quote($this->getContactConsultation(), 'text') . ", " .
1523  $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED, 'integer') . ", " .
1524  $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " .
1525  $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1526  $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT, 'integer') . ", " .
1527  $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " .
1528  "0, " .
1529  $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1530  "1, " .
1531  "0, " .
1532  $ilDB->quote(IL_CRS_VIEW_TIMING_ABSOLUTE, 'integer') . ', ' .
1533  $ilDB->quote($this->ABO_ENABLED, 'integer') . ", " .
1534  $ilDB->quote($this->getLatitude(), 'text') . ", " .
1535  $ilDB->quote($this->getLongitude(), 'text') . ", " .
1536  $ilDB->quote($this->getLocationZoom(), 'integer') . ", " .
1537  $ilDB->quote($this->getEnableCourseMap(), 'integer') . ", " .
1538  #"objective_view = '0', ".
1539  "1, " .
1540  "1," .
1541  '0,' .
1542  $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1543  $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1544  $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1545  $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1546  $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1547  $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1548  $ilDB->quote((int) $this->getStatusDetermination(), 'integer') . ', ' .
1549  $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ' ' .
1550  ")";
1551 
1552  $res = $ilDB->manipulate($query);
1553  $this->__readSettings();
1554 
1555  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1556  $sorting = new ilContainerSortingSettings($this->getId());
1557  $sorting->setSortMode(ilContainer::SORT_MANUAL);
1558  $sorting->update();
1559  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
const IL_CRS_VIEW_TIMING_ABSOLUTE
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
setRegistrationAccessCode($a_code)
Set refistration access code.
getLocationZoom()
Get LocationZoom.
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
getRegistrationAccessCode()
get access code
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
static generateCode()
Generate new registration key.
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
$DIC
Definition: xapitoken.php:46
const IL_CRS_SUBSCRIPTION_DIRECT
getEnableCourseMap()
Get Enable Course Map.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __deleteSettings()

ilObjCourse::__deleteSettings ( )

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

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

Referenced by delete().

1904  {
1905  global $DIC;
1906 
1907  $ilDB = $DIC['ilDB'];
1908 
1909  $query = "DELETE FROM crs_settings " .
1910  "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
1911  $res = $ilDB->manipulate($query);
1912 
1913  return true;
1914  }
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getCrsNonMemberTemplateId()

ilObjCourse::__getCrsNonMemberTemplateId ( )

get course non-member template private

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

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

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

Referenced by setParentRolePermissions().

1780  {
1781  global $DIC;
1782 
1783  $ilDB = $DIC['ilDB'];
1784 
1785  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1786  $res = $this->ilias->db->query($q);
1787  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
1788 
1789  return $row["obj_id"];
1790  }
foreach($_POST as $key=> $value) $res
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )

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

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

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

1893  {
1894  global $DIC;
1895 
1896  $rbacreview = $DIC['rbacreview'];
1897 
1898  // GET role_objects of predefined roles
1899 
1900  return $rbacreview->getRolesOfRoleFolder($this->getRefId(), false);
1901  }
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __readSettings()

ilObjCourse::__readSettings ( )

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

References $DIC, $ilDB, $query, $res, ilPrivacySettings\_getInstance(), enableRegistrationAccessCode(), enableSessionLimit(), enableSubscriptionMembershipLimitation(), enableWaitingList(), ilDBConstants\FETCHMODE_OBJECT, ilObject\getId(), 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(), ilObject\setOfflineStatus(), setRegistrationAccessCode(), setShowMembers(), setShowMembersExport(), setStatusDetermination(), setSubscriptionEnd(), setSubscriptionLimitationType(), setSubscriptionMaxMembers(), setSubscriptionMinMembers(), setSubscriptionNotify(), setSubscriptionPassword(), setSubscriptionStart(), setSubscriptionType(), setSyllabus(), setTargetGroup(), setTimingMode(), setViewMode(), setWaitingListAutoFill(), ilObjectActivation\TIMINGS_ACTIVATION, toggleCourseStartTimeIndication(), and ilTimeZone\UTC.

Referenced by __createDefaultSettings(), and read().

1563  {
1564  global $DIC;
1565 
1566  $ilDB = $DIC['ilDB'];
1567 
1568  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . "";
1569 
1570  $res = $ilDB->query($query);
1571  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1572  $this->setSyllabus($row->syllabus);
1573  $this->setTargetGroup($row->target_group);
1574  $this->setContactName($row->contact_name);
1575  $this->setContactResponsibility($row->contact_responsibility);
1576  $this->setContactPhone($row->contact_phone);
1577  $this->setContactEmail($row->contact_email);
1578  $this->setContactConsultation($row->contact_consultation);
1579  $this->setOfflineStatus(!(bool) $row->activation_type); // see below
1580  $this->setSubscriptionLimitationType($row->sub_limitation_type);
1581  $this->setSubscriptionStart($row->sub_start);
1582  $this->setSubscriptionEnd($row->sub_end);
1583  $this->setSubscriptionType($row->sub_type);
1584  $this->setSubscriptionPassword($row->sub_password);
1585  $this->enableSubscriptionMembershipLimitation($row->sub_mem_limit);
1586  $this->setSubscriptionMaxMembers($row->sub_max_members);
1587  $this->setSubscriptionNotify($row->sub_notify);
1588  $this->setViewMode($row->view_mode);
1589  $this->setTimingMode((int) $row->timing_mode);
1590  $this->setAboStatus($row->abo);
1591  $this->enableWaitingList($row->waiting_list);
1592  $this->setImportantInformation($row->important);
1593  $this->setShowMembers($row->show_members);
1594 
1595  if (\ilPrivacySettings::_getInstance()->participantsListInCoursesEnabled()) {
1596  $this->setShowMembersExport($row->show_members_export);
1597  } else {
1598  $this->setShowMembersExport(false);
1599  }
1600  $this->setLatitude($row->latitude);
1601  $this->setLongitude($row->longitude);
1602  $this->setLocationZoom($row->location_zoom);
1603  $this->setEnableCourseMap($row->enable_course_map);
1604  $this->enableSessionLimit($row->session_limit);
1605  $this->setNumberOfPreviousSessions($row->session_prev);
1606  $this->setNumberOfNextSessions($row->session_next);
1607  $this->enableRegistrationAccessCode($row->reg_ac_enabled);
1608  $this->setRegistrationAccessCode($row->reg_ac);
1609  $this->setAutoNotification($row->auto_notification == 1 ? true : false);
1610  $this->setStatusDetermination((int) $row->status_dt);
1611  $this->setMailToMembersType($row->mail_members_type);
1612 
1613  if ($row->period_time_indication) {
1614  $this->setCoursePeriod(
1615  new \ilDateTime($row->period_start, IL_CAL_DATETIME, \ilTimeZone::UTC),
1616  new \ilDateTime($row->period_end, IL_CAL_DATETIME, \ilTimeZone::UTC)
1617  );
1618  } elseif (!is_null($row->period_start) && !is_null($row->period_end)) {
1619  $this->setCoursePeriod(
1620  new \ilDate($row->period_start, IL_CAL_DATE),
1621  new \ilDate($row->period_end, IL_CAL_DATE)
1622  );
1623  }
1624  $this->toggleCourseStartTimeIndication((bool) $row->period_time_indication);
1625  $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
1626  $this->setWaitingListAutoFill($row->auto_wait);
1627  $this->setSubscriptionMinMembers($row->min_members ? $row->min_members : null);
1628  }
1629 
1630  // moved activation to ilObjectActivation
1631  if ($this->ref_id) {
1632  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1633  $activation = ilObjectActivation::getItem($this->ref_id);
1634  switch ($activation["timing_type"]) {
1636  $this->setActivationStart($activation["timing_start"]);
1637  $this->setActivationEnd($activation["timing_end"]);
1638  $this->setActivationVisibility($activation["visible"]);
1639  break;
1640  }
1641  }
1642  return true;
1643  }
setActivationEnd($a_value)
setSubscriptionNotify($a_value)
setContactResponsibility($a_value)
setSubscriptionStart($a_value)
setSubscriptionEnd($a_value)
setCoursePeriod(\ilDateTime $start=null, \ilDateTime $end=null)
setShowMembersExport($a_mem_export)
const IL_CAL_DATETIME
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
setAutoNotification($value)
Sets automatic notification status in $this->auto_notification, using given $status.
setImportantInformation($a_info)
setMailToMembersType($a_type)
Set mail to members type.
static getItem($a_ref_id)
Get item data.
setContactEmail($a_value)
enableSubscriptionMembershipLimitation($a_status)
enable max members
enableSessionLimit($a_status)
en/disable limited number of sessions
setTimingMode($a_mode)
const IL_CAL_UNIX
setSubscriptionPassword($a_value)
setRegistrationAccessCode($a_code)
Set refistration access code.
setSyllabus($a_syllabus)
setLatitude($a_latitude)
Set Latitude.
setViewMode($a_mode)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
setAboStatus($a_status)
setLocationZoom($a_locationzoom)
Set LocationZoom.
setActivationStart($a_value)
Class for single dates.
foreach($_POST as $key=> $value) $res
setLongitude($a_longitude)
Set Longitude.
getId()
get object id public
setSubscriptionType($a_value)
setSubscriptionMinMembers($a_value)
setNumberOfNextSessions($a_num)
Set number of previous sessions.
setContactConsultation($a_value)
$query
enableRegistrationAccessCode($a_status)
En/disable registration access code.
setTargetGroup(?string $a_tg)
const IL_CAL_DATE
setContactPhone($a_value)
setCancellationEnd(ilDate $a_value=null)
setOfflineStatus($a_status)
Set offline status.
global $ilDB
$DIC
Definition: xapitoken.php:46
setSubscriptionMaxMembers($a_value)
enableWaitingList($a_status)
toggleCourseStartTimeIndication(bool $time_indication)
setWaitingListAutoFill($a_value)
static _getInstance()
Get instance of ilPrivacySettings.
setShowMembers($a_status)
setStatusDetermination($a_value)
Set status determination mode.
setSubscriptionLimitationType($a_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteUser()

static ilObjCourse::_deleteUser (   $a_usr_id)
static

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

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

Referenced by ilObjUser\delete().

1957  {
1958  // Delete all user related data
1959  // delete lm_history
1960  include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
1961  ilCourseLMHistory::_deleteUser($a_usr_id);
1962 
1963  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1965 
1966  // Course objectives
1967  include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1969  }
static _deleteUser($a_usr_id)
Delete user type $ilDB.
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
static _deleteUser($a_usr_id)
Delete user data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

static ilObjCourse::_isActivated (   $a_obj_id)
static

Is activated.

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

Parameters
intid of user
Returns
boolean

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

References ilObjCourseAccess\_isActivated().

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

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

◆ _isSubscriptionNotificationEnabled()

static ilObjCourse::_isSubscriptionNotificationEnabled (   $a_course_id)
static

Check if subscription notification is enabled.

public

Parameters
intcourse_id

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

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

488  {
489  global $DIC;
490 
491  $ilDB = $DIC['ilDB'];
492 
493  $query = "SELECT * FROM crs_settings " .
494  "WHERE obj_id = " . $ilDB->quote($a_course_id, 'integer') . " " .
495  "AND sub_notify = 1";
496  $res = $ilDB->query($query);
497  return $res->numRows() ? true : false;
498  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ _lookupAboStatus()

static ilObjCourse::_lookupAboStatus (   $a_id)
static

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

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

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

682  {
683  global $DIC;
684 
685  $ilDB = $DIC['ilDB'];
686 
687  $query = "SELECT abo FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
688  $res = $ilDB->query($query);
689  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
690  return $row->abo;
691  }
692  return false;
693  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _lookupViewMode()

static ilObjCourse::_lookupViewMode (   $a_id)
static

lookup view mode of container

Parameters
int$a_id
Returns
mixed int | bool

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

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

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

668  {
669  global $DIC;
670 
671  $ilDB = $DIC['ilDB'];
672 
673  $query = "SELECT view_mode FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
674  $res = $ilDB->query($query);
675  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
676  return $row->view_mode;
677  }
678  return false;
679  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _registrationEnabled()

static ilObjCourse::_registrationEnabled (   $a_obj_id)
static

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

Parameters
intid of user
Returns
boolean

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

References ilObjCourseAccess\_registrationEnabled().

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

809  {
810  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
811  return ilObjCourseAccess::_registrationEnabled($a_obj_id);
812  }
static _registrationEnabled($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjCourse::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

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

References ilObjectActivation\addAdditionalSubItemInformation().

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

◆ allowAbo()

ilObjCourse::allowAbo ( )

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

816  {
817  return $this->ABO == $this->ABO_ENABLED;
818  }

◆ appendMessage()

ilObjCourse::appendMessage (   $a_message)

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

References getMessage().

Referenced by validate().

764  {
765  if ($this->getMessage()) {
766  $this->message .= "<br /> ";
767  }
768  $this->message .= $a_message;
769  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLPStatusSync()

ilObjCourse::checkLPStatusSync (   $a_member_id)

sync course status from lp

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

Parameters
int$a_member_id

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

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

◆ cloneAutoGeneratedRoles()

ilObjCourse::cloneAutoGeneratedRoles (   $new_obj)

Clone automatic genrated roles (permissions and template permissions)

public

Parameters
objectnew course object

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

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

Referenced by cloneObject().

1170  {
1171  global $DIC;
1172 
1173  $ilLog = $DIC['ilLog'];
1174  $rbacadmin = $DIC['rbacadmin'];
1175  $rbacreview = $DIC['rbacreview'];
1176 
1177  $admin = $this->getDefaultAdminRole();
1178  $new_admin = $new_obj->getDefaultAdminRole();
1179 
1180  if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
1181  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_admin');
1182  }
1183  $rbacadmin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
1184  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_admin.');
1185 
1186  $tutor = $this->getDefaultTutorRole();
1187  $new_tutor = $new_obj->getDefaultTutorRole();
1188  if (!$tutor || !$new_tutor) {
1189  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_tutor');
1190  }
1191  $rbacadmin->copyRolePermissions($tutor, $this->getRefId(), $new_obj->getRefId(), $new_tutor, true);
1192  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_tutor.');
1193 
1194  $member = $this->getDefaultMemberRole();
1195  $new_member = $new_obj->getDefaultMemberRole();
1196  if (!$member || !$new_member) {
1197  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_member');
1198  }
1199  $rbacadmin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
1200  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_member.');
1201 
1202  return true;
1203  }
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjCourse::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (start objects, preconditions)

public

Parameters
inttarget ref id of new course
intcopy id

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

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

1131  {
1132  parent::cloneDependencies($a_target_id, $a_copy_id);
1133 
1134  // Clone course start objects
1135  include_once('Services/Container/classes/class.ilContainerStartObjects.php');
1136  $start = new ilContainerStartObjects($this->getRefId(), $this->getId());
1137  $start->cloneDependencies($a_target_id, $a_copy_id);
1138 
1139  // Clone course item settings
1140  include_once('Services/Object/classes/class.ilObjectActivation.php');
1141  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
1142 
1143  // clone objective settings
1144  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
1145  ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
1146 
1147  // Clone course learning objectives
1148  include_once('Modules/Course/classes/class.ilCourseObjective.php');
1149  $crs_objective = new ilCourseObjective($this);
1150  $crs_objective->ilClone($a_target_id, $a_copy_id);
1151 
1152  // clone membership limitation
1153  foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
1154  \ilLoggerFactory::getLogger('crs')->info('Handling grouping id: ' . $grouping_id);
1155  $grouping = new \ilObjCourseGrouping($grouping_id);
1156  $grouping->cloneGrouping($a_target_id, $a_copy_id);
1157  }
1158 
1159  return true;
1160  }
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
getId()
get object id public
class ilcourseobjective
static _lookupObjId($a_id)
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
getRefId()
get reference id public
static getLogger($a_component_id)
Get component logger.
static _getGroupings($a_course_id)
+ Here is the call graph for this function:

◆ cloneObject()

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

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

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

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

1057  {
1058  global $DIC;
1059 
1060  $ilDB = $DIC['ilDB'];
1061  $ilUser = $DIC['ilUser'];
1062  $certificateLogger = $DIC->logger()->cert();
1063 
1064 
1065  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
1066 
1067  $this->cloneAutoGeneratedRoles($new_obj);
1068  $this->cloneMetaData($new_obj);
1069 
1070  // Assign admin
1071  $new_obj->getMemberObject()->add($ilUser->getId(), IL_CRS_ADMIN);
1072  // cognos-blu-patch: begin
1073  $new_obj->getMemberObject()->updateContact($ilUser->getId(), 1);
1074  // cognos-blu-patch: end
1075 
1076 
1077  // #14596
1078  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
1079  if ($cwo->isRootNode($this->getRefId())) {
1080  $this->setOfflineStatus(true);
1081  }
1082 
1083  // Copy settings
1084  $this->cloneSettings($new_obj);
1085 
1086  // Course Defined Fields
1087  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1088  ilCourseDefinedFieldDefinition::_clone($this->getId(), $new_obj->getId());
1089 
1090  // Clone course files
1091  include_once('Modules/Course/classes/class.ilCourseFile.php');
1092  ilCourseFile::_cloneFiles($this->getId(), $new_obj->getId());
1093 
1094  // Copy learning progress settings
1095  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
1096  $obj_settings = new ilLPObjSettings($this->getId());
1097  $obj_settings->cloneSettings($new_obj->getId());
1098  unset($obj_settings);
1099 
1100  // clone certificate (#11085)
1101  $pathFactory = new ilCertificatePathFactory();
1102  $templateRepository = new ilCertificateTemplateRepository($ilDB);
1103 
1104  $cloneAction = new ilCertificateCloneAction(
1105  $ilDB,
1106  $pathFactory,
1107  $templateRepository,
1108  $DIC->filesystem()->web(),
1109  $certificateLogger,
1111  );
1112 
1113  $cloneAction->cloneCertificate($this, $new_obj);
1114 
1115  $book_service = new ilBookingService();
1116  $book_service->cloneSettings($this->getId(), $new_obj->getId());
1117 
1118 
1119  return $new_obj;
1120  }
static _clone($a_source_id, $a_target_id)
Clone fields.
cloneSettings(\ilObjCourse $new_obj)
Clone entries in settings table.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
Low level api for booking service.
$ilUser
Definition: imgupload.php:18
cloneMetaData($target_obj)
Copy meta data.
const IL_CRS_ADMIN
Base class for course and group participants.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
setOfflineStatus($a_status)
Set offline status.
global $ilDB
$DIC
Definition: xapitoken.php:46
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.
+ Here is the call graph for this function:

◆ cloneSettings()

ilObjCourse::cloneSettings ( \ilObjCourse  $new_obj)

Clone entries in settings table.

public

Parameters
ilObjCoursenew course object

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

References enabledWaitingList(), enableRegistrationAccessCode(), enableSessionLimit(), enableSubscriptionMembershipLimitation(), enableWaitingList(), ilMembershipRegistrationCodeUtils\generateCode(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationVisibility(), getAutoNotification(), getCancellationEnd(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getCourseEnd(), getCourseStart(), getEnableCourseMap(), getImportantInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), ilObject\getOfflineStatus(), getOrderType(), getShowMembers(), getShowMembersExport(), getStatusDetermination(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionMinMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSyllabus(), getTargetGroup(), getTimingMode(), getViewMode(), hasWaitingListAutoFill(), isRegistrationAccessCodeEnabled(), isSessionLimitEnabled(), isSubscriptionMembershipLimited(), setAboStatus(), setActivationEnd(), setActivationStart(), setActivationVisibility(), setAutoNotification(), setCancellationEnd(), setContactConsultation(), setContactEmail(), setContactName(), setContactPhone(), setContactResponsibility(), setCoursePeriod(), setEnableCourseMap(), setImportantInformation(), setLatitude(), setLocationZoom(), setLongitude(), setMailToMembersType(), setNumberOfNextSessions(), setNumberOfPreviousSessions(), ilObject\setOfflineStatus(), ilContainer\setOrderType(), setRegistrationAccessCode(), setShowMembers(), setShowMembersExport(), setStatusDetermination(), setSubscriptionEnd(), setSubscriptionLimitationType(), setSubscriptionMaxMembers(), setSubscriptionMinMembers(), setSubscriptionNotify(), setSubscriptionPassword(), setSubscriptionStart(), setSubscriptionType(), setSyllabus(), setTargetGroup(), setTimingMode(), setViewMode(), setWaitingListAutoFill(), and update().

Referenced by cloneObject().

1444  {
1445  $new_obj->setSyllabus($this->getSyllabus());
1446  $new_obj->setContactName($this->getContactName());
1447  $new_obj->setContactResponsibility($this->getContactResponsibility());
1448  $new_obj->setContactPhone($this->getContactPhone());
1449  $new_obj->setContactEmail($this->getContactEmail());
1450  $new_obj->setContactConsultation($this->getContactConsultation());
1451  $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1452  $new_obj->setActivationStart($this->getActivationStart());
1453  $new_obj->setActivationEnd($this->getActivationEnd());
1454  $new_obj->setActivationVisibility($this->getActivationVisibility());
1455  $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1456  $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1457  $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1458  $new_obj->setSubscriptionType($this->getSubscriptionType());
1459  $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1460  $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1461  $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1462  $new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
1463  $new_obj->setViewMode($this->getViewMode());
1464  $new_obj->setTimingMode($this->getTimingMode());
1465  $new_obj->setOrderType($this->getOrderType());
1466  $new_obj->setAboStatus($this->getAboStatus());
1467  $new_obj->enableWaitingList($this->enabledWaitingList());
1468  $new_obj->setImportantInformation($this->getImportantInformation());
1469  $new_obj->setTargetGroup($this->getTargetGroup());
1470  $new_obj->setShowMembers($this->getShowMembers());
1471  // patch mem_exp
1472  $new_obj->setShowMembersExport($this->getShowMembersExport());
1473  // patch mem_exp
1474  $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1475  $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1476  $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1477  $new_obj->setAutoNotification($this->getAutoNotification());
1478  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1479  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1480  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1481  $new_obj->setStatusDetermination($this->getStatusDetermination());
1482  $new_obj->setMailToMembersType($this->getMailToMembersType());
1483  $new_obj->setCoursePeriod(
1484  $this->getCourseStart(),
1485  $this->getCourseEnd()
1486  );
1487  $new_obj->setCancellationEnd($this->getCancellationEnd());
1488  $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
1489  $new_obj->setSubscriptionMinMembers($this->getSubscriptionMinMembers());
1490 
1491  // #10271
1492  $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1493  $new_obj->setLatitude($this->getLatitude());
1494  $new_obj->setLongitude($this->getLongitude());
1495  $new_obj->setLocationZoom($this->getLocationZoom());
1496 
1497  $new_obj->update();
1498  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
getOfflineStatus()
Get offline status.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
getLocationZoom()
Get LocationZoom.
getNumberOfNextSessions()
Set number of previous sessions.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
static generateCode()
Generate new registration key.
getNumberOfPreviousSessions()
Set number of previous sessions.
getEnableCourseMap()
Get Enable Course Map.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjCourse::create (   $a_upload = false)

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

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

833  {
834  global $DIC;
835 
836  $ilAppEventHandler = $DIC['ilAppEventHandler'];
837 
838  parent::create($a_upload);
839 
840  if (!$a_upload) {
841  $this->createMetaData();
842  }
843  $this->__createDefaultSettings();
844 
845  $ilAppEventHandler->raise(
846  'Modules/Course',
847  'create',
848  array('object' => $this,
849  'obj_id' => $this->getId(),
850  'appointments' => $this->prepareAppointments('create'))
851  );
852  }
createMetaData()
create meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
$DIC
Definition: xapitoken.php:46
+ 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 1278 of file class.ilObjCourse.php.

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

1279  {
1280  global $DIC;
1281 
1282  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1283 
1284  // always call parent delete function first!!
1285  if (!parent::delete()) {
1286  return false;
1287  }
1288 
1289  // delete meta data
1290  $this->deleteMetaData();
1291 
1292  // put here course specific stuff
1293 
1294  $this->__deleteSettings();
1295 
1296  include_once('Modules/Course/classes/class.ilCourseParticipants.php');
1298 
1299  include_once './Modules/Course/classes/class.ilCourseObjective.php';
1301 
1302  include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
1304 
1305  include_once './Modules/Course/classes/class.ilCourseFile.php';
1307 
1308  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1310 
1311  $ilAppEventHandler->raise(
1312  'Modules/Course',
1313  'delete',
1314  array('object' => $this,
1315  'obj_id' => $this->getId(),
1316  'appointments' => $this->prepareAppointments('delete'))
1317  );
1318 
1319 
1320  return true;
1321  }
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
static _deleteByContainer($a_container_id)
Delete all fields of a container.
static _deleteAll($a_course_id)
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
static _deleteByCourse($a_course_id)
$DIC
Definition: xapitoken.php:46
static _deleteAll($course_id)
deleteMetaData()
delete meta data entry
+ Here is the call graph for this function:

◆ enabledObjectiveView()

ilObjCourse::enabledObjectiveView ( )

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

References IL_CRS_VIEW_OBJECTIVE.

Referenced by getOrderType().

369  {
370  return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
371  }
const IL_CRS_VIEW_OBJECTIVE
+ Here is the caller graph for this function:

◆ enabledWaitingList()

ilObjCourse::enabledWaitingList ( )

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

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

374  {
375  return (bool) $this->waiting_list;
376  }
+ Here is the caller graph for this function:

◆ enableRegistrationAccessCode()

ilObjCourse::enableRegistrationAccessCode (   $a_status)

En/disable registration access code.

Parameters
object$a_status
Returns

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

Referenced by __readSettings(), and cloneSettings().

212  {
213  $this->reg_access_code_enabled = $a_status;
214  }
+ Here is the caller graph for this function:

◆ enableSessionLimit()

ilObjCourse::enableSessionLimit (   $a_status)

en/disable limited number of sessions

Returns
Parameters
object$a_status

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

Referenced by __readSettings(), and cloneSettings().

400  {
401  $this->session_limit = $a_status;
402  }
+ Here is the caller graph for this function:

◆ enableSubscriptionMembershipLimitation()

ilObjCourse::enableSubscriptionMembershipLimitation (   $a_status)

enable max members

public

Parameters
boolstatus
Returns

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

Referenced by __readSettings(), and cloneSettings().

417  {
418  $this->subscription_membership_limitation = $a_status;
419  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjCourse::enableWaitingList (   $a_status)

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

Referenced by __readSettings(), and cloneSettings().

379  {
380  $this->waiting_list = (bool) $a_status;
381  }
+ Here is the caller graph for this function:

◆ findCoursesWithNotEnoughMembers()

static ilObjCourse::findCoursesWithNotEnoughMembers ( )
static

Minimum members check type $ilDB.

Returns
array

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

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

Referenced by ilMembershipCronMinMembers\getCourses().

2397  {
2398  $ilDB = $GLOBALS['DIC']->database();
2399  $tree = $GLOBALS['DIC']->repositoryTree();
2400 
2401  $res = array();
2402 
2403  $before = new ilDateTime(time(), IL_CAL_UNIX);
2404  $before->increment(IL_CAL_DAY, -1);
2405  $now = $before->get(IL_CAL_UNIX);
2406 
2407  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
2408 
2409  $set = $ilDB->query("SELECT obj_id, min_members" .
2410  " FROM crs_settings" .
2411  " WHERE min_members > " . $ilDB->quote(0, "integer") .
2412  " AND sub_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
2413  " AND ((leave_end IS NOT NULL" .
2414  " AND leave_end < " . $ilDB->quote($now, "text") . ")" .
2415  " OR (leave_end IS NULL" .
2416  " AND sub_end IS NOT NULL" .
2417  " AND sub_end < " . $ilDB->quote($now, "text") . "))" .
2418  " AND (period_start IS NULL OR period_start > " . $ilDB->quote($now, "integer") . ")");
2419  while ($row = $ilDB->fetchAssoc($set)) {
2420  $refs = ilObject::_getAllReferences($row['obj_id']);
2421  $ref = end($refs);
2422 
2423  if ($tree->isDeleted($ref)) {
2424  continue;
2425  }
2426 
2427  $part = new ilCourseParticipants($row["obj_id"]);
2428  $reci = $part->getNotificationRecipients();
2429  if (sizeof($reci)) {
2430  $missing = (int) $row["min_members"] - $part->getCountMembers();
2431  if ($missing > 0) {
2432  $res[$row["obj_id"]] = array($missing, $reci);
2433  }
2434  }
2435  }
2436 
2437  return $res;
2438  }
const IL_CAL_UNIX
static _getAllReferences($a_id)
get all reference ids of object
const IL_CAL_DAY
foreach($_POST as $key=> $value) $res
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAboStatus()

ilObjCourse::getAboStatus ( )

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

Referenced by cloneSettings(), and updateSettings().

724  {
725  return $this->abo;
726  }
+ Here is the caller graph for this function:

◆ getActivationEnd()

ilObjCourse::getActivationEnd ( )

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

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

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

◆ getActivationStart()

ilObjCourse::getActivationStart ( )

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

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

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

◆ getActivationUnlimitedStatus()

ilObjCourse::getActivationUnlimitedStatus ( )

get activation unlimited no start or no end

Returns
bool

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

References getActivationEnd(), and getActivationStart().

Referenced by isActivated(), and prepareAppointments().

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

◆ getActivationVisibility()

ilObjCourse::getActivationVisibility ( )

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

Referenced by cloneSettings(), and updateSettings().

319  {
320  return $this->activation_visibility;
321  }
+ Here is the caller graph for this function:

◆ getArchiveEnd()

ilObjCourse::getArchiveEnd ( )

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

704  {
705  return $this->archive_end ? $this->archive_end : mktime(0, 0, 0, 12, 12, date("Y", time()) + 2);
706  }

◆ getArchiveStart()

ilObjCourse::getArchiveStart ( )

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

696  {
697  return $this->archive_start ? $this->archive_start : time();
698  }

◆ getArchiveType()

ilObjCourse::getArchiveType ( )

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

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

712  {
713  return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
714  }
const IL_CRS_ARCHIVE_NONE
const IL_CRS_ARCHIVE_DOWNLOAD

◆ getAutoNotification()

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

Returns
boolean

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

References $auto_notification.

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

2230  {
2231  return $this->auto_notification;
2232  }
+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjCourse::getCancellationEnd ( )

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

References $leave_end.

Referenced by cloneSettings(), and updateSettings().

1021  {
1022  return $this->leave_end;
1023  }
+ Here is the caller graph for this function:

◆ getContactConsultation()

ilObjCourse::getContactConsultation ( )

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

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

258  {
259  return $this->contact_consultation;
260  }
+ Here is the caller graph for this function:

◆ getContactEmail()

ilObjCourse::getContactEmail ( )

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

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

274  {
275  return $this->contact_email;
276  }
+ Here is the caller graph for this function:

◆ getContactName()

ilObjCourse::getContactName ( )

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

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

250  {
251  return $this->contact_name;
252  }
+ Here is the caller graph for this function:

◆ getContactPhone()

ilObjCourse::getContactPhone ( )

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

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

266  {
267  return $this->contact_phone;
268  }
+ Here is the caller graph for this function:

◆ getContactResponsibility()

ilObjCourse::getContactResponsibility ( )

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

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

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

◆ getCourseEnd()

ilObjCourse::getCourseEnd ( )
Returns
|null

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

References $crs_end.

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

1010  : ?\ilDateTime
1011  {
1012  return $this->crs_end;
1013  }
Date and time handling
+ Here is the caller graph for this function:

◆ getCourseStart()

ilObjCourse::getCourseStart ( )
Returns
| null

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

References $crs_start.

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

994  : ?\ilDateTime
995  {
996  return $this->crs_start;
997  }
Date and time handling
+ Here is the caller graph for this function:

◆ getCourseStartTimeIndication()

ilObjCourse::getCourseStartTimeIndication ( )
Returns
bool

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

References $course_start_time_indication.

Referenced by prepareAppointments(), and updateSettings().

977  : bool
978  {
980  }
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjCourse::getDefaultAdminRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1943  {
1944  $local_roles = $this->__getLocalRoles();
1945 
1946  foreach ($local_roles as $role_id) {
1947  if ($tmp_role = &ilObjectFactory::getInstanceByObjId($role_id, false)) {
1948  if (!strcmp($tmp_role->getTitle(), "il_crs_admin_" . $this->getRefId())) {
1949  return $role_id;
1950  }
1951  }
1952  }
1953  return false;
1954  }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultCourseRoles()

ilObjCourse::getDefaultCourseRoles (   $a_crs_id = "")

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

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

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

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

1855  {
1856  global $DIC;
1857 
1858  $rbacadmin = $DIC['rbacadmin'];
1859  $rbacreview = $DIC['rbacreview'];
1860 
1861  if (strlen($a_crs_id) > 0) {
1862  $crs_id = $a_crs_id;
1863  } else {
1864  $crs_id = $this->getRefId();
1865  }
1866 
1867  $role_arr = $rbacreview->getRolesOfRoleFolder($crs_id);
1868 
1869  foreach ($role_arr as $role_id) {
1870  $role_Obj = &$this->ilias->obj_factory->getInstanceByObjId($role_id);
1871 
1872  $crs_Member = "il_crs_member_" . $crs_id;
1873  $crs_Admin = "il_crs_admin_" . $crs_id;
1874  $crs_Tutor = "il_crs_tutor_" . $crs_id;
1875 
1876  if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
1877  $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1878  }
1879 
1880  if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
1881  $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1882  }
1883 
1884  if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
1885  $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1886  }
1887  }
1888 
1889  return $arr_crsDefaultRoles;
1890  }
redirection script todo: (a better solution should control the processing via a xml file) ...
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjCourse::getDefaultMemberRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1918  {
1919  $local_roles = $this->__getLocalRoles();
1920 
1921  foreach ($local_roles as $role_id) {
1922  $title = ilObject::_lookupTitle($role_id);
1923  if (substr($title, 0, 8) == 'il_crs_m') {
1924  return $role_id;
1925  }
1926  }
1927  return 0;
1928  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultTutorRole()

ilObjCourse::getDefaultTutorRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1930  {
1931  $local_roles = $this->__getLocalRoles();
1932 
1933  foreach ($local_roles as $role_id) {
1934  if ($tmp_role = &ilObjectFactory::getInstanceByObjId($role_id, false)) {
1935  if (!strcmp($tmp_role->getTitle(), "il_crs_tutor_" . $this->getRefId())) {
1936  return $role_id;
1937  }
1938  }
1939  }
1940  return false;
1941  }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableCourseMap()

ilObjCourse::getEnableCourseMap ( )

Get Enable Course Map.

Returns
boolean Enable Course Map

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

References $enablemap.

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

939  {
940  return $this->enablemap;
941  }
+ Here is the caller graph for this function:

◆ getEnableMap()

ilObjCourse::getEnableMap ( )

Type independent wrapper.

Returns
type

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

References getEnableCourseMap().

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

◆ getImportantInformation()

ilObjCourse::getImportantInformation ( )

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

Referenced by cloneSettings(), and updateSettings().

217  {
218  return $this->important;
219  }
+ Here is the caller graph for this function:

◆ getLatitude()

ilObjCourse::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

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

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

◆ getLocalCourseRoles()

ilObjCourse::getLocalCourseRoles (   $a_translate = false)

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

info is stored in object variable public

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

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

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

1816  {
1817  global $DIC;
1818 
1819  $rbacadmin = $DIC['rbacadmin'];
1820  $rbacreview = $DIC['rbacreview'];
1821 
1822  if (empty($this->local_roles)) {
1823  $this->local_roles = array();
1824  $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1825 
1826  foreach ($role_arr as $role_id) {
1827  if ($rbacreview->isAssignable($role_id, $this->getRefId()) == true) {
1828  $role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1829 
1830  if ($a_translate) {
1831  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1832  } else {
1833  $role_name = $role_Obj->getTitle();
1834  }
1835  $this->local_roles[$role_name] = $role_Obj->getId();
1836  }
1837  }
1838  }
1839 
1840  return $this->local_roles;
1841  }
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getTranslation($a_role_title)
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getLocationZoom()

ilObjCourse::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

References $locationzoom.

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

910  {
911  return $this->locationzoom;
912  }
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

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

890  {
891  return $this->longitude;
892  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

References $mail_members.

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

751  {
752  return $this->mail_members;
753  }
+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

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

References $member_obj, and initCourseMemberObject().

1693  {
1694  if (!$this->member_obj instanceof ilCourseParticipant) {
1695  $this->initCourseMemberObject();
1696  }
1697  return $this->member_obj;
1698  }
initCourseMemberObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:

◆ getMembersObject()

ilObjCourse::getMembersObject ( )
Returns
ilCourseParticipants

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

References $members_obj, and initCourseMembersObject().

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

1704  {
1705  if (!$this->members_obj instanceof ilCourseParticipants) {
1706  $this->initCourseMembersObject();
1707  }
1708  return $this->members_obj;
1709  }
initCourseMembersObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjCourse::getMessage ( )

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

References $message.

Referenced by appendMessage(), and validate().

756  {
757  return $this->message;
758  }
$message
Definition: xapiexit.php:14
+ Here is the caller graph for this function:

◆ getNumberOfNextSessions()

ilObjCourse::getNumberOfNextSessions ( )

Set number of previous sessions.

Returns

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

References $session_next.

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

455  {
456  return $this->session_next;
457  }
+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjCourse::getNumberOfPreviousSessions ( )

Set number of previous sessions.

Returns

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

References $session_prev.

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

436  {
437  return $this->session_prev;
438  }
+ Here is the caller graph for this function:

◆ getOrderType()

ilObjCourse::getOrderType ( )

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

References enabledObjectiveView(), and ilContainer\SORT_MANUAL.

Referenced by cloneSettings(), and update().

2309  {
2310  if ($this->enabledObjectiveView()) {
2311  return ilContainer::SORT_MANUAL;
2312  }
2313  return parent::getOrderType();
2314  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjCourse::getRegistrationAccessCode ( )

get access code

Returns

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

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

183  {
184  return $this->reg_access_code;
185  }
+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjCourse::getShowMembers ( )

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

Referenced by cloneSettings(), and updateSettings().

732  {
733  return $this->show_members;
734  }
+ Here is the caller graph for this function:

◆ getShowMembersExport()

ilObjCourse::getShowMembersExport ( )

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

References $member_export.

Referenced by cloneSettings(), and updateSettings().

169  {
170  return $this->member_export;
171  }
+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

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

References $status_dt.

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

2272  {
2273  return $this->status_dt;
2274  }
+ Here is the caller graph for this function:

◆ getSubItems()

ilObjCourse::getSubItems (   $a_admin_panel_enabled = false,
  $a_include_side_block = false,
  $a_get_single = 0,
\ilContainerUserFilter  $container_user_filter = null 
)

Get subitems of container.

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

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

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

511  {
512  global $DIC;
513 
514  $ilUser = $DIC['ilUser'];
515  $access = $DIC->access();
516 
517  // Caching
518  if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block])) {
519  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
520  }
521 
522  // Results are stored in $this->items
523  parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
524 
525  $limit_sess = false;
526  if (!$a_admin_panel_enabled &&
527  !$a_include_side_block &&
528  $this->items['sess'] &&
529  is_array($this->items['sess']) &&
530  $this->isSessionLimitEnabled() &&
531  $this->getViewMode() == ilContainer::VIEW_SESSIONS) { // #16686
532  $limit_sess = true;
533  }
534 
535  if (!$limit_sess) {
536  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
537  }
538 
539 
540  // do session limit
541 
542  // @todo move to gui class
543  if (isset($_GET['crs_prev_sess'])) {
544  $ilUser->writePref('crs_sess_show_prev_' . $this->getId(), (string) (int) $_GET['crs_prev_sess']);
545  }
546  if (isset($_GET['crs_next_sess'])) {
547  $ilUser->writePref('crs_sess_show_next_' . $this->getId(), (string) (int) $_GET['crs_next_sess']);
548  }
549 
550  $session_rbac_checked = [];
551  foreach ($this->items['sess'] as $session_tree_info) {
552  if ($access->checkAccess('visible', '', $session_tree_info['ref_id'])) {
553  $session_rbac_checked[] = $session_tree_info;
554  }
555  }
556  $sessions = ilUtil::sortArray($session_rbac_checked, 'start', 'ASC', true, false);
557  //$sessions = ilUtil::sortArray($this->items['sess'],'start','ASC',true,false);
558  $today = new ilDate(date('Ymd', time()), IL_CAL_DATE);
559  $previous = $current = $next = array();
560  foreach ($sessions as $key => $item) {
561  $start = new ilDateTime($item['start'], IL_CAL_UNIX);
562  $end = new ilDateTime($item['end'], IL_CAL_UNIX);
563 
564  if (ilDateTime::_within($today, $start, $end, IL_CAL_DAY)) {
565  $current[] = $item;
566  } elseif (ilDateTime::_before($start, $today, IL_CAL_DAY)) {
567  $previous[] = $item;
568  } elseif (ilDateTime::_after($start, $today, IL_CAL_DAY)) {
569  $next[] = $item;
570  }
571  }
572  $num_previous_remove = max(
573  count($previous) - $this->getNumberOfPreviousSessions(),
574  0
575  );
576  while ($num_previous_remove--) {
577  if (!$ilUser->getPref('crs_sess_show_prev_' . $this->getId())) {
578  array_shift($previous);
579  }
580  $this->items['sess_link']['prev']['value'] = 1;
581  }
582 
583  $num_next_remove = max(
584  count($next) - $this->getNumberOfNextSessions(),
585  0
586  );
587  while ($num_next_remove--) {
588  if (!$ilUser->getPref('crs_sess_show_next_' . $this->getId())) {
589  array_pop($next);
590  }
591  // @fixme
592  $this->items['sess_link']['next']['value'] = 1;
593  }
594 
595  $sessions = array_merge($previous, $current, $next);
596  $this->items['sess'] = $sessions;
597 
598  // #15389 - see ilContainer::getSubItems()
599  include_once('Services/Container/classes/class.ilContainerSorting.php');
600  $sort = ilContainerSorting::_getInstance($this->getId());
601  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
602 
603  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
604  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$_GET["client_id"]
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const IL_CAL_UNIX
const IL_CAL_DAY
Class for single dates.
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
$ilUser
Definition: imgupload.php:18
const IL_CAL_DATE
getNumberOfPreviousSessions()
Set number of previous sessions.
$DIC
Definition: xapitoken.php:46
static _getInstance($a_obj_id)
get instance by obj_id
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check whether an date is within a date duration given by start and end.
+ Here is the call graph for this function:

◆ getSubscriptionEnd()

ilObjCourse::getSubscriptionEnd ( )

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

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

344  {
345  return $this->subscription_end;
346  }
+ Here is the caller graph for this function:

◆ getSubscriptionLimitationType()

ilObjCourse::getSubscriptionLimitationType ( )

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

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

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

◆ getSubscriptionMaxMembers()

ilObjCourse::getSubscriptionMaxMembers ( )

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

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

471  {
472  return $this->subscription_max_members;
473  }
+ Here is the caller graph for this function:

◆ getSubscriptionMinMembers()

ilObjCourse::getSubscriptionMinMembers ( )

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

References $min_members.

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

1034  {
1035  return $this->min_members;
1036  }
+ Here is the caller graph for this function:

◆ getSubscriptionNotify()

ilObjCourse::getSubscriptionNotify ( )

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

Referenced by cloneSettings(), and updateSettings().

607  {
608  return true;
609  return $this->subscription_notify ? true : false;
610  }
+ Here is the caller graph for this function:

◆ getSubscriptionPassword()

ilObjCourse::getSubscriptionPassword ( )

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

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

361  {
362  return $this->subscription_password;
363  }
+ Here is the caller graph for this function:

◆ getSubscriptionStart()

ilObjCourse::getSubscriptionStart ( )

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

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

336  {
337  return $this->subscription_start;
338  }
+ Here is the caller graph for this function:

◆ getSubscriptionType()

ilObjCourse::getSubscriptionType ( )

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

References IL_CRS_SUBSCRIPTION_DIRECT.

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

352  {
353  return $this->subscription_type ? $this->subscription_type : IL_CRS_SUBSCRIPTION_DIRECT;
354  #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
355  }
const IL_CRS_SUBSCRIPTION_DIRECT
+ Here is the caller graph for this function:

◆ getSubscriptionUnlimitedStatus()

ilObjCourse::getSubscriptionUnlimitedStatus ( )

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

References IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

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

◆ getSyllabus()

ilObjCourse::getSyllabus ( )

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

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

225  {
226  return $this->syllabus;
227  }
+ Here is the caller graph for this function:

◆ getTargetGroup()

ilObjCourse::getTargetGroup ( )
Returns
string|null

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

References $target_group.

Referenced by cloneSettings(), and updateSettings().

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

◆ getTimingMode()

ilObjCourse::getTimingMode ( )
Returns
int

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

References $timing_mode.

Referenced by cloneSettings(), and updateSettings().

657  {
658  return $this->timing_mode;
659  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilObjCourse::getViewMode ( )

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

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

621  {
622  return $this->view_mode;
623  }
+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjCourse::handleAutoFill ( )

Handle course auto fill.

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

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

2320  {
2321  if (
2322  !$this->enabledWaitingList() or
2323  !$this->hasWaitingListAutoFill()
2324  ) {
2325  $this->course_logger->debug('Waiting list or auto fill disabled.');
2326  return;
2327  }
2328 
2329  $max = $this->getSubscriptionMaxMembers();
2331 
2332  $this->course_logger->debug('Max members: ' . $max);
2333  $this->course_logger->debug('Current members: ' . $now);
2334 
2335  if ($max <= $now) {
2336  return;
2337  }
2338 
2339  // see assignFromWaitingListObject()
2340  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2341  $waiting_list = new ilCourseWaitingList($this->getId());
2342 
2343  foreach ($waiting_list->getUserIds() as $user_id) {
2344  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
2345  $this->course_logger->warning('Cannot create user instance for id: ' . $user_id);
2346  continue;
2347  }
2348  if ($this->getMembersObject()->isAssigned($user_id)) {
2349  $this->course_logger->warning('User is already assigned to course. uid: ' . $user_id . ' course_id: ' . $this->getRefId());
2350  continue;
2351  }
2352  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
2353  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id, true);
2354  $waiting_list->removeFromList($user_id);
2355  $this->checkLPStatusSync($user_id);
2356 
2357  $this->course_logger->info('Assigned user from waiting list to course: ' . $this->getTitle());
2358  $now++;
2359  if ($now >= $max) {
2360  break;
2361  }
2362  }
2363  }
static lookupNumberOfMembers($a_ref_id)
Lookup number of members ilRbacReview $rbacreview <type> $ilObjDataCache.
const IL_CRS_MEMBER
getId()
get object id public
getTitle()
get object title public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
checkLPStatusSync($a_member_id)
sync course status from lp
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

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

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

1263  {
1264  return strlen($this->getContactName()) or
1265  strlen($this->getContactResponsibility()) or
1266  strlen($this->getContactEmail()) or
1267  strlen($this->getContactPhone()) or
1268  strlen($this->getContactConsultation());
1269  }
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjCourse::hasWaitingListAutoFill ( )

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

References $auto_fill_from_waiting.

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

1044  {
1045  return (bool) $this->auto_fill_from_waiting;
1046  }
+ Here is the caller graph for this function:

◆ initCourseMemberObject()

ilObjCourse::initCourseMemberObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMemberObject().

1662  {
1663  global $DIC;
1664 
1665  $ilUser = $DIC['ilUser'];
1666 
1667  include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
1668  $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(), $ilUser->getId());
1669  return true;
1670  }
getId()
get object id public
$ilUser
Definition: imgupload.php:18
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCourseMembersObject()

ilObjCourse::initCourseMembersObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMembersObject().

1678  {
1679  global $DIC;
1680 
1681  $ilUser = $DIC['ilUser'];
1682 
1683  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1684  $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1685  return true;
1686  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
getId()
get object id public
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjCourse::initDefaultRoles ( )

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

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

1715  {
1716  global $DIC;
1717 
1718  $rbacadmin = $DIC['rbacadmin'];
1719  $rbacreview = $DIC['rbacreview'];
1720  $ilDB = $DIC['ilDB'];
1721 
1722  include_once './Services/AccessControl/classes/class.ilObjRole.php';
1724  'il_crs_admin_' . $this->getRefId(),
1725  "Admin of crs obj_no." . $this->getId(),
1726  'il_crs_admin',
1727  $this->getRefId()
1728  );
1730  'il_crs_tutor_' . $this->getRefId(),
1731  "Tutor of crs obj_no." . $this->getId(),
1732  'il_crs_tutor',
1733  $this->getRefId()
1734  );
1736  'il_crs_member_' . $this->getRefId(),
1737  "Member of crs obj_no." . $this->getId(),
1738  'il_crs_member',
1739  $this->getRefId()
1740  );
1741 
1742  return array();
1743  }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
global $ilDB
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

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

References ilObject\getId().

1646  {
1647  include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
1648 
1649  if (!is_object($this->waiting_list_obj)) {
1650  $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1651  }
1652  return true;
1653  }
getId()
get object id public
+ Here is the call graph for this function:

◆ inSubscriptionTime()

ilObjCourse::inSubscriptionTime ( )

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

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

Referenced by register().

384  {
385  if ($this->getSubscriptionUnlimitedStatus()) {
386  return true;
387  }
388  if (time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd()) {
389  return true;
390  }
391  return false;
392  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

ilObjCourse::isActivated ( )

Check if course is active and not offline.

Returns
bool

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

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

776  {
777  if ($this->getOfflineStatus()) {
778  return false;
779  }
780  if ($this->getActivationUnlimitedStatus()) {
781  return true;
782  }
783  if (time() < $this->getActivationStart() or
784  time() > $this->getActivationEnd()) {
785  return false;
786  }
787  return true;
788  }
getOfflineStatus()
Get offline status.
getActivationUnlimitedStatus()
get activation unlimited no start or no end
+ Here is the call graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjCourse::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

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

References $reg_access_code_enabled.

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

202  {
203  return (bool) $this->reg_access_code_enabled;
204  }
+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjCourse::isSessionLimitEnabled ( )

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

References $session_limit.

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

405  {
406  return (bool) $this->session_limit;
407  }
+ Here is the caller graph for this function:

◆ isSubscriptionMembershipLimited()

ilObjCourse::isSubscriptionMembershipLimited ( )

is membership limited

public

Parameters

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

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

466  {
467  return (bool) $this->subscription_membership_limitation;
468  }
+ Here is the caller graph for this function:

◆ lookupCourseNonMemberTemplatesId()

static ilObjCourse::lookupCourseNonMemberTemplatesId ( )
static

Lookup course non member id.

Returns
int

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

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

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

1797  {
1798  global $DIC;
1799 
1800  $ilDB = $DIC['ilDB'];
1801 
1802  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_crs_non_member', 'text');
1803  $res = $ilDB->query($query);
1804  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
1805 
1806  return isset($row['obj_id']) ? $row['obj_id'] : 0;
1807  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

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

Implements ilMembershipRegistrationCodes.

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

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

2117  {
2118  global $DIC;
2119 
2120  $ilDB = $DIC['ilDB'];
2121 
2122  $query = "SELECT obj_id FROM crs_settings " .
2123  "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
2124  "AND reg_ac = " . $ilDB->quote($a_code, 'text');
2125  $res = $ilDB->query($query);
2126 
2127  $obj_ids = array();
2128  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
2129  $obj_ids[] = $row->obj_id;
2130  }
2131  return $obj_ids;
2132  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ lookupShowMembersEnabled()

static ilObjCourse::lookupShowMembersEnabled (   $a_obj_id)
static

Check if show member is enabled.

Parameters
int$a_obj_id
Returns
bool

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

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

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

158  {
159  $query = 'SELECT show_members FROM crs_settings ' .
160  'WHERE obj_id = ' . $GLOBALS['DIC']['ilDB']->quote($a_obj_id, 'integer');
161  $res = $GLOBALS['DIC']['ilDB']->query($query);
162  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163  return (bool) $row->show_members;
164  }
165  return false;
166  }
foreach($_POST as $key=> $value) $res
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$query
+ Here is the caller graph for this function:

◆ lookupTimingMode()

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

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

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

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

630  {
631  global $DIC;
632 
633  $ilDB = $DIC['ilDB'];
634 
635  $query = 'SELECT timing_mode FROM crs_settings ' .
636  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
637  $res = $ilDB->query($query);
638 
639  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
640  return (int) $row->timing_mode;
641  }
643  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ mayLeave()

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

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

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

Referenced by ilObjCourseAccess\_checkAccess().

2366  {
2367  global $DIC;
2368 
2369  $ilUser = $DIC['ilUser'];
2370  $ilDB = $DIC['ilDB'];
2371 
2372  if (!$a_user_id) {
2373  $a_user_id = $ilUser->getId();
2374  }
2375 
2376  $set = $ilDB->query("SELECT leave_end" .
2377  " FROM crs_settings" .
2378  " WHERE obj_id = " . $ilDB->quote($a_course_id, "integer"));
2379  $row = $ilDB->fetchAssoc($set);
2380  if ($row && $row["leave_end"]) {
2381  // timestamp to date
2382  $limit = date("Ymd", $row["leave_end"]);
2383  if ($limit < date("Ymd")) {
2384  $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
2385  return false;
2386  }
2387  }
2388  return true;
2389  }
Class for single dates.
$ilUser
Definition: imgupload.php:18
const IL_CAL_DATE
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjCourse::MDUpdateListener (   $a_element)

Overwriten Metadata update listener for ECS functionalities.

public

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

References $DIC, and $ilLog.

1978  {
1979  global $DIC;
1980 
1981  $ilLog = $DIC['ilLog'];
1982 
1983  parent::MDUpdateListener($a_element);
1984 
1985  switch ($a_element) {
1986  case 'General':
1987  // Update ecs content
1988  include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
1989  $ecs = new ilECSCourseSettings($this);
1990  $ecs->handleContentUpdate();
1991  break;
1992 
1993  default:
1994  return true;
1995  }
1996  }
$DIC
Definition: xapitoken.php:46
Class ilECSCourseSettings.

◆ prepareAppointments()

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

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

Definition at line 2015 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_TRANSLATION_SYSTEM, IL_CAL_UNIX, IL_CRS_SUBSCRIPTION_LIMITED, ilCourseConstants\IL_CRS_VIEW_TIMING, and ilObjectActivation\TIMINGS_PRESETTING.

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

2016  {
2017  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
2018  include_once('./Services/Calendar/classes/class.ilDateTime.php');
2019 
2020  switch ($a_mode) {
2021  case 'create':
2022  case 'update':
2023  if (!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus()) {
2024  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
2025  $app->setTitle($this->getTitle());
2026  $app->setSubtitle('crs_cal_activation_start');
2027  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2028  $app->setDescription($this->getLongDescription());
2029  $app->setStart(new ilDateTime($this->getActivationStart(), IL_CAL_UNIX));
2030  $apps[] = $app;
2031 
2032  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
2033  $app->setTitle($this->getTitle());
2034  $app->setSubtitle('crs_cal_activation_end');
2035  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2036  $app->setDescription($this->getLongDescription());
2037  $app->setStart(new ilDateTime($this->getActivationEnd(), IL_CAL_UNIX));
2038  $apps[] = $app;
2039  }
2041  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
2042  $app->setTitle($this->getTitle());
2043  $app->setSubtitle('crs_cal_reg_start');
2044  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2045  $app->setDescription($this->getLongDescription());
2046  $app->setStart(new ilDateTime($this->getSubscriptionStart(), IL_CAL_UNIX));
2047  $apps[] = $app;
2048 
2049  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
2050  $app->setTitle($this->getTitle());
2051  $app->setSubtitle('crs_cal_reg_end');
2052  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2053  $app->setDescription($this->getLongDescription());
2054  $app->setStart(new ilDateTime($this->getSubscriptionEnd(), IL_CAL_UNIX));
2055  $apps[] = $app;
2056  }
2057  if ($this->getCourseStart() && $this->getCourseEnd()) {
2058  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_START);
2059  $app->setTitle($this->getTitle());
2060  $app->setSubtitle('crs_cal_start');
2061  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2062  $app->setDescription($this->getLongDescription());
2063  $app->setStart($this->getCourseStart());
2064  $app->setFullday(!$this->getCourseStartTimeIndication());
2065  $apps[] = $app;
2066 
2067  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_END);
2068  $app->setTitle($this->getTitle());
2069  $app->setSubtitle('crs_cal_end');
2070  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2071  $app->setDescription($this->getLongDescription());
2072  $app->setStart($this->getCourseEnd());
2073  $app->setFullday(!$this->getCourseStartTimeIndication());
2074  $apps[] = $app;
2075  }
2076  if (
2078  ) {
2079  $active = ilObjectActivation::getTimingsItems($this->getRefId());
2080  foreach ($active as $null => $item) {
2081  if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) {
2082  // create calendar entry for fixed types
2083  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_START);
2084  $app->setContextInfo($item['ref_id']);
2085  $app->setTitle($item['title']);
2086  $app->setSubtitle('cal_crs_timing_start');
2087  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2088  $app->setStart(new ilDate($item['suggestion_start'], IL_CAL_UNIX));
2089  $app->setFullday(true);
2090  $apps[] = $app;
2091 
2092  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_END);
2093  $app->setContextInfo($item['ref_id']);
2094  $app->setTitle($item['title']);
2095  $app->setSubtitle('cal_crs_timing_end');
2096  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
2097  $app->setStart(new ilDate($item['suggestion_end'], IL_CAL_UNIX));
2098  $app->setFullday(true);
2099  $apps[] = $app;
2100  }
2101  }
2102  }
2103  return $apps ? $apps : array();
2104 
2105  case 'delete':
2106  // Nothing to do: The category and all assigned appointments will be deleted.
2107  return array();
2108  }
2109  }
$app
Definition: cli.php:38
const IL_CRS_SUBSCRIPTION_LIMITED
const IL_CAL_TRANSLATION_SYSTEM
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
getOfflineStatus()
Get offline status.
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
Class for single dates.
getTitle()
get object title public
getActivationUnlimitedStatus()
get activation unlimited no start or no end
getLongDescription()
get object long description (stored in object_description)
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourse::read ( )

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

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

824  {
825  parent::read();
826 
827  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
829 
830  $this->__readSettings();
831  }
getId()
get object id public
setOrderType($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:

◆ register()

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

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

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

2142  {
2143  global $DIC;
2144 
2145  $ilCtrl = $DIC['ilCtrl'];
2146  $tree = $DIC['tree'];
2147  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
2148  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
2150 
2151  if ($part->isAssigned($a_user_id)) {
2152  return true;
2153  }
2154 
2155  if (!$a_force_registration) {
2156  // offline
2157  if (ilObjCourseAccess::_isOffline($this->getId())) {
2159  "Can't register to course, course is offline.",
2161  );
2162  }
2163  // activation
2164  if (!ilObjCourseAccess::_isActivated($this->getId())) {
2166  "Can't register to course, course is not activated.",
2168  );
2169  }
2170 
2173  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
2174  ', course subscription is deactivated.', ilMembershipRegistrationException::REGISTRATION_CODE_DISABLED);
2175  }
2176  }
2177 
2178  // Time Limitation
2180  if (!$this->inSubscriptionTime()) {
2181  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
2182  ', course is out of registration time.', ilMembershipRegistrationException::OUT_OF_REGISTRATION_PERIOD);
2183  }
2184  }
2185 
2186  // Max members
2187  if ($this->isSubscriptionMembershipLimited()) {
2188  $free = max(0, $this->getSubscriptionMaxMembers() - $part->getCountMembers());
2189  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2190  $waiting_list = new ilCourseWaitingList($this->getId());
2191  if ($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers())) {
2192  $waiting_list->addToList($a_user_id);
2193  $this->lng->loadLanguageModule("crs");
2194  $info = sprintf(
2195  $this->lng->txt('crs_added_to_list'),
2196  $waiting_list->getPosition($a_user_id)
2197  );
2198  include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
2199  $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
2200  $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
2201 
2203  }
2204 
2205  if (!$this->enabledWaitingList() && !$free) {
2206  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
2207  ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
2208  }
2209  }
2210  }
2211 
2212  $part->add($a_user_id, $a_role);
2213  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2214  $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
2215 
2216 
2217  include_once './Modules/Forum/classes/class.ilForumNotification.php';
2219 
2220  return true;
2221  }
const IL_CRS_SUBSCRIPTION_LIMITED
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _usingRegistrationCode()
Using Registration code.
global $ilCtrl
Definition: ilias.php:18
getId()
get object id public
static _isOffline($a_obj_id)
Type-specific implementation of general status.
isSubscriptionMembershipLimited()
is membership limited
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
static checkForumsExistsInsert($ref_id, $user_id=0)
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:

◆ setAboStatus()

ilObjCourse::setAboStatus (   $a_status)

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

Referenced by __readSettings(), and cloneSettings().

720  {
721  $this->abo = $a_status;
722  }
+ Here is the caller graph for this function:

◆ setActivationEnd()

ilObjCourse::setActivationEnd (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

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

◆ setActivationStart()

ilObjCourse::setActivationStart (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

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

◆ setActivationVisibility()

ilObjCourse::setActivationVisibility (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

315  {
316  $this->activation_visibility = (bool) $a_value;
317  }
+ Here is the caller graph for this function:

◆ setArchiveEnd()

ilObjCourse::setArchiveEnd (   $a_value)

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

708  {
709  $this->archive_end = $a_value;
710  }

◆ setArchiveStart()

ilObjCourse::setArchiveStart (   $a_value)

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

700  {
701  $this->archive_start = $a_value;
702  }

◆ setArchiveType()

ilObjCourse::setArchiveType (   $a_value)

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

716  {
717  $this->archive_type = $a_value;
718  }

◆ setAutoNotification()

ilObjCourse::setAutoNotification (   $value)

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

Parameters
mixedboolean

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

Referenced by __readSettings(), and cloneSettings().

2242  {
2243  $this->auto_notification = $value;
2244  }
+ Here is the caller graph for this function:

◆ setCancellationEnd()

ilObjCourse::setCancellationEnd ( ilDate  $a_value = null)

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

Referenced by __readSettings(), and cloneSettings().

1016  {
1017  $this->leave_end = $a_value;
1018  }
+ Here is the caller graph for this function:

◆ setContactConsultation()

ilObjCourse::setContactConsultation (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

262  {
263  $this->contact_consultation = $a_value;
264  }
+ Here is the caller graph for this function:

◆ setContactEmail()

ilObjCourse::setContactEmail (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

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

◆ setContactName()

ilObjCourse::setContactName (   $a_cn)

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

Referenced by __readSettings(), and cloneSettings().

254  {
255  $this->contact_name = $a_cn;
256  }
+ Here is the caller graph for this function:

◆ setContactPhone()

ilObjCourse::setContactPhone (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

270  {
271  $this->contact_phone = $a_value;
272  }
+ Here is the caller graph for this function:

◆ setContactResponsibility()

ilObjCourse::setContactResponsibility (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

286  {
287  $this->contact_responsibility = $a_value;
288  }
+ Here is the caller graph for this function:

◆ setCourseEnd()

ilObjCourse::setCourseEnd ( ilDateTime  $a_value = null)
protected
Parameters
\ilDateTime | null$a_value

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

Referenced by setCoursePeriod().

1003  {
1004  $this->crs_end = $a_value;
1005  }
+ Here is the caller graph for this function:

◆ setCoursePeriod()

ilObjCourse::setCoursePeriod ( \ilDateTime  $start = null,
\ilDateTime  $end = null 
)
Parameters
\ilDateTime | null$start
\ilDateTime | null$end
Exceptions
InvalidArgumentException

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

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

Referenced by __readSettings(), and cloneSettings().

949  {
950  if (
951  ($start instanceof \ilDate && !$end instanceof ilDate) ||
952  ($end instanceof \ilDate && !$start instanceof ilDate)
953  ) {
954  throw new InvalidArgumentException('Different date types not supported.');
955  }
956 
957  if ($start instanceof \ilDate) {
958  $this->toggleCourseStartTimeIndication(false);
959  } else {
960  $this->toggleCourseStartTimeIndication(true);
961  }
962  $this->setCourseStart($start);
963  $this->setCourseEnd($end);
964  }
Class for single dates.
toggleCourseStartTimeIndication(bool $time_indication)
setCourseEnd(ilDateTime $a_value=null)
setCourseStart(ilDateTime $a_value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCourseStart()

ilObjCourse::setCourseStart ( ilDateTime  $a_value = null)
protected
Parameters
\ilDateTime | null$a_value

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

Referenced by setCoursePeriod().

987  {
988  $this->crs_start = $a_value;
989  }
+ Here is the caller graph for this function:

◆ setEnableCourseMap()

ilObjCourse::setEnableCourseMap (   $a_enablemap)

Set Enable Course Map.

Parameters
boolean$a_enablemapEnable Course Map

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

Referenced by __readSettings(), and cloneSettings().

920  {
921  $this->enablemap = $a_enablemap;
922  }
+ Here is the caller graph for this function:

◆ setImportantInformation()

ilObjCourse::setImportantInformation (   $a_info)

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

Referenced by __readSettings(), and cloneSettings().

221  {
222  $this->important = $a_info;
223  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjCourse::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by __readSettings(), and cloneSettings().

860  {
861  $this->latitude = $a_latitude;
862  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by __readSettings(), and cloneSettings().

900  {
901  $this->locationzoom = $a_locationzoom;
902  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by __readSettings(), and cloneSettings().

880  {
881  $this->longitude = $a_longitude;
882  }
+ Here is the caller graph for this function:

◆ setMailToMembersType()

ilObjCourse::setMailToMembersType (   $a_type)

Set mail to members type.

See also
ilCourseConstants
Parameters
type$a_type

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

References $a_type.

Referenced by __readSettings(), and cloneSettings().

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

◆ setMessage()

ilObjCourse::setMessage (   $a_message)

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

Referenced by validate().

760  {
761  $this->message = $a_message;
762  }
+ Here is the caller graph for this function:

◆ setNumberOfNextSessions()

ilObjCourse::setNumberOfNextSessions (   $a_num)

Set number of previous sessions.

Returns
Parameters
int$a_num

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

Referenced by __readSettings(), and cloneSettings().

446  {
447  $this->session_next = $a_num;
448  }
+ Here is the caller graph for this function:

◆ setNumberOfPreviousSessions()

ilObjCourse::setNumberOfPreviousSessions (   $a_num)

Set number of previous sessions.

Returns
Parameters
int$a_num

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

Referenced by __readSettings(), and cloneSettings().

427  {
428  $this->session_prev = $a_num;
429  }
+ Here is the caller graph for this function:

◆ setParentRolePermissions()

ilObjCourse::setParentRolePermissions (   $a_parent_ref)

This method is called before "initDefaultRoles".

Therefore now local course roles are created.

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

Parameters
type$a_parent_ref

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

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

1755  {
1756  global $DIC;
1757 
1758  $rbacadmin = $DIC['rbacadmin'];
1759  $rbacreview = $DIC['rbacreview'];
1760 
1761  $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1762  foreach ((array) $parent_roles as $parent_role) {
1763  $rbacadmin->initIntersectionPermissions(
1764  $this->getRefId(),
1765  $parent_role['obj_id'],
1766  $parent_role['parent'],
1767  $this->__getCrsNonMemberTemplateId(),
1768  ROLE_FOLDER_ID
1769  );
1770  }
1771  }
__getCrsNonMemberTemplateId()
get course non-member template private
$DIC
Definition: xapitoken.php:46
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ setRegistrationAccessCode()

ilObjCourse::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

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

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

193  {
194  $this->reg_access_code = $a_code;
195  }
+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjCourse::setShowMembers (   $a_status)

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

Referenced by __readSettings(), and cloneSettings().

728  {
729  $this->show_members = $a_status;
730  }
+ Here is the caller graph for this function:

◆ setShowMembersExport()

ilObjCourse::setShowMembersExport (   $a_mem_export)

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

Referenced by __readSettings(), and cloneSettings().

174  {
175  $this->member_export = $a_mem_export;
176  }
+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

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

References ilObjUserTracking\_enabledLearningProgress().

Referenced by __construct(), __readSettings(), and cloneSettings().

2252  {
2253  $a_value = (int) $a_value;
2254 
2255  // #13905
2256  if ($a_value == self::STATUS_DETERMINATION_LP) {
2257  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2259  $a_value = self::STATUS_DETERMINATION_MANUAL;
2260  }
2261  }
2262 
2263  $this->status_dt = $a_value;
2264  }
static _enabledLearningProgress()
check wether learing progress is enabled or not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubscriptionEnd()

ilObjCourse::setSubscriptionEnd (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

348  {
349  $this->subscription_end = $a_value;
350  }
+ Here is the caller graph for this function:

◆ setSubscriptionLimitationType()

ilObjCourse::setSubscriptionLimitationType (   $a_type)

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

References $a_type.

Referenced by __readSettings(), and cloneSettings().

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

◆ setSubscriptionMaxMembers()

ilObjCourse::setSubscriptionMaxMembers (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

475  {
476  $this->subscription_max_members = $a_value;
477  }
+ Here is the caller graph for this function:

◆ setSubscriptionMinMembers()

ilObjCourse::setSubscriptionMinMembers (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

1026  {
1027  if ($a_value !== null) {
1028  $a_value = (int) $a_value;
1029  }
1030  $this->min_members = $a_value;
1031  }
+ Here is the caller graph for this function:

◆ setSubscriptionNotify()

ilObjCourse::setSubscriptionNotify (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

612  {
613  $this->subscription_notify = $a_value ? true : false;
614  }
+ Here is the caller graph for this function:

◆ setSubscriptionPassword()

ilObjCourse::setSubscriptionPassword (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

365  {
366  $this->subscription_password = $a_value;
367  }
+ Here is the caller graph for this function:

◆ setSubscriptionStart()

ilObjCourse::setSubscriptionStart (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

340  {
341  $this->subscription_start = $a_value;
342  }
+ Here is the caller graph for this function:

◆ setSubscriptionType()

ilObjCourse::setSubscriptionType (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

357  {
358  $this->subscription_type = $a_value;
359  }
+ Here is the caller graph for this function:

◆ setSyllabus()

ilObjCourse::setSyllabus (   $a_syllabus)

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

Referenced by __readSettings(), and cloneSettings().

229  {
230  $this->syllabus = $a_syllabus;
231  }
+ Here is the caller graph for this function:

◆ setTargetGroup()

ilObjCourse::setTargetGroup ( ?string  $a_tg)
Parameters
string | null$a_tg

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

Referenced by __readSettings(), and cloneSettings().

245  {
246  $this->target_group = $a_tg;
247  }
+ Here is the caller graph for this function:

◆ setTimingMode()

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

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

Referenced by __readSettings(), and cloneSettings().

649  {
650  $this->timing_mode = $a_mode;
651  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjCourse::setViewMode (   $a_mode)

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

Referenced by __readSettings(), and cloneSettings().

617  {
618  $this->view_mode = $a_mode;
619  }
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjCourse::setWaitingListAutoFill (   $a_value)

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

Referenced by __readSettings(), and cloneSettings().

1039  {
1040  $this->auto_fill_from_waiting = (bool) $a_value;
1041  }
+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

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

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

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

◆ toggleCourseStartTimeIndication()

ilObjCourse::toggleCourseStartTimeIndication ( bool  $time_indication)
protected
Parameters
bool$time_indication

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

Referenced by __readSettings(), and setCoursePeriod().

970  {
971  $this->course_start_time_indication = $time_indication;
972  }
+ Here is the caller graph for this function:

◆ update()

ilObjCourse::update ( )

update complete object

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

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

Referenced by cloneSettings().

1328  {
1329  global $DIC;
1330 
1331  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1332  $ilLog = $DIC->logger()->crs();
1333 
1334  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1335  $sorting = new ilContainerSortingSettings($this->getId());
1336  $sorting->setSortMode($this->getOrderType());
1337  $sorting->update();
1338 
1339  $this->updateMetaData();
1340  $this->updateSettings();
1341  parent::update();
1342 
1343  $ilAppEventHandler->raise(
1344  'Modules/Course',
1345  'update',
1346  array('object' => $this,
1347  'obj_id' => $this->getId(),
1348  'appointments' => $this->prepareAppointments('update'))
1349  );
1350  }
updateMetaData()
update meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
$DIC
Definition: xapitoken.php:46
updateSettings()
Update settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSettings()

ilObjCourse::updateSettings ( )

Update settings.

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

References $DIC, $ilDB, $query, $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(), ilObjectActivation\setTimingType(), ilDBConstants\T_INTEGER, ilDBConstants\T_TEXT, ilDBConstants\T_TIMESTAMP, ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by update().

1356  {
1357  global $DIC;
1358 
1359  $ilDB = $DIC['ilDB'];
1360 
1361  // Due to a bug 3.5.alpha maybe no settings exist. => create default settings
1362 
1363  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
1364  $res = $ilDB->query($query);
1365 
1366  if (!$res->numRows()) {
1367  $this->__createDefaultSettings();
1368  }
1369 
1370 
1371  $query = "UPDATE crs_settings SET " .
1372  "syllabus = " . $ilDB->quote($this->getSyllabus(), 'text') . ", " .
1373  "contact_name = " . $ilDB->quote($this->getContactName(), 'text') . ", " .
1374  "contact_responsibility = " . $ilDB->quote($this->getContactResponsibility(), 'text') . ", " .
1375  "contact_phone = " . $ilDB->quote($this->getContactPhone(), 'text') . ", " .
1376  "contact_email = " . $ilDB->quote($this->getContactEmail(), 'text') . ", " .
1377  "contact_consultation = " . $ilDB->quote($this->getContactConsultation(), 'text') . ", " .
1378  "activation_type = " . $ilDB->quote(!$this->getOfflineStatus(), 'integer') . ", " .
1379  "sub_limitation_type = " . $ilDB->quote($this->getSubscriptionLimitationType(), 'integer') . ", " .
1380  "sub_start = " . $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " .
1381  "sub_end = " . $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1382  "sub_type = " . $ilDB->quote($this->getSubscriptionType(), 'integer') . ", " .
1383  "sub_password = " . $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " .
1384  "sub_mem_limit = " . $ilDB->quote((int) $this->isSubscriptionMembershipLimited(), 'integer') . ", " .
1385  "sub_max_members = " . $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1386  "sub_notify = " . $ilDB->quote($this->getSubscriptionNotify(), 'integer') . ", " .
1387  "view_mode = " . $ilDB->quote($this->getViewMode(), 'integer') . ", " .
1388  'timing_mode = ' . $ilDB->quote($this->getTimingMode(), 'integer') . ', ' .
1389  "abo = " . $ilDB->quote($this->getAboStatus(), 'integer') . ", " .
1390  "waiting_list = " . $ilDB->quote($this->enabledWaitingList(), 'integer') . ", " .
1391  "important = " . $ilDB->quote($this->getImportantInformation(), 'text') . ", " .
1392  'target_group = ' . $ilDB->quote($this->getTargetGroup(), \ilDBConstants::T_TEXT) . ', ' .
1393  "show_members = " . $ilDB->quote($this->getShowMembers(), 'integer') . ", " .
1394  "show_members_export = " . $ilDB->quote($this->getShowMembersExport(), 'integer') . ", " .
1395  "latitude = " . $ilDB->quote($this->getLatitude(), 'text') . ", " .
1396  "longitude = " . $ilDB->quote($this->getLongitude(), 'text') . ", " .
1397  "location_zoom = " . $ilDB->quote($this->getLocationZoom(), 'integer') . ", " .
1398  "enable_course_map = " . $ilDB->quote((int) $this->getEnableCourseMap(), 'integer') . ", " .
1399  'session_limit = ' . $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1400  'session_prev = ' . $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1401  'session_next = ' . $ilDB->quote($this->getNumberOfNextSessions(), 'integer') . ', ' .
1402  'reg_ac_enabled = ' . $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1403  'reg_ac = ' . $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1404  'auto_notification = ' . $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1405  'status_dt = ' . $ilDB->quote((int) $this->getStatusDetermination()) . ', ' .
1406  'mail_members_type = ' . $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ', ' .
1407  'period_start = ' . $ilDB->quote(\ilCalendarUtil::convertDateToUtcDBTimestamp($this->getCourseStart()), \ilDBConstants::T_TIMESTAMP) . ', ' .
1408  'period_end = ' . $ilDB->quote(\ilCalendarUtil::convertDateToUtcDBTimestamp($this->getCourseEnd()), \ilDBConstants::T_TIMESTAMP) . ', ' .
1409  'period_time_indication = ' . $ilDB->quote($this->getCourseStartTimeIndication() ? 1 : 0, \ilDBConstants::T_INTEGER) . ', ' .
1410  'auto_wait = ' . $ilDB->quote((int) $this->hasWaitingListAutoFill(), 'integer') . ', ' .
1411  'leave_end = ' . $ilDB->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1412  'min_members = ' . $ilDB->quote((int) $this->getSubscriptionMinMembers(), 'integer') . ' ' .
1413  "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . "";
1414 
1415  $res = $ilDB->manipulate($query);
1416 
1417  // moved activation to ilObjectActivation
1418  if ($this->ref_id) {
1419  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1420  ilObjectActivation::getItem($this->ref_id);
1421 
1422  $item = new ilObjectActivation;
1423  if (!$this->getActivationStart() || !$this->getActivationEnd()) {
1425  } else {
1426  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1427  $item->setTimingStart($this->getActivationStart());
1428  $item->setTimingEnd($this->getActivationEnd());
1429  $item->toggleVisible($this->getActivationVisibility());
1430  }
1431 
1432  $item->update($this->ref_id);
1433  }
1434  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
static convertDateToUtcDBTimestamp(\ilDateTime $date=null)
static getItem($a_ref_id)
Get item data.
getOfflineStatus()
Get offline status.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
getLocationZoom()
Get LocationZoom.
foreach($_POST as $key=> $value) $res
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
$query
getRegistrationAccessCode()
get access code
setTimingType($a_type)
Set timing type.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
$DIC
Definition: xapitoken.php:46
getEnableCourseMap()
Get Enable Course Map.
Class ilObjectActivation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjCourse::validate ( )

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

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

1207  {
1208  $this->setMessage('');
1209 
1211  $this->getSubscriptionStart() > $this->getSubscriptionEnd()) {
1212  $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
1213  }
1215  $this->appendMessage($this->lng->txt("crs_password_required"));
1216  }
1217  if ($this->isSubscriptionMembershipLimited()) {
1218  if ($this->getSubscriptionMinMembers() <= 0 && $this->getSubscriptionMaxMembers() <= 0) {
1219  $this->appendMessage($this->lng->txt("crs_max_and_min_members_needed"));
1220  }
1221  if ($this->getSubscriptionMaxMembers() <= 0 && $this->enabledWaitingList()) {
1222  $this->appendMessage($this->lng->txt("crs_max_members_needed"));
1223  }
1224  if ($this->getSubscriptionMaxMembers() > 0 && $this->getSubscriptionMinMembers() > $this->getSubscriptionMaxMembers()) {
1225  $this->appendMessage($this->lng->txt("crs_max_and_min_members_invalid"));
1226  }
1227  }
1228  if (!$this->getTitle() || !$this->getStatusDetermination()) {
1229  $this->appendMessage($this->lng->txt('err_check_input'));
1230  }
1231 
1232  // :TODO: checkInput() is not used properly
1233  if (($this->getCourseStart() && !$this->getCourseEnd()) ||
1234  (!$this->getCourseStart() && $this->getCourseEnd()) ||
1235  ($this->getCourseStart() && $this->getCourseEnd() && $this->getCourseStart()->get(IL_CAL_UNIX) > $this->getCourseEnd()->get(IL_CAL_UNIX))) {
1236  $this->appendMessage($this->lng->txt("crs_course_period_not_valid"));
1237  }
1238 
1239  return $this->getMessage() ? false : true;
1240  }
const IL_CRS_SUBSCRIPTION_LIMITED
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
const IL_CRS_SUBSCRIPTION_PASSWORD
getTitle()
get object title public
setMessage($a_message)
isSubscriptionMembershipLimited()
is membership limited
appendMessage($a_message)
+ Here is the call graph for this function:

◆ validateInfoSettings()

ilObjCourse::validateInfoSettings ( )

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

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

1243  {
1244  global $DIC;
1245 
1246  $ilErr = $DIC['ilErr'];
1247  $error = false;
1248  if ($this->getContactEmail()) {
1249  $emails = explode(",", $this->getContactEmail());
1250 
1251  foreach ($emails as $email) {
1252  $email = trim($email);
1253  if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email))) {
1254  $ilErr->appendMessage($this->lng->txt('contact_email_not_valid') . " '" . $email . "'");
1255  $error = true;
1256  }
1257  }
1258  }
1259  return !$error;
1260  }
static getUserIdByLogin($a_login)
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
$ilErr
Definition: raiseError.php:18
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:285
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Field Documentation

◆ $archives_obj

ilObjCourse::$archives_obj

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

◆ $auto_fill_from_waiting

ilObjCourse::$auto_fill_from_waiting
protected

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

Referenced by hasWaitingListAutoFill().

◆ $auto_notification

ilObjCourse::$auto_notification = true
private

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

Referenced by getAutoNotification().

◆ $course_logger

ilObjCourse::$course_logger = null
protected

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

◆ $course_start_time_indication

ilObjCourse::$course_start_time_indication = false
protected

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

Referenced by getCourseStartTimeIndication().

◆ $crs_end

ilObjCourse::$crs_end
protected

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

Referenced by getCourseEnd().

◆ $crs_start

ilObjCourse::$crs_start
protected

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

Referenced by getCourseStart().

◆ $enablemap

ilObjCourse::$enablemap = 0
private

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

Referenced by getEnableCourseMap().

◆ $latitude

ilObjCourse::$latitude = ''
private

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

Referenced by getLatitude().

◆ $leave_end

ilObjCourse::$leave_end
protected

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

Referenced by getCancellationEnd().

◆ $locationzoom

ilObjCourse::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $longitude

ilObjCourse::$longitude = ''
private

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

Referenced by getLongitude().

◆ $mail_members

ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $member_export

ilObjCourse::$member_export = false
protected

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

Referenced by getShowMembersExport().

◆ $member_obj

ilObjCourse::$member_obj = null
private

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

Referenced by getMemberObject().

◆ $members_obj

ilObjCourse::$members_obj = null
private

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

Referenced by getMembersObject().

◆ $min_members

ilObjCourse::$min_members
protected

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

Referenced by getSubscriptionMinMembers().

◆ $reg_access_code

ilObjCourse::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjCourse::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $session_limit

ilObjCourse::$session_limit = 0
private

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

Referenced by isSessionLimitEnabled().

◆ $session_next

ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

ilObjCourse::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

◆ $status_dt

ilObjCourse::$status_dt = null
private

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

Referenced by getStatusDetermination().

◆ $target_group

ilObjCourse::$target_group = ''
private

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

Referenced by getTargetGroup().

◆ $timing_mode

ilObjCourse::$timing_mode = ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE
private

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

Referenced by getTimingMode().

◆ CAL_ACTIVATION_END

const ilObjCourse::CAL_ACTIVATION_END = 4

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

◆ CAL_ACTIVATION_START

const ilObjCourse::CAL_ACTIVATION_START = 3

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

◆ CAL_COURSE_END

const ilObjCourse::CAL_COURSE_END = 6

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

◆ CAL_COURSE_START

const ilObjCourse::CAL_COURSE_START = 5

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

◆ CAL_COURSE_TIMING_END

◆ CAL_COURSE_TIMING_START

◆ CAL_REG_END

const ilObjCourse::CAL_REG_END = 2

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

◆ CAL_REG_START

const ilObjCourse::CAL_REG_START = 1

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

◆ STATUS_DETERMINATION_LP

◆ STATUS_DETERMINATION_MANUAL

const ilObjCourse::STATUS_DETERMINATION_MANUAL = 2

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

Referenced by ilObjCourseGUI\initEditForm().


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