ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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 ()
 
 setParentRolePermissions ($a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 __getCrsNonMemberTemplateId ()
 get course non-member template private More...
 
 getLocalCourseRoles ($a_translate=false)
 get ALL local roles of course, also those created and defined afterwards only fetch data once from database. More...
 
 getDefaultCourseRoles ($a_crs_id="")
 get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member public More...
 
 __getLocalRoles ()
 
 __deleteSettings ()
 
 getDefaultMemberRole ()
 
 getDefaultTutorRole ()
 
 getDefaultAdminRole ()
 
 _deleteUser ($a_usr_id)
 
 MDUpdateListener ($a_element)
 Overwriten Metadata update listener for ECS functionalities. More...
 
 addAdditionalSubItemInformation (&$a_item_data)
 Add additional information to sub item, e.g. More...
 
 register ($a_user_id, $a_role=ilCourseConstants::CRS_MEMBER, $a_force_registration=false)
 
 getAutoNotification ()
 Returns automatic notification status from $this->auto_notification. More...
 
 setAutoNotification ($value)
 Sets automatic notification status in $this->auto_notification, using given $status. More...
 
 setStatusDetermination ($a_value)
 Set status determination mode. More...
 
 getStatusDetermination ()
 Get status determination mode. More...
 
 syncMembersStatusWithLP ()
 Set course status for all members by lp status. More...
 
 checkLPStatusSync ($a_member_id)
 sync course status from lp More...
 
 getOrderType ()
 
- 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...
 
 getCustomIconPath ()
 Get path for custom icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 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...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register ($a_user_id)
 Register an user. More...
 

Static Public Member Functions

static lookupShowMembersEnabled ($a_obj_id)
 Check if show member is enabled. More...
 
static _isSubscriptionNotificationEnabled ($a_course_id)
 Check if subscription notification is enabled. More...
 
static lookupCourseNonMemberTemplatesId ()
 Lookup course non member id. More...
 
static lookupObjectsByCode ($a_code)
 
- Static Public Member Functions inherited from ilContainer
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $a_obj_id)
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _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
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

 initCourseMemberObject ()
 Init course member object 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 1280 of file class.ilObjCourse.php.

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

Referenced by create(), and updateSettings().

1281  {
1282  global $ilDB;
1283 
1284  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1286 
1287  $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility,".
1288  "contact_phone,contact_email,contact_consultation,activation_type,activation_start,".
1289  "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit,".
1290  "sub_max_members,sub_notify,view_mode,archive_start,archive_end,archive_type,abo," .
1291  "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, ".
1292  "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) ".
1293  "VALUES( ".
1294  $ilDB->quote($this->getId() ,'integer').", ".
1295  $ilDB->quote($this->getSyllabus() ,'text').", ".
1296  $ilDB->quote($this->getContactName() ,'text').", ".
1297  $ilDB->quote($this->getContactResponsibility() ,'text').", ".
1298  $ilDB->quote($this->getContactPhone() ,'text').", ".
1299  $ilDB->quote($this->getContactEmail() ,'text').", ".
1300  $ilDB->quote($this->getContactConsultation() ,'text').", ".
1301  $ilDB->quote(0 ,'integer').", ".
1302  $ilDB->quote($this->getActivationStart() ,'integer').", ".
1303  $ilDB->quote($this->getActivationEnd() ,'integer').", ".
1304  $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED ,'integer').", ".
1305  $ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
1306  $ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
1307  $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT ,'integer').", ".
1308  $ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
1309  "0, ".
1310  $ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
1311  "1, ".
1312  "0, ".
1313  $ilDB->quote($this->getArchiveStart() ,'integer').", ".
1314  $ilDB->quote($this->getArchiveEnd() ,'integer').", ".
1315  $ilDB->quote(IL_CRS_ARCHIVE_NONE ,'integer').", ".
1316  $ilDB->quote($this->ABO_ENABLED ,'integer').", ".
1317  $ilDB->quote($this->getLatitude() ,'text').", ".
1318  $ilDB->quote($this->getLongitude() ,'text').", ".
1319  $ilDB->quote($this->getLocationZoom() ,'integer').", ".
1320  $ilDB->quote($this->getEnableCourseMap() ,'integer').", ".
1321  #"objective_view = '0', ".
1322  "1, ".
1323  "1,".
1324  $ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
1325  $ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1326  $ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
1327  $ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
1328  $ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
1329  $ilDB->quote((int)$this->getAutoNotification(),'integer').', '.
1330  $ilDB->quote((int)$this->getStatusDetermination(),'integer').', '.
1331  $ilDB->quote((int) $this->getMailToMembersType(),'integer').' '.
1332  ")";
1333 
1334  $res = $ilDB->manipulate($query);
1335  $this->__readSettings();
1336 
1337  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1338  $sorting = new ilContainerSortingSettings($this->getId());
1339  $sorting->setSortMode(ilContainer::SORT_MANUAL);
1340  $sorting->update();
1341  }
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.
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
const IL_CRS_SUBSCRIPTION_DIRECT
getEnableCourseMap()
Get Enable Course Map.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __deleteSettings()

ilObjCourse::__deleteSettings ( )

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

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

Referenced by delete().

