ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjCourse Class Reference

Class ilObjCourse. More...

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

Public Member Functions

 ilObjCourse ($a_id=0, $a_call_by_reference=true)
 Constructor 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 ()
 
 _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)
 
 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...
 
 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 ()
 
 __setCourseStatus ()
 set course status More...
 
 __getCrsNonMemberTemplateId ()
 get course non-member template private More...
 
 getLocalCourseRoles ($a_translate=false)
 get ALL local roles of course, also those created and defined afterwards only fetch data once from database. More...
 
 getDefaultCourseRoles ($a_crs_id="")
 get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member public More...
 
 __getLocalRoles ()
 
 __deleteSettings ()
 
 getDefaultMemberRole ()
 
 getDefaultTutorRole ()
 
 getDefaultAdminRole ()
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id=0)
 
 _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...
 
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor 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...
 
 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_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons More...
 
 removeBigIcon ()
 remove big icon More...
 
 removeSmallIcon ()
 remove small icon More...
 
 removeTinyIcon ()
 remove tiny 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)
 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 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 public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 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 public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 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...
 
 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) public More...
 
 createRoleFolder ()
 creates a local role folder 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...
 
- 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 lookupObjectsByCode ($a_code)
 
- Static Public Member Functions inherited from ilContainer
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 _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 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 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 hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const CAL_REG_START = 1
 
const CAL_REG_END = 2
 
const CAL_ACTIVATION_START = 3
 
const CAL_ACTIVATION_END = 4
 
const 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_ILINC = 7
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
- 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 ilObjUser $ilUser. More...
 
 initCourseMembersObject ()
 Init course member object ilObjUser $ilUser. More...
 
 prepareAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 

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
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = 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 1267 of file class.ilObjCourse.php.

References $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().

1268  {
1269  global $ilDB;
1270 
1271  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1273 
1274  $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility,".
1275  "contact_phone,contact_email,contact_consultation,activation_type,activation_start,".
1276  "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit,".
1277  "sub_max_members,sub_notify,view_mode,archive_start,archive_end,archive_type,abo," .
1278  "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, ".
1279  "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) ".
1280  "VALUES( ".
1281  $ilDB->quote($this->getId() ,'integer').", ".
1282  $ilDB->quote($this->getSyllabus() ,'text').", ".
1283  $ilDB->quote($this->getContactName() ,'text').", ".
1284  $ilDB->quote($this->getContactResponsibility() ,'text').", ".
1285  $ilDB->quote($this->getContactPhone() ,'text').", ".
1286  $ilDB->quote($this->getContactEmail() ,'text').", ".
1287  $ilDB->quote($this->getContactConsultation() ,'text').", ".
1288  $ilDB->quote(0 ,'integer').", ".
1289  $ilDB->quote($this->getActivationStart() ,'integer').", ".
1290  $ilDB->quote($this->getActivationEnd() ,'integer').", ".
1291  $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED ,'integer').", ".
1292  $ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
1293  $ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
1294  $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT ,'integer').", ".
1295  $ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
1296  "0, ".
1297  $ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
1298  "1, ".
1299  "0, ".
1300  $ilDB->quote($this->getArchiveStart() ,'integer').", ".
1301  $ilDB->quote($this->getArchiveEnd() ,'integer').", ".
1302  $ilDB->quote(IL_CRS_ARCHIVE_NONE ,'integer').", ".
1303  $ilDB->quote($this->ABO_ENABLED ,'integer').", ".
1304  $ilDB->quote($this->getLatitude() ,'text').", ".
1305  $ilDB->quote($this->getLongitude() ,'text').", ".
1306  $ilDB->quote($this->getLocationZoom() ,'integer').", ".
1307  $ilDB->quote($this->getEnableCourseMap() ,'integer').", ".
1308  #"objective_view = '0', ".
1309  "1, ".
1310  "1,".
1311  $ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
1312  $ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1313  $ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1314  $ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
1315  $ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
1316  $ilDB->quote((int)$this->getAutoNotification(),'integer').', '.
1317  $ilDB->quote((int)$this->getStatusDetermination(),'integer').', '.
1318  $ilDB->quote((int) $this->getMailToMembersType(),'integer').' '.
1319  ")";
1320 
1321  $res = $ilDB->manipulate($query);
1322  $this->__readSettings();
1323 
1324  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1325  $sorting = new ilContainerSortingSettings($this->getId());
1326  $sorting->setSortMode(ilContainer::SORT_MANUAL);
1327  $sorting->update();
1328  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
setRegistrationAccessCode($a_code)
Set refistration access code.
const IL_CRS_ARCHIVE_NONE
getLocationZoom()
Get LocationZoom.
getId()
get object id public
getRegistrationAccessCode()
get access code
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
static generateCode()
Generate new registration key.
getNumberOfPreviousSessions()
Set number of previous sessions.
const IL_CRS_SUBSCRIPTION_DIRECT
getEnableCourseMap()
Get Enable Course Map.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __deleteSettings()

ilObjCourse::__deleteSettings ( )

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

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

Referenced by delete().

1764  {
1765  global $ilDB;
1766 
1767  $query = "DELETE FROM crs_settings ".
1768  "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
1769  $res = $ilDB->manipulate($query);
1770 
1771  return true;
1772  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getCrsNonMemberTemplateId()

ilObjCourse::__getCrsNonMemberTemplateId ( )

get course non-member template private

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

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

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by __setCourseStatus().

1650  {
1651  global $ilDB;
1652 
1653  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1654  $res = $this->ilias->db->query($q);
1655  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1656 
1657  return $row["obj_id"];
1658  }
redirection script todo: (a better solution should control the processing via a xml file) ...
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )

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

References ilObject\getRefId().

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

1753  {
1754  global $rbacreview;
1755 
1756  // GET role_objects of predefined roles
1757 
1758  $rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
1759 
1760  return $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
1761  }
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __readSettings()

ilObjCourse::__readSettings ( )

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

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

Referenced by __createDefaultSettings(), and read().

