ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjCourse Class Reference

Class ilObjCourse. More...

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

Public Member Functions

 ilObjCourse ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 getRegistrationAccessCode ()
 get access code More...
 
 setRegistrationAccessCode ($a_code)
 Set refistration access code. More...
 
 isRegistrationAccessCodeEnabled ()
 Check if access code is enabled. More...
 
 enableRegistrationAccessCode ($a_status)
 En/disable registration access code. More...
 
 getImportantInformation ()
 
 setImportantInformation ($a_info)
 
 getSyllabus ()
 
 setSyllabus ($a_syllabus)
 
 getContactName ()
 
 setContactName ($a_cn)
 
 getContactConsultation ()
 
 setContactConsultation ($a_value)
 
 getContactPhone ()
 
 setContactPhone ($a_value)
 
 getContactEmail ()
 
 setContactEmail ($a_value)
 
 getContactResponsibility ()
 
 setContactResponsibility ($a_value)
 
 getActivationType ()
 
 setActivationType ($a_type)
 
 getActivationUnlimitedStatus ()
 
 getActivationStart ()
 
 setActivationStart ($a_value)
 
 getActivationEnd ()
 
 setActivationEnd ($a_value)
 
 getOfflineStatus ()
 
 setOfflineStatus ($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)
 Get subitems of container. More...
 
 getSubscriptionNotify ()
 
 setSubscriptionNotify ($a_value)
 
 setViewMode ($a_mode)
 
 getViewMode ()
 Get container view mode. More...
 
 _lookupViewMode ($a_id)
 
 _lookupAboStatus ($a_id)
 
 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 ($a_check_archive=false)
 
 _isActivated ($a_obj_id)
 Is activated. More...
 
 _registrationEnabled ($a_obj_id)
 Registration enabled? Method is in Access class, since it is needed by Access/ListGUI. More...
 
 isArchived ()
 
 allowAbo ()
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 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...
 
 getEnableCourseMap ()
 Get Enable Course Map. More...
 
 setCourseStart (ilDate $a_value=null)
 
 getCourseStart ()
 
 setCourseEnd (ilDate $a_value=null)
 
 getCourseEnd ()
 
 setCancellationEnd (ilDate $a_value=null)
 
 getCancellationEnd ()
 
 setSubscriptionMinMembers ($a_value)
 
 getSubscriptionMinMembers ()
 
 setWaitingListAutoFill ($a_value)
 
 hasWaitingListAutoFill ()
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone course (no member data) More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (start objects, preconditions) More...
 
 cloneAutoGeneratedRoles ($new_obj)
 Clone automatic genrated roles (permissions and template permissions) More...
 
 validate ()
 
 validateInfoSettings ()
 
 hasContactData ()
 
 delete ()
 delete course and all related data
More...
 
 update ()
 update complete object More...
 
 updateSettings ()
 
 cloneSettings ($new_obj)
 Clone entries in settings table. More...
 
 __createDefaultSettings ()
 
 __readSettings ()
 
 initWaitingList ()
 
 getMemberObject ()
 Get course member object. More...
 
 getMembersObject ()
 
 initCourseArchiveObject ()
 
 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) @access public More...
 
 setParentRolePermissions ($a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 __getCrsNonMemberTemplateId ()
 get course non-member template @access 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 @access public More...
 
 __getLocalRoles ()
 
 __deleteSettings ()
 
 getDefaultMemberRole ()
 
 getDefaultTutorRole ()
 
 getDefaultAdminRole ()
 
 _deleteUser ($a_usr_id)
 
 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 ()
 Get order type default implementation. More...
 
 handleAutoFill ()
 
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 _getContainerDirectory ($a_id)
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 getCustomIconPath ()
 Get path for custom icon. 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...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings. 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...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. 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 lookupCourseNonMemberTemplatesId ()
 Lookup course non member id. More...
 
static lookupObjectsByCode ($a_code)
 
static mayLeave ($a_course_id, $a_user_id=null, &$a_date=null)
 
static findCoursesWithNotEnoughMembers ()
 Minimum members check @global type $ilDB. More...
 
- Static Public Member Functions inherited from ilContainer
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 _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public 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 _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. 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 hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
static lookupObjectsByCode ($a_code)
 Lookup all objects with reg_access_code enabled and. 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 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
 
 $ilias
 
 $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
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

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

Protected Attributes

 $crs_start
 
 $crs_end
 
 $leave_end
 
 $min_members
 
 $auto_fill_from_waiting
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = false
 

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
 
 $auto_notification = true
 

Additional Inherited Members

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

Detailed Description

Class ilObjCourse.

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

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

Member Function Documentation

◆ __createDefaultSettings()

ilObjCourse::__createDefaultSettings ( )

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

1373 {
1374 global $ilDB;
1375
1376 include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1378
1379 $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility,".
1380 "contact_phone,contact_email,contact_consultation,activation_type,activation_start,".
1381 "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit,".
1382 "sub_max_members,sub_notify,view_mode,archive_start,archive_end,archive_type,abo," .
1383 "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, ".
1384 "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) ".
1385 "VALUES( ".
1386 $ilDB->quote($this->getId() ,'integer').", ".
1387 $ilDB->quote($this->getSyllabus() ,'text').", ".
1388 $ilDB->quote($this->getContactName() ,'text').", ".
1389 $ilDB->quote($this->getContactResponsibility() ,'text').", ".
1390 $ilDB->quote($this->getContactPhone() ,'text').", ".
1391 $ilDB->quote($this->getContactEmail() ,'text').", ".
1392 $ilDB->quote($this->getContactConsultation() ,'text').", ".
1393 $ilDB->quote(0 ,'integer').", ".
1394 $ilDB->quote($this->getActivationStart() ,'integer').", ".
1395 $ilDB->quote($this->getActivationEnd() ,'integer').", ".
1396 $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED ,'integer').", ".
1397 $ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
1398 $ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
1399 $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT ,'integer').", ".
1400 $ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
1401 "0, ".
1402 $ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
1403 "1, ".
1404 "0, ".
1405 $ilDB->quote($this->getArchiveStart() ,'integer').", ".
1406 $ilDB->quote($this->getArchiveEnd() ,'integer').", ".
1407 $ilDB->quote(IL_CRS_ARCHIVE_NONE ,'integer').", ".
1408 $ilDB->quote($this->ABO_ENABLED ,'integer').", ".
1409 $ilDB->quote($this->getLatitude() ,'text').", ".
1410 $ilDB->quote($this->getLongitude() ,'text').", ".
1411 $ilDB->quote($this->getLocationZoom() ,'integer').", ".
1412 $ilDB->quote($this->getEnableCourseMap() ,'integer').", ".
1413 #"objective_view = '0', ".
1414 "1, ".
1415 "1,".
1416 $ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
1417 $ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1418 $ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1419 $ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
1420 $ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
1421 $ilDB->quote((int)$this->getAutoNotification(),'integer').', '.
1422 $ilDB->quote((int)$this->getStatusDetermination(),'integer').', '.
1423 $ilDB->quote((int) $this->getMailToMembersType(),'integer').' '.
1424 ")";
1425
1426 $res = $ilDB->manipulate($query);
1427 $this->__readSettings();
1428
1429 include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1430 $sorting = new ilContainerSortingSettings($this->getId());
1431 $sorting->setSortMode(ilContainer::SORT_MANUAL);
1432 $sorting->update();
1433 }
const IL_CRS_ARCHIVE_NONE
const IL_CRS_SUBSCRIPTION_DEACTIVATED
const IL_CRS_SUBSCRIPTION_DIRECT
static generateCode()
Generate new registration key.
getMailToMembersType()
Get mail to members type.
getLatitude()
Get Latitude.
setRegistrationAccessCode($a_code)
Set refistration access code.
getLocationZoom()
Get LocationZoom.
getEnableCourseMap()
Get Enable Course Map.
getRegistrationAccessCode()
get access code
getStatusDetermination()
Get status determination mode.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getNumberOfPreviousSessions()
Set number of previous sessions.
getLongitude()
Get Longitude.
getId()
get object id @access public
global $ilDB

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

Referenced by create(), and updateSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __deleteSettings()

ilObjCourse::__deleteSettings ( )

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

1780 {
1781 global $ilDB;
1782
1783 $query = "DELETE FROM crs_settings ".
1784 "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
1785 $res = $ilDB->manipulate($query);
1786
1787 return true;
1788 }

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

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getCrsNonMemberTemplateId()

ilObjCourse::__getCrsNonMemberTemplateId ( )

get course non-member template @access private

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

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

1655 {
1656 global $ilDB;
1657
1658 $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1659 $res = $this->ilias->db->query($q);
1660 $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1661
1662 return $row["obj_id"];
1663 }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
redirection script todo: (a better solution should control the processing via a xml file)

References $ilDB, $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by setParentRolePermissions().

+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )

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

1771 {
1772 global $rbacreview;
1773
1774 // GET role_objects of predefined roles
1775
1776 return $rbacreview->getRolesOfRoleFolder($this->getRefId(),false);
1777 }
getRefId()
get reference id @access public

References ilObject\getRefId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __readSettings()

ilObjCourse::__readSettings ( )

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