1683  {
1684  global $ilDB;
1685 
1686  $query = "DELETE FROM crs_settings ".
1687  "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
1688  $res = $ilDB->manipulate($query);
1689 
1690  return true;
1691  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getCrsNonMemberTemplateId()

ilObjCourse::__getCrsNonMemberTemplateId ( )

get course non-member template private

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

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

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

Referenced by setParentRolePermissions().

1558  {
1559  global $ilDB;
1560 
1561  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1562  $res = $this->ilias->db->query($q);
1563  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1564 
1565  return $row["obj_id"];
1566  }
redirection script todo: (a better solution should control the processing via a xml file) ...
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
global $ilDB
+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )

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

References ilObject\getRefId().

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

1674  {
1675  global $rbacreview;
1676 
1677  // GET role_objects of predefined roles
1678 
1679  return $rbacreview->getRolesOfRoleFolder($this->getRefId(),false);
1680  }
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 1344 of file class.ilObjCourse.php.

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

1345  {
1346  global $ilDB;
1347 
1348  $query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
1349 
1350  $res = $ilDB->query($query);
1351  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1352  {
1353  $this->setSyllabus($row->syllabus);
1354  $this->setContactName($row->contact_name);
1355  $this->setContactResponsibility($row->contact_responsibility);
1356  $this->setContactPhone($row->contact_phone);
1357  $this->setContactEmail($row->contact_email);
1358  $this->setContactConsultation($row->contact_consultation);
1359  $this->setOfflineStatus(!(bool)$row->activation_type); // see below
1360  $this->setSubscriptionLimitationType($row->sub_limitation_type);
1361  $this->setSubscriptionStart($row->sub_start);
1362  $this->setSubscriptionEnd($row->sub_end);
1363  $this->setSubscriptionType($row->sub_type);
1364  $this->setSubscriptionPassword($row->sub_password);
1365  $this->enableSubscriptionMembershipLimitation($row->sub_mem_limit);
1366  $this->setSubscriptionMaxMembers($row->sub_max_members);
1367  $this->setSubscriptionNotify($row->sub_notify);
1368  $this->setViewMode($row->view_mode);
1369  $this->setArchiveStart($row->archive_start);
1370  $this->setArchiveEnd($row->archive_end);
1371  $this->setArchiveType($row->archive_type);
1372  $this->setAboStatus($row->abo);
1373  $this->enableWaitingList($row->waiting_list);
1374  $this->setImportantInformation($row->important);
1375  $this->setShowMembers($row->show_members);
1376  $this->setLatitude($row->latitude);
1377  $this->setLongitude($row->longitude);
1378  $this->setLocationZoom($row->location_zoom);
1379  $this->setEnableCourseMap($row->enable_course_map);
1380  $this->enableSessionLimit($row->session_limit);
1381  $this->setNumberOfPreviousSessions($row->session_prev);
1382  $this->setNumberOfNextSessions($row->session_next);
1383  $this->enableRegistrationAccessCode($row->reg_ac_enabled);
1384  $this->setRegistrationAccessCode($row->reg_ac);
1385  $this->setAutoNotification($row->auto_notification == 1 ? true : false);
1386  $this->setStatusDetermination((int) $row->status_dt);
1387  $this->setMailToMembersType($row->mail_members_type);
1388  }
1389 
1390  // moved activation to ilObjectActivation
1391  if($this->ref_id)
1392  {
1393  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1394  $activation = ilObjectActivation::getItem($this->ref_id);
1395  switch($activation["timing_type"])
1396  {
1399  $this->setActivationStart($activation["timing_start"]);
1400  $this->setActivationEnd($activation["timing_end"]);
1401  $this->setActivationVisibility($activation["visible"]);
1402  break;
1403 
1404  default:
1406  break;
1407  }
1408  }
1409  else
1410  {
1411  // #13176 - there should always be default
1413  }
1414 
1415  return true;
1416  }
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)
global $ilDB
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:

◆ _deleteUser()

ilObjCourse::_deleteUser (   $a_usr_id)

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

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

Referenced by ilObjUser\delete().

1742  {
1743  // Delete all user related data
1744  // delete lm_history
1745  include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
1746  ilCourseLMHistory::_deleteUser($a_usr_id);
1747 
1748  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1750 
1751  // Course objectives
1752  include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1754  }
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
static _deleteUser($a_usr_id)
Delete user data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

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

References ilObjCourseAccess\_isActivated().

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

708  {
709  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
710  return ilObjCourseAccess::_isActivated($a_obj_id);
711  }
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 $ilDB, $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  }
global $ilDB

◆ _lookupAboStatus()

ilObjCourse::_lookupAboStatus (   $a_id)

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

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

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

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

◆ _lookupViewMode()

ilObjCourse::_lookupViewMode (   $a_id)

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

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

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

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

References ilObjCourseAccess\_registrationEnabled().

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

720  {
721  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
722  return ilObjCourseAccess::_registrationEnabled($a_obj_id);
723  }
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 1786 of file class.ilObjCourse.php.

References ilObjectActivation\addAdditionalSubItemInformation().

1787  {
1788  include_once './Services/Object/classes/class.ilObjectActivation.php';
1790  }
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 738 of file class.ilObjCourse.php.

739  {
740  return $this->ABO == $this->ABO_ENABLED;
741  }

◆ appendMessage()

ilObjCourse::appendMessage (   $a_message)

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

References getMessage().

Referenced by validate().

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

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

2031  {
2032  // #11113
2033  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2036  {
2037  include_once("Services/Tracking/classes/class.ilLPStatus.php");
2038  // #13811 - we need to suppress creation if status entry
2039  $has_completed = (ilLPStatus::_lookupStatus($this->getId(), $a_member_id, false) == ilLPStatus::LP_STATUS_COMPLETED_NUM);
2040  $this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
2041  }
2042  }
const LP_STATUS_COMPLETED_NUM
getStatusDetermination()
Get status determination mode.
const STATUS_DETERMINATION_LP
static _enabledLearningProgress()
check wether learing progress is enabled or not
getId()
get object id public
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
+ Here is the call graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjCourse::cloneAutoGeneratedRoles (   $new_obj)