1332  {
1333  global $ilDB;
1334 
1335  $query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
1336 
1337  $res = $ilDB->query($query);
1338  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1339  {
1340  $this->setSyllabus($row->syllabus);
1341  $this->setContactName($row->contact_name);
1342  $this->setContactResponsibility($row->contact_responsibility);
1343  $this->setContactPhone($row->contact_phone);
1344  $this->setContactEmail($row->contact_email);
1345  $this->setContactConsultation($row->contact_consultation);
1346  $this->setOfflineStatus(!(bool)$row->activation_type); // see below
1347  $this->setSubscriptionLimitationType($row->sub_limitation_type);
1348  $this->setSubscriptionStart($row->sub_start);
1349  $this->setSubscriptionEnd($row->sub_end);
1350  $this->setSubscriptionType($row->sub_type);
1351  $this->setSubscriptionPassword($row->sub_password);
1352  $this->enableSubscriptionMembershipLimitation($row->sub_mem_limit);
1353  $this->setSubscriptionMaxMembers($row->sub_max_members);
1354  $this->setSubscriptionNotify($row->sub_notify);
1355  $this->setViewMode($row->view_mode);
1356  $this->setArchiveStart($row->archive_start);
1357  $this->setArchiveEnd($row->archive_end);
1358  $this->setArchiveType($row->archive_type);
1359  $this->setAboStatus($row->abo);
1360  $this->enableWaitingList($row->waiting_list);
1361  $this->setImportantInformation($row->important);
1362  $this->setShowMembers($row->show_members);
1363  $this->setLatitude($row->latitude);
1364  $this->setLongitude($row->longitude);
1365  $this->setLocationZoom($row->location_zoom);
1366  $this->setEnableCourseMap($row->enable_course_map);
1367  $this->enableSessionLimit($row->session_limit);
1368  $this->setNumberOfPreviousSessions($row->session_prev);
1369  $this->setNumberOfNextSessions($row->session_next);
1370  $this->enableRegistrationAccessCode($row->reg_ac_enabled);
1371  $this->setRegistrationAccessCode($row->reg_ac);
1372  $this->setAutoNotification($row->auto_notification == 1 ? true : false);
1373  $this->setStatusDetermination((int) $row->status_dt);
1374  $this->setMailToMembersType($row->mail_members_type);
1375  }
1376 
1377  // moved activation to ilObjectActivation
1378  if($this->ref_id)
1379  {
1380  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1381  $activation = ilObjectActivation::getItem($this->ref_id);
1382  switch($activation["timing_type"])
1383  {
1386  $this->setActivationStart($activation["timing_start"]);
1387  $this->setActivationEnd($activation["timing_end"]);
1388  $this->setActivationVisibility($activation["visible"]);
1389  break;
1390 
1391  default:
1393  break;
1394  }
1395  }
1396  else
1397  {
1398  // #13176 - there should always be default
1400  }
1401 
1402  return true;
1403  }
setActivationEnd($a_value)
setArchiveType($a_value)
setSubscriptionNotify($a_value)
const IL_CRS_ACTIVATION_LIMITED
setContactResponsibility($a_value)
setSubscriptionStart($a_value)
setSubscriptionEnd($a_value)
setNumberOfPreviousSessions($a_num)
Set number of previous sessions.
setAutoNotification($value)
Sets automatic notification status in $this->auto_notification, using given $status.
setImportantInformation($a_info)
setMailToMembersType($a_type)
Set mail to members type.
static getItem($a_ref_id)
Get item data.
setContactEmail($a_value)
enableSubscriptionMembershipLimitation($a_status)
enable max members
setOfflineStatus($a_value)
enableSessionLimit($a_status)
en/disable limited number of sessions
setSubscriptionPassword($a_value)
setRegistrationAccessCode($a_code)
Set refistration access code.
setSyllabus($a_syllabus)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setLatitude($a_latitude)
Set Latitude.
setViewMode($a_mode)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
setAboStatus($a_status)
setLocationZoom($a_locationzoom)
Set LocationZoom.
setActivationStart($a_value)
setLongitude($a_longitude)
Set Longitude.
getId()
get object id public
setSubscriptionType($a_value)
setNumberOfNextSessions($a_num)
Set number of previous sessions.
setArchiveEnd($a_value)
setContactConsultation($a_value)
enableRegistrationAccessCode($a_status)
En/disable registration access code.
setActivationType($a_type)
setContactPhone($a_value)
setSubscriptionMaxMembers($a_value)
enableWaitingList($a_status)
setShowMembers($a_status)
const IL_CRS_ACTIVATION_UNLIMITED
setStatusDetermination($a_value)
Set status determination mode.
setArchiveStart($a_value)
setSubscriptionLimitationType($a_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setCourseStatus()

ilObjCourse::__setCourseStatus ( )

set course status

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

Creates linked roles in the local role folder object for all parent roles and initializes their permission templates. Each permission template is initialized by computing the intersection of the role template il_crs_non_member and the permission template of the parent role.

private

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

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

Referenced by initDefaultRoles().

1575  {
1576  global $rbacadmin, $rbacreview, $rbacsystem;
1577 
1578  //get Rolefolder of course
1579  $rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
1580 
1581  //define all relevant roles for which rights are needed to be changed
1582  $arr_parentRoles = $rbacreview->getParentRoleIds($this->getRefId());
1583  $arr_relevantParentRoleIds = array_diff(array_keys($arr_parentRoles),$this->getDefaultCourseRoles());
1584 
1585  $template_id = $this->__getCrsNonMemberTemplateId();
1586 
1587  //get defined operations from template
1588  if (is_null($template_id))
1589  {
1590  $template_ops = array();
1591  } else {
1592  $template_ops = $rbacreview->getOperationsOfRole($template_id, 'crs', ROLE_FOLDER_ID);
1593  }
1594 
1595  foreach ($arr_relevantParentRoleIds as $parentRole)
1596  {
1597  if ($rbacreview->isProtected($arr_parentRoles[$parentRole]['parent'],$parentRole))
1598  {
1599  continue;
1600  }
1601 
1602  $granted_permissions = array();
1603 
1604  // Delete the linked role for the parent role
1605  // (just in case if it already exists).
1606  $rbacadmin->deleteLocalRole($parentRole,$rolf_data["child"]);
1607 
1608  // Grant permissions on the course object for
1609  // the parent role. In the foreach loop we
1610  // compute the intersection of the role
1611  // template il_crs_non_member and the
1612  // permission template of the parent role.
1613  $current_ops = $rbacreview->getRoleOperationsOnObject($parentRole, $this->getRefId());
1614  $rbacadmin->revokePermission($this->getRefId(), $parentRole);
1615  foreach ($template_ops as $template_op)
1616  {
1617  if (in_array($template_op,$current_ops))
1618  {
1619  array_push($granted_permissions,$template_op);
1620  }
1621  }
1622  if (!empty($granted_permissions))
1623  {
1624  $rbacadmin->grantPermission($parentRole, $granted_permissions, $this->getRefId());
1625  }
1626 
1627  // Create a linked role for the parent role and
1628  // initialize it with the intersection of
1629  // il_crs_non_member and the permission
1630  // template of the parent role
1631  if (! is_null($template_id))
1632  {
1633  $rbacadmin->copyRolePermissionIntersection(
1634  $template_id, ROLE_FOLDER_ID,
1635  $parentRole, $arr_parentRoles[$parentRole]['parent'],
1636  $rolf_data["child"], $parentRole
1637  );
1638  }
1639  $rbacadmin->assignRoleToFolder($parentRole,$rolf_data["child"],"false");
1640  }//END foreach
1641  }
getDefaultCourseRoles($a_crs_id="")
get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_...
__getCrsNonMemberTemplateId()
get course non-member template private
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkCondition()

ilObjCourse::_checkCondition (   $a_obj_id,
  $a_operator,
  $a_value,
  $a_usr_id = 0 
)

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

References $ilUser, and ilParticipants\_hasPassed().

Referenced by ilConditionHandler\_checkCondition().

1824  {
1825  global $ilUser;
1826 
1827  $a_usr_id = $a_usr_id ? $a_usr_id : $ilUser->getId();
1828 
1829  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1830 
1831  switch($a_operator)
1832  {
1833  case 'passed':
1834  return ilCourseParticipants::_hasPassed($a_obj_id,$a_usr_id);
1835 
1836  default:
1837  return true;
1838  }
1839  }
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
global $ilUser
Definition: imgupload.php:15
+ 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 1841 of file class.ilObjCourse.php.

References ilCourseLMHistory\_deleteUser(), ilCourseObjectiveResult\_deleteUser(), and ilParticipants\_deleteUser().

Referenced by ilObjUser\delete().

1842  {
1843  // Delete all user related data
1844  // delete lm_history
1845  include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
1846  ilCourseLMHistory::_deleteUser($a_usr_id);
1847 
1848  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1850 
1851  // Course objectives
1852  include_once './Modules/Course/classes/class.ilCourseObjectiveResult.php';
1854  }
static _deleteUser($a_usr_id)
Delete user data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

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

References ilObjCourseAccess\_isActivated().

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

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

◆ _isSubscriptionNotificationEnabled()

static ilObjCourse::_isSubscriptionNotificationEnabled (   $a_course_id)
static

Check if subscription notification is enabled.

public

Parameters
intcourse_id

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

References $query, and $res.

437  {
438  global $ilDB;
439 
440  $query = "SELECT * FROM crs_settings ".
441  "WHERE obj_id = ".$ilDB->quote($a_course_id ,'integer')." ".
442  "AND sub_notify = 1";
443  $res = $ilDB->query($query);
444  return $res->numRows() ? true : false;
445  }

◆ _lookupAboStatus()

ilObjCourse::_lookupAboStatus (   $a_id)

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

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

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

584  {
585  global $ilDB;
586 
587  $query = "SELECT abo FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,'integer')." ";
588  $res = $ilDB->query($query);
589  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
590  {
591  return $row->abo;
592  }
593  return false;
594  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ _lookupViewMode()

ilObjCourse::_lookupViewMode (   $a_id)

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

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

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

571  {
572  global $ilDB;
573 
574  $query = "SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,'integer')." ";
575  $res = $ilDB->query($query);
576  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
577  {
578  return $row->view_mode;
579  }
580  return false;
581  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ 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 716 of file class.ilObjCourse.php.

References ilObjCourseAccess\_registrationEnabled().

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

717  {
718  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
719  return ilObjCourseAccess::_registrationEnabled($a_obj_id);
720  }
static _registrationEnabled($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjCourse::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

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

References ilObjectActivation\addAdditionalSubItemInformation().

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

◆ allowAbo()

ilObjCourse::allowAbo ( )

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

736  {
737  return $this->ABO == $this->ABO_ENABLED;
738  }

◆ appendMessage()

ilObjCourse::appendMessage (   $a_message)

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

References getMessage().

Referenced by validate().

665  {
666  if($this->getMessage())
667  {
668  $this->message .= "<br /> ";
669  }
670  $this->message .= $a_message;
671  }
+ 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 2130 of file class.ilObjCourse.php.

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

2131  {
2132  // #11113
2133  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2136  {
2137  include_once("Services/Tracking/classes/class.ilLPStatus.php");
2138  $has_completed = ilLPStatus::_hasUserCompleted($this->getId(), $a_member_id);
2139  $this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
2140  }
2141  }
getStatusDetermination()
Get status determination mode.
const STATUS_DETERMINATION_LP
static _enabledLearningProgress()
check wether learing progress is enabled or not
getId()
get object id public
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
+ Here is the call graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjCourse::cloneAutoGeneratedRoles (   $new_obj)

Clone automatic genrated roles (permissions and template permissions)

public

Parameters
objectnew course object

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

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

Referenced by cloneObject().

944  {
945  global $ilLog,$rbacadmin,$rbacreview;
946 
947  $admin = $this->getDefaultAdminRole();
948  $new_admin = $new_obj->getDefaultAdminRole();
949  $source_rolf = $rbacreview->getRoleFolderIdOfObject($this->getRefId());
950  $target_rolf = $rbacreview->getRoleFolderIdOfObject($new_obj->getRefId());
951 
952  if(!$admin || !$new_admin || !$source_rolf || !$target_rolf)
953  {
954  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_admin');
955  }
956  $rbacadmin->copyRolePermissions($admin,$source_rolf,$target_rolf,$new_admin,true);
957  $ilLog->write(__METHOD__.' : Finished copying of role crs_admin.');
958 
959  $tutor = $this->getDefaultTutorRole();
960  $new_tutor = $new_obj->getDefaultTutorRole();
961  if(!$tutor || !$new_tutor)
962  {
963  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_tutor');
964  }
965  $rbacadmin->copyRolePermissions($tutor,$source_rolf,$target_rolf,$new_tutor,true);
966  $ilLog->write(__METHOD__.' : Finished copying of role crs_tutor.');
967 
968  $member = $this->getDefaultMemberRole();
969  $new_member = $new_obj->getDefaultMemberRole();
970  if(!$member || !$new_member)
971  {
972  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_member');
973  }
974  $rbacadmin->copyRolePermissions($member,$source_rolf,$target_rolf,$new_member,true);
975  $ilLog->write(__METHOD__.' : Finished copying of role crs_member.');
976 
977  return true;
978  }
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjCourse::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (start objects, preconditions)

public

Parameters
inttarget ref id of new course
intcopy id

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

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

916  {
917  parent::cloneDependencies($a_target_id,$a_copy_id);
918 
919  // Clone course start objects
920  include_once('Modules/Course/classes/class.ilCourseStart.php');
921  $start = new ilCourseStart($this->getRefId(),$this->getId());
922  $start->cloneDependencies($a_target_id,$a_copy_id);
923 
924  // Clone course item settings
925  include_once('Services/Object/classes/class.ilObjectActivation.php');
926  ilObjectActivation::cloneDependencies($this->getRefId(),$a_target_id,$a_copy_id);
927 
928  // Clone course learning objectives
929  include_once('Modules/Course/classes/class.ilCourseObjective.php');
930  $crs_objective = new ilCourseObjective($this);
931  $crs_objective->ilClone($a_target_id,$a_copy_id);
932 
933  return true;
934  }
Class ilObj<module_name>
getId()
get object id public
class ilcourseobjective
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ cloneObject()

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

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

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

References $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().

855  {
856  global $ilDB,$ilUser;
857 
858  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
859 
860  $this->cloneAutoGeneratedRoles($new_obj);
861  $this->cloneMetaData($new_obj);
862 
863  // Assign admin
864  $new_obj->getMemberObject()->add($ilUser->getId(),IL_CRS_ADMIN);
865 
866  // #14596
867  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
868  if($cwo->isRootNode($this->getRefId()))
869  {
870  $this->setOfflineStatus(true);
871  }
872 
873  // Copy settings
874  $this->cloneSettings($new_obj);
875 
876  // Course Defined Fields
877  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
878  ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
879 
880  // Clone course files
881  include_once('Modules/Course/classes/class.ilCourseFile.php');
882  ilCourseFile::_cloneFiles($this->getId(),$new_obj->getId());
883 
884  // Copy learning progress settings
885  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
886  $obj_settings = new ilLPObjSettings($this->getId());
887  $obj_settings->cloneSettings($new_obj->getId());
888  unset($obj_settings);
889 
890  // clone icons
891  global $ilLog;
892  $ilLog->write(__METHOD__.': '.$this->getBigIconPath().' '.$this->getSmallIconPath());
893  $new_obj->saveIcons($this->getBigIconPath(),
894  $this->getSmallIconPath(),
895  $this->getTinyIconPath());
896 
897  // clone certificate (#11085)
898  include_once "./Services/Certificate/classes/class.ilCertificate.php";
899  include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
900  $cert = new ilCertificate(new ilCourseCertificateAdapter($this));
901  $newcert = new ilCertificate(new ilCourseCertificateAdapter($new_obj));
902  $cert->cloneCertificate($newcert);
903 
904  return $new_obj;
905  }
getBigIconPath()
Get path for big icon.
setOfflineStatus($a_value)
getTinyIconPath()
Get path for tiny icon.
static _clone($a_source_id, $a_target_id)
Clone fields.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
cloneMetaData($target_obj)
Copy meta data.
const IL_CRS_ADMIN
Base class for course and group participants.
cloneSettings($new_obj)
Clone entries in settings table.
getSmallIconPath()
Get path for small icon.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
global $ilUser
Definition: imgupload.php:15
Create PDF certificates.
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.
+ Here is the call graph for this function:

◆ cloneSettings()

ilObjCourse::cloneSettings (   $new_obj)

Clone entries in settings table.

public

Parameters
ilObjCoursenew course object

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

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

Referenced by cloneObject().

1225  {
1226  $new_obj->setSyllabus($this->getSyllabus());
1227  $new_obj->setContactName($this->getContactName());
1228  $new_obj->setContactResponsibility($this->getContactResponsibility());
1229  $new_obj->setContactPhone($this->getContactPhone());
1230  $new_obj->setContactEmail($this->getContactEmail());
1231  $new_obj->setContactConsultation($this->getContactConsultation());
1232  $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1233  $new_obj->setActivationType($this->getActivationType());
1234  $new_obj->setActivationStart($this->getActivationStart());
1235  $new_obj->setActivationEnd($this->getActivationEnd());
1236  $new_obj->setActivationVisibility($this->getActivationVisibility());
1237  $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1238  $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1239  $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1240  $new_obj->setSubscriptionType($this->getSubscriptionType());
1241  $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1242  $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1243  $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1244  $new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
1245  $new_obj->setViewMode($this->getViewMode());
1246  $new_obj->setOrderType($this->getOrderType());
1247  $new_obj->setArchiveStart($this->getArchiveStart());
1248  $new_obj->setArchiveEnd($this->getArchiveEnd());
1249  $new_obj->setArchiveType($this->getArchiveType());
1250  $new_obj->setAboStatus($this->getAboStatus());
1251  $new_obj->enableWaitingList($this->enabledWaitingList());
1252  $new_obj->setImportantInformation($this->getImportantInformation());
1253  $new_obj->setShowMembers($this->getShowMembers());
1254  $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1255  $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1256  $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1257  $new_obj->setAutoNotification( $this->getAutoNotification() );
1258  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1259  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1260  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1261  $new_obj->setStatusDetermination($this->getStatusDetermination());
1262  $new_obj->setMailToMembersType($this->getMailToMembersType());
1263 
1264  $new_obj->update();
1265  }
getMailToMembersType()
Get mail to members type.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
getOrderType()
Get order type default implementation.
getNumberOfNextSessions()
Set number of previous sessions.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
isSubscriptionMembershipLimited()
is membership limited
static generateCode()
Generate new registration key.
getNumberOfPreviousSessions()
Set number of previous sessions.
+ 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 746 of file class.ilObjCourse.php.

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

747  {
748  global $ilAppEventHandler;
749 
750  parent::create($a_upload);
751 
752  if(!$a_upload)
753  {
754  $this->createMetaData();
755  }
756  $this->__createDefaultSettings();
757 
758  $ilAppEventHandler->raise('Modules/Course',
759  'create',
760  array('object' => $this,
761  'obj_id' => $this->getId(),
762  'appointments' => $this->prepareAppointments('create')));
763 
764  }
createMetaData()
create meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
+ Here is the call graph for this function:

◆ delete()

ilObjCourse::delete ( )

delete course and all related data

public

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

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

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

1069  {
1070  global $ilAppEventHandler;
1071 
1072  // always call parent delete function first!!
1073  if (!parent::delete())
1074  {
1075  return false;
1076  }
1077 
1078  // delete meta data
1079  $this->deleteMetaData();
1080 
1081  // put here course specific stuff
1082 
1083  $this->__deleteSettings();
1084 
1085  include_once('Modules/Course/classes/class.ilCourseParticipants.php');
1087 
1088  $this->initCourseArchiveObject();
1089  $this->archives_obj->deleteAll();
1090 
1091  include_once './Modules/Course/classes/class.ilCourseObjective.php';
1093 
1094  include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
1096 
1097  include_once './Modules/Course/classes/class.ilCourseFile.php';
1099 
1100  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1102 
1103  $ilAppEventHandler->raise('Modules/Course',
1104  'delete',
1105  array('object' => $this,
1106  'obj_id' => $this->getId(),
1107  'appointments' => $this->prepareAppointments('delete')));
1108 
1109 
1110  return true;
1111  }
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
static _deleteByContainer($a_container_id)
Delete all fields of a container.
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
deleteMetaData()
delete meta data entry
_deleteByCourse($a_course_id)
+ Here is the call graph for this function:

◆ enabledObjectiveView()

ilObjCourse::enabledObjectiveView ( )

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

References IL_CRS_VIEW_OBJECTIVE.

316  {
317  return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
318  }
const IL_CRS_VIEW_OBJECTIVE

◆ enabledWaitingList()

ilObjCourse::enabledWaitingList ( )

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

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

321  {
322  return (bool) $this->waiting_list;
323  }
+ 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 157 of file class.ilObjCourse.php.

Referenced by __readSettings().

158  {
159  $this->reg_access_code_enabled = $a_status;
160  }
+ 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 348 of file class.ilObjCourse.php.

Referenced by __readSettings().

349  {
350  $this->session_limit = $a_status;
351  }
+ Here is the caller graph for this function:

◆ enableSubscriptionMembershipLimitation()

ilObjCourse::enableSubscriptionMembershipLimitation (   $a_status)

enable max members

public

Parameters
boolstatus
Returns

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

Referenced by __readSettings().

366  {
367  $this->subscription_membership_limitation = $a_status;
368  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjCourse::enableWaitingList (   $a_status)

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

Referenced by __readSettings().

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

◆ getAboStatus()

ilObjCourse::getAboStatus ( )

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

Referenced by cloneSettings(), and updateSettings().

625  {
626  return $this->abo;
627  }
+ Here is the caller graph for this function:

◆ getActivationEnd()

ilObjCourse::getActivationEnd ( )

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

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

246  {
247  return $this->activation_end ? $this->activation_end : mktime(0,0,0,12,12,date("Y",time())+2);
248  }
+ Here is the caller graph for this function:

◆ getActivationStart()

ilObjCourse::getActivationStart ( )

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

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

238  {
239  return $this->activation_start ? $this->activation_start : time();
240  }
+ Here is the caller graph for this function:

◆ getActivationType()

ilObjCourse::getActivationType ( )

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

Referenced by cloneSettings(), and validate().

219  {
220  return (int) $this->activation_type;
221  }
+ Here is the caller graph for this function:

◆ getActivationUnlimitedStatus()

ilObjCourse::getActivationUnlimitedStatus ( )

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

References IL_CRS_ACTIVATION_UNLIMITED.

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

234  {
235  return $this->activation_type == IL_CRS_ACTIVATION_UNLIMITED;
236  }
const IL_CRS_ACTIVATION_UNLIMITED
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjCourse::getActivationVisibility ( )

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

Referenced by cloneSettings(), and updateSettings().

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

◆ getArchiveEnd()

ilObjCourse::getArchiveEnd ( )

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

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

605  {
606  return $this->archive_end ? $this->archive_end : mktime(0,0,0,12,12,date("Y",time())+2);
607  }
+ Here is the caller graph for this function:

◆ getArchiveStart()

ilObjCourse::getArchiveStart ( )

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

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

597  {
598  return $this->archive_start ? $this->archive_start : time();
599  }
+ Here is the caller graph for this function:

◆ getArchiveType()

ilObjCourse::getArchiveType ( )

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

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

Referenced by cloneSettings(), and updateSettings().

613  {
614  return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
615  }
const IL_CRS_ARCHIVE_NONE
const IL_CRS_ARCHIVE_DOWNLOAD
+ Here is the caller graph for this function:

◆ getAutoNotification()

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

Returns
boolean

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

References $auto_notification.

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

2062  {
2063  return $this->auto_notification;
2064  }
+ Here is the caller graph for this function:

◆ getContactConsultation()

ilObjCourse::getContactConsultation ( )

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

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

187  {
188  return $this->contact_consultation;
189  }
+ Here is the caller graph for this function:

◆ getContactEmail()

ilObjCourse::getContactEmail ( )

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

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

203  {
204  return $this->contact_email;
205  }
+ Here is the caller graph for this function:

◆ getContactName()

ilObjCourse::getContactName ( )

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

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

179  {
180  return $this->contact_name;
181  }
+ Here is the caller graph for this function:

◆ getContactPhone()

ilObjCourse::getContactPhone ( )

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

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

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

◆ getContactResponsibility()

ilObjCourse::getContactResponsibility ( )

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

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

211  {
212  return $this->contact_responsibility;
213  }
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjCourse::getDefaultAdminRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

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_admin_".$this->getRefId()))
1814  {
1815  return $role_id;
1816  }
1817  }
1818  }
1819  return false;
1820  }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultCourseRoles()

ilObjCourse::getDefaultCourseRoles (   $a_crs_id = "")

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

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

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

References ilObject\getRefId().

Referenced by __setCourseStatus().

1710  {
1711  global $rbacadmin, $rbacreview;
1712 
1713  if (strlen($a_crs_id) > 0)
1714  {
1715  $crs_id = $a_crs_id;
1716  }
1717  else
1718  {
1719  $crs_id = $this->getRefId();
1720  }
1721 
1722  $rolf = $rbacreview->getRoleFolderOfObject($crs_id);
1723  $role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
1724 
1725  foreach ($role_arr as $role_id)
1726  {
1727  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1728 
1729  $crs_Member ="il_crs_member_".$crs_id;
1730  $crs_Admin ="il_crs_admin_".$crs_id;
1731  $crs_Tutor ="il_crs_tutor_".$crs_id;
1732 
1733  if (strcmp($role_Obj->getTitle(), $crs_Member) == 0 )
1734  {
1735  $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1736  }
1737 
1738  if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0)
1739  {
1740  $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1741  }
1742 
1743  if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0)
1744  {
1745  $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1746  }
1747  }
1748 
1749  return $arr_crsDefaultRoles;
1750  }
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjCourse::getDefaultMemberRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1776  {
1777  $local_roles = $this->__getLocalRoles();
1778 
1779  foreach($local_roles as $role_id)
1780  {
1781  $title = ilObject::_lookupTitle($role_id);
1782  if(substr($title,0,8) == 'il_crs_m')
1783  {
1784  return $role_id;
1785  }
1786  }
1787  return 0;
1788  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultTutorRole()

ilObjCourse::getDefaultTutorRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1790  {
1791  $local_roles = $this->__getLocalRoles();
1792 
1793  foreach($local_roles as $role_id)
1794  {
1795  if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
1796  {
1797  if(!strcmp($tmp_role->getTitle(),"il_crs_tutor_".$this->getRefId()))
1798  {
1799  return $role_id;
1800  }
1801  }
1802  }
1803  return false;
1804  }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableCourseMap()

ilObjCourse::getEnableCourseMap ( )

Get Enable Course Map.

Returns
boolean Enable Course Map

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

References $enablemap.

Referenced by __createDefaultSettings(), and updateSettings().

842  {
843  return $this->enablemap;
844  }
+ Here is the caller graph for this function:

◆ getImportantInformation()

ilObjCourse::getImportantInformation ( )

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

Referenced by cloneSettings(), and updateSettings().

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

◆ getLatitude()

ilObjCourse::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

Referenced by __createDefaultSettings(), and updateSettings().

782  {
783  return $this->latitude;
784  }
+ Here is the caller graph for this function:

◆ getLocalCourseRoles()

ilObjCourse::getLocalCourseRoles (   $a_translate = false)

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

info is stored in object variable public

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

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

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

1667  {
1668  global $rbacadmin,$rbacreview;
1669 
1670  if (empty($this->local_roles))
1671  {
1672  $this->local_roles = array();
1673  $rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
1674  $role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
1675 
1676  foreach ($role_arr as $role_id)
1677  {
1678  if ($rbacreview->isAssignable($role_id,$rolf["ref_id"]) == true)
1679  {
1680  $role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1681 
1682  if ($a_translate)
1683  {
1684  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1685  }
1686  else
1687  {
1688  $role_name = $role_Obj->getTitle();
1689  }
1690  $this->local_roles[$role_name] = $role_Obj->getId();
1691  }
1692  }
1693  }
1694 
1695  return $this->local_roles;
1696  }
_getTranslation($a_role_title)
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getLocationZoom()

ilObjCourse::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

References $locationzoom.

Referenced by __createDefaultSettings(), and updateSettings().

822  {
823  return $this->locationzoom;
824  }
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

Referenced by __createDefaultSettings(), and updateSettings().

802  {
803  return $this->longitude;
804  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

References $mail_members.

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

652  {
653  return $this->mail_members;
654  }
+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

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

References $member_obj, and initCourseMemberObject().

1450  {
1451  if(!$this->member_obj instanceof ilCourseParticipant)
1452  {
1453  $this->initCourseMemberObject();
1454  }
1455  return $this->member_obj;
1456  }
initCourseMemberObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:

◆ getMembersObject()

ilObjCourse::getMembersObject ( )
Deprecated:
Returns
ilCourseParticipants

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

References $members_obj, and initCourseMembersObject().

Referenced by checkLPStatusSync(), and syncMembersStatusWithLP().

1463  {
1464  if(!$this->members_obj instanceof ilCourseParticipants)
1465  {
1466  $this->initCourseMembersObject();
1467  }
1468  return $this->members_obj;
1469  }
initCourseMembersObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjCourse::getMessage ( )

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

Referenced by appendMessage(), and validate().

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

◆ getNumberOfNextSessions()

ilObjCourse::getNumberOfNextSessions ( )

Set number of previous sessions.

Returns

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

References $session_next.

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

404  {
405  return $this->session_next;
406  }
+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjCourse::getNumberOfPreviousSessions ( )

Set number of previous sessions.

Returns

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

References $session_prev.

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

385  {
386  return $this->session_prev;
387  }
+ Here is the caller graph for this function:

◆ getOfflineStatus()

ilObjCourse::getOfflineStatus ( )

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

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

254  {
255  return (bool)$this->activation_offline;
256  }
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjCourse::getRegistrationAccessCode ( )

get access code

Returns

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

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

129  {
130  return $this->reg_access_code;
131  }
+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjCourse::getShowMembers ( )

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

Referenced by cloneSettings(), and updateSettings().

633  {
634  return $this->show_members;
635  }
+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

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

References $status_dt.

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

2106  {
2107  return $this->status_dt;
2108  }
+ 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 453 of file class.ilObjCourse.php.

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

454  {
455  global $ilUser;
456 
457  // Caching
458  if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]))
459  {
460  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
461  }
462 
463  // Results are stored in $this->items
464  parent::getSubItems($a_admin_panel_enabled,$a_include_side_block);
465 
466  // No sessions
467  if(!is_array($this->items['sess']) or !$this->items['sess'])
468  {
469  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
470  }
471  // No session limit
472  if(!$this->isSessionLimitEnabled() or $a_admin_panel_enabled)
473  {
474  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
475  }
476 
477  if($a_include_side_block)
478  {
479  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
480  }
481 
482  // @todo move to gui class
483  if(isset($_GET['crs_prev_sess']))
484  {
485  $ilUser->writePref('crs_sess_show_prev_'.$this->getId(), (string) (int) $_GET['crs_prev_sess']);
486  }
487  if(isset($_GET['crs_next_sess']))
488  {
489  $ilUser->writePref('crs_sess_show_next_'.$this->getId(), (string) (int) $_GET['crs_next_sess']);
490  }
491 
492  $sessions = ilUtil::sortArray($this->items['sess'],'start','ASC',true,false);
493  $today = new ilDate(date('Ymd',time()),IL_CAL_DATE);
494  $previous = $current = $next = array();
495  foreach($sessions as $key => $item)
496  {
497  $start = new ilDateTime($item['start'],IL_CAL_UNIX);
498  $end = new ilDateTime($item['end'],IL_CAL_UNIX);
499 
500  if(ilDateTime::_within($today, $start, $end, IL_CAL_DAY))
501  {
502  $current[] = $item;
503  }
504  elseif(ilDateTime::_before($start, $today, IL_CAL_DAY))
505  {
506  $previous[] = $item;
507  }
508  elseif(ilDateTime::_after($start, $today, IL_CAL_DAY))
509  {
510  $next[] = $item;
511  }
512  }
513  $num_previous_remove = max(
514  count($previous) - $this->getNumberOfPreviousSessions(),
515  0
516  );
517  while($num_previous_remove--)
518  {
519  if(!$ilUser->getPref('crs_sess_show_prev_'.$this->getId()))
520  {
521  array_shift($previous);
522  }
523  $this->items['sess_link']['prev']['value'] = 1;
524  }
525 
526  $num_next_remove = max(
527  count($next) - $this->getNumberOfNextSessions(),
528  0
529  );
530  while($num_next_remove--)
531  {
532  if(!$ilUser->getPref('crs_sess_show_next_'.$this->getId()))
533  {
534  array_pop($next);
535  }
536  // @fixme
537  $this->items['sess_link']['next']['value'] = 1;
538  }
539 
540  $sessions = array_merge($previous,$current,$next);
541  $this->items['sess'] = $sessions;
542 
543  // #15389 - see ilContainer::getSubItems()
544  include_once('Services/Container/classes/class.ilContainerSorting.php');
545  $sort = ilContainerSorting::_getInstance($this->getId());
546  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
547 
548  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
549  }
$_GET["client_id"]
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const IL_CAL_UNIX
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
const IL_CAL_DAY
Class for single dates.
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
Date and time handling
const IL_CAL_DATE
global $ilUser
Definition: imgupload.php:15
getNumberOfPreviousSessions()
Set number of previous sessions.
static _getInstance($a_obj_id)
get instance by obj_id
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check whether an date is within a date duration given by start and end.
+ Here is the call graph for this function:

◆ getSubscriptionEnd()

ilObjCourse::getSubscriptionEnd ( )

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

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

291  {
292  return $this->subscription_end ? $this->subscription_end : mktime(0,0,0,12,12,date("Y",time())+2);
293  }
+ Here is the caller graph for this function:

◆ getSubscriptionLimitationType()

ilObjCourse::getSubscriptionLimitationType ( )

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

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

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

◆ getSubscriptionMaxMembers()

ilObjCourse::getSubscriptionMaxMembers ( )

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

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

420  {
421  return $this->subscription_max_members;
422  }
+ Here is the caller graph for this function:

◆ getSubscriptionNotify()

ilObjCourse::getSubscriptionNotify ( )

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

Referenced by cloneSettings(), and updateSettings().

552  {
553  return true;
554  return $this->subscription_notify ? true : false;
555  }
+ Here is the caller graph for this function:

◆ getSubscriptionPassword()

ilObjCourse::getSubscriptionPassword ( )

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

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

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

◆ getSubscriptionStart()

ilObjCourse::getSubscriptionStart ( )

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

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

283  {
284  return $this->subscription_start ? $this->subscription_start : time();
285  }
+ Here is the caller graph for this function:

◆ getSubscriptionType()

ilObjCourse::getSubscriptionType ( )

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