1437 {
1438 global $ilDB;
1439
1440 $query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
1441
1442 $res = $ilDB->query($query);
1443 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1444 {
1445 $this->setSyllabus($row->syllabus);
1446 $this->setContactName($row->contact_name);
1447 $this->setContactResponsibility($row->contact_responsibility);
1448 $this->setContactPhone($row->contact_phone);
1449 $this->setContactEmail($row->contact_email);
1450 $this->setContactConsultation($row->contact_consultation);
1451 $this->setOfflineStatus(!(bool)$row->activation_type); // see below
1452 $this->setSubscriptionLimitationType($row->sub_limitation_type);
1453 $this->setSubscriptionStart($row->sub_start);
1454 $this->setSubscriptionEnd($row->sub_end);
1455 $this->setSubscriptionType($row->sub_type);
1456 $this->setSubscriptionPassword($row->sub_password);
1457 $this->enableSubscriptionMembershipLimitation($row->sub_mem_limit);
1458 $this->setSubscriptionMaxMembers($row->sub_max_members);
1459 $this->setSubscriptionNotify($row->sub_notify);
1460 $this->setViewMode($row->view_mode);
1461 $this->setArchiveStart($row->archive_start);
1462 $this->setArchiveEnd($row->archive_end);
1463 $this->setArchiveType($row->archive_type);
1464 $this->setAboStatus($row->abo);
1465 $this->enableWaitingList($row->waiting_list);
1466 $this->setImportantInformation($row->important);
1467 $this->setShowMembers($row->show_members);
1468 $this->setLatitude($row->latitude);
1469 $this->setLongitude($row->longitude);
1470 $this->setLocationZoom($row->location_zoom);
1471 $this->setEnableCourseMap($row->enable_course_map);
1472 $this->enableSessionLimit($row->session_limit);
1473 $this->setNumberOfPreviousSessions($row->session_prev);
1474 $this->setNumberOfNextSessions($row->session_next);
1475 $this->enableRegistrationAccessCode($row->reg_ac_enabled);
1476 $this->setRegistrationAccessCode($row->reg_ac);
1477 $this->setAutoNotification($row->auto_notification == 1 ? true : false);
1478 $this->setStatusDetermination((int) $row->status_dt);
1479 $this->setMailToMembersType($row->mail_members_type);
1480 $this->setCourseStart($row->crs_start ? new ilDate($row->crs_start, IL_CAL_UNIX) : null);
1481 $this->setCourseEnd($row->crs_end ? new ilDate($row->crs_end, IL_CAL_UNIX) : null);
1482 $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
1483 $this->setWaitingListAutoFill($row->auto_wait);
1484 $this->setSubscriptionMinMembers($row->min_members ? $row->min_members : null);
1485 }
1486
1487 // moved activation to ilObjectActivation
1488 if($this->ref_id)
1489 {
1490 include_once "./Services/Object/classes/class.ilObjectActivation.php";
1491 $activation = ilObjectActivation::getItem($this->ref_id);
1492 switch($activation["timing_type"])
1493 {
1496 $this->setActivationStart($activation["timing_start"]);
1497 $this->setActivationEnd($activation["timing_end"]);
1498 $this->setActivationVisibility($activation["visible"]);
1499 break;
1500
1501 default:
1503 break;
1504 }
1505 }
1506 else
1507 {
1508 // #13176 - there should always be default
1510 }
1511
1512 return true;
1513 }
const IL_CRS_ACTIVATION_UNLIMITED
const IL_CRS_ACTIVATION_LIMITED
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
const IL_CAL_UNIX
Class for single dates.
setLongitude($a_longitude)
Set Longitude.
setActivationStart($a_value)
setStatusDetermination($a_value)
Set status determination mode.
setSubscriptionNotify($a_value)
enableWaitingList($a_status)
enableSubscriptionMembershipLimitation($a_status)
enable max members
enableSessionLimit($a_status)
en/disable limited number of sessions
setNumberOfNextSessions($a_num)
Set number of previous sessions.
setWaitingListAutoFill($a_value)
setCourseEnd(ilDate $a_value=null)
setSubscriptionType($a_value)
setCourseStart(ilDate $a_value=null)
setContactEmail($a_value)
setOfflineStatus($a_value)
setActivationEnd($a_value)
setContactPhone($a_value)
setArchiveType($a_value)
setSubscriptionEnd($a_value)
setLatitude($a_latitude)
Set Latitude.
enableRegistrationAccessCode($a_status)
En/disable registration access code.
setSubscriptionMaxMembers($a_value)
setArchiveEnd($a_value)
setShowMembers($a_status)
setMailToMembersType($a_type)
Set mail to members type.
setSubscriptionPassword($a_value)
setSubscriptionStart($a_value)
setImportantInformation($a_info)
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
setContactConsultation($a_value)
setSyllabus($a_syllabus)
setSubscriptionMinMembers($a_value)
setContactResponsibility($a_value)
setAboStatus($a_status)
setViewMode($a_mode)
setArchiveStart($a_value)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setSubscriptionLimitationType($a_type)
setActivationType($a_type)
setCancellationEnd(ilDate $a_value=null)
setLocationZoom($a_locationzoom)
Set LocationZoom.
setAutoNotification($value)
Sets automatic notification status in $this->auto_notification, using given $status.
setActivationVisibility($a_value)
static getItem($a_ref_id)
Get item data.

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

Referenced by __createDefaultSettings(), and read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteUser()

ilObjCourse::_deleteUser (   $a_usr_id)

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

1839 {
1840 // Delete all user related data
1841 // delete lm_history
1842 include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
1844
1845 include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1847
1848 // Course objectives
1849 include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1851 }
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
static _deleteUser($a_usr_id)
Delete user data.

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

Referenced by ilObjUser\delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

ilObjCourse::_isActivated (   $a_obj_id)

Is activated.

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

Parameters
intid of user
Returns
boolean

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

716 {
717 include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
718 return ilObjCourseAccess::_isActivated($a_obj_id);
719 }
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?

References ilObjCourseAccess\_isActivated().

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

+ 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.

@access public

Parameters
intcourse_id

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

445 {
446 global $ilDB;
447
448 $query = "SELECT * FROM crs_settings ".
449 "WHERE obj_id = ".$ilDB->quote($a_course_id ,'integer')." ".
450 "AND sub_notify = 1";
451 $res = $ilDB->query($query);
452 return $res->numRows() ? true : false;
453 }

References $ilDB, $query, and $res.

◆ _lookupAboStatus()

ilObjCourse::_lookupAboStatus (   $a_id)

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

595 {
596 global $ilDB;
597
598 $query = "SELECT abo FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,'integer')." ";
599 $res = $ilDB->query($query);
600 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
601 {
602 return $row->abo;
603 }
604 return false;
605 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

+ Here is the caller graph for this function:

◆ _lookupViewMode()

ilObjCourse::_lookupViewMode (   $a_id)

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

582 {
583 global $ilDB;
584
585 $query = "SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,'integer')." ";
586 $res = $ilDB->query($query);
587 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
588 {
589 return $row->view_mode;
590 }
591 return false;
592 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

+ Here is the caller graph for this function:

◆ _registrationEnabled()

ilObjCourse::_registrationEnabled (   $a_obj_id)

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

Parameters
intid of user
Returns
boolean

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

728 {
729 include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
731 }
static _registrationEnabled($a_obj_id)

References ilObjCourseAccess\_registrationEnabled().

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

+ 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.

Reimplemented from ilContainer.

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

1884 {
1885 include_once './Services/Object/classes/class.ilObjectActivation.php';
1887 }
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.

References ilObjectActivation\addAdditionalSubItemInformation().

+ Here is the call graph for this function:

◆ allowAbo()

ilObjCourse::allowAbo ( )

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

747 {
748 return $this->ABO == $this->ABO_ENABLED;
749 }

◆ appendMessage()

ilObjCourse::appendMessage (   $a_message)

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

676 {
677 if($this->getMessage())
678 {
679 $this->message .= "<br /> ";
680 }
681 $this->message .= $a_message;
682 }

References getMessage().

Referenced by validate().

+ 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 2148 of file class.ilObjCourse.php.

2149 {
2150 // #11113
2151 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2154 {
2155 include_once("Services/Tracking/classes/class.ilLPStatus.php");
2156 // #13811 - we need to suppress creation if status entry
2157 $has_completed = (ilLPStatus::_lookupStatus($this->getId(), $a_member_id, false) == ilLPStatus::LP_STATUS_COMPLETED_NUM);
2158 $this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
2159 }
2160 }
const LP_STATUS_COMPLETED_NUM
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const STATUS_DETERMINATION_LP
static _enabledLearningProgress()
check wether learing progress is enabled or not

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

Referenced by handleAutoFill().

+ 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)

@access public

Parameters
objectnew course object

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

1020 {
1021 global $ilLog,$rbacadmin,$rbacreview;
1022
1023 $admin = $this->getDefaultAdminRole();
1024 $new_admin = $new_obj->getDefaultAdminRole();
1025
1026 if(!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId())
1027 {
1028 $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_admin');
1029 }
1030 $rbacadmin->copyRolePermissions($admin,$this->getRefId(),$new_obj->getRefId(),$new_admin,true);
1031 $ilLog->write(__METHOD__.' : Finished copying of role crs_admin.');
1032
1033 $tutor = $this->getDefaultTutorRole();
1034 $new_tutor = $new_obj->getDefaultTutorRole();
1035 if(!$tutor || !$new_tutor)
1036 {
1037 $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_tutor');
1038 }
1039 $rbacadmin->copyRolePermissions($tutor,$this->getRefId(),$new_obj->getRefId(),$new_tutor,true);
1040 $ilLog->write(__METHOD__.' : Finished copying of role crs_tutor.');
1041
1042 $member = $this->getDefaultMemberRole();
1043 $new_member = $new_obj->getDefaultMemberRole();
1044 if(!$member || !$new_member)
1045 {
1046 $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_member');
1047 }
1048 $rbacadmin->copyRolePermissions($member,$this->getRefId(),$new_obj->getRefId(),$new_member,true);
1049 $ilLog->write(__METHOD__.' : Finished copying of role crs_member.');
1050
1051 return true;
1052 }

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

Referenced by cloneObject().

+ 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)

@access public

Parameters
inttarget ref id of new course
intcopy id

Reimplemented from ilContainer.

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

988 {
989 parent::cloneDependencies($a_target_id,$a_copy_id);
990
991 // Clone course start objects
992 include_once('Services/Container/classes/class.ilContainerStartObjects.php');
993 $start = new ilContainerStartObjects($this->getRefId(),$this->getId());
994 $start->cloneDependencies($a_target_id,$a_copy_id);
995
996 // Clone course item settings
997 include_once('Services/Object/classes/class.ilObjectActivation.php');
998 ilObjectActivation::cloneDependencies($this->getRefId(),$a_target_id,$a_copy_id);
999
1000 // clone objective settings
1001 include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
1002 ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
1003
1004 // Clone course learning objectives
1005 include_once('Modules/Course/classes/class.ilCourseObjective.php');
1006 $crs_objective = new ilCourseObjective($this);
1007 $crs_objective->ilClone($a_target_id,$a_copy_id);
1008
1009 return true;
1010 }
class ilcourseobjective
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
static _lookupObjId($a_id)

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