Clone automatic genrated roles (permissions and template permissions)

public

Parameters
objectnew course object

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

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

Referenced by cloneObject().

953  {
954  global $ilLog,$rbacadmin,$rbacreview;
955 
956  $admin = $this->getDefaultAdminRole();
957  $new_admin = $new_obj->getDefaultAdminRole();
958 
959  if(!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId())
960  {
961  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_admin');
962  }
963  $rbacadmin->copyRolePermissions($admin,$this->getRefId(),$new_obj->getRefId(),$new_admin,true);
964  $ilLog->write(__METHOD__.' : Finished copying of role crs_admin.');
965 
966  $tutor = $this->getDefaultTutorRole();
967  $new_tutor = $new_obj->getDefaultTutorRole();
968  if(!$tutor || !$new_tutor)
969  {
970  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_tutor');
971  }
972  $rbacadmin->copyRolePermissions($tutor,$this->getRefId(),$new_obj->getRefId(),$new_tutor,true);
973  $ilLog->write(__METHOD__.' : Finished copying of role crs_tutor.');
974 
975  $member = $this->getDefaultMemberRole();
976  $new_member = $new_obj->getDefaultMemberRole();
977  if(!$member || !$new_member)
978  {
979  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_member');
980  }
981  $rbacadmin->copyRolePermissions($member,$this->getRefId(),$new_obj->getRefId(),$new_member,true);
982  $ilLog->write(__METHOD__.' : Finished copying of role crs_member.');
983 
984  return true;
985  }
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 921 of file class.ilObjCourse.php.

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

922  {
923  parent::cloneDependencies($a_target_id,$a_copy_id);
924 
925  // Clone course start objects
926  include_once('Services/Container/classes/class.ilContainerStartObjects.php');
927  $start = new ilContainerStartObjects($this->getRefId(),$this->getId());
928  $start->cloneDependencies($a_target_id,$a_copy_id);
929 
930  // Clone course item settings
931  include_once('Services/Object/classes/class.ilObjectActivation.php');
932  ilObjectActivation::cloneDependencies($this->getRefId(),$a_target_id,$a_copy_id);
933 
934  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
935  ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
936 
937  // Clone course learning objectives
938  include_once('Modules/Course/classes/class.ilCourseObjective.php');
939  $crs_objective = new ilCourseObjective($this);
940  $crs_objective->ilClone($a_target_id,$a_copy_id);
941 
942  return true;
943  }
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
getId()
get object id public
class ilcourseobjective
static _lookupObjId($a_id)
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
getRefId()
get reference id public
+ 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 860 of file class.ilObjCourse.php.

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

861  {
862  global $ilDB,$ilUser;
863 
864  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
865 
866  $this->cloneAutoGeneratedRoles($new_obj);
867  $this->cloneMetaData($new_obj);
868 
869  // Assign admin
870  $new_obj->getMemberObject()->add($ilUser->getId(),IL_CRS_ADMIN);
871 
872  // #14596
873  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
874  if($cwo->isRootNode($this->getRefId()))
875  {
876  $this->setOfflineStatus(true);
877  }
878 
879  // Copy settings
880  $this->cloneSettings($new_obj);
881 
882  // Course Defined Fields
883  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
884  ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
885 
886  // Clone course files
887  include_once('Modules/Course/classes/class.ilCourseFile.php');
888  ilCourseFile::_cloneFiles($this->getId(),$new_obj->getId());
889 
890  // Copy learning progress settings
891  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
892  $obj_settings = new ilLPObjSettings($this->getId());
893  $obj_settings->cloneSettings($new_obj->getId());
894  unset($obj_settings);
895 
896  // clone icons
897  global $ilLog;
898  $ilLog->write(__METHOD__.': '.$this->getBigIconPath().' '.$this->getSmallIconPath());
899  $new_obj->saveIcons($this->getBigIconPath(),
900  $this->getSmallIconPath(),
901  $this->getTinyIconPath());
902 
903  // clone certificate (#11085)
904  include_once "./Services/Certificate/classes/class.ilCertificate.php";
905  include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
906  $cert = new ilCertificate(new ilCourseCertificateAdapter($this));
907  $newcert = new ilCertificate(new ilCourseCertificateAdapter($new_obj));
908  $cert->cloneCertificate($newcert);
909 
910  return $new_obj;
911  }
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
global $ilDB
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 1231 of file class.ilObjCourse.php.

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

Referenced by cloneObject().