References IL_CRS_SUBSCRIPTION_DIRECT.

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

299  {
300  return $this->subscription_type ? $this->subscription_type : IL_CRS_SUBSCRIPTION_DIRECT;
301  #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
302  }
const IL_CRS_SUBSCRIPTION_DIRECT
+ Here is the caller graph for this function:

◆ getSubscriptionUnlimitedStatus()

ilObjCourse::getSubscriptionUnlimitedStatus ( )

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

References IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

279  {
280  return $this->subscription_limitation_type == IL_CRS_SUBSCRIPTION_UNLIMITED;
281  }
const IL_CRS_SUBSCRIPTION_UNLIMITED
+ Here is the caller graph for this function:

◆ getSyllabus()

ilObjCourse::getSyllabus ( )

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

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

171  {
172  return $this->syllabus;
173  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilObjCourse::getViewMode ( )

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

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

566  {
567  return $this->view_mode;
568  }
+ Here is the caller graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

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

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

1053  {
1054  return strlen($this->getContactName()) or
1055  strlen($this->getContactResponsibility()) or
1056  strlen($this->getContactEmail()) or
1057  strlen($this->getContactPhone()) or
1058  strlen($this->getContactConsultation());
1059  }
+ Here is the call graph for this function:

◆ ilObjCourse()

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

Constructor public.

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

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

References setStatusDetermination().

82  {
83 
84  #define("ILIAS_MODULE","course");
85  #define("KEEP_IMAGE_PATH",1);
86 
87  $this->SUBSCRIPTION_DEACTIVATED = 1;
88  $this->SUBSCRIPTION_CONFIRMATION = 2;
89  $this->SUBSCRIPTION_DIRECT = 3;
90  $this->SUBSCRIPTION_PASSWORD = 4;
91  $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
92  $this->ARCHIVE_DISABLED = 1;
93  $this->ARCHIVE_READ = 2;
94  $this->ARCHIVE_DOWNLOAD = 3;
95  $this->ABO_ENABLED = 1;
96  $this->ABO_DISABLED = 0;
97  $this->SHOW_MEMBERS_ENABLED = 1;
98  $this->SHOW_MEMBERS_DISABLED = 0;
99  $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
100 
101  $this->type = "crs";
102 
103  parent::__construct($a_id,$a_call_by_reference);
104 
105  }
setStatusDetermination($a_value)
Set status determination mode.
+ Here is the call graph for this function:

◆ initCourseArchiveObject()

ilObjCourse::initCourseArchiveObject ( )

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

Referenced by delete().

1472  {
1473  include_once "./Modules/Course/classes/class.ilCourseArchives.php";
1474 
1475  if(!is_object($this->archives_obj))
1476  {
1477  $this->archives_obj =& new ilCourseArchives($this);
1478  }
1479  return true;
1480  }
class ilCourseArchives
+ Here is the caller graph for this function:

◆ initCourseMemberObject()

ilObjCourse::initCourseMemberObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMemberObject().

1423  {
1424  global $ilUser;
1425 
1426  include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
1427  $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(),$ilUser->getId());
1428  return true;
1429  }
getId()
get object id public
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCourseMembersObject()