+ Here is the call graph for this function:

◆ cloneObject()

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

Clone course (no member data)

@access public

Parameters
inttarget ref_id
intcopy id

Reimplemented from ilContainer.

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

923 {
924 global $ilDB,$ilUser;
925
926 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
927
928 $this->cloneAutoGeneratedRoles($new_obj);
929 $this->cloneMetaData($new_obj);
930
931 // Assign admin
932 $new_obj->getMemberObject()->add($ilUser->getId(),IL_CRS_ADMIN);
933 // cognos-blu-patch: begin
934 $new_obj->getMemberObject()->updateContact($ilUser->getId(), 1);
935 // cognos-blu-patch: end
936
937
938 // #14596
939 $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
940 if($cwo->isRootNode($this->getRefId()))
941 {
942 $this->setOfflineStatus(true);
943 }
944
945 // Copy settings
946 $this->cloneSettings($new_obj);
947
948 // Course Defined Fields
949 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
950 ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
951
952 // Clone course files
953 include_once('Modules/Course/classes/class.ilCourseFile.php');
954 ilCourseFile::_cloneFiles($this->getId(),$new_obj->getId());
955
956 // Copy learning progress settings
957 include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
958 $obj_settings = new ilLPObjSettings($this->getId());
959 $obj_settings->cloneSettings($new_obj->getId());
960 unset($obj_settings);
961
962 // clone icons
963 global $ilLog;
964 $ilLog->write(__METHOD__.': '.$this->getBigIconPath().' '.$this->getSmallIconPath());
965 $new_obj->saveIcons($this->getBigIconPath(),
966 $this->getSmallIconPath(),
967 $this->getTinyIconPath());
968
969 // clone certificate (#11085)
970 include_once "./Services/Certificate/classes/class.ilCertificate.php";
971 include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
972 $cert = new ilCertificate(new ilCourseCertificateAdapter($this));
973 $newcert = new ilCertificate(new ilCourseCertificateAdapter($new_obj));
974 $cert->cloneCertificate($newcert);
975
976 return $new_obj;
977 }
const IL_CRS_ADMIN
Base class for course and group participants.
Create PDF certificates.
getBigIconPath()
Get path for big icon.
getSmallIconPath()
Get path for small icon.
getTinyIconPath()
Get path for tiny icon.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _clone($a_source_id, $a_target_id)
Clone fields.
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
cloneSettings($new_obj)
Clone entries in settings table.
cloneMetaData($target_obj)
Copy meta data.
global $ilUser
Definition: imgupload.php:15

References $ilDB, $ilLog, $ilUser, ilCourseDefinedFieldDefinition\_clone(), ilCourseFile\_cloneFiles(), ilCopyWizardOptions\_getInstance(), cloneAutoGeneratedRoles(), ilObject\cloneMetaData(), cloneSettings(), ilContainer\getBigIconPath(), ilObject\getId(), ilContainer\getSmallIconPath(), ilContainer\getTinyIconPath(), IL_CRS_ADMIN, and setOfflineStatus().

+ Here is the call graph for this function:

◆ cloneSettings()

ilObjCourse::cloneSettings (   $new_obj)

Clone entries in settings table.

@access public

Parameters
ilObjCoursenew course object

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

1319 {
1320 $new_obj->setSyllabus($this->getSyllabus());
1321 $new_obj->setContactName($this->getContactName());
1322 $new_obj->setContactResponsibility($this->getContactResponsibility());
1323 $new_obj->setContactPhone($this->getContactPhone());
1324 $new_obj->setContactEmail($this->getContactEmail());
1325 $new_obj->setContactConsultation($this->getContactConsultation());
1326 $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1327 $new_obj->setActivationType($this->getActivationType());
1328 $new_obj->setActivationStart($this->getActivationStart());
1329 $new_obj->setActivationEnd($this->getActivationEnd());
1330 $new_obj->setActivationVisibility($this->getActivationVisibility());
1331 $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1332 $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1333 $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1334 $new_obj->setSubscriptionType($this->getSubscriptionType());
1335 $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1336 $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1337 $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1338 $new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
1339 $new_obj->setViewMode($this->getViewMode());
1340 $new_obj->setOrderType($this->getOrderType());
1341 $new_obj->setArchiveStart($this->getArchiveStart());
1342 $new_obj->setArchiveEnd($this->getArchiveEnd());
1343 $new_obj->setArchiveType($this->getArchiveType());
1344 $new_obj->setAboStatus($this->getAboStatus());
1345 $new_obj->enableWaitingList($this->enabledWaitingList());
1346 $new_obj->setImportantInformation($this->getImportantInformation());
1347 $new_obj->setShowMembers($this->getShowMembers());
1348 $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1349 $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1350 $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1351 $new_obj->setAutoNotification( $this->getAutoNotification() );
1352 $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1353 include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1354 $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1355 $new_obj->setStatusDetermination($this->getStatusDetermination());
1356 $new_obj->setMailToMembersType($this->getMailToMembersType());
1357 $new_obj->setCourseStart($this->getCourseStart());
1358 $new_obj->setCourseEnd($this->getCourseEnd());
1359 $new_obj->setCancellationEnd($this->getCancellationEnd());
1360 $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
1361 $new_obj->setSubscriptionMinMembers($this->getSubscriptionMinMembers());
1362
1363 // #10271
1364 $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1365 $new_obj->setLatitude($this->getLatitude());
1366 $new_obj->setLongitude($this->getLongitude());
1367 $new_obj->setLocationZoom($this->getLocationZoom());
1368
1369 $new_obj->update();
1370 }
getNumberOfNextSessions()
Set number of previous sessions.
isSubscriptionMembershipLimited()
is membership limited
getViewMode()
Get container view mode.
getOrderType()
Get order type default implementation.

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

Referenced by cloneObject().

+ 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 760 of file class.ilObjCourse.php.

761 {
762 global $ilAppEventHandler;
763
764 parent::create($a_upload);
765
766 if(!$a_upload)
767 {
768 $this->createMetaData();
769 }
771
772 $ilAppEventHandler->raise('Modules/Course',
773 'create',
774 array('object' => $this,
775 'obj_id' => $this->getId(),
776 'appointments' => $this->prepareAppointments('create')));
777
778 }
prepareAppointments($a_mode='create')
Prepare calendar appointments.
createMetaData()
create meta data entry

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

+ Here is the call graph for this function:

◆ delete()

ilObjCourse::delete ( )

delete course and all related data

@access public

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

Reimplemented from ilObject.

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

1159 {
1160 global $ilAppEventHandler;
1161
1162 // always call parent delete function first!!
1163 if (!parent::delete())
1164 {
1165 return false;
1166 }
1167
1168 // delete meta data
1169 $this->deleteMetaData();
1170
1171 // put here course specific stuff
1172
1173 $this->__deleteSettings();
1174
1175 include_once('Modules/Course/classes/class.ilCourseParticipants.php');
1177
1178 $this->initCourseArchiveObject();
1179 $this->archives_obj->deleteAll();
1180
1181 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1183
1184 include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
1186
1187 include_once './Modules/Course/classes/class.ilCourseFile.php';
1189
1190 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1192
1193 $ilAppEventHandler->raise('Modules/Course',
1194 'delete',
1195 array('object' => $this,
1196 'obj_id' => $this->getId(),
1197 'appointments' => $this->prepareAppointments('delete')));
1198
1199
1200 return true;
1201 }
static _deleteByContainer($a_container_id)
Delete all fields of a container.
_deleteByCourse($a_course_id)
deleteMetaData()
delete meta data entry
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.

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

+ Here is the call graph for this function:

◆ enabledObjectiveView()

ilObjCourse::enabledObjectiveView ( )

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

324 {
325 return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
326 }
const IL_CRS_VIEW_OBJECTIVE

References IL_CRS_VIEW_OBJECTIVE.

Referenced by getOrderType().

+ Here is the caller graph for this function:

◆ enabledWaitingList()

ilObjCourse::enabledWaitingList ( )

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

329 {
330 return (bool) $this->waiting_list;
331 }

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

+ 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 165 of file class.ilObjCourse.php.

166 {
167 $this->reg_access_code_enabled = $a_status;
168 }

Referenced by __readSettings().

+ 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 356 of file class.ilObjCourse.php.