1232  {
1233  $new_obj->setSyllabus($this->getSyllabus());
1234  $new_obj->setContactName($this->getContactName());
1235  $new_obj->setContactResponsibility($this->getContactResponsibility());
1236  $new_obj->setContactPhone($this->getContactPhone());
1237  $new_obj->setContactEmail($this->getContactEmail());
1238  $new_obj->setContactConsultation($this->getContactConsultation());
1239  $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1240  $new_obj->setActivationType($this->getActivationType());
1241  $new_obj->setActivationStart($this->getActivationStart());
1242  $new_obj->setActivationEnd($this->getActivationEnd());
1243  $new_obj->setActivationVisibility($this->getActivationVisibility());
1244  $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1245  $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1246  $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1247  $new_obj->setSubscriptionType($this->getSubscriptionType());
1248  $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1249  $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1250  $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1251  $new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
1252  $new_obj->setViewMode($this->getViewMode());
1253  $new_obj->setOrderType($this->getOrderType());
1254  $new_obj->setArchiveStart($this->getArchiveStart());
1255  $new_obj->setArchiveEnd($this->getArchiveEnd());
1256  $new_obj->setArchiveType($this->getArchiveType());
1257  $new_obj->setAboStatus($this->getAboStatus());
1258  $new_obj->enableWaitingList($this->enabledWaitingList());
1259  $new_obj->setImportantInformation($this->getImportantInformation());
1260  $new_obj->setShowMembers($this->getShowMembers());
1261  $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1262  $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1263  $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1264  $new_obj->setAutoNotification( $this->getAutoNotification() );
1265  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1266  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1267  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1268  $new_obj->setStatusDetermination($this->getStatusDetermination());
1269  $new_obj->setMailToMembersType($this->getMailToMembersType());
1270 
1271  // #10271
1272  $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1273  $new_obj->setLatitude($this->getLatitude());
1274  $new_obj->setLongitude($this->getLongitude());
1275  $new_obj->setLocationZoom($this->getLocationZoom());
1276 
1277  $new_obj->update();
1278  }
getMailToMembersType()
Get mail to members type.
getLongitude()
Get Longitude.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getStatusDetermination()
Get status determination mode.
getLocationZoom()
Get LocationZoom.
getNumberOfNextSessions()
Set number of previous sessions.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
static generateCode()
Generate new registration key.
getNumberOfPreviousSessions()
Set number of previous sessions.
getEnableCourseMap()
Get Enable Course Map.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjCourse::create (   $a_upload = false)

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

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

753  {
754  global $ilAppEventHandler;
755 
756  parent::create($a_upload);
757 
758  if(!$a_upload)
759  {
760  $this->createMetaData();
761  }
762  $this->__createDefaultSettings();
763 
764  $ilAppEventHandler->raise('Modules/Course',
765  'create',
766  array('object' => $this,
767  'obj_id' => $this->getId(),
768  'appointments' => $this->prepareAppointments('create')));
769 
770  }
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 1075 of file class.ilObjCourse.php.

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

1076  {
1077  global $ilAppEventHandler;
1078 
1079  // always call parent delete function first!!
1080  if (!parent::delete())
1081  {
1082  return false;
1083  }
1084 
1085  // delete meta data
1086  $this->deleteMetaData();
1087 
1088  // put here course specific stuff
1089 
1090  $this->__deleteSettings();
1091 
1092  include_once('Modules/Course/classes/class.ilCourseParticipants.php');
1094 
1095  $this->initCourseArchiveObject();
1096  $this->archives_obj->deleteAll();
1097 
1098  include_once './Modules/Course/classes/class.ilCourseObjective.php';
1100 
1101  include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
1103 
1104  include_once './Modules/Course/classes/class.ilCourseFile.php';
1106 
1107  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1109 
1110  $ilAppEventHandler->raise('Modules/Course',
1111  'delete',
1112  array('object' => $this,
1113  'obj_id' => $this->getId(),
1114  'appointments' => $this->prepareAppointments('delete')));
1115 
1116 
1117  return true;
1118  }
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.

Referenced by getOrderType().

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

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

Referenced by cloneSettings(), and updateSettings().

628  {
629  return $this->abo;
630  }
+ 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 607 of file class.ilObjCourse.php.

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

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

◆ getArchiveStart()

ilObjCourse::getArchiveStart ( )

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

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

600  {
601  return $this->archive_start ? $this->archive_start : time();
602  }
+ Here is the caller graph for this function:

◆ getArchiveType()

ilObjCourse::getArchiveType ( )

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

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

Referenced by cloneSettings(), and updateSettings().

616  {
617  return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
618  }
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 1961 of file class.ilObjCourse.php.

References $auto_notification.

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

1962  {
1963  return $this->auto_notification;
1964  }
+ 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 1724 of file class.ilObjCourse.php.

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

Referenced by cloneAutoGeneratedRoles().

1725  {
1726  $local_roles = $this->__getLocalRoles();
1727 
1728  foreach($local_roles as $role_id)
1729  {
1730  if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
1731  {
1732  if(!strcmp($tmp_role->getTitle(),"il_crs_admin_".$this->getRefId()))
1733  {
1734  return $role_id;
1735  }
1736  }
1737  }
1738  return false;
1739  }
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 1631 of file class.ilObjCourse.php.

References ilObject\getRefId().

1632  {
1633  global $rbacadmin, $rbacreview;
1634 
1635  if (strlen($a_crs_id) > 0)
1636  {
1637  $crs_id = $a_crs_id;
1638  }
1639  else
1640  {
1641  $crs_id = $this->getRefId();
1642  }
1643 
1644  $role_arr = $rbacreview->getRolesOfRoleFolder($crs_id);
1645 
1646  foreach ($role_arr as $role_id)
1647  {
1648  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1649 
1650  $crs_Member ="il_crs_member_".$crs_id;
1651  $crs_Admin ="il_crs_admin_".$crs_id;
1652  $crs_Tutor ="il_crs_tutor_".$crs_id;
1653 
1654  if (strcmp($role_Obj->getTitle(), $crs_Member) == 0 )
1655  {
1656  $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1657  }
1658 
1659  if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0)
1660  {
1661  $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1662  }
1663 
1664  if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0)
1665  {
1666  $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1667  }
1668  }
1669 
1670  return $arr_crsDefaultRoles;
1671  }
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjCourse::getDefaultMemberRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1695  {
1696  $local_roles = $this->__getLocalRoles();
1697 
1698  foreach($local_roles as $role_id)
1699  {
1700  $title = ilObject::_lookupTitle($role_id);
1701  if(substr($title,0,8) == 'il_crs_m')
1702  {
1703  return $role_id;
1704  }
1705  }
1706  return 0;
1707  }
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 1708 of file class.ilObjCourse.php.

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