ilObjCourse::initCourseMembersObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMembersObject().

1437  {
1438  global $ilUser;
1439 
1440  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1441  $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1442  return true;
1443  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
getId()
get object id public
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjCourse::initDefaultRoles ( )

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

References $query, $res, __setCourseStatus(), ilObject\createRoleFolder(), DB_FETCHMODE_OBJECT, ilObject\getId(), and ilObject\getRefId().

1486  {
1487  global $rbacadmin,$rbacreview,$ilDB;
1488 
1489  $rolf_obj = $this->createRoleFolder();
1490 
1491  // CREATE ADMIN ROLE
1492  $role_obj = $rolf_obj->createRole("il_crs_admin_".$this->getRefId(),"Admin of course obj_no.".$this->getId());
1493  $admin_id = $role_obj->getId();
1494 
1495  // SET PERMISSION TEMPLATE OF NEW LOCAL ADMIN ROLE
1496  $query = "SELECT obj_id FROM object_data ".
1497  " WHERE type='rolt' AND title='il_crs_admin'";
1498 
1499  $res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
1500  $rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
1501 
1502  // SET OBJECT PERMISSIONS OF COURSE OBJECT
1503  $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"crs",$rolf_obj->getRefId());
1504  $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
1505 
1506  // SET OBJECT PERMISSIONS OF ROLE FOLDER OBJECT
1507  //$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"rolf",$rolf_obj->getRefId());
1508  //$rbacadmin->grantPermission($role_obj->getId(),$ops,$rolf_obj->getRefId());
1509 
1510  // CREATE TUTOR ROLE
1511  // CREATE ROLE AND ASSIGN ROLE TO ROLEFOLDER...
1512  $role_obj = $rolf_obj->createRole("il_crs_tutor_".$this->getRefId(),"Tutors of course obj_no.".$this->getId());
1513  $member_id = $role_obj->getId();
1514 
1515  // SET PERMISSION TEMPLATE OF NEW LOCAL ROLE
1516  $query = "SELECT obj_id FROM object_data ".
1517  " WHERE type='rolt' AND title='il_crs_tutor'";
1518  $res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
1519  $rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
1520 
1521  // SET OBJECT PERMISSIONS OF COURSE OBJECT
1522  $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"crs",$rolf_obj->getRefId());
1523  $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
1524 
1525  // SET OBJECT PERMISSIONS OF ROLE FOLDER OBJECT
1526  //$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"rolf",$rolf_obj->getRefId());
1527  //$rbacadmin->grantPermission($role_obj->getId(),$ops,$rolf_obj->getRefId());
1528 
1529  // CREATE MEMBER ROLE
1530  // CREATE ROLE AND ASSIGN ROLE TO ROLEFOLDER...
1531  $role_obj = $rolf_obj->createRole("il_crs_member_".$this->getRefId(),"Member of course obj_no.".$this->getId());
1532  $member_id = $role_obj->getId();
1533 
1534  // SET PERMISSION TEMPLATE OF NEW LOCAL ROLE
1535  $query = "SELECT obj_id FROM object_data ".
1536  " WHERE type='rolt' AND title='il_crs_member'";
1537  $res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
1538  $rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
1539 
1540  // SET OBJECT PERMISSIONS OF COURSE OBJECT
1541  $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"crs",$rolf_obj->getRefId());
1542  $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
1543 
1544  // SET OBJECT PERMISSIONS OF ROLE FOLDER OBJECT
1545  //$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"rolf",$rolf_obj->getRefId());
1546  //$rbacadmin->grantPermission($role_obj->getId(),$ops,$rolf_obj->getRefId());
1547 
1548  unset($role_obj);
1549  unset($rolf_obj);
1550 
1551  // Break inheritance, create local roles and initialize permission
1552  // settings depending on course status.
1553  $this->__setCourseStatus();
1554 
1555  return true;
1556  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getId()
get object id public
__setCourseStatus()
set course status
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
createRoleFolder()
creates a local role folder
+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

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