357 {
358 $this->session_limit = $a_status;
359 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ enableSubscriptionMembershipLimitation()

ilObjCourse::enableSubscriptionMembershipLimitation (   $a_status)

enable max members

@access public

Parameters
boolstatus
Returns

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

374 {
375 $this->subscription_membership_limitation = $a_status;
376 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjCourse::enableWaitingList (   $a_status)

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

334 {
335 $this->waiting_list = (bool) $a_status;
336 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ findCoursesWithNotEnoughMembers()

static ilObjCourse::findCoursesWithNotEnoughMembers ( )
static

Minimum members check @global type $ilDB.

Returns
array

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

2242 {
2243 global $ilDB;
2244
2245 $res = array();
2246
2247 $now = time();
2248
2249 include_once "Modules/Course/classes/class.ilCourseParticipants.php";
2250
2251 $set = $ilDB->query("SELECT obj_id, min_members".
2252 " FROM crs_settings".
2253 " WHERE min_members > ".$ilDB->quote(0, "integer").
2254 " AND sub_mem_limit = ".$ilDB->quote(1, "integer"). // #17206
2255 " AND ((leave_end IS NOT NULL".
2256 " AND leave_end < ".$ilDB->quote($now, "text").")".
2257 " OR (leave_end IS NULL".
2258 " AND sub_end IS NOT NULL".
2259 " AND sub_end < ".$ilDB->quote($now, "text")."))".
2260 " AND (crs_start IS NULL OR crs_start > ".$ilDB->quote($now, "integer").")");
2261 while($row = $ilDB->fetchAssoc($set))
2262 {
2263 $refs = ilObject::_getAllReferences($row['obj_id']);
2264 $ref = end($refs);
2265
2266 if($GLOBALS['tree']->isDeleted($ref))
2267 {
2268 continue;
2269 }
2270
2271 $part = new ilCourseParticipants($row["obj_id"]);
2272 $reci = $part->getNotificationRecipients();
2273 if(sizeof($reci))
2274 {
2275 $missing = (int)$row["min_members"]-$part->getCountMembers();
2276 if($missing > 0)
2277 {
2278 $res[$row["obj_id"]] = array($missing, $reci);
2279 }
2280 }
2281 }
2282
2283 return $res;
2284 }
static _getAllReferences($a_id)
get all reference ids of object
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, $ilDB, $res, $row, and ilObject\_getAllReferences().

Referenced by ilMembershipCronMinMembers\getCourses().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAboStatus()

ilObjCourse::getAboStatus ( )

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

636 {
637 return $this->abo;
638 }

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getActivationEnd()

ilObjCourse::getActivationEnd ( )

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

254 {
255 return $this->activation_end ? $this->activation_end : mktime(0,0,0,12,12,date("Y",time())+2);
256 }

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

+ Here is the caller graph for this function:

◆ getActivationStart()

ilObjCourse::getActivationStart ( )

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

246 {
247 return $this->activation_start ? $this->activation_start : time();
248 }

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

+ Here is the caller graph for this function:

◆ getActivationType()

ilObjCourse::getActivationType ( )

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

227 {
228 return (int) $this->activation_type;
229 }

Referenced by cloneSettings(), and validate().

+ Here is the caller graph for this function:

◆ getActivationUnlimitedStatus()

ilObjCourse::getActivationUnlimitedStatus ( )

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

242 {
243 return $this->activation_type == IL_CRS_ACTIVATION_UNLIMITED;
244 }

References IL_CRS_ACTIVATION_UNLIMITED.

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

+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjCourse::getActivationVisibility ( )

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

274 {
275 return $this->activation_visibility;
276 }

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getArchiveEnd()

ilObjCourse::getArchiveEnd ( )

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

616 {
617 return $this->archive_end ? $this->archive_end : mktime(0,0,0,12,12,date("Y",time())+2);
618 }

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

+ Here is the caller graph for this function:

◆ getArchiveStart()

ilObjCourse::getArchiveStart ( )

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

608 {
609 return $this->archive_start ? $this->archive_start : time();
610 }

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

+ Here is the caller graph for this function:

◆ getArchiveType()

ilObjCourse::getArchiveType ( )

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

624 {
625 return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
626 }
const IL_CRS_ARCHIVE_DOWNLOAD

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getAutoNotification()

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

Returns
boolean

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

2080 {
2082 }

References $auto_notification.

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

+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjCourse::getCancellationEnd ( )

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

886 {
887 return $this->leave_end;
888 }

References $leave_end.

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getContactConsultation()

ilObjCourse::getContactConsultation ( )

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

195 {
196 return $this->contact_consultation;
197 }

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

+ Here is the caller graph for this function:

◆ getContactEmail()

ilObjCourse::getContactEmail ( )

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

211 {
212 return $this->contact_email;
213 }

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

+ Here is the caller graph for this function:

◆ getContactName()

ilObjCourse::getContactName ( )

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

187 {
188 return $this->contact_name;
189 }

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

+ Here is the caller graph for this function:

◆ getContactPhone()

ilObjCourse::getContactPhone ( )

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

203 {
204 return $this->contact_phone;
205 }

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

+ Here is the caller graph for this function:

◆ getContactResponsibility()

ilObjCourse::getContactResponsibility ( )

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

219 {
220 return $this->contact_responsibility;
221 }

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

+ Here is the caller graph for this function:

◆ getCourseEnd()

ilObjCourse::getCourseEnd ( )

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

876 {
877 return $this->crs_end;
878 }

References $crs_end.

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

+ Here is the caller graph for this function:

◆ getCourseStart()

ilObjCourse::getCourseStart ( )

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

866 {
867 return $this->crs_start;
868 }

References $crs_start.

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

+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjCourse::getDefaultAdminRole ( )

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

1822 {
1823 $local_roles = $this->__getLocalRoles();
1824
1825 foreach($local_roles as $role_id)
1826 {
1827 if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
1828 {
1829 if(!strcmp($tmp_role->getTitle(),"il_crs_admin_".$this->getRefId()))
1830 {
1831 return $role_id;
1832 }
1833 }
1834 }
1835 return false;
1836 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id

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

Referenced by cloneAutoGeneratedRoles().

+ 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 @access 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 1728 of file class.ilObjCourse.php.

1729 {
1730 global $rbacadmin, $rbacreview;
1731
1732 if (strlen($a_crs_id) > 0)
1733 {
1734 $crs_id = $a_crs_id;
1735 }
1736 else
1737 {
1738 $crs_id = $this->getRefId();
1739 }
1740
1741 $role_arr = $rbacreview->getRolesOfRoleFolder($crs_id);
1742
1743 foreach ($role_arr as $role_id)
1744 {
1745 $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1746
1747 $crs_Member ="il_crs_member_".$crs_id;
1748 $crs_Admin ="il_crs_admin_".$crs_id;
1749 $crs_Tutor ="il_crs_tutor_".$crs_id;
1750
1751 if (strcmp($role_Obj->getTitle(), $crs_Member) == 0 )
1752 {
1753 $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1754 }
1755
1756 if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0)
1757 {
1758 $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1759 }
1760
1761 if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0)
1762 {
1763 $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1764 }
1765 }
1766
1767 return $arr_crsDefaultRoles;
1768 }

References ilObject\getRefId().

+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjCourse::getDefaultMemberRole ( )

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

1792 {
1793 $local_roles = $this->__getLocalRoles();
1794
1795 foreach($local_roles as $role_id)
1796 {
1797 $title = ilObject::_lookupTitle($role_id);
1798 if(substr($title,0,8) == 'il_crs_m')
1799 {
1800 return $role_id;
1801 }
1802 }
1803 return 0;
1804 }
static _lookupTitle($a_id)
lookup object title

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

Referenced by cloneAutoGeneratedRoles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultTutorRole()

ilObjCourse::getDefaultTutorRole ( )

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

1806 {
1807 $local_roles = $this->__getLocalRoles();
1808
1809 foreach($local_roles as $role_id)
1810 {
1811 if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
1812 {
1813 if(!strcmp($tmp_role->getTitle(),"il_crs_tutor_".$this->getRefId()))
1814 {
1815 return $role_id;
1816 }
1817 }
1818 }
1819 return false;
1820 }

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

Referenced by cloneAutoGeneratedRoles().

+ 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 855 of file class.ilObjCourse.php.

856 {
857 return $this->enablemap;
858 }

References $enablemap.

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

+ Here is the caller graph for this function:

◆ getImportantInformation()

ilObjCourse::getImportantInformation ( )

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

171 {
172 return $this->important;
173 }

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getLatitude()

ilObjCourse::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

796 {
797 return $this->latitude;
798 }

References $latitude.

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

+ 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 @access public

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

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

1687 {
1688 global $rbacadmin,$rbacreview;
1689
1690 if (empty($this->local_roles))
1691 {
1692 $this->local_roles = array();
1693 $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1694
1695 foreach ($role_arr as $role_id)
1696 {
1697 if ($rbacreview->isAssignable($role_id,$this->getRefId()) == true)
1698 {
1699 $role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1700
1701 if ($a_translate)
1702 {
1703 $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1704 }
1705 else
1706 {
1707 $role_name = $role_Obj->getTitle();
1708 }
1709 $this->local_roles[$role_name] = $role_Obj->getId();
1710 }
1711 }
1712 }
1713
1714 return $this->local_roles;
1715 }
_getTranslation($a_role_title)

References ilObjRole\_getTranslation(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ getLocationZoom()

ilObjCourse::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

836 {
837 return $this->locationzoom;
838 }

References $locationzoom.

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

+ Here is the caller graph for this function:

◆ getLongitude()

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

816 {
817 return $this->longitude;
818 }

References $longitude.

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

+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

663 {
664 return $this->mail_members;
665 }

References $mail_members.

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

+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

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

1560 {
1561 if(!$this->member_obj instanceof ilCourseParticipant)
1562 {
1563 $this->initCourseMemberObject();
1564 }
1565 return $this->member_obj;
1566 }
initCourseMemberObject()
Init course member object @global ilObjUser $ilUser.

References $member_obj, and initCourseMemberObject().

+ Here is the call graph for this function:

◆ getMembersObject()

ilObjCourse::getMembersObject ( )
Deprecated:
Returns
ilCourseParticipants

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

1573 {
1574 if(!$this->members_obj instanceof ilCourseParticipants)
1575 {
1576 $this->initCourseMembersObject();
1577 }
1578 return $this->members_obj;
1579 }
initCourseMembersObject()
Init course member object @global ilObjUser $ilUser.

References $members_obj, and initCourseMembersObject().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjCourse::getMessage ( )

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

668 {
669 return $this->message;
670 }

Referenced by appendMessage(), and validate().

+ Here is the caller graph for this function:

◆ getNumberOfNextSessions()

ilObjCourse::getNumberOfNextSessions ( )

Set number of previous sessions.

Returns

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

412 {
413 return $this->session_next;
414 }

References $session_next.

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

+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjCourse::getNumberOfPreviousSessions ( )

Set number of previous sessions.

Returns

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

393 {
394 return $this->session_prev;
395 }

References $session_prev.

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

+ Here is the caller graph for this function:

◆ getOfflineStatus()

ilObjCourse::getOfflineStatus ( )

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

262 {
263 return (bool)$this->activation_offline;
264 }

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

+ Here is the caller graph for this function:

◆ getOrderType()

ilObjCourse::getOrderType ( )

Get order type default implementation.

Reimplemented from ilContainer.

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

2163 {
2164 if($this->enabledObjectiveView())
2165 {
2167 }
2168 return parent::getOrderType();
2169 }

References enabledObjectiveView(), and ilContainer\SORT_MANUAL.

Referenced by cloneSettings(), and update().

+ 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 136 of file class.ilObjCourse.php.

137 {
139 }

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjCourse::getShowMembers ( )

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

644 {
645 return $this->show_members;
646 }

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

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

2124 {
2125 return $this->status_dt;
2126 }

References $status_dt.

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

+ Here is the caller graph for this function:

◆ getSubItems()

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

Get subitems of container.

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

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

462 {
463 global $ilUser;
464
465 // Caching
466 if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]))
467 {
468 return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
469 }
470
471 // Results are stored in $this->items
472 parent::getSubItems($a_admin_panel_enabled,$a_include_side_block);
473
474 $limit_sess = false;
475 if(!$a_admin_panel_enabled &&
476 !$a_include_side_block &&
477 $this->items['sess'] &&
478 is_array($this->items['sess']) &&
479 $this->isSessionLimitEnabled() &&
480 $this->getViewMode() == ilContainer::VIEW_SESSIONS) // #16686
481 {
482 $limit_sess = true;
483 }
484
485 if(!$limit_sess)
486 {
487 return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
488 }
489
490
491 // do session limit
492
493 // @todo move to gui class
494 if(isset($_GET['crs_prev_sess']))
495 {
496 $ilUser->writePref('crs_sess_show_prev_'.$this->getId(), (string) (int) $_GET['crs_prev_sess']);
497 }
498 if(isset($_GET['crs_next_sess']))
499 {
500 $ilUser->writePref('crs_sess_show_next_'.$this->getId(), (string) (int) $_GET['crs_next_sess']);
501 }
502
503 $sessions = ilUtil::sortArray($this->items['sess'],'start','ASC',true,false);
504 $today = new ilDate(date('Ymd',time()),IL_CAL_DATE);
505 $previous = $current = $next = array();
506 foreach($sessions as $key => $item)
507 {
508 $start = new ilDateTime($item['start'],IL_CAL_UNIX);
509 $end = new ilDateTime($item['end'],IL_CAL_UNIX);
510
511 if(ilDateTime::_within($today, $start, $end, IL_CAL_DAY))
512 {
513 $current[] = $item;
514 }
515 elseif(ilDateTime::_before($start, $today, IL_CAL_DAY))
516 {
517 $previous[] = $item;
518 }
519 elseif(ilDateTime::_after($start, $today, IL_CAL_DAY))
520 {
521 $next[] = $item;
522 }
523 }
524 $num_previous_remove = max(
525 count($previous) - $this->getNumberOfPreviousSessions(),
526 0
527 );
528 while($num_previous_remove--)
529 {
530 if(!$ilUser->getPref('crs_sess_show_prev_'.$this->getId()))
531 {
532 array_shift($previous);
533 }
534 $this->items['sess_link']['prev']['value'] = 1;
535 }
536
537 $num_next_remove = max(
538 count($next) - $this->getNumberOfNextSessions(),
539 0
540 );
541 while($num_next_remove--)
542 {
543 if(!$ilUser->getPref('crs_sess_show_next_'.$this->getId()))
544 {
545 array_pop($next);
546 }
547 // @fixme
548 $this->items['sess_link']['next']['value'] = 1;
549 }
550
551 $sessions = array_merge($previous,$current,$next);
552 $this->items['sess'] = $sessions;
553
554 // #15389 - see ilContainer::getSubItems()
555 include_once('Services/Container/classes/class.ilContainerSorting.php');
556 $sort = ilContainerSorting::_getInstance($this->getId());
557 $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
558
559 return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
560 }
$_GET["client_id"]
const IL_CAL_DATE
const IL_CAL_DAY
static _getInstance($a_obj_id)
get instance by obj_id
@classDescription Date and time handling
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 _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.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray

References $_GET, $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.

+ Here is the call graph for this function:

◆ getSubscriptionEnd()

ilObjCourse::getSubscriptionEnd ( )

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

299 {
300 return $this->subscription_end ? $this->subscription_end : mktime(0,0,0,12,12,date("Y",time())+2);
301 }

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

+ Here is the caller graph for this function:

◆ getSubscriptionLimitationType()

ilObjCourse::getSubscriptionLimitationType ( )

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

279 {
280 return $this->subscription_limitation_type;
281 }

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

+ Here is the caller graph for this function:

◆ getSubscriptionMaxMembers()

ilObjCourse::getSubscriptionMaxMembers ( )

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

428 {
429 return $this->subscription_max_members;
430 }

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

+ Here is the caller graph for this function:

◆ getSubscriptionMinMembers()

ilObjCourse::getSubscriptionMinMembers ( )

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

900 {
901 return $this->min_members;
902 }

References $min_members.

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

+ Here is the caller graph for this function:

◆ getSubscriptionNotify()

ilObjCourse::getSubscriptionNotify ( )

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

563 {
564 return true;
565 return $this->subscription_notify ? true : false;
566 }

Referenced by cloneSettings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getSubscriptionPassword()

ilObjCourse::getSubscriptionPassword ( )

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

316 {
317 return $this->subscription_password;
318 }

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

+ Here is the caller graph for this function:

◆ getSubscriptionStart()

ilObjCourse::getSubscriptionStart ( )

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

291 {
292 return $this->subscription_start ? $this->subscription_start : time();
293 }

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

+ Here is the caller graph for this function:

◆ getSubscriptionType()

ilObjCourse::getSubscriptionType ( )

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

307 {
308 return $this->subscription_type ? $this->subscription_type : IL_CRS_SUBSCRIPTION_DIRECT;
309 #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
310 }

References IL_CRS_SUBSCRIPTION_DIRECT.

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

+ Here is the caller graph for this function:

◆ getSubscriptionUnlimitedStatus()

ilObjCourse::getSubscriptionUnlimitedStatus ( )

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

287 {
288 return $this->subscription_limitation_type == IL_CRS_SUBSCRIPTION_UNLIMITED;
289 }
const IL_CRS_SUBSCRIPTION_UNLIMITED

References IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

+ Here is the caller graph for this function:

◆ getSyllabus()

ilObjCourse::getSyllabus ( )

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

179 {
180 return $this->syllabus;
181 }

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

+ Here is the caller graph for this function:

◆ getViewMode()

ilObjCourse::getViewMode ( )

Get container view mode.

Reimplemented from ilContainer.

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

577 {
578 return $this->view_mode;
579 }

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

+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjCourse::handleAutoFill ( )

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

2172 {
2173 if($this->enabledWaitingList() &&
2174 $this->hasWaitingListAutoFill())
2175 {
2176 $max = $this->getSubscriptionMaxMembers();
2178 if($max > $now)
2179 {
2180 // see assignFromWaitingListObject()
2181 include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2182 $waiting_list = new ilCourseWaitingList($this->getId());
2183
2184 foreach($waiting_list->getUserIds() as $user_id)
2185 {
2186 if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
2187 {
2188 continue;
2189 }
2190 if($this->getMembersObject()->isAssigned($user_id))
2191 {
2192 continue;
2193 }
2194 $this->getMembersObject()->add($user_id,IL_CRS_MEMBER);
2195 $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2196 $waiting_list->removeFromList($user_id);
2197
2198 $this->checkLPStatusSync($user_id);
2199
2200 $now++;
2201 if($now >= $max)
2202 {
2203 break;
2204 }
2205 }
2206 }
2207 }
2208 }
const IL_CRS_MEMBER
checkLPStatusSync($a_member_id)
sync course status from lp
static lookupNumberOfMembers($a_ref_id)
Lookup number of members @global ilRbacReview $rbacreview @global <type> $ilObjDataCache.

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

+ Here is the call graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

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

1143 {
1144 return strlen($this->getContactName()) or
1145 strlen($this->getContactResponsibility()) or
1146 strlen($this->getContactEmail()) or
1147 strlen($this->getContactPhone()) or
1148 strlen($this->getContactConsultation());
1149 }

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

+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjCourse::hasWaitingListAutoFill ( )

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

910 {
912 }

References $auto_fill_from_waiting.

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

+ Here is the caller graph for this function:

◆ ilObjCourse()

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

Constructor @access public.

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

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

90 {
91
92 #define("ILIAS_MODULE","course");
93 #define("KEEP_IMAGE_PATH",1);
94
95 $this->SUBSCRIPTION_DEACTIVATED = 1;
96 $this->SUBSCRIPTION_CONFIRMATION = 2;
97 $this->SUBSCRIPTION_DIRECT = 3;
98 $this->SUBSCRIPTION_PASSWORD = 4;
99 $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
100 $this->ARCHIVE_DISABLED = 1;
101 $this->ARCHIVE_READ = 2;
102 $this->ARCHIVE_DOWNLOAD = 3;
103 $this->ABO_ENABLED = 1;
104 $this->ABO_DISABLED = 0;
105 $this->SHOW_MEMBERS_ENABLED = 1;
106 $this->SHOW_MEMBERS_DISABLED = 0;
107 $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
108
109 $this->type = "crs";
110
111 parent::__construct($a_id,$a_call_by_reference);
112
113 }

References setStatusDetermination().

+ Here is the call graph for this function:

◆ initCourseArchiveObject()

ilObjCourse::initCourseArchiveObject ( )

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

1582 {
1583 include_once "./Modules/Course/classes/class.ilCourseArchives.php";
1584
1585 if(!is_object($this->archives_obj))
1586 {
1587 $this->archives_obj =& new ilCourseArchives($this);
1588 }
1589 return true;
1590 }
class ilCourseArchives

Referenced by delete().

+ Here is the caller graph for this function:

◆ initCourseMemberObject()

ilObjCourse::initCourseMemberObject ( )
protected

Init course member object @global ilObjUser $ilUser.

Returns
<type>

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

1533 {
1534 global $ilUser;
1535
1536 include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
1537 $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(),$ilUser->getId());
1538 return true;
1539 }
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.

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

Referenced by getMemberObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCourseMembersObject()

ilObjCourse::initCourseMembersObject ( )
protected

Init course member object @global ilObjUser $ilUser.

Returns
<type>

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

1547 {
1548 global $ilUser;
1549
1550 include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1551 $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1552 return true;
1553 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.

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

Referenced by getMembersObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjCourse::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) @access public

Returns
array empty array

Reimplemented from ilObject.

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

1596 {
1597 global $rbacadmin,$rbacreview,$ilDB;
1598
1599 include_once './Services/AccessControl/classes/class.ilObjRole.php';
1601 'il_crs_admin_'.$this->getRefId(),
1602 "Admin of crs obj_no.".$this->getId(),
1603 'il_crs_admin',
1604 $this->getRefId()
1605 );
1607 'il_crs_tutor_'.$this->getRefId(),
1608 "Tutor of crs obj_no.".$this->getId(),
1609 'il_crs_tutor',
1610 $this->getRefId()
1611 );
1613 'il_crs_member_'.$this->getRefId(),
1614 "Member of crs obj_no.".$this->getId(),
1615 'il_crs_member',
1616 $this->getRefId()
1617 );
1618
1619 return array();
1620 }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)

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