Referenced by cloneAutoGeneratedRoles().

1709  {
1710  $local_roles = $this->__getLocalRoles();
1711 
1712  foreach($local_roles as $role_id)
1713  {
1714  if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
1715  {
1716  if(!strcmp($tmp_role->getTitle(),"il_crs_tutor_".$this->getRefId()))
1717  {
1718  return $role_id;
1719  }
1720  }
1721  }
1722  return false;
1723  }
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 847 of file class.ilObjCourse.php.

References $enablemap.

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

848  {
849  return $this->enablemap;
850  }
+ 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 787 of file class.ilObjCourse.php.

References $latitude.

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

788  {
789  return $this->latitude;
790  }
+ 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 1589 of file class.ilObjCourse.php.

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

1590  {
1591  global $rbacadmin,$rbacreview;
1592 
1593  if (empty($this->local_roles))
1594  {
1595  $this->local_roles = array();
1596  $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1597 
1598  foreach ($role_arr as $role_id)
1599  {
1600  if ($rbacreview->isAssignable($role_id,$this->getRefId()) == true)
1601  {
1602  $role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1603 
1604  if ($a_translate)
1605  {
1606  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1607  }
1608  else
1609  {
1610  $role_name = $role_Obj->getTitle();
1611  }
1612  $this->local_roles[$role_name] = $role_Obj->getId();
1613  }
1614  }
1615  }
1616 
1617  return $this->local_roles;
1618  }
_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 827 of file class.ilObjCourse.php.

References $locationzoom.

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

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

◆ getLongitude()

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

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

808  {
809  return $this->longitude;
810  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

References $mail_members.

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

655  {
656  return $this->mail_members;
657  }
+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

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

References $member_obj, and initCourseMemberObject().

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

◆ getMembersObject()

ilObjCourse::getMembersObject ( )
Deprecated:
Returns
ilCourseParticipants

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

References $members_obj, and initCourseMembersObject().

Referenced by checkLPStatusSync(), and syncMembersStatusWithLP().

1476  {
1477  if(!$this->members_obj instanceof ilCourseParticipants)
1478  {
1479  $this->initCourseMembersObject();
1480  }
1481  return $this->members_obj;
1482  }
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 659 of file class.ilObjCourse.php.

Referenced by appendMessage(), and validate().

660  {
661  return $this->message;
662  }
+ 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:

◆ getOrderType()

ilObjCourse::getOrderType ( )

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

References enabledObjectiveView(), and ilContainer\SORT_MANUAL.

Referenced by cloneSettings(), and update().

2045  {
2046  if($this->enabledObjectiveView())
2047  {
2048  return ilContainer::SORT_MANUAL;
2049  }
2050  return parent::getOrderType();
2051  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjCourse::getRegistrationAccessCode ( )

get access code

Returns

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

Referenced by cloneSettings(), and updateSettings().

636  {
637  return $this->show_members;
638  }
+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

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

References $status_dt.

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

2006  {
2007  return $this->status_dt;
2008  }
+ 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(), getViewMode(), IL_CAL_DATE, IL_CAL_DAY, IL_CAL_UNIX, isSessionLimitEnabled(), ilUtil\sortArray(), and ilContainer\VIEW_SESSIONS.

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  $limit_sess = false;
467  if(!$a_admin_panel_enabled &&
468  !$a_include_side_block &&
469  $this->items['sess'] &&
470  is_array($this->items['sess']) &&
471  $this->isSessionLimitEnabled() &&
472  $this->getViewMode() == ilContainer::VIEW_SESSIONS) // #16686
473  {
474  $limit_sess = true;
475  }
476 
477  if(!$limit_sess)
478  {
479  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
480  }
481 
482 
483  // do session limit
484 
485  // @todo move to gui class
486  if(isset($_GET['crs_prev_sess']))
487  {
488  $ilUser->writePref('crs_sess_show_prev_'.$this->getId(), (string) (int) $_GET['crs_prev_sess']);
489  }
490  if(isset($_GET['crs_next_sess']))
491  {
492  $ilUser->writePref('crs_sess_show_next_'.$this->getId(), (string) (int) $_GET['crs_next_sess']);
493  }
494 
495  $sessions = ilUtil::sortArray($this->items['sess'],'start','ASC',true,false);
496  $today = new ilDate(date('Ymd',time()),IL_CAL_DATE);
497  $previous = $current = $next = array();
498  foreach($sessions as $key => $item)
499  {
500  $start = new ilDateTime($item['start'],IL_CAL_UNIX);
501  $end = new ilDateTime($item['end'],IL_CAL_UNIX);
502 
503  if(ilDateTime::_within($today, $start, $end, IL_CAL_DAY))
504  {
505  $current[] = $item;
506  }
507  elseif(ilDateTime::_before($start, $today, IL_CAL_DAY))
508  {
509  $previous[] = $item;
510  }
511  elseif(ilDateTime::_after($start, $today, IL_CAL_DAY))
512  {
513  $next[] = $item;
514  }
515  }
516  $num_previous_remove = max(
517  count($previous) - $this->getNumberOfPreviousSessions(),
518  0
519  );
520  while($num_previous_remove--)
521  {
522  if(!$ilUser->getPref('crs_sess_show_prev_'.$this->getId()))
523  {
524  array_shift($previous);
525  }
526  $this->items['sess_link']['prev']['value'] = 1;
527  }
528 
529  $num_next_remove = max(
530  count($next) - $this->getNumberOfNextSessions(),
531  0
532  );
533  while($num_next_remove--)
534  {
535  if(!$ilUser->getPref('crs_sess_show_next_'.$this->getId()))
536  {
537  array_pop($next);
538  }
539  // @fixme
540  $this->items['sess_link']['next']['value'] = 1;
541  }
542 
543  $sessions = array_merge($previous,$current,$next);
544  $this->items['sess'] = $sessions;
545 
546  // #15389 - see ilContainer::getSubItems()
547  include_once('Services/Container/classes/class.ilContainerSorting.php');
548  $sort = ilContainerSorting::_getInstance($this->getId());
549  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
550 
551  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
552  }
$_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 554 of file class.ilObjCourse.php.

Referenced by cloneSettings(), and updateSettings().

555  {
556  return true;
557  return $this->subscription_notify ? true : false;
558  }
+ 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 568 of file class.ilObjCourse.php.

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

569  {
570  return $this->view_mode;
571  }
+ Here is the caller graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

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

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

1060  {
1061  return strlen($this->getContactName()) or
1062  strlen($this->getContactResponsibility()) or
1063  strlen($this->getContactEmail()) or
1064  strlen($this->getContactPhone()) or
1065  strlen($this->getContactConsultation());
1066  }
+ 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 1484 of file class.ilObjCourse.php.

Referenced by delete().

1485  {
1486  include_once "./Modules/Course/classes/class.ilCourseArchives.php";
1487 
1488  if(!is_object($this->archives_obj))
1489  {
1490  $this->archives_obj =& new ilCourseArchives($this);
1491  }
1492  return true;
1493  }
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 1435 of file class.ilObjCourse.php.

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

Referenced by getMemberObject().

1436  {
1437  global $ilUser;
1438 
1439  include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
1440  $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(),$ilUser->getId());
1441  return true;
1442  }
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 1449 of file class.ilObjCourse.php.

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