References ilObject\getId().

1406  {
1407  include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
1408 
1409  if(!is_object($this->waiting_list_obj))
1410  {
1411  $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1412  }
1413  return true;
1414  }
getId()
get object id public
+ Here is the call graph for this function:

◆ inSubscriptionTime()

ilObjCourse::inSubscriptionTime ( )

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

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

Referenced by register().

331  {
332  if($this->getSubscriptionUnlimitedStatus())
333  {
334  return true;
335  }
336  if(time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd())
337  {
338  return true;
339  }
340  return false;
341  }
+ 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 673 of file class.ilObjCourse.php.

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

674  {
675  if($a_check_archive)
676  {
677  if($this->isArchived())
678  {
679  return true;
680  }
681  }
682  if($this->getOfflineStatus())
683  {
684  return false;
685  }
686  if($this->getActivationUnlimitedStatus())
687  {
688  return true;
689  }
690  if(time() < $this->getActivationStart() or
691  time() > $this->getActivationEnd())
692  {
693  return false;
694  }
695  return true;
696  }
+ Here is the call graph for this function:

◆ isArchived()

ilObjCourse::isArchived ( )

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

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

Referenced by isActivated().

723  {
724  if($this->getViewMode() != IL_CRS_VIEW_ARCHIVE)
725  {
726  return false;
727  }
728  if(time() < $this->getArchiveStart() or time() > $this->getArchiveEnd())
729  {
730  return false;
731  }
732  return true;
733  }
const IL_CRS_VIEW_ARCHIVE
+ 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 147 of file class.ilObjCourse.php.

References $reg_access_code_enabled.

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

148  {
149  return (bool) $this->reg_access_code_enabled;
150  }
+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjCourse::isSessionLimitEnabled ( )

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

References $session_limit.

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

354  {
355  return (bool) $this->session_limit;
356  }
+ Here is the caller graph for this function:

◆ isSubscriptionMembershipLimited()

ilObjCourse::isSubscriptionMembershipLimited ( )

is membership limited

public

Parameters

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

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

415  {
416  return (bool) $this->subscription_membership_limitation;
417  }
+ 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 1958 of file class.ilObjCourse.php.

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1959  {
1960  global $ilDB;
1961 
1962  $query = "SELECT obj_id FROM crs_settings ".
1963  "WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
1964  "AND reg_ac = ".$ilDB->quote($a_code,'text');
1965  $res = $ilDB->query($query);
1966 
1967  $obj_ids = array();
1968  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1969  {
1970  $obj_ids[] = $row->obj_id;
1971  }
1972  return $obj_ids;
1973  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ 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 112 of file class.ilObjCourse.php.

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

Referenced by ilParticipants\hasParticipantListAccess().

113  {
114  $query = 'SELECT show_members FROM crs_settings '.
115  'WHERE obj_id = '.$GLOBALS['ilDB']->quote($a_obj_id,'integer');
116  $res = $GLOBALS['ilDB']->query($query);
117  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
118  {
119  return (bool) $row->show_members;
120  }
121  return false;
122  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
$GLOBALS['ct_recipient']
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjCourse::MDUpdateListener (   $a_element)

Overwriten Metadata update listener for ECS functionalities.

public

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

References $ilLog.

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

◆ prepareAppointments()

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

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

References getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), 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().

1900  {
1901  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1902  include_once('./Services/Calendar/classes/class.ilDateTime.php');
1903 
1904  switch($a_mode)
1905  {
1906  case 'create':
1907  case 'update':
1908  if(!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus())
1909  {
1910  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1911  $app->setTitle($this->getTitle());
1912  $app->setSubtitle('crs_cal_activation_start');
1913  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1914  $app->setDescription($this->getLongDescription());
1915  $app->setStart(new ilDateTime($this->getActivationStart(),IL_CAL_UNIX));
1916  $apps[] = $app;
1917 
1918  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1919  $app->setTitle($this->getTitle());
1920  $app->setSubtitle('crs_cal_activation_end');
1921  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1922  $app->setDescription($this->getLongDescription());
1923  $app->setStart(new ilDateTime($this->getActivationEnd(),IL_CAL_UNIX));
1924  $apps[] = $app;
1925  }
1927  {
1928  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1929  $app->setTitle($this->getTitle());
1930  $app->setSubtitle('crs_cal_reg_start');
1931  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1932  $app->setDescription($this->getLongDescription());
1933  $app->setStart(new ilDateTime($this->getSubscriptionStart(),IL_CAL_UNIX));
1934  $apps[] = $app;
1935 
1936  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1937  $app->setTitle($this->getTitle());
1938  $app->setSubtitle('crs_cal_reg_end');
1939  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1940  $app->setDescription($this->getLongDescription());
1941  $app->setStart(new ilDateTime($this->getSubscriptionEnd(),IL_CAL_UNIX));
1942  $apps[] = $app;
1943  }
1944 
1945  return $apps ? $apps : array();
1946 
1947  case 'delete':
1948  // Nothing to do: The category and all assigned appointments will be deleted.
1949  return array();
1950  }
1951  }
const IL_CRS_SUBSCRIPTION_LIMITED
const IL_CAL_TRANSLATION_SYSTEM
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
getTitle()
get object title public
Date and time handling
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourse::read (   $a_force_db = false)

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

References __readSettings().

741  {
742  parent::read($a_force_db);
743 
744  $this->__readSettings();
745  }
+ 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 1981 of file class.ilObjCourse.php.

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

1982  {
1983  global $ilCtrl, $tree;
1984  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1985  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1987 
1988  if($part->isAssigned($a_user_id))
1989  {
1990  return true;
1991  }
1992 
1993  if(!$a_force_registration)
1994  {
1995  // Availability
1997  {
1998  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1999 
2001  {
2002  throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
2003  ', course subscription is deactivated.', '456');
2004  }
2005  }
2006 
2007  // Time Limitation
2009  {
2010  if( !$this->inSubscriptionTime() )
2011  {
2012  throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
2013  ', course is out of registration time.', '789');
2014  }
2015  }
2016 
2017  // Max members
2018  if($this->isSubscriptionMembershipLimited())
2019  {
2020  $free = max(0,$this->getSubscriptionMaxMembers() - $part->getCountMembers());
2021  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2022  $waiting_list = new ilCourseWaitingList($this->getId());
2023  if($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
2024  {
2025  $waiting_list->addToList($a_user_id);
2026  $this->lng->loadLanguageModule("crs");
2027  $info = sprintf($this->lng->txt('crs_added_to_list'),
2028  $waiting_list->getPosition($a_user_id));
2029  include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
2030  $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
2031  $participants->sendNotification($participants->NOTIFY_WAITING_LIST,$a_user_id);
2032 
2033  throw new ilMembershipRegistrationException($info, '124');
2034  }
2035 
2036  if(!$this->enabledWaitingList() && !$free)
2037  {
2038  throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
2039  ', membership is limited.', '123');
2040  }
2041  }
2042  }
2043 
2044  $part->add($a_user_id,$a_role);
2045  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
2046  $part->sendNotification($part->NOTIFY_ADMINS,$a_user_id);
2047 
2048 
2049  include_once './Modules/Forum/classes/class.ilForumNotification.php';
2051 
2052  return true;
2053  }
const IL_CRS_SUBSCRIPTION_LIMITED
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _usingRegistrationCode()
Using Registration code.
global $ilCtrl
Definition: ilias.php:18
getId()
get object id public
isSubscriptionMembershipLimited()
is membership limited
getRefId()
get reference id public
static checkForumsExistsInsert($ref_id, $user_id=0)
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:

◆ setAboStatus()

ilObjCourse::setAboStatus (   $a_status)

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

Referenced by __readSettings().

621  {
622  $this->abo = $a_status;
623  }
+ Here is the caller graph for this function:

◆ setActivationEnd()

ilObjCourse::setActivationEnd (   $a_value)

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

Referenced by __readSettings().

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

◆ setActivationStart()

ilObjCourse::setActivationStart (   $a_value)

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

Referenced by __readSettings().

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

◆ setActivationType()

ilObjCourse::setActivationType (   $a_type)

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

References IL_CRS_ACTIVATION_OFFLINE, IL_CRS_ACTIVATION_UNLIMITED, and setOfflineStatus().

Referenced by __readSettings().

223  {
224  // offline is separate property now
225  if($a_type == IL_CRS_ACTIVATION_OFFLINE)
226  {
227  $this->setOfflineStatus(true);
228  $a_type = IL_CRS_ACTIVATION_UNLIMITED;
229  }
230 
231  $this->activation_type = $a_type;
232  }
setOfflineStatus($a_value)
const IL_CRS_ACTIVATION_OFFLINE
const IL_CRS_ACTIVATION_UNLIMITED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjCourse::setActivationVisibility (   $a_value)

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

Referenced by __readSettings().

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

◆ setArchiveEnd()

ilObjCourse::setArchiveEnd (   $a_value)

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

Referenced by __readSettings().

609  {
610  $this->archive_end = $a_value;
611  }
+ Here is the caller graph for this function:

◆ setArchiveStart()

ilObjCourse::setArchiveStart (   $a_value)

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

Referenced by __readSettings().

601  {
602  $this->archive_start = $a_value;
603  }
+ Here is the caller graph for this function:

◆ setArchiveType()

ilObjCourse::setArchiveType (   $a_value)

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

Referenced by __readSettings().

617  {
618  $this->archive_type = $a_value;
619  }
+ 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 2073 of file class.ilObjCourse.php.

Referenced by __readSettings().

2074  {
2075  $this->auto_notification = $value;
2076  }
+ Here is the caller graph for this function:

◆ setContactConsultation()

ilObjCourse::setContactConsultation (   $a_value)

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

Referenced by __readSettings().

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

◆ setContactEmail()

ilObjCourse::setContactEmail (   $a_value)

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

Referenced by __readSettings().

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

◆ setContactName()

ilObjCourse::setContactName (   $a_cn)

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

Referenced by __readSettings().

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

◆ setContactPhone()

ilObjCourse::setContactPhone (   $a_value)

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

Referenced by __readSettings().

199  {
200  $this->contact_phone = $a_value;
201  }
+ Here is the caller graph for this function:

◆ setContactResponsibility()

ilObjCourse::setContactResponsibility (   $a_value)

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

Referenced by __readSettings().

215  {
216  $this->contact_responsibility = $a_value;
217  }
+ 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 831 of file class.ilObjCourse.php.

Referenced by __readSettings().

832  {
833  $this->enablemap = $a_enablemap;
834  }
+ Here is the caller graph for this function:

◆ setImportantInformation()

ilObjCourse::setImportantInformation (   $a_info)

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

Referenced by __readSettings().

167  {
168  $this->important = $a_info;
169  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjCourse::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by __readSettings().

772  {
773  $this->latitude = $a_latitude;
774  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by __readSettings().

812  {
813  $this->locationzoom = $a_locationzoom;
814  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by __readSettings().

792  {
793  $this->longitude = $a_longitude;
794  }
+ 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 642 of file class.ilObjCourse.php.

Referenced by __readSettings().

643  {
644  $this->mail_members = $a_type;
645  }
+ Here is the caller graph for this function:

◆ setMessage()

ilObjCourse::setMessage (   $a_message)

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

Referenced by validate().

661  {
662  $this->message = $a_message;
663  }
+ 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 394 of file class.ilObjCourse.php.

Referenced by __readSettings().

395  {
396  $this->session_next = $a_num;
397  }
+ 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 375 of file class.ilObjCourse.php.

Referenced by __readSettings().

376  {
377  $this->session_prev = $a_num;
378  }
+ Here is the caller graph for this function:

◆ setOfflineStatus()

ilObjCourse::setOfflineStatus (   $a_value)

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

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

258  {
259  $this->activation_offline = (bool) $a_value;
260  }
+ Here is the caller graph for this function:

◆ setRegistrationAccessCode()

ilObjCourse::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

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

Referenced by __createDefaultSettings(), and __readSettings().

139  {
140  $this->reg_access_code = $a_code;
141  }
+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjCourse::setShowMembers (   $a_status)

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

Referenced by __readSettings().

629  {
630  $this->show_members = $a_status;
631  }
+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

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

References ilObjUserTracking\_enabledLearningProgress().

Referenced by __readSettings(), and ilObjCourse().

2084  {
2085  $a_value = (int)$a_value;
2086 
2087  // #13905
2088  if($a_value == self::STATUS_DETERMINATION_LP)
2089  {
2090  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2092  {
2093  $a_value = self::STATUS_DETERMINATION_MANUAL;
2094  }
2095  }
2096 
2097  $this->status_dt = $a_value;
2098  }
static _enabledLearningProgress()
check wether learing progress is enabled or not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubscriptionEnd()

ilObjCourse::setSubscriptionEnd (   $a_value)

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

Referenced by __readSettings().

295  {
296  $this->subscription_end = $a_value;
297  }
+ Here is the caller graph for this function:

◆ setSubscriptionLimitationType()

ilObjCourse::setSubscriptionLimitationType (   $a_type)

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

Referenced by __readSettings().

275  {
276  $this->subscription_limitation_type = $a_type;
277  }
+ Here is the caller graph for this function:

◆ setSubscriptionMaxMembers()

ilObjCourse::setSubscriptionMaxMembers (   $a_value)

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

Referenced by __readSettings().

424  {
425  $this->subscription_max_members = $a_value;
426  }
+ Here is the caller graph for this function:

◆ setSubscriptionNotify()

ilObjCourse::setSubscriptionNotify (   $a_value)

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

Referenced by __readSettings().

557  {
558  $this->subscription_notify = $a_value ? true : false;
559  }
+ Here is the caller graph for this function:

◆ setSubscriptionPassword()

ilObjCourse::setSubscriptionPassword (   $a_value)

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

Referenced by __readSettings().

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

◆ setSubscriptionStart()

ilObjCourse::setSubscriptionStart (   $a_value)

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

Referenced by __readSettings().

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

◆ setSubscriptionType()

ilObjCourse::setSubscriptionType (   $a_value)

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

Referenced by __readSettings().

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

◆ setSyllabus()

ilObjCourse::setSyllabus (   $a_syllabus)

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

Referenced by __readSettings().

175  {
176  $this->syllabus = $a_syllabus;
177  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjCourse::setViewMode (   $a_mode)

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

Referenced by __readSettings().

562  {
563  $this->view_mode = $a_mode;
564  }
+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

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

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

2114  {
2115  include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
2116  foreach($this->getMembersObject()->getParticipants() as $user_id)
2117  {
2118  // #15529 - force raise on sync
2119  ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, false, true);
2120  }
2121  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
getId()
get object id public
+ Here is the call graph for this function:

◆ update()

ilObjCourse::update ( )

update complete object

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

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

1119  {
1120  global $ilAppEventHandler,$ilLog;
1121 
1122  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1123  $sorting = new ilContainerSortingSettings($this->getId());
1124  $sorting->setSortMode($this->getOrderType());
1125  $sorting->update();
1126 
1127  $this->updateMetaData();
1128  $this->updateSettings();
1129  parent::update();
1130 
1131  $ilAppEventHandler->raise('Modules/Course',
1132  'update',
1133  array('object' => $this,
1134  'obj_id' => $this->getId(),
1135  'appointments' => $this->prepareAppointments('update')));
1136 
1137  }
updateMetaData()
update meta data entry
getOrderType()
Get order type default implementation.
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
+ Here is the call graph for this function:

◆ updateSettings()

ilObjCourse::updateSettings ( )

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

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

Referenced by update().

1140  {
1141  global $ilDB;
1142 
1143  // Due to a bug 3.5.alpha maybe no settings exist. => create default settings
1144 
1145  $query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
1146  $res = $ilDB->query($query);
1147 
1148  if(!$res->numRows())
1149  {
1150  $this->__createDefaultSettings();
1151  }
1152 
1153  $query = "UPDATE crs_settings SET ".
1154  "syllabus = ".$ilDB->quote($this->getSyllabus() ,'text').", ".
1155  "contact_name = ".$ilDB->quote($this->getContactName() ,'text').", ".
1156  "contact_responsibility = ".$ilDB->quote($this->getContactResponsibility() ,'text').", ".
1157  "contact_phone = ".$ilDB->quote($this->getContactPhone() ,'text').", ".
1158  "contact_email = ".$ilDB->quote($this->getContactEmail() ,'text').", ".
1159  "contact_consultation = ".$ilDB->quote($this->getContactConsultation() ,'text').", ".
1160  "activation_type = ".$ilDB->quote(!$this->getOfflineStatus() ,'integer').", ".
1161  "sub_limitation_type = ".$ilDB->quote($this->getSubscriptionLimitationType() ,'integer').", ".
1162  "sub_start = ".$ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
1163  "sub_end = ".$ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
1164  "sub_type = ".$ilDB->quote($this->getSubscriptionType() ,'integer').", ".
1165  "sub_password = ".$ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
1166  "sub_mem_limit = ".$ilDB->quote((int) $this->isSubscriptionMembershipLimited() ,'integer').", ".
1167  "sub_max_members = ".$ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
1168  "sub_notify = ".$ilDB->quote($this->getSubscriptionNotify() ,'integer').", ".
1169  "view_mode = ".$ilDB->quote($this->getViewMode() ,'integer').", ".
1170  "archive_start = ".$ilDB->quote($this->getArchiveStart() ,'integer').", ".
1171  "archive_end = ".$ilDB->quote($this->getArchiveEnd() ,'integer').", ".
1172  "archive_type = ".$ilDB->quote($this->getArchiveType() ,'integer').", ".
1173  "abo = ".$ilDB->quote($this->getAboStatus() ,'integer').", ".
1174  "waiting_list = ".$ilDB->quote($this->enabledWaitingList() ,'integer').", ".
1175  "important = ".$ilDB->quote($this->getImportantInformation() ,'text').", ".
1176  "show_members = ".$ilDB->quote($this->getShowMembers() ,'integer').", ".
1177  "latitude = ".$ilDB->quote($this->getLatitude() ,'text').", ".
1178  "longitude = ".$ilDB->quote($this->getLongitude() ,'text').", ".
1179  "location_zoom = ".$ilDB->quote($this->getLocationZoom() ,'integer').", ".
1180  "enable_course_map = ".$ilDB->quote((int) $this->getEnableCourseMap() ,'integer').", ".
1181  'session_limit = '.$ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
1182  'session_prev = '.$ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1183  'session_next = '.$ilDB->quote($this->getNumberOfNextSessions(),'integer').', '.
1184  'reg_ac_enabled = '.$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
1185  'reg_ac = '.$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
1186  'auto_notification = '.$ilDB->quote( (int)$this->getAutoNotification(), 'integer').', '.
1187  'status_dt = '.$ilDB->quote((int) $this->getStatusDetermination()).', '.
1188  'mail_members_type = '.$ilDB->quote((int) $this->getMailToMembersType(),'integer').' '.
1189  "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
1190 
1191 
1192  $res = $ilDB->manipulate($query);
1193 
1194  // moved activation to ilObjectActivation
1195  if($this->ref_id)
1196  {
1197  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1198  ilObjectActivation::getItem($this->ref_id);
1199 
1200  $item = new ilObjectActivation;
1201  if($this->getActivationUnlimitedStatus())
1202  {
1204  }
1205  else
1206  {
1207  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1208  $item->setTimingStart($this->getActivationStart());
1209  $item->setTimingEnd($this->getActivationEnd());
1210  $item->toggleVisible($this->getActivationVisibility());
1211  }
1212 
1213  $item->update($this->ref_id);
1214  }
1215  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
static getItem($a_ref_id)
Get item data.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
getLocationZoom()
Get LocationZoom.
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
getRegistrationAccessCode()
get access code
setTimingType($a_type)
Set timing type.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
getNumberOfPreviousSessions()
Set number of previous sessions.
getEnableCourseMap()
Get Enable Course Map.
Class ilObjectActivation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjCourse::validate ( )

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

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

982  {
983  $this->setMessage('');
984 
985  #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and
986  # $this->getSubscriptionType() == )
987  #{
988  # $this->appendMessage($this->lng->txt('crs_select_registration_type'));
989  #}
990 
991  if(($this->getActivationType() == IL_CRS_ACTIVATION_LIMITED) and
992  $this->getActivationEnd() < $this->getActivationStart())
993  {
994  $this->appendMessage($this->lng->txt("activation_times_not_valid"));
995  }
997  $this->getSubscriptionStart() > $this->getSubscriptionEnd())
998  {
999  $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
1000  }
1001  #if((!$this->getActivationUnlimitedStatus() and
1002  # !$this->getSubscriptionUnlimitedStatus()) and
1003  # ($this->getSubscriptionStart() > $this->getActivationEnd() or
1004  # $this->getSubscriptionStart() < $this->getActivationStart() or
1005  # $this->getSubscriptionEnd() > $this->getActivationEnd() or
1006  # $this->getSubscriptionEnd() < $this->getActivationStart()))
1007  #
1008  #{
1009  # $this->appendMessage($this->lng->txt("subscription_time_not_within_activation"));
1010  #}
1012  {
1013  $this->appendMessage($this->lng->txt("crs_password_required"));
1014  }
1015  if($this->isSubscriptionMembershipLimited() and ($this->getSubscriptionMaxMembers() <= 0 or !is_numeric($this->getSubscriptionMaxMembers())))
1016  {
1017  $this->appendMessage($this->lng->txt("max_members_not_numeric"));
1018  }
1019  if(($this->getViewMode() == IL_CRS_VIEW_ARCHIVE) and
1020  $this->getArchiveStart() > $this->getArchiveEnd())
1021  {
1022  $this->appendMessage($this->lng->txt("archive_times_not_valid"));
1023  }
1024  if(!$this->getTitle() || !$this->getStatusDetermination())
1025  {
1026  $this->appendMessage($this->lng->txt('err_check_input'));
1027  }
1028 
1029 
1030  return $this->getMessage() ? false : true;
1031  }
const IL_CRS_ACTIVATION_LIMITED
const IL_CRS_SUBSCRIPTION_LIMITED
getStatusDetermination()
Get status determination mode.
const IL_CRS_SUBSCRIPTION_PASSWORD
getTitle()
get object title public
const IL_CRS_VIEW_ARCHIVE
setMessage($a_message)
isSubscriptionMembershipLimited()
is membership limited
appendMessage($a_message)
+ Here is the call graph for this function:

◆ validateInfoSettings()

ilObjCourse::validateInfoSettings ( )

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

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

1034  {
1035  global $ilErr;
1036  $error = false;
1037  if($this->getContactEmail()) {
1038  $emails = split(",",$this->getContactEmail());
1039 
1040  foreach ($emails as $email) {
1041  $email = trim($email);
1042  if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email)))
1043  {
1044  $ilErr->appendMessage($this->lng->txt('contact_email_not_valid')." '".$email."'");
1045  $error = true;
1046  }
1047  }
1048  }
1049  return !$error;
1050  }
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
getUserIdByLogin($a_login)
+ Here is the call graph for this function:

Field Documentation

◆ $archives_obj

ilObjCourse::$archives_obj

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

◆ $auto_notification

ilObjCourse::$auto_notification = true
private

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

Referenced by getAutoNotification().

◆ $enablemap

ilObjCourse::$enablemap = 0
private

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

Referenced by getEnableCourseMap().

◆ $latitude

ilObjCourse::$latitude = ''
private

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

Referenced by getLatitude().

◆ $locationzoom

ilObjCourse::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $longitude

ilObjCourse::$longitude = ''
private

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

Referenced by getLongitude().

◆ $mail_members

ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $member_obj

ilObjCourse::$member_obj = null
private

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

Referenced by getMemberObject().

◆ $members_obj

ilObjCourse::$members_obj = null
private

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

Referenced by getMembersObject().

◆ $reg_access_code

ilObjCourse::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjCourse::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $session_limit

ilObjCourse::$session_limit = 0
private

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

Referenced by isSessionLimitEnabled().

◆ $session_next

ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

ilObjCourse::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

◆ $status_dt

ilObjCourse::$status_dt = null
private

Definition at line 61 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_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 44 of file class.ilObjCourse.php.

Referenced by ilObjCourseGUI\initEditForm().


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