+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

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

1516 {
1517 include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
1518
1519 if(!is_object($this->waiting_list_obj))
1520 {
1521 $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1522 }
1523 return true;
1524 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ inSubscriptionTime()

ilObjCourse::inSubscriptionTime ( )

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

339 {
341 {
342 return true;
343 }
344 if(time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd())
345 {
346 return true;
347 }
348 return false;
349 }

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

Referenced by register().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

ilObjCourse::isActivated (   $a_check_archive = false)

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

685 {
686 if($a_check_archive)
687 {
688 if($this->isArchived())
689 {
690 return true;
691 }
692 }
693 if($this->getOfflineStatus())
694 {
695 return false;
696 }
698 {
699 return true;
700 }
701 if(time() < $this->getActivationStart() or
702 time() > $this->getActivationEnd())
703 {
704 return false;
705 }
706 return true;
707 }

References getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), getOfflineStatus(), and isArchived().

+ Here is the call graph for this function:

◆ isArchived()

ilObjCourse::isArchived ( )

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

734 {
735 if($this->getViewMode() != IL_CRS_VIEW_ARCHIVE)
736 {
737 return false;
738 }
739 if(time() < $this->getArchiveStart() or time() > $this->getArchiveEnd())
740 {
741 return false;
742 }
743 return true;
744 }
const IL_CRS_VIEW_ARCHIVE

References getArchiveEnd(), getArchiveStart(), getViewMode(), and IL_CRS_VIEW_ARCHIVE.

Referenced by isActivated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjCourse::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

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

156 {
157 return (bool) $this->reg_access_code_enabled;
158 }

References $reg_access_code_enabled.

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

+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjCourse::isSessionLimitEnabled ( )

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

362 {
363 return (bool) $this->session_limit;
364 }

References $session_limit.

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

+ Here is the caller graph for this function:

◆ isSubscriptionMembershipLimited()

ilObjCourse::isSubscriptionMembershipLimited ( )

is membership limited

@access public

Parameters

return

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

423 {
424 return (bool) $this->subscription_membership_limitation;
425 }

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

+ Here is the caller graph for this function:

◆ lookupCourseNonMemberTemplatesId()

static ilObjCourse::lookupCourseNonMemberTemplatesId ( )
static

Lookup course non member id.

Returns
int

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

1670 {
1671 global $ilDB;
1672
1673 $query = 'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote('rolt','text').' AND title = '.$ilDB->quote('il_crs_non_member','text');
1674 $res = $ilDB->query($query);
1675 $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1676
1677 return isset($row['obj_id']) ? $row['obj_id'] : 0;
1678 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

+ 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 1976 of file class.ilObjCourse.php.

1977 {
1978 global $ilDB;
1979
1980 $query = "SELECT obj_id FROM crs_settings ".
1981 "WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
1982 "AND reg_ac = ".$ilDB->quote($a_code,'text');
1983 $res = $ilDB->query($query);
1984
1985 $obj_ids = array();
1986 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1987 {
1988 $obj_ids[] = $row->obj_id;
1989 }
1990 return $obj_ids;
1991 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

+ 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 120 of file class.ilObjCourse.php.

121 {
122 $query = 'SELECT show_members FROM crs_settings '.
123 'WHERE obj_id = '.$GLOBALS['ilDB']->quote($a_obj_id,'integer');
124 $res = $GLOBALS['ilDB']->query($query);
125 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
126 {
127 return (bool) $row->show_members;
128 }
129 return false;
130 }

References $GLOBALS, $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

+ 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 2210 of file class.ilObjCourse.php.

2211 {
2212 global $ilUser, $ilDB;
2213
2214 if(!$a_user_id)
2215 {
2216 $a_user_id = $ilUser->getId();
2217 }
2218
2219 $set = $ilDB->query("SELECT leave_end".
2220 " FROM crs_settings".
2221 " WHERE obj_id = ".$ilDB->quote($a_course_id, "integer"));
2222 $row = $ilDB->fetchAssoc($set);
2223 if($row && $row["leave_end"])
2224 {
2225 // timestamp to date
2226 $limit = date("Ymd", $row["leave_end"]);
2227 if($limit < date("Ymd"))
2228 {
2229 $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
2230 return false;
2231 }
2232 }
2233 return true;
2234 }

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

Referenced by ilObjCourseAccess\_checkAccess().

+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjCourse::MDUpdateListener (   $a_element)

Overwriten Metadata update listener for ECS functionalities.

@access public

Reimplemented from ilObject.

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

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

References $ilLog.

◆ prepareAppointments()

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

Prepare calendar appointments.

@access protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

1897 {
1898 include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1899 include_once('./Services/Calendar/classes/class.ilDateTime.php');
1900
1901 switch($a_mode)
1902 {
1903 case 'create':
1904 case 'update':
1905 if(!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus())
1906 {
1907 $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1908 $app->setTitle($this->getTitle());
1909 $app->setSubtitle('crs_cal_activation_start');
1910 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1911 $app->setDescription($this->getLongDescription());
1912 $app->setStart(new ilDateTime($this->getActivationStart(),IL_CAL_UNIX));
1913 $apps[] = $app;
1914
1915 $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1916 $app->setTitle($this->getTitle());
1917 $app->setSubtitle('crs_cal_activation_end');
1918 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1919 $app->setDescription($this->getLongDescription());
1920 $app->setStart(new ilDateTime($this->getActivationEnd(),IL_CAL_UNIX));
1921 $apps[] = $app;
1922 }
1924 {
1925 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1926 $app->setTitle($this->getTitle());
1927 $app->setSubtitle('crs_cal_reg_start');
1928 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1929 $app->setDescription($this->getLongDescription());
1930 $app->setStart(new ilDateTime($this->getSubscriptionStart(),IL_CAL_UNIX));
1931 $apps[] = $app;
1932
1933 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1934 $app->setTitle($this->getTitle());
1935 $app->setSubtitle('crs_cal_reg_end');
1936 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1937 $app->setDescription($this->getLongDescription());
1938 $app->setStart(new ilDateTime($this->getSubscriptionEnd(),IL_CAL_UNIX));
1939 $apps[] = $app;
1940 }
1941 if($this->getCourseStart() && $this->getCourseEnd())
1942 {
1943 $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_START);
1944 $app->setTitle($this->getTitle());
1945 $app->setSubtitle('crs_start');
1946 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1947 $app->setDescription($this->getLongDescription());
1948 $app->setStart($this->getCourseStart());
1949 $app->setFullday(true);
1950 $apps[] = $app;
1951
1952 $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_END);
1953 $app->setTitle($this->getTitle());
1954 $app->setSubtitle('crs_end');
1955 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1956 $app->setDescription($this->getLongDescription());
1957 $app->setStart($this->getCourseEnd());
1958 $app->setFullday(true);
1959 $apps[] = $app;
1960 }
1961
1962
1963 return $apps ? $apps : array();
1964
1965 case 'delete':
1966 // Nothing to do: The category and all assigned appointments will be deleted.
1967 return array();
1968 }
1969 }
const IL_CAL_TRANSLATION_SYSTEM
const IL_CRS_SUBSCRIPTION_LIMITED
Apointment templates are used for automatic generated apointments.
getLongDescription()
get object long description (stored in object_description)
getTitle()
get object title @access public

References getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), getCourseEnd(), getCourseStart(), ilObject\getLongDescription(), getOfflineStatus(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionStart(), ilObject\getTitle(), IL_CAL_TRANSLATION_SYSTEM, IL_CAL_UNIX, and IL_CRS_SUBSCRIPTION_LIMITED.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourse::read (   $a_force_db = false)

read object data from db into object

Parameters
boolean@access public

Reimplemented from ilObject.

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

752 {
753 parent::read($a_force_db);
754
755 include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
757
758 $this->__readSettings();
759 }
static _lookupSortMode($a_obj_id)
lookup sort mode
setOrderType($a_value)

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

+ 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.

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

2000 {
2001 global $ilCtrl, $tree;
2002 include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
2003 include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
2005
2006 if($part->isAssigned($a_user_id))
2007 {
2008 return true;
2009 }
2010
2011 if(!$a_force_registration)
2012 {
2013 // Availability
2015 {
2016 include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
2017
2019 {
2020 throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
2021 ', course subscription is deactivated.', '456');
2022 }
2023 }
2024
2025 // Time Limitation
2027 {
2028 if( !$this->inSubscriptionTime() )
2029 {
2030 throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
2031 ', course is out of registration time.', '789');
2032 }
2033 }
2034
2035 // Max members
2037 {
2038 $free = max(0,$this->getSubscriptionMaxMembers() - $part->getCountMembers());
2039 include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2040 $waiting_list = new ilCourseWaitingList($this->getId());
2041 if($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
2042 {
2043 $waiting_list->addToList($a_user_id);
2044 $this->lng->loadLanguageModule("crs");
2045 $info = sprintf($this->lng->txt('crs_added_to_list'),
2046 $waiting_list->getPosition($a_user_id));
2047 include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
2048 $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
2049 $participants->sendNotification($participants->NOTIFY_WAITING_LIST,$a_user_id);
2050
2051 throw new ilMembershipRegistrationException($info, '124');
2052 }
2053
2054 if(!$this->enabledWaitingList() && !$free)
2055 {
2056 throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
2057 ', membership is limited.', '123');
2058 }
2059 }
2060 }
2061
2062 $part->add($a_user_id,$a_role);
2063 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2064 $part->sendNotification($part->NOTIFY_ADMINS,$a_user_id);
2065
2066
2067 include_once './Modules/Forum/classes/class.ilForumNotification.php';
2069
2070 return true;
2071 }
static checkForumsExistsInsert($ref_id, $user_id=0)
static _usingRegistrationCode()
Using Registration code.
$info
Definition: example_052.php:80
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $info, ilCourseParticipants\_getInstanceByObjId(), ilObjCourseAccess\_usingRegistrationCode(), ilForumNotification\checkForumsExistsInsert(), enabledWaitingList(), ilObject\getId(), ilObject\getRefId(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), IL_CRS_SUBSCRIPTION_DEACTIVATED, IL_CRS_SUBSCRIPTION_LIMITED, inSubscriptionTime(), and isSubscriptionMembershipLimited().