Referenced by getMembersObject().

1450  {
1451  global $ilUser;
1452 
1453  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1454  $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1455  return true;
1456  }
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 1498 of file class.ilObjCourse.php.

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

1499  {
1500  global $rbacadmin,$rbacreview,$ilDB;
1501 
1502  include_once './Services/AccessControl/classes/class.ilObjRole.php';
1504  'il_crs_admin_'.$this->getRefId(),
1505  "Admin of crs obj_no.".$this->getId(),
1506  'il_crs_admin',
1507  $this->getRefId()
1508  );
1510  'il_crs_tutor_'.$this->getRefId(),
1511  "Tutor of crs obj_no.".$this->getId(),
1512  'il_crs_tutor',
1513  $this->getRefId()
1514  );
1516  'il_crs_member_'.$this->getRefId(),
1517  "Member of crs obj_no.".$this->getId(),
1518  'il_crs_member',
1519  $this->getRefId()
1520  );
1521 
1522  return array();
1523  }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
global $ilDB
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

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

References ilObject\getId().

1419  {
1420  include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
1421 
1422  if(!is_object($this->waiting_list_obj))
1423  {
1424  $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1425  }
1426  return true;
1427  }
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 676 of file class.ilObjCourse.php.

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

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

◆ isArchived()

ilObjCourse::isArchived ( )

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

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

Referenced by isActivated().

726  {
727  if($this->getViewMode() != IL_CRS_VIEW_ARCHIVE)
728  {
729  return false;
730  }
731  if(time() < $this->getArchiveStart() or time() > $this->getArchiveEnd())
732  {
733  return false;
734  }
735  return true;
736  }
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:

◆ lookupCourseNonMemberTemplatesId()

static ilObjCourse::lookupCourseNonMemberTemplatesId ( )
static

Lookup course non member id.

Returns
int

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

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

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

1573  {
1574  global $ilDB;
1575 
1576  $query = 'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote('rolt','text').' AND title = '.$ilDB->quote('il_crs_non_member','text');
1577  $res = $ilDB->query($query);
1578  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1579 
1580  return isset($row['obj_id']) ? $row['obj_id'] : 0;
1581  }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
global $ilDB
+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

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

Implements ilMembershipRegistrationCodes.

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

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1859  {
1860  global $ilDB;
1861 
1862  $query = "SELECT obj_id FROM crs_settings ".
1863  "WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
1864  "AND reg_ac = ".$ilDB->quote($a_code,'text');
1865  $res = $ilDB->query($query);
1866 
1867  $obj_ids = array();
1868  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1869  {
1870  $obj_ids[] = $row->obj_id;
1871  }
1872  return $obj_ids;
1873  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ lookupShowMembersEnabled()

static ilObjCourse::lookupShowMembersEnabled (   $a_obj_id)
static

Check if show member is enabled.

Parameters
int$a_obj_id
Returns
bool

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

References $ilLog.

1763  {
1764  global $ilLog;
1765 
1766  parent::MDUpdateListener($a_element);
1767 
1768  switch($a_element)
1769  {
1770  case 'General':
1771  // Update ecs content
1772  include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
1773  $ecs = new ilECSCourseSettings($this);
1774  $ecs->handleContentUpdate();
1775  break;
1776 
1777  default:
1778  return true;
1779  }
1780  }
Class ilECSCourseSettings.

◆ prepareAppointments()

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

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

1800  {
1801  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1802  include_once('./Services/Calendar/classes/class.ilDateTime.php');
1803 
1804  switch($a_mode)
1805  {
1806  case 'create':
1807  case 'update':
1808  if(!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus())
1809  {
1810  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1811  $app->setTitle($this->getTitle());
1812  $app->setSubtitle('crs_cal_activation_start');
1813  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1814  $app->setDescription($this->getLongDescription());
1815  $app->setStart(new ilDateTime($this->getActivationStart(),IL_CAL_UNIX));
1816  $apps[] = $app;
1817 
1818  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1819  $app->setTitle($this->getTitle());
1820  $app->setSubtitle('crs_cal_activation_end');
1821  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1822  $app->setDescription($this->getLongDescription());
1823  $app->setStart(new ilDateTime($this->getActivationEnd(),IL_CAL_UNIX));
1824  $apps[] = $app;
1825  }
1827  {
1828  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1829  $app->setTitle($this->getTitle());
1830  $app->setSubtitle('crs_cal_reg_start');
1831  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1832  $app->setDescription($this->getLongDescription());
1833  $app->setStart(new ilDateTime($this->getSubscriptionStart(),IL_CAL_UNIX));
1834  $apps[] = $app;
1835 
1836  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1837  $app->setTitle($this->getTitle());
1838  $app->setSubtitle('crs_cal_reg_end');
1839  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1840  $app->setDescription($this->getLongDescription());
1841  $app->setStart(new ilDateTime($this->getSubscriptionEnd(),IL_CAL_UNIX));
1842  $apps[] = $app;
1843  }
1844 
1845  return $apps ? $apps : array();
1846 
1847  case 'delete':
1848  // Nothing to do: The category and all assigned appointments will be deleted.
1849  return array();
1850  }
1851  }
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 743 of file class.ilObjCourse.php.

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

744  {
745  parent::read($a_force_db);
746 
747  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
749 
750  $this->__readSettings();
751  }
getId()
get object id public
setOrderType($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:

◆ register()

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

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

1882  {
1883  global $ilCtrl, $tree;
1884  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1885  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1887 
1888  if($part->isAssigned($a_user_id))
1889  {
1890  return true;
1891  }
1892 
1893  if(!$a_force_registration)
1894  {
1895  // Availability
1897  {
1898  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1899 
1901  {
1902  throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
1903  ', course subscription is deactivated.', '456');
1904  }
1905  }
1906 
1907  // Time Limitation
1909  {
1910  if( !$this->inSubscriptionTime() )
1911  {
1912  throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
1913  ', course is out of registration time.', '789');
1914  }
1915  }
1916 
1917  // Max members
1918  if($this->isSubscriptionMembershipLimited())
1919  {
1920  $free = max(0,$this->getSubscriptionMaxMembers() - $part->getCountMembers());
1921  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
1922  $waiting_list = new ilCourseWaitingList($this->getId());
1923  if($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
1924  {
1925  $waiting_list->addToList($a_user_id);
1926  $this->lng->loadLanguageModule("crs");
1927  $info = sprintf($this->lng->txt('crs_added_to_list'),
1928  $waiting_list->getPosition($a_user_id));
1929  include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
1930  $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
1931  $participants->sendNotification($participants->NOTIFY_WAITING_LIST,$a_user_id);
1932 
1933  throw new ilMembershipRegistrationException($info, '124');
1934  }
1935 
1936  if(!$this->enabledWaitingList() && !$free)
1937  {
1938  throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
1939  ', membership is limited.', '123');
1940  }
1941  }
1942  }
1943 
1944  $part->add($a_user_id,$a_role);
1945  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
1946  $part->sendNotification($part->NOTIFY_ADMINS,$a_user_id);
1947 
1948 
1949  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1951 
1952  return true;
1953  }
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 623 of file class.ilObjCourse.php.

Referenced by __readSettings().

624  {
625  $this->abo = $a_status;
626  }
+ 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 611 of file class.ilObjCourse.php.

Referenced by __readSettings().

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

◆ setArchiveStart()

ilObjCourse::setArchiveStart (   $a_value)

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

Referenced by __readSettings().

604  {
605  $this->archive_start = $a_value;
606  }
+ Here is the caller graph for this function:

◆ setArchiveType()

ilObjCourse::setArchiveType (   $a_value)

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

Referenced by __readSettings().

620  {
621  $this->archive_type = $a_value;
622  }
+ 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 1973 of file class.ilObjCourse.php.

Referenced by __readSettings().

1974  {
1975  $this->auto_notification = $value;
1976  }
+ 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 837 of file class.ilObjCourse.php.

Referenced by __readSettings().

838  {
839  $this->enablemap = $a_enablemap;
840  }
+ 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 777 of file class.ilObjCourse.php.

Referenced by __readSettings().