+ Here is the call graph for this function:

◆ setAboStatus()

ilObjCourse::setAboStatus (   $a_status)

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

632 {
633 $this->abo = $a_status;
634 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setActivationEnd()

ilObjCourse::setActivationEnd (   $a_value)

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

258 {
259 $this->activation_end = $a_value;
260 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setActivationStart()

ilObjCourse::setActivationStart (   $a_value)

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

250 {
251 $this->activation_start = $a_value;
252 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setActivationType()

ilObjCourse::setActivationType (   $a_type)

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

231 {
232 // offline is separate property now
233 if($a_type == IL_CRS_ACTIVATION_OFFLINE)
234 {
235 $this->setOfflineStatus(true);
237 }
238
239 $this->activation_type = $a_type;
240 }
const IL_CRS_ACTIVATION_OFFLINE

References IL_CRS_ACTIVATION_OFFLINE, IL_CRS_ACTIVATION_UNLIMITED, and setOfflineStatus().

Referenced by __readSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjCourse::setActivationVisibility (   $a_value)

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

270 {
271 $this->activation_visibility = (bool) $a_value;
272 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setArchiveEnd()

ilObjCourse::setArchiveEnd (   $a_value)

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

620 {
621 $this->archive_end = $a_value;
622 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setArchiveStart()

ilObjCourse::setArchiveStart (   $a_value)

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

612 {
613 $this->archive_start = $a_value;
614 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setArchiveType()

ilObjCourse::setArchiveType (   $a_value)

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

628 {
629 $this->archive_type = $a_value;
630 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setAutoNotification()

ilObjCourse::setAutoNotification (   $value)

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

Parameters
mixedboolean

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

2092 {
2093 $this->auto_notification = $value;
2094 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setCancellationEnd()

ilObjCourse::setCancellationEnd ( ilDate  $a_value = null)

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

881 {
882 $this->leave_end = $a_value;
883 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setContactConsultation()

ilObjCourse::setContactConsultation (   $a_value)

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

199 {
200 $this->contact_consultation = $a_value;
201 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setContactEmail()

ilObjCourse::setContactEmail (   $a_value)

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

215 {
216 $this->contact_email = $a_value;
217 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setContactName()

ilObjCourse::setContactName (   $a_cn)

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

191 {
192 $this->contact_name = $a_cn;
193 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setContactPhone()

ilObjCourse::setContactPhone (   $a_value)

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

207 {
208 $this->contact_phone = $a_value;
209 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setContactResponsibility()

ilObjCourse::setContactResponsibility (   $a_value)

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

223 {
224 $this->contact_responsibility = $a_value;
225 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setCourseEnd()

ilObjCourse::setCourseEnd ( ilDate  $a_value = null)

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

871 {
872 $this->crs_end = $a_value;
873 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setCourseStart()

ilObjCourse::setCourseStart ( ilDate  $a_value = null)

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

861 {
862 $this->crs_start = $a_value;
863 }

Referenced by __readSettings().

+ 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 845 of file class.ilObjCourse.php.

846 {
847 $this->enablemap = $a_enablemap;
848 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setImportantInformation()

ilObjCourse::setImportantInformation (   $a_info)

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

175 {
176 $this->important = $a_info;
177 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setLatitude()

ilObjCourse::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

786 {
787 $this->latitude = $a_latitude;
788 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

826 {
827 $this->locationzoom = $a_locationzoom;
828 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setLongitude()

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

806 {
807 $this->longitude = $a_longitude;
808 }

Referenced by __readSettings().

+ 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 653 of file class.ilObjCourse.php.

654 {
655 $this->mail_members = $a_type;
656 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setMessage()

ilObjCourse::setMessage (   $a_message)

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

672 {
673 $this->message = $a_message;
674 }

Referenced by validate().

+ 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 402 of file class.ilObjCourse.php.

403 {
404 $this->session_next = $a_num;
405 }

Referenced by __readSettings().

+ 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 383 of file class.ilObjCourse.php.

384 {
385 $this->session_prev = $a_num;
386 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setOfflineStatus()

ilObjCourse::setOfflineStatus (   $a_value)

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

266 {
267 $this->activation_offline = (bool) $a_value;
268 }

Referenced by __readSettings(), cloneObject(), and setActivationType().

+ 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

Reimplemented from ilObject.

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

1632 {
1633 global $rbacadmin, $rbacreview;
1634
1635 $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1636 foreach((array) $parent_roles as $parent_role)
1637 {
1638 $rbacadmin->initIntersectionPermissions(
1639 $this->getRefId(),
1640 $parent_role['obj_id'],
1641 $parent_role['parent'],
1643 ROLE_FOLDER_ID
1644 );
1645 }
1646 }
__getCrsNonMemberTemplateId()
get course non-member template @access private

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

+ 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 146 of file class.ilObjCourse.php.

147 {
148 $this->reg_access_code = $a_code;
149 }

Referenced by __createDefaultSettings(), and __readSettings().

+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjCourse::setShowMembers (   $a_status)

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

640 {
641 $this->show_members = $a_status;
642 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

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

2102 {
2103 $a_value = (int)$a_value;
2104
2105 // #13905
2106 if($a_value == self::STATUS_DETERMINATION_LP)
2107 {
2108 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2110 {
2112 }
2113 }
2114
2115 $this->status_dt = $a_value;
2116 }
const STATUS_DETERMINATION_MANUAL

References ilObjUserTracking\_enabledLearningProgress(), and STATUS_DETERMINATION_MANUAL.

Referenced by __readSettings(), and ilObjCourse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubscriptionEnd()

ilObjCourse::setSubscriptionEnd (   $a_value)

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

303 {
304 $this->subscription_end = $a_value;
305 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionLimitationType()

ilObjCourse::setSubscriptionLimitationType (   $a_type)

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

283 {
284 $this->subscription_limitation_type = $a_type;
285 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionMaxMembers()

ilObjCourse::setSubscriptionMaxMembers (   $a_value)

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

432 {
433 $this->subscription_max_members = $a_value;
434 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionMinMembers()

ilObjCourse::setSubscriptionMinMembers (   $a_value)

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

891 {
892 if($a_value !== null)
893 {
894 $a_value = (int)$a_value;
895 }
896 $this->min_members = $a_value;
897 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionNotify()

ilObjCourse::setSubscriptionNotify (   $a_value)

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

568 {
569 $this->subscription_notify = $a_value ? true : false;
570 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionPassword()

ilObjCourse::setSubscriptionPassword (   $a_value)

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

320 {
321 $this->subscription_password = $a_value;
322 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionStart()

ilObjCourse::setSubscriptionStart (   $a_value)

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

295 {
296 $this->subscription_start = $a_value;
297 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSubscriptionType()

ilObjCourse::setSubscriptionType (   $a_value)

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

312 {
313 $this->subscription_type = $a_value;
314 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setSyllabus()

ilObjCourse::setSyllabus (   $a_syllabus)

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

183 {
184 $this->syllabus = $a_syllabus;
185 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setViewMode()

ilObjCourse::setViewMode (   $a_mode)

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

573 {
574 $this->view_mode = $a_mode;
575 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjCourse::setWaitingListAutoFill (   $a_value)

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

905 {
906 $this->auto_fill_from_waiting = (bool)$a_value;
907 }

Referenced by __readSettings().

+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

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

2132 {
2133 include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
2134 foreach($this->getMembersObject()->getParticipants() as $user_id)
2135 {
2136 // #15529 - force raise on sync
2137 ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, true);
2138 }
2139 }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.

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

+ Here is the call graph for this function:

◆ update()

ilObjCourse::update ( )

update complete object

Reimplemented from ilContainer.

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

1209 {
1210 global $ilAppEventHandler,$ilLog;
1211
1212 include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1213 $sorting = new ilContainerSortingSettings($this->getId());
1214 $sorting->setSortMode($this->getOrderType());
1215 $sorting->update();
1216
1217 $this->updateMetaData();
1218 $this->updateSettings();
1219 parent::update();
1220
1221 $ilAppEventHandler->raise('Modules/Course',
1222 'update',
1223 array('object' => $this,
1224 'obj_id' => $this->getId(),
1225 'appointments' => $this->prepareAppointments('update')));
1226
1227 }
updateMetaData()
update meta data entry

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

+ Here is the call graph for this function:

◆ updateSettings()

ilObjCourse::updateSettings ( )

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

1230 {
1231 global $ilDB;
1232
1233 // Due to a bug 3.5.alpha maybe no settings exist. => create default settings
1234
1235 $query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
1236 $res = $ilDB->query($query);
1237
1238 if(!$res->numRows())
1239 {
1240 $this->__createDefaultSettings();
1241 }
1242
1243 $query = "UPDATE crs_settings SET ".
1244 "syllabus = ".$ilDB->quote($this->getSyllabus() ,'text').", ".
1245 "contact_name = ".$ilDB->quote($this->getContactName() ,'text').", ".
1246 "contact_responsibility = ".$ilDB->quote($this->getContactResponsibility() ,'text').", ".
1247 "contact_phone = ".$ilDB->quote($this->getContactPhone() ,'text').", ".
1248 "contact_email = ".$ilDB->quote($this->getContactEmail() ,'text').", ".
1249 "contact_consultation = ".$ilDB->quote($this->getContactConsultation() ,'text').", ".
1250 "activation_type = ".$ilDB->quote(!$this->getOfflineStatus() ,'integer').", ".
1251 "sub_limitation_type = ".$ilDB->quote($this->getSubscriptionLimitationType() ,'integer').", ".
1252 "sub_start = ".$ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
1253 "sub_end = ".$ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
1254 "sub_type = ".$ilDB->quote($this->getSubscriptionType() ,'integer').", ".
1255 "sub_password = ".$ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
1256 "sub_mem_limit = ".$ilDB->quote((int) $this->isSubscriptionMembershipLimited() ,'integer').", ".
1257 "sub_max_members = ".$ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
1258 "sub_notify = ".$ilDB->quote($this->getSubscriptionNotify() ,'integer').", ".
1259 "view_mode = ".$ilDB->quote($this->getViewMode() ,'integer').", ".
1260 "archive_start = ".$ilDB->quote($this->getArchiveStart() ,'integer').", ".
1261 "archive_end = ".$ilDB->quote($this->getArchiveEnd() ,'integer').", ".
1262 "archive_type = ".$ilDB->quote($this->getArchiveType() ,'integer').", ".
1263 "abo = ".$ilDB->quote($this->getAboStatus() ,'integer').", ".
1264 "waiting_list = ".$ilDB->quote($this->enabledWaitingList() ,'integer').", ".
1265 "important = ".$ilDB->quote($this->getImportantInformation() ,'text').", ".
1266 "show_members = ".$ilDB->quote($this->getShowMembers() ,'integer').", ".
1267 "latitude = ".$ilDB->quote($this->getLatitude() ,'text').", ".
1268 "longitude = ".$ilDB->quote($this->getLongitude() ,'text').", ".
1269 "location_zoom = ".$ilDB->quote($this->getLocationZoom() ,'integer').", ".
1270 "enable_course_map = ".$ilDB->quote((int) $this->getEnableCourseMap() ,'integer').", ".
1271 'session_limit = '.$ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
1272 'session_prev = '.$ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1273 'session_next = '.$ilDB->quote($this->getNumberOfNextSessions(),'integer').', '.
1274 'reg_ac_enabled = '.$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
1275 'reg_ac = '.$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
1276 'auto_notification = '.$ilDB->quote( (int)$this->getAutoNotification(), 'integer').', '.
1277 'status_dt = '.$ilDB->quote((int) $this->getStatusDetermination()).', '.
1278 'mail_members_type = '.$ilDB->quote((int) $this->getMailToMembersType(),'integer').', '.
1279 'crs_start = '.$ilDB->quote(($this->getCourseStart() && !$this->getCourseStart()->isNull()) ? $this->getCourseStart()->get(IL_CAL_UNIX) : null, 'integer').', '.
1280 'crs_end = '.$ilDB->quote(($this->getCourseEnd() && !$this->getCourseEnd()->isNull()) ? $this->getCourseEnd()->get(IL_CAL_UNIX) : null, 'integer').', '.
1281 'auto_wait = '.$ilDB->quote((int) $this->hasWaitingListAutoFill(),'integer').', '.
1282 'leave_end = '.$ilDB->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer').', '.
1283 'min_members = '.$ilDB->quote((int) $this->getSubscriptionMinMembers(),'integer').' '.
1284 "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
1285
1286 $res = $ilDB->manipulate($query);
1287
1288 // moved activation to ilObjectActivation
1289 if($this->ref_id)
1290 {
1291 include_once "./Services/Object/classes/class.ilObjectActivation.php";
1292 ilObjectActivation::getItem($this->ref_id);
1293
1294 $item = new ilObjectActivation;
1295 if($this->getActivationUnlimitedStatus())
1296 {
1298 }
1299 else
1300 {
1301 $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1302 $item->setTimingStart($this->getActivationStart());
1303 $item->setTimingEnd($this->getActivationEnd());
1304 $item->toggleVisible($this->getActivationVisibility());
1305 }
1306
1307 $item->update($this->ref_id);
1308 }
1309 }
Class ilObjectActivation.
setTimingType($a_type)
Set timing type.

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

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjCourse::validate ( )

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

1056 {
1057 $this->setMessage('');
1058
1059 #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and
1060 # $this->getSubscriptionType() == )
1061 #{
1062 # $this->appendMessage($this->lng->txt('crs_select_registration_type'));
1063 #}
1064
1065 if(($this->getActivationType() == IL_CRS_ACTIVATION_LIMITED) and
1066 $this->getActivationEnd() < $this->getActivationStart())
1067 {
1068 $this->appendMessage($this->lng->txt("activation_times_not_valid"));
1069 }
1071 $this->getSubscriptionStart() > $this->getSubscriptionEnd())
1072 {
1073 $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
1074 }
1075 #if((!$this->getActivationUnlimitedStatus() and
1076 # !$this->getSubscriptionUnlimitedStatus()) and
1077 # ($this->getSubscriptionStart() > $this->getActivationEnd() or
1078 # $this->getSubscriptionStart() < $this->getActivationStart() or
1079 # $this->getSubscriptionEnd() > $this->getActivationEnd() or
1080 # $this->getSubscriptionEnd() < $this->getActivationStart()))
1081 #
1082 #{
1083 # $this->appendMessage($this->lng->txt("subscription_time_not_within_activation"));
1084 #}
1086 {
1087 $this->appendMessage($this->lng->txt("crs_password_required"));
1088 }
1090 {
1091 if($this->getSubscriptionMinMembers() <= 0 && $this->getSubscriptionMaxMembers() <= 0)
1092 {
1093 $this->appendMessage($this->lng->txt("crs_max_and_min_members_needed"));
1094 }
1095 if($this->getSubscriptionMaxMembers() <= 0 && $this->enabledWaitingList())
1096 {
1097 $this->appendMessage($this->lng->txt("crs_max_members_needed"));
1098 }
1100 {
1101 $this->appendMessage($this->lng->txt("crs_max_and_min_members_invalid"));
1102 }
1103 }
1104 if(($this->getViewMode() == IL_CRS_VIEW_ARCHIVE) and
1105 $this->getArchiveStart() > $this->getArchiveEnd())
1106 {
1107 $this->appendMessage($this->lng->txt("archive_times_not_valid"));
1108 }
1109 if(!$this->getTitle() || !$this->getStatusDetermination())
1110 {
1111 $this->appendMessage($this->lng->txt('err_check_input'));
1112 }
1113
1114 if($this->getCourseStart() &&
1115 $this->getCourseStart()->get(IL_CAL_UNIX) > $this->getCourseEnd()->get(IL_CAL_UNIX))
1116 {
1117 $this->appendMessage($this->lng->txt("crs_course_period_not_valid"));
1118 }
1119
1120 return $this->getMessage() ? false : true;
1121 }
const IL_CRS_SUBSCRIPTION_PASSWORD
setMessage($a_message)
appendMessage($a_message)

References appendMessage(), enabledWaitingList(), getActivationEnd(), getActivationStart(), getActivationType(), getArchiveEnd(), getArchiveStart(), getCourseEnd(), getCourseStart(), getMessage(), getStatusDetermination(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionMinMembers(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), ilObject\getTitle(), getViewMode(), IL_CAL_UNIX, IL_CRS_ACTIVATION_LIMITED, IL_CRS_SUBSCRIPTION_LIMITED, IL_CRS_SUBSCRIPTION_PASSWORD, IL_CRS_VIEW_ARCHIVE, isSubscriptionMembershipLimited(), and setMessage().

+ Here is the call graph for this function:

◆ validateInfoSettings()

ilObjCourse::validateInfoSettings ( )

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

1124 {
1125 global $ilErr;
1126 $error = false;
1127 if($this->getContactEmail()) {
1128 $emails = split(",",$this->getContactEmail());
1129
1130 foreach ($emails as $email) {
1131 $email = trim($email);
1132 if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email)))
1133 {
1134 $ilErr->appendMessage($this->lng->txt('contact_email_not_valid')." '".$email."'");
1135 $error = true;
1136 }
1137 }
1138 }
1139 return !$error;
1140 }
getUserIdByLogin($a_login)
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.

References $ilErr, getContactEmail(), ilObjUser\getUserIdByLogin(), and ilUtil\is_email().

+ Here is the call graph for this function:

Field Documentation

◆ $archives_obj

ilObjCourse::$archives_obj

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

◆ $auto_fill_from_waiting

ilObjCourse::$auto_fill_from_waiting
protected

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

Referenced by hasWaitingListAutoFill().

◆ $auto_notification

ilObjCourse::$auto_notification = true
private

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

Referenced by getAutoNotification().

◆ $crs_end

ilObjCourse::$crs_end
protected

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

Referenced by getCourseEnd().

◆ $crs_start

ilObjCourse::$crs_start
protected

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

Referenced by getCourseStart().

◆ $enablemap

ilObjCourse::$enablemap = 0
private

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

Referenced by getEnableCourseMap().

◆ $latitude

ilObjCourse::$latitude = ''
private

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

Referenced by getLatitude().

◆ $leave_end

ilObjCourse::$leave_end
protected

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

Referenced by getCancellationEnd().

◆ $locationzoom

ilObjCourse::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $longitude

ilObjCourse::$longitude = ''
private

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

Referenced by getLongitude().

◆ $mail_members

ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $member_obj

ilObjCourse::$member_obj = null
private

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

Referenced by getMemberObject().

◆ $members_obj

ilObjCourse::$members_obj = null
private

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

Referenced by getMembersObject().

◆ $min_members

ilObjCourse::$min_members
protected

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

Referenced by getSubscriptionMinMembers().

◆ $reg_access_code

ilObjCourse::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjCourse::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $session_limit

ilObjCourse::$session_limit = 0
private

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

Referenced by isSessionLimitEnabled().

◆ $session_next

ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

ilObjCourse::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

◆ $status_dt

ilObjCourse::$status_dt = null
private

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

Referenced by getStatusDetermination().

◆ CAL_ACTIVATION_END

const ilObjCourse::CAL_ACTIVATION_END = 4

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

◆ CAL_ACTIVATION_START

const ilObjCourse::CAL_ACTIVATION_START = 3

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

◆ CAL_COURSE_END

const ilObjCourse::CAL_COURSE_END = 6

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

◆ CAL_COURSE_START

const ilObjCourse::CAL_COURSE_START = 5

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

◆ CAL_REG_END

const ilObjCourse::CAL_REG_END = 2

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

◆ CAL_REG_START

const ilObjCourse::CAL_REG_START = 1

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

◆ STATUS_DETERMINATION_LP

◆ STATUS_DETERMINATION_MANUAL

const ilObjCourse::STATUS_DETERMINATION_MANUAL = 2

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

Referenced by ilObjCourseGUI\initEditForm(), and setStatusDetermination().


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