778  {
779  $this->latitude = $a_latitude;
780  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by __readSettings().

818  {
819  $this->locationzoom = $a_locationzoom;
820  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by __readSettings().

798  {
799  $this->longitude = $a_longitude;
800  }
+ 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 645 of file class.ilObjCourse.php.

Referenced by __readSettings().

646  {
647  $this->mail_members = $a_type;
648  }
+ Here is the caller graph for this function:

◆ setMessage()

ilObjCourse::setMessage (   $a_message)

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

Referenced by validate().

664  {
665  $this->message = $a_message;
666  }
+ 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:

◆ setParentRolePermissions()

ilObjCourse::setParentRolePermissions (   $a_parent_ref)

This method is called before "initDefaultRoles".

Therefore now local course roles are created.

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

Parameters
type$a_parent_ref

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

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

1535  {
1536  global $rbacadmin, $rbacreview;
1537 
1538  $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1539  foreach((array) $parent_roles as $parent_role)
1540  {
1541  $rbacadmin->initIntersectionPermissions(
1542  $this->getRefId(),
1543  $parent_role['obj_id'],
1544  $parent_role['parent'],
1545  $this->__getCrsNonMemberTemplateId(),
1546  ROLE_FOLDER_ID
1547  );
1548  }
1549  }
__getCrsNonMemberTemplateId()
get course non-member template private
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ setRegistrationAccessCode()

ilObjCourse::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

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

Referenced by __readSettings().

632  {
633  $this->show_members = $a_status;
634  }
+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

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

References ilObjUserTracking\_enabledLearningProgress().

Referenced by __readSettings(), and ilObjCourse().

1984  {
1985  $a_value = (int)$a_value;
1986 
1987  // #13905
1988  if($a_value == self::STATUS_DETERMINATION_LP)
1989  {
1990  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
1992  {
1993  $a_value = self::STATUS_DETERMINATION_MANUAL;
1994  }
1995  }
1996 
1997  $this->status_dt = $a_value;
1998  }
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 559 of file class.ilObjCourse.php.

Referenced by __readSettings().

560  {
561  $this->subscription_notify = $a_value ? true : false;
562  }
+ 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 564 of file class.ilObjCourse.php.

Referenced by __readSettings().

565  {
566  $this->view_mode = $a_mode;
567  }
+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

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

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

2014  {
2015  include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
2016  foreach($this->getMembersObject()->getParticipants() as $user_id)
2017  {
2018  // #15529 - force raise on sync
2019  ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, false, true);
2020  }
2021  }
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 1125 of file class.ilObjCourse.php.

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

1126  {
1127  global $ilAppEventHandler,$ilLog;
1128 
1129  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1130  $sorting = new ilContainerSortingSettings($this->getId());
1131  $sorting->setSortMode($this->getOrderType());
1132  $sorting->update();
1133 
1134  $this->updateMetaData();
1135  $this->updateSettings();
1136  parent::update();
1137 
1138  $ilAppEventHandler->raise('Modules/Course',
1139  'update',
1140  array('object' => $this,
1141  'obj_id' => $this->getId(),
1142  'appointments' => $this->prepareAppointments('update')));
1143 
1144  }
updateMetaData()
update meta data entry
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 1146 of file class.ilObjCourse.php.

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

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

◆ validate()

ilObjCourse::validate ( )

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

989  {
990  $this->setMessage('');
991 
992  #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and
993  # $this->getSubscriptionType() == )
994  #{
995  # $this->appendMessage($this->lng->txt('crs_select_registration_type'));
996  #}
997 
998  if(($this->getActivationType() == IL_CRS_ACTIVATION_LIMITED) and
999  $this->getActivationEnd() < $this->getActivationStart())
1000  {
1001  $this->appendMessage($this->lng->txt("activation_times_not_valid"));
1002  }
1004  $this->getSubscriptionStart() > $this->getSubscriptionEnd())
1005  {
1006  $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
1007  }
1008  #if((!$this->getActivationUnlimitedStatus() and
1009  # !$this->getSubscriptionUnlimitedStatus()) and
1010  # ($this->getSubscriptionStart() > $this->getActivationEnd() or
1011  # $this->getSubscriptionStart() < $this->getActivationStart() or
1012  # $this->getSubscriptionEnd() > $this->getActivationEnd() or
1013  # $this->getSubscriptionEnd() < $this->getActivationStart()))
1014  #
1015  #{
1016  # $this->appendMessage($this->lng->txt("subscription_time_not_within_activation"));
1017  #}
1019  {
1020  $this->appendMessage($this->lng->txt("crs_password_required"));
1021  }
1022  if($this->isSubscriptionMembershipLimited() and ($this->getSubscriptionMaxMembers() <= 0 or !is_numeric($this->getSubscriptionMaxMembers())))
1023  {
1024  $this->appendMessage($this->lng->txt("max_members_not_numeric"));
1025  }
1026  if(($this->getViewMode() == IL_CRS_VIEW_ARCHIVE) and
1027  $this->getArchiveStart() > $this->getArchiveEnd())
1028  {
1029  $this->appendMessage($this->lng->txt("archive_times_not_valid"));
1030  }
1031  if(!$this->getTitle() || !$this->getStatusDetermination())
1032  {
1033  $this->appendMessage($this->lng->txt('err_check_input'));
1034  }
1035 
1036 
1037  return $this->getMessage() ? false : true;
1038  }
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 1040 of file class.ilObjCourse.php.

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

1041  {
1042  global $ilErr;
1043  $error = false;
1044  if($this->getContactEmail()) {
1045  $emails = split(",",$this->getContactEmail());
1046 
1047  foreach ($emails as $email) {
1048  $email = trim($email);
1049  if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email)))
1050  {
1051  $ilErr->appendMessage($this->lng->txt('contact_email_not_valid')." '".$email."'");
1052  $error = true;
1053  }
1054  }
1055  }
1056  return !$error;
1057  }
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: