ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjCourse Class Reference

Class ilObjCourse. More...

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

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 getShowMembersExport ()
 
 setShowMembersExport ($a_mem_export)
 
 getRegistrationAccessCode ()
 get access code More...
 
 setRegistrationAccessCode ($a_code)
 Set refistration access code. More...
 
 isRegistrationAccessCodeEnabled ()
 Check if access code is enabled. More...
 
 enableRegistrationAccessCode ($a_status)
 En/disable registration access code. More...
 
 getImportantInformation ()
 
 setImportantInformation ($a_info)
 
 getSyllabus ()
 
 setSyllabus ($a_syllabus)
 
 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, $a_get_single=0)
 Get subitems of container. More...
 
 getSubscriptionNotify ()
 
 setSubscriptionNotify ($a_value)
 
 setViewMode ($a_mode)
 
 getViewMode ()
 
 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 ()
 
 allowAbo ()
 
 read ()
 
 create ($a_upload=false)
 
 setLatitude ($a_latitude)
 Set Latitude. More...
 
 getLatitude ()
 Get Latitude. More...
 
 setLongitude ($a_longitude)
 Set Longitude. More...
 
 getLongitude ()
 Get Longitude. More...
 
 setLocationZoom ($a_locationzoom)
 Set LocationZoom. More...
 
 getLocationZoom ()
 Get LocationZoom. More...
 
 setEnableCourseMap ($a_enablemap)
 Set Enable Course Map. More...
 
 getEnableMap ()
 Type independent wrapper. More...
 
 getEnableCourseMap ()
 Get Enable Course Map. More...
 
 setCourseStart (ilDate $a_value=null)
 
 getCourseStart ()
 
 setCourseEnd (ilDate $a_value=null)
 
 getCourseEnd ()
 
 setCancellationEnd (ilDate $a_value=null)
 
 getCancellationEnd ()
 
 setSubscriptionMinMembers ($a_value)
 
 getSubscriptionMinMembers ()
 
 setWaitingListAutoFill ($a_value)
 
 hasWaitingListAutoFill ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone course (no member data) More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (start objects, preconditions) More...
 
 cloneAutoGeneratedRoles ($new_obj)
 Clone automatic genrated roles (permissions and template permissions) More...
 
 validate ()
 
 validateInfoSettings ()
 
 hasContactData ()
 
 delete ()
 delete course and all related data More...
 
 update ()
 update complete object More...
 
 updateSettings ()
 
 cloneSettings ($new_obj)
 Clone entries in settings table. More...
 
 __createDefaultSettings ()
 
 __readSettings ()
 
 initWaitingList ()
 
 getMemberObject ()
 Get course member object. More...
 
 getMembersObject ()
 
 initDefaultRoles ()
 
 setParentRolePermissions ($a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 __getCrsNonMemberTemplateId ()
 get course non-member template private More...
 
 getLocalCourseRoles ($a_translate=false)
 get ALL local roles of course, also those created and defined afterwards only fetch data once from database. More...
 
 getDefaultCourseRoles ($a_crs_id="")
 get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member public More...
 
 __getLocalRoles ()
 
 __deleteSettings ()
 
 getDefaultMemberRole ()
 
 getDefaultTutorRole ()
 
 getDefaultAdminRole ()
 
 MDUpdateListener ($a_element)
 Overwriten Metadata update listener for ECS functionalities. More...
 
 addAdditionalSubItemInformation (&$a_item_data)
 Add additional information to sub item, e.g. More...
 
 register ($a_user_id, $a_role=ilCourseConstants::CRS_MEMBER, $a_force_registration=false)
 
 getAutoNotification ()
 Returns automatic notification status from $this->auto_notification. More...
 
 setAutoNotification ($value)
 Sets automatic notification status in $this->auto_notification, using given $status. More...
 
 setStatusDetermination ($a_value)
 Set status determination mode. More...
 
 getStatusDetermination ()
 Get status determination mode. More...
 
 syncMembersStatusWithLP ()
 Set course status for all members by lp status. More...
 
 checkLPStatusSync ($a_member_id)
 sync course status from lp More...
 
 getOrderType ()
 
 handleAutoFill ()
 Handle course auto fill. More...
 
- Public Member Functions inherited from ilContainer
 __construct ($a_id=0, $a_reference=true)
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 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...
 
 setNewsTimeline ($a_val)
 Set news timeline. More...
 
 getNewsTimeline ()
 Get news timeline. More...
 
 setNewsTimelineAutoEntries ($a_val)
 Set news timeline auto entries. More...
 
 getNewsTimelineAutoEntries ()
 Get news timeline auto entries. More...
 
 setNewsTimelineLandingPage ($a_val)
 Set news timline is landing page. More...
 
 getNewsTimelineLandingPage ()
 Get news timline is landing page. More...
 
 isNewsTimelineEffective ()
 Is news timeline effective? More...
 
 isNewsTimelineLandingPageEffective ()
 Is news timeline landing page effective? More...
 
 setNewsBlockActivated ($a_val)
 Set news block activated. More...
 
 getNewsBlockActivated ()
 Get news block activated. More...
 
 setUseNews ($a_val)
 Set use news. More...
 
 getUseNews ()
 Get use news. More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false, $a_submode=1)
 clone all objects according to this container More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
 readContainerSettings ()
 Read container settings. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register ($a_user_id)
 Register an user. More...
 

Static Public Member Functions

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

Data Fields

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

Protected Member Functions

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

Protected Attributes

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Class ilObjCourse.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

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

References $GLOBALS, and setStatusDetermination().

100  {
101 
102  #define("ILIAS_MODULE","course");
103  #define("KEEP_IMAGE_PATH",1);
104 
105  $this->SUBSCRIPTION_DEACTIVATED = 1;
106  $this->SUBSCRIPTION_CONFIRMATION = 2;
107  $this->SUBSCRIPTION_DIRECT = 3;
108  $this->SUBSCRIPTION_PASSWORD = 4;
109  $this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
110  $this->ARCHIVE_DISABLED = 1;
111  $this->ARCHIVE_READ = 2;
112  $this->ARCHIVE_DOWNLOAD = 3;
113  $this->ABO_ENABLED = 1;
114  $this->ABO_DISABLED = 0;
115  $this->SHOW_MEMBERS_ENABLED = 1;
116  $this->SHOW_MEMBERS_DISABLED = 0;
117  $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
118 
119  $this->type = "crs";
120 
121  $this->course_logger = $GLOBALS['DIC']->logger()->crs();
122 
123  parent::__construct($a_id, $a_call_by_reference);
124  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setStatusDetermination($a_value)
Set status determination mode.
+ Here is the call graph for this function:

Member Function Documentation

◆ __createDefaultSettings()

ilObjCourse::__createDefaultSettings ( )

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

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

Referenced by create(), and updateSettings().

1334  {
1335  global $ilDB;
1336 
1337  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1339 
1340  $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
1341  "contact_phone,contact_email,contact_consultation,activation_type,activation_start," .
1342  "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
1343  "sub_max_members,sub_notify,view_mode,abo," .
1344  "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
1345  "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
1346  "VALUES( " .
1347  $ilDB->quote($this->getId(), 'integer') . ", " .
1348  $ilDB->quote($this->getSyllabus(), 'text') . ", " .
1349  $ilDB->quote($this->getContactName(), 'text') . ", " .
1350  $ilDB->quote($this->getContactResponsibility(), 'text') . ", " .
1351  $ilDB->quote($this->getContactPhone(), 'text') . ", " .
1352  $ilDB->quote($this->getContactEmail(), 'text') . ", " .
1353  $ilDB->quote($this->getContactConsultation(), 'text') . ", " .
1354  $ilDB->quote(0, 'integer') . ", " .
1355  $ilDB->quote($this->getActivationStart(), 'integer') . ", " .
1356  $ilDB->quote($this->getActivationEnd(), 'integer') . ", " .
1357  $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED, 'integer') . ", " .
1358  $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " .
1359  $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1360  $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT, 'integer') . ", " .
1361  $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " .
1362  "0, " .
1363  $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1364  "1, " .
1365  "0, " .
1366  $ilDB->quote($this->ABO_ENABLED, 'integer') . ", " .
1367  $ilDB->quote($this->getLatitude(), 'text') . ", " .
1368  $ilDB->quote($this->getLongitude(), 'text') . ", " .
1369  $ilDB->quote($this->getLocationZoom(), 'integer') . ", " .
1370  $ilDB->quote($this->getEnableCourseMap(), 'integer') . ", " .
1371  #"objective_view = '0', ".
1372  "1, " .
1373  "1," .
1374  '0,' .
1375  $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1376  $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1377  $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1378  $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1379  $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1380  $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1381  $ilDB->quote((int) $this->getStatusDetermination(), 'integer') . ', ' .
1382  $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ' ' .
1383  ")";
1384 
1385  $res = $ilDB->manipulate($query);
1386  $this->__readSettings();
1387 
1388  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1389  $sorting = new ilContainerSortingSettings($this->getId());
1390  $sorting->setSortMode(ilContainer::SORT_MANUAL);
1391  $sorting->update();
1392  }
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.
getLocationZoom()
Get LocationZoom.
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
getRegistrationAccessCode()
get access code
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
static generateCode()
Generate new registration key.
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
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 1702 of file class.ilObjCourse.php.

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

Referenced by delete().

1703  {
1704  global $ilDB;
1705 
1706  $query = "DELETE FROM crs_settings " .
1707  "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
1708  $res = $ilDB->manipulate($query);
1709 
1710  return true;
1711  }
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
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 1590 of file class.ilObjCourse.php.

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

Referenced by setParentRolePermissions().

1591  {
1592  global $ilDB;
1593 
1594  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1595  $res = $this->ilias->db->query($q);
1597 
1598  return $row["obj_id"];
1599  }
foreach($_POST as $key=> $value) $res
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilDB
+ Here is the caller graph for this function:

◆ __getLocalRoles()

ilObjCourse::__getLocalRoles ( )

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

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

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

1694  {
1695  global $rbacreview;
1696 
1697  // GET role_objects of predefined roles
1698 
1699  return $rbacreview->getRolesOfRoleFolder($this->getRefId(), false);
1700  }
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 1395 of file class.ilObjCourse.php.

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

Referenced by __createDefaultSettings(), and read().

1396  {
1397  global $ilDB;
1398 
1399  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . "";
1400 
1401  $res = $ilDB->query($query);
1402  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1403  $this->setSyllabus($row->syllabus);
1404  $this->setContactName($row->contact_name);
1405  $this->setContactResponsibility($row->contact_responsibility);
1406  $this->setContactPhone($row->contact_phone);
1407  $this->setContactEmail($row->contact_email);
1408  $this->setContactConsultation($row->contact_consultation);
1409  $this->setOfflineStatus(!(bool) $row->activation_type); // see below
1410  $this->setSubscriptionLimitationType($row->sub_limitation_type);
1411  $this->setSubscriptionStart($row->sub_start);
1412  $this->setSubscriptionEnd($row->sub_end);
1413  $this->setSubscriptionType($row->sub_type);
1414  $this->setSubscriptionPassword($row->sub_password);
1415  $this->enableSubscriptionMembershipLimitation($row->sub_mem_limit);
1416  $this->setSubscriptionMaxMembers($row->sub_max_members);
1417  $this->setSubscriptionNotify($row->sub_notify);
1418  $this->setViewMode($row->view_mode);
1419  $this->setAboStatus($row->abo);
1420  $this->enableWaitingList($row->waiting_list);
1421  $this->setImportantInformation($row->important);
1422  $this->setShowMembers($row->show_members);
1423  $this->setShowMembersExport($row->show_members_export);
1424  $this->setLatitude($row->latitude);
1425  $this->setLongitude($row->longitude);
1426  $this->setLocationZoom($row->location_zoom);
1427  $this->setEnableCourseMap($row->enable_course_map);
1428  $this->enableSessionLimit($row->session_limit);
1429  $this->setNumberOfPreviousSessions($row->session_prev);
1430  $this->setNumberOfNextSessions($row->session_next);
1431  $this->enableRegistrationAccessCode($row->reg_ac_enabled);
1432  $this->setRegistrationAccessCode($row->reg_ac);
1433  $this->setAutoNotification($row->auto_notification == 1 ? true : false);
1434  $this->setStatusDetermination((int) $row->status_dt);
1435  $this->setMailToMembersType($row->mail_members_type);
1436  $this->setCourseStart($row->crs_start ? new ilDate($row->crs_start, IL_CAL_UNIX) : null);
1437  $this->setCourseEnd($row->crs_end ? new ilDate($row->crs_end, IL_CAL_UNIX) : null);
1438  $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
1439  $this->setWaitingListAutoFill($row->auto_wait);
1440  $this->setSubscriptionMinMembers($row->min_members ? $row->min_members : null);
1441  }
1442 
1443  // moved activation to ilObjectActivation
1444  if ($this->ref_id) {
1445  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1446  $activation = ilObjectActivation::getItem($this->ref_id);
1447  switch ($activation["timing_type"]) {
1450  $this->setActivationStart($activation["timing_start"]);
1451  $this->setActivationEnd($activation["timing_end"]);
1452  $this->setActivationVisibility($activation["visible"]);
1453  break;
1454 
1455  default:
1457  break;
1458  }
1459  } else {
1460  // #13176 - there should always be default
1462  }
1463 
1464  return true;
1465  }
setActivationEnd($a_value)
setSubscriptionNotify($a_value)
const IL_CRS_ACTIVATION_LIMITED
setContactResponsibility($a_value)
setSubscriptionStart($a_value)
setSubscriptionEnd($a_value)
setShowMembersExport($a_mem_export)
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
const IL_CAL_UNIX
setSubscriptionPassword($a_value)
setCourseEnd(ilDate $a_value=null)
setRegistrationAccessCode($a_code)
Set refistration access code.
setSyllabus($a_syllabus)
setLatitude($a_latitude)
Set Latitude.
setViewMode($a_mode)
setEnableCourseMap($a_enablemap)
Set Enable Course Map.
setActivationVisibility($a_value)
setAboStatus($a_status)
setLocationZoom($a_locationzoom)
Set LocationZoom.
setActivationStart($a_value)
Class for single dates.
foreach($_POST as $key=> $value) $res
setLongitude($a_longitude)
Set Longitude.
getId()
get object id public
setSubscriptionType($a_value)
setSubscriptionMinMembers($a_value)
setNumberOfNextSessions($a_num)
Set number of previous sessions.
setContactConsultation($a_value)
$query
enableRegistrationAccessCode($a_status)
En/disable registration access code.
setActivationType($a_type)
setContactPhone($a_value)
setCancellationEnd(ilDate $a_value=null)
global $ilDB
setSubscriptionMaxMembers($a_value)
enableWaitingList($a_status)
setWaitingListAutoFill($a_value)
setShowMembers($a_status)
setCourseStart(ilDate $a_value=null)
const IL_CRS_ACTIVATION_UNLIMITED
setStatusDetermination($a_value)
Set status determination mode.
setSubscriptionLimitationType($a_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteUser()

static ilObjCourse::_deleteUser (   $a_usr_id)
static

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

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

Referenced by ilObjUser\delete().

1754  {
1755  // Delete all user related data
1756  // delete lm_history
1757  include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
1758  ilCourseLMHistory::_deleteUser($a_usr_id);
1759 
1760  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1762 
1763  // Course objectives
1764  include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1766  }
static _deleteUser($a_usr_id)
Delete user type $ilDB.
static deleteResultsForUser($a_user_id)
Delete all result entries for user.
static _deleteUser($a_usr_id)
Delete user data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isActivated()

static ilObjCourse::_isActivated (   $a_obj_id)
static

Is activated.

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

Parameters
intid of user
Returns
boolean

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

References ilObjCourseAccess\_isActivated().

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

710  {
711  include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
712  return ilObjCourseAccess::_isActivated($a_obj_id);
713  }
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 461 of file class.ilObjCourse.php.

References $ilDB, $query, and $res.

462  {
463  global $ilDB;
464 
465  $query = "SELECT * FROM crs_settings " .
466  "WHERE obj_id = " . $ilDB->quote($a_course_id, 'integer') . " " .
467  "AND sub_notify = 1";
468  $res = $ilDB->query($query);
469  return $res->numRows() ? true : false;
470  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB

◆ _lookupAboStatus()

static ilObjCourse::_lookupAboStatus (   $a_id)
static

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

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

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

601  {
602  global $ilDB;
603 
604  $query = "SELECT abo FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
605  $res = $ilDB->query($query);
606  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
607  return $row->abo;
608  }
609  return false;
610  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupViewMode()

static ilObjCourse::_lookupViewMode (   $a_id)
static

lookup view mode of container

Parameters
int$a_id
Returns
mixed int | bool

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

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

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

589  {
590  global $ilDB;
591 
592  $query = "SELECT view_mode FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
593  $res = $ilDB->query($query);
594  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
595  return $row->view_mode;
596  }
597  return false;
598  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _registrationEnabled()

static ilObjCourse::_registrationEnabled (   $a_obj_id)
static

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

Parameters
intid of user
Returns
boolean

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

References ilObjCourseAccess\_registrationEnabled().

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

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

References ilObjectActivation\addAdditionalSubItemInformation().

1798  {
1799  include_once './Services/Object/classes/class.ilObjectActivation.php';
1801  }
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 728 of file class.ilObjCourse.php.

729  {
730  return $this->ABO == $this->ABO_ENABLED;
731  }

◆ appendMessage()

ilObjCourse::appendMessage (   $a_message)

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

References getMessage().

Referenced by validate().

681  {
682  if ($this->getMessage()) {
683  $this->message .= "<br /> ";
684  }
685  $this->message .= $a_message;
686  }
+ 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 2061 of file class.ilObjCourse.php.

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

Referenced by handleAutoFill().

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

◆ cloneAutoGeneratedRoles()

ilObjCourse::cloneAutoGeneratedRoles (   $new_obj)

Clone automatic genrated roles (permissions and template permissions)

public

Parameters
objectnew course object

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

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

Referenced by cloneObject().

1005  {
1006  global $ilLog,$rbacadmin,$rbacreview;
1007 
1008  $admin = $this->getDefaultAdminRole();
1009  $new_admin = $new_obj->getDefaultAdminRole();
1010 
1011  if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
1012  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_admin');
1013  }
1014  $rbacadmin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
1015  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_admin.');
1016 
1017  $tutor = $this->getDefaultTutorRole();
1018  $new_tutor = $new_obj->getDefaultTutorRole();
1019  if (!$tutor || !$new_tutor) {
1020  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_tutor');
1021  }
1022  $rbacadmin->copyRolePermissions($tutor, $this->getRefId(), $new_obj->getRefId(), $new_tutor, true);
1023  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_tutor.');
1024 
1025  $member = $this->getDefaultMemberRole();
1026  $new_member = $new_obj->getDefaultMemberRole();
1027  if (!$member || !$new_member) {
1028  $ilLog->write(__METHOD__ . ' : Error cloning auto generated role: il_crs_member');
1029  }
1030  $rbacadmin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
1031  $ilLog->write(__METHOD__ . ' : Finished copying of role crs_member.');
1032 
1033  return true;
1034  }
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 972 of file class.ilObjCourse.php.

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

973  {
974  parent::cloneDependencies($a_target_id, $a_copy_id);
975 
976  // Clone course start objects
977  include_once('Services/Container/classes/class.ilContainerStartObjects.php');
978  $start = new ilContainerStartObjects($this->getRefId(), $this->getId());
979  $start->cloneDependencies($a_target_id, $a_copy_id);
980 
981  // Clone course item settings
982  include_once('Services/Object/classes/class.ilObjectActivation.php');
983  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
984 
985  // clone objective settings
986  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
987  ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
988 
989  // Clone course learning objectives
990  include_once('Modules/Course/classes/class.ilCourseObjective.php');
991  $crs_objective = new ilCourseObjective($this);
992  $crs_objective->ilClone($a_target_id, $a_copy_id);
993 
994  return true;
995  }
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,
  $a_omit_tree = false 
)

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

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

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

916  {
917  global $ilDB,$ilUser;
918 
919  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
920 
921  $this->cloneAutoGeneratedRoles($new_obj);
922  $this->cloneMetaData($new_obj);
923 
924  // Assign admin
925  $new_obj->getMemberObject()->add($ilUser->getId(), IL_CRS_ADMIN);
926  // cognos-blu-patch: begin
927  $new_obj->getMemberObject()->updateContact($ilUser->getId(), 1);
928  // cognos-blu-patch: end
929 
930 
931  // #14596
932  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
933  if ($cwo->isRootNode($this->getRefId())) {
934  $this->setOfflineStatus(true);
935  }
936 
937  // Copy settings
938  $this->cloneSettings($new_obj);
939 
940  // Course Defined Fields
941  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
942  ilCourseDefinedFieldDefinition::_clone($this->getId(), $new_obj->getId());
943 
944  // Clone course files
945  include_once('Modules/Course/classes/class.ilCourseFile.php');
946  ilCourseFile::_cloneFiles($this->getId(), $new_obj->getId());
947 
948  // Copy learning progress settings
949  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
950  $obj_settings = new ilLPObjSettings($this->getId());
951  $obj_settings->cloneSettings($new_obj->getId());
952  unset($obj_settings);
953 
954  // clone certificate (#11085)
955  include_once "./Services/Certificate/classes/class.ilCertificate.php";
956  include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
957  $cert = new ilCertificate(new ilCourseCertificateAdapter($this));
958  $newcert = new ilCertificate(new ilCourseCertificateAdapter($new_obj));
959  $cert->cloneCertificate($newcert);
960 
961  return $new_obj;
962  }
setOfflineStatus($a_value)
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
$ilUser
Definition: imgupload.php:18
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.
cloneAutoGeneratedRoles($new_obj)
Clone automatic genrated roles (permissions and template permissions)
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 1279 of file class.ilObjCourse.php.

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

Referenced by cloneObject().

1280  {
1281  $new_obj->setSyllabus($this->getSyllabus());
1282  $new_obj->setContactName($this->getContactName());
1283  $new_obj->setContactResponsibility($this->getContactResponsibility());
1284  $new_obj->setContactPhone($this->getContactPhone());
1285  $new_obj->setContactEmail($this->getContactEmail());
1286  $new_obj->setContactConsultation($this->getContactConsultation());
1287  $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1288  $new_obj->setActivationType($this->getActivationType());
1289  $new_obj->setActivationStart($this->getActivationStart());
1290  $new_obj->setActivationEnd($this->getActivationEnd());
1291  $new_obj->setActivationVisibility($this->getActivationVisibility());
1292  $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1293  $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1294  $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1295  $new_obj->setSubscriptionType($this->getSubscriptionType());
1296  $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1297  $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1298  $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1299  $new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
1300  $new_obj->setViewMode($this->getViewMode());
1301  $new_obj->setOrderType($this->getOrderType());
1302  $new_obj->setAboStatus($this->getAboStatus());
1303  $new_obj->enableWaitingList($this->enabledWaitingList());
1304  $new_obj->setImportantInformation($this->getImportantInformation());
1305  $new_obj->setShowMembers($this->getShowMembers());
1306  // patch mem_exp
1307  $new_obj->setShowMembersExport($this->getShowMembersExport());
1308  // patch mem_exp
1309  $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1310  $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1311  $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1312  $new_obj->setAutoNotification($this->getAutoNotification());
1313  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1314  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1315  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1316  $new_obj->setStatusDetermination($this->getStatusDetermination());
1317  $new_obj->setMailToMembersType($this->getMailToMembersType());
1318  $new_obj->setCourseStart($this->getCourseStart());
1319  $new_obj->setCourseEnd($this->getCourseEnd());
1320  $new_obj->setCancellationEnd($this->getCancellationEnd());
1321  $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
1322  $new_obj->setSubscriptionMinMembers($this->getSubscriptionMinMembers());
1323 
1324  // #10271
1325  $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1326  $new_obj->setLatitude($this->getLatitude());
1327  $new_obj->setLongitude($this->getLongitude());
1328  $new_obj->setLocationZoom($this->getLocationZoom());
1329 
1330  $new_obj->update();
1331  }
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 745 of file class.ilObjCourse.php.

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

746  {
747  global $ilAppEventHandler;
748 
749  parent::create($a_upload);
750 
751  if (!$a_upload) {
752  $this->createMetaData();
753  }
754  $this->__createDefaultSettings();
755 
756  $ilAppEventHandler->raise(
757  'Modules/Course',
758  'create',
759  array('object' => $this,
760  'obj_id' => $this->getId(),
761  'appointments' => $this->prepareAppointments('create'))
762  );
763  }
createMetaData()
create meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
Create styles array
The data for the language used.
+ 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 1127 of file class.ilObjCourse.php.

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

1128  {
1129  global $ilAppEventHandler;
1130 
1131  // always call parent delete function first!!
1132  if (!parent::delete()) {
1133  return false;
1134  }
1135 
1136  // delete meta data
1137  $this->deleteMetaData();
1138 
1139  // put here course specific stuff
1140 
1141  $this->__deleteSettings();
1142 
1143  include_once('Modules/Course/classes/class.ilCourseParticipants.php');
1145 
1146  include_once './Modules/Course/classes/class.ilCourseObjective.php';
1148 
1149  include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
1151 
1152  include_once './Modules/Course/classes/class.ilCourseFile.php';
1154 
1155  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1157 
1158  $ilAppEventHandler->raise(
1159  'Modules/Course',
1160  'delete',
1161  array('object' => $this,
1162  'obj_id' => $this->getId(),
1163  'appointments' => $this->prepareAppointments('delete'))
1164  );
1165 
1166 
1167  return true;
1168  }
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
static _deleteByContainer($a_container_id)
Delete all fields of a container.
static _deleteAll($a_course_id)
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
Create styles array
The data for the language used.
static _deleteByCourse($a_course_id)
static _deleteAll($course_id)
deleteMetaData()
delete meta data entry
+ Here is the call graph for this function:

◆ enabledObjectiveView()

ilObjCourse::enabledObjectiveView ( )

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

References IL_CRS_VIEW_OBJECTIVE.

Referenced by getOrderType().

343  {
344  return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
345  }
const IL_CRS_VIEW_OBJECTIVE
+ Here is the caller graph for this function:

◆ enabledWaitingList()

ilObjCourse::enabledWaitingList ( )

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

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

348  {
349  return (bool) $this->waiting_list;
350  }
+ 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 185 of file class.ilObjCourse.php.

Referenced by __readSettings().

186  {
187  $this->reg_access_code_enabled = $a_status;
188  }
+ 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 373 of file class.ilObjCourse.php.

Referenced by __readSettings().

374  {
375  $this->session_limit = $a_status;
376  }
+ Here is the caller graph for this function:

◆ enableSubscriptionMembershipLimitation()

ilObjCourse::enableSubscriptionMembershipLimitation (   $a_status)

enable max members

public

Parameters
boolstatus
Returns

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

Referenced by __readSettings().

391  {
392  $this->subscription_membership_limitation = $a_status;
393  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjCourse::enableWaitingList (   $a_status)

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

Referenced by __readSettings().

353  {
354  $this->waiting_list = (bool) $a_status;
355  }
+ Here is the caller graph for this function:

◆ findCoursesWithNotEnoughMembers()

static ilObjCourse::findCoursesWithNotEnoughMembers ( )
static

Minimum members check type $ilDB.

Returns
array

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

References $GLOBALS, $ilDB, $res, $row, ilContainer\$tree, ilObject\_getAllReferences(), array, and time.

Referenced by ilMembershipCronMinMembers\getCourses().

2160  {
2161  $ilDB = $GLOBALS['DIC']->database();
2162  $tree = $GLOBALS['DIC']->repositoryTree();
2163 
2164  $res = array();
2165 
2166  $now = time();
2167 
2168  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
2169 
2170  $set = $ilDB->query("SELECT obj_id, min_members" .
2171  " FROM crs_settings" .
2172  " WHERE min_members > " . $ilDB->quote(0, "integer") .
2173  " AND sub_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
2174  " AND ((leave_end IS NOT NULL" .
2175  " AND leave_end < " . $ilDB->quote($now, "text") . ")" .
2176  " OR (leave_end IS NULL" .
2177  " AND sub_end IS NOT NULL" .
2178  " AND sub_end < " . $ilDB->quote($now, "text") . "))" .
2179  " AND (crs_start IS NULL OR crs_start > " . $ilDB->quote($now, "integer") . ")");
2180  while ($row = $ilDB->fetchAssoc($set)) {
2181  $refs = ilObject::_getAllReferences($row['obj_id']);
2182  $ref = end($refs);
2183 
2184  if ($tree->isDeleted($ref)) {
2185  continue;
2186  }
2187 
2188  $part = new ilCourseParticipants($row["obj_id"]);
2189  $reci = $part->getNotificationRecipients();
2190  if (sizeof($reci)) {
2191  $missing = (int) $row["min_members"]-$part->getCountMembers();
2192  if ($missing > 0) {
2193  $res[$row["obj_id"]] = array($missing, $reci);
2194  }
2195  }
2196  }
2197 
2198  return $res;
2199  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getAllReferences($a_id)
get all reference ids of object
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
global $ilDB
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAboStatus()

ilObjCourse::getAboStatus ( )

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

Referenced by cloneSettings(), and updateSettings().

641  {
642  return $this->abo;
643  }
+ Here is the caller graph for this function:

◆ getActivationEnd()

ilObjCourse::getActivationEnd ( )

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

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

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

◆ getActivationStart()

ilObjCourse::getActivationStart ( )

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

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

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

◆ getActivationType()

ilObjCourse::getActivationType ( )

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

Referenced by cloneSettings(), and validate().

247  {
248  return (int) $this->activation_type;
249  }
+ Here is the caller graph for this function:

◆ getActivationUnlimitedStatus()

ilObjCourse::getActivationUnlimitedStatus ( )

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

References IL_CRS_ACTIVATION_UNLIMITED.

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

261  {
262  return $this->activation_type == IL_CRS_ACTIVATION_UNLIMITED;
263  }
const IL_CRS_ACTIVATION_UNLIMITED
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjCourse::getActivationVisibility ( )

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

Referenced by cloneSettings(), and updateSettings().

293  {
294  return $this->activation_visibility;
295  }
+ Here is the caller graph for this function:

◆ getArchiveEnd()

ilObjCourse::getArchiveEnd ( )

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

References date, and time.

621  {
622  return $this->archive_end ? $this->archive_end : mktime(0, 0, 0, 12, 12, date("Y", time())+2);
623  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.

◆ getArchiveStart()

ilObjCourse::getArchiveStart ( )

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

References time.

613  {
614  return $this->archive_start ? $this->archive_start : time();
615  }
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.

◆ getArchiveType()

ilObjCourse::getArchiveType ( )

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

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

629  {
630  return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
631  }
const IL_CRS_ARCHIVE_NONE
const IL_CRS_ARCHIVE_DOWNLOAD

◆ getAutoNotification()

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

Returns
boolean

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

References $auto_notification.

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

1996  {
1997  return $this->auto_notification;
1998  }
+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjCourse::getCancellationEnd ( )

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

References $leave_end.

Referenced by cloneSettings(), and updateSettings().

880  {
881  return $this->leave_end;
882  }
+ Here is the caller graph for this function:

◆ getContactConsultation()

ilObjCourse::getContactConsultation ( )

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

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

215  {
216  return $this->contact_consultation;
217  }
+ Here is the caller graph for this function:

◆ getContactEmail()

ilObjCourse::getContactEmail ( )

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

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

231  {
232  return $this->contact_email;
233  }
+ Here is the caller graph for this function:

◆ getContactName()

ilObjCourse::getContactName ( )

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

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

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

◆ getContactPhone()

ilObjCourse::getContactPhone ( )

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

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

223  {
224  return $this->contact_phone;
225  }
+ Here is the caller graph for this function:

◆ getContactResponsibility()

ilObjCourse::getContactResponsibility ( )

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

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

239  {
240  return $this->contact_responsibility;
241  }
+ Here is the caller graph for this function:

◆ getCourseEnd()

ilObjCourse::getCourseEnd ( )

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

References $crs_end.

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

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

◆ getCourseStart()

ilObjCourse::getCourseStart ( )

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

References $crs_start.

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

860  {
861  return $this->crs_start;
862  }
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjCourse::getDefaultAdminRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

1740  {
1741  $local_roles = $this->__getLocalRoles();
1742 
1743  foreach ($local_roles as $role_id) {
1744  if ($tmp_role =&ilObjectFactory::getInstanceByObjId($role_id, false)) {
1745  if (!strcmp($tmp_role->getTitle(), "il_crs_admin_" . $this->getRefId())) {
1746  return $role_id;
1747  }
1748  }
1749  }
1750  return false;
1751  }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultCourseRoles()

ilObjCourse::getDefaultCourseRoles (   $a_crs_id = "")

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

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

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

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

1659  {
1660  global $rbacadmin, $rbacreview;
1661 
1662  if (strlen($a_crs_id) > 0) {
1663  $crs_id = $a_crs_id;
1664  } else {
1665  $crs_id = $this->getRefId();
1666  }
1667 
1668  $role_arr = $rbacreview->getRolesOfRoleFolder($crs_id);
1669 
1670  foreach ($role_arr as $role_id) {
1671  $role_Obj =&$this->ilias->obj_factory->getInstanceByObjId($role_id);
1672 
1673  $crs_Member ="il_crs_member_" . $crs_id;
1674  $crs_Admin ="il_crs_admin_" . $crs_id;
1675  $crs_Tutor ="il_crs_tutor_" . $crs_id;
1676 
1677  if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
1678  $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1679  }
1680 
1681  if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
1682  $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1683  }
1684 
1685  if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
1686  $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1687  }
1688  }
1689 
1690  return $arr_crsDefaultRoles;
1691  }
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 1714 of file class.ilObjCourse.php.

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

Referenced by cloneAutoGeneratedRoles().

1715  {
1716  $local_roles = $this->__getLocalRoles();
1717 
1718  foreach ($local_roles as $role_id) {
1719  $title = ilObject::_lookupTitle($role_id);
1720  if (substr($title, 0, 8) == 'il_crs_m') {
1721  return $role_id;
1722  }
1723  }
1724  return 0;
1725  }
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 1726 of file class.ilObjCourse.php.

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

Referenced by cloneAutoGeneratedRoles().

1727  {
1728  $local_roles = $this->__getLocalRoles();
1729 
1730  foreach ($local_roles as $role_id) {
1731  if ($tmp_role =&ilObjectFactory::getInstanceByObjId($role_id, false)) {
1732  if (!strcmp($tmp_role->getTitle(), "il_crs_tutor_" . $this->getRefId())) {
1733  return $role_id;
1734  }
1735  }
1736  }
1737  return false;
1738  }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableCourseMap()

ilObjCourse::getEnableCourseMap ( )

Get Enable Course Map.

Returns
boolean Enable Course Map

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

References $enablemap.

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

850  {
851  return $this->enablemap;
852  }
+ Here is the caller graph for this function:

◆ getEnableMap()

ilObjCourse::getEnableMap ( )

Type independent wrapper.

Returns
type

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

References getEnableCourseMap().

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

◆ getImportantInformation()

ilObjCourse::getImportantInformation ( )

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

Referenced by cloneSettings(), and updateSettings().

191  {
192  return $this->important;
193  }
+ Here is the caller graph for this function:

◆ getLatitude()

ilObjCourse::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

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

781  {
782  return $this->latitude;
783  }
+ 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 1622 of file class.ilObjCourse.php.

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

1623  {
1624  global $rbacadmin,$rbacreview;
1625 
1626  if (empty($this->local_roles)) {
1627  $this->local_roles = array();
1628  $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1629 
1630  foreach ($role_arr as $role_id) {
1631  if ($rbacreview->isAssignable($role_id, $this->getRefId()) == true) {
1632  $role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1633 
1634  if ($a_translate) {
1635  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1636  } else {
1637  $role_name = $role_Obj->getTitle();
1638  }
1639  $this->local_roles[$role_name] = $role_Obj->getId();
1640  }
1641  }
1642  }
1643 
1644  return $this->local_roles;
1645  }
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getTranslation($a_role_title)
Create styles array
The data for the language used.
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getLocationZoom()

ilObjCourse::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

References $locationzoom.

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

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

◆ getLongitude()

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

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

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

◆ getMailToMembersType()

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

References $mail_members.

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

668  {
669  return $this->mail_members;
670  }
+ Here is the caller graph for this function:

◆ getMemberObject()

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

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

References $member_obj, and initCourseMemberObject().

1511  {
1512  if (!$this->member_obj instanceof ilCourseParticipant) {
1513  $this->initCourseMemberObject();
1514  }
1515  return $this->member_obj;
1516  }
initCourseMemberObject()
Init course member object ilObjUser $ilUser.
+ Here is the call graph for this function:

◆ getMembersObject()

ilObjCourse::getMembersObject ( )
Returns
ilCourseParticipants

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

References $members_obj, and initCourseMembersObject().

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

1522  {
1523  if (!$this->members_obj instanceof ilCourseParticipants) {
1524  $this->initCourseMembersObject();
1525  }
1526  return $this->members_obj;
1527  }
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 672 of file class.ilObjCourse.php.

References $message.

Referenced by appendMessage(), and validate().

673  {
674  return $this->message;
675  }
catch(Exception $e) $message
+ Here is the caller graph for this function:

◆ getNumberOfNextSessions()

ilObjCourse::getNumberOfNextSessions ( )

Set number of previous sessions.

Returns

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

References $session_next.

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

429  {
430  return $this->session_next;
431  }
+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjCourse::getNumberOfPreviousSessions ( )

Set number of previous sessions.

Returns

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

References $session_prev.

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

410  {
411  return $this->session_prev;
412  }
+ Here is the caller graph for this function:

◆ getOfflineStatus()

ilObjCourse::getOfflineStatus ( )

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

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

281  {
282  return (bool) $this->activation_offline;
283  }
+ Here is the caller graph for this function:

◆ getOrderType()

ilObjCourse::getOrderType ( )

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

References enabledObjectiveView(), and ilContainer\SORT_MANUAL.

Referenced by cloneSettings(), and update().

2075  {
2076  if ($this->enabledObjectiveView()) {
2077  return ilContainer::SORT_MANUAL;
2078  }
2079  return parent::getOrderType();
2080  }
+ 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 156 of file class.ilObjCourse.php.

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

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

◆ getShowMembers()

ilObjCourse::getShowMembers ( )

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

Referenced by cloneSettings(), and updateSettings().

649  {
650  return $this->show_members;
651  }
+ Here is the caller graph for this function:

◆ getShowMembersExport()

ilObjCourse::getShowMembersExport ( )

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

References $member_export.

Referenced by cloneSettings(), and updateSettings().

143  {
144  return $this->member_export;
145  }
+ Here is the caller graph for this function:

◆ getStatusDetermination()

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

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

References $status_dt.

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

2038  {
2039  return $this->status_dt;
2040  }
+ Here is the caller graph for this function:

◆ getSubItems()

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

Get subitems of container.

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

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

References $_GET, $current, $end, $ilUser, $key, ilDateTime\_after(), ilDateTime\_before(), ilContainerSorting\_getInstance(), ilDateTime\_within(), array, date, ilObject\getId(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), getViewMode(), IL_CAL_DATE, IL_CAL_DAY, IL_CAL_UNIX, isSessionLimitEnabled(), ilUtil\sortArray(), time, and ilContainer\VIEW_SESSIONS.

479  {
480  global $ilUser;
481 
482  // Caching
483  if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block])) {
484  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
485  }
486 
487  // Results are stored in $this->items
488  parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
489 
490  $limit_sess = false;
491  if (!$a_admin_panel_enabled &&
492  !$a_include_side_block &&
493  $this->items['sess'] &&
494  is_array($this->items['sess']) &&
495  $this->isSessionLimitEnabled() &&
496  $this->getViewMode() == ilContainer::VIEW_SESSIONS) { // #16686
497  $limit_sess = true;
498  }
499 
500  if (!$limit_sess) {
501  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
502  }
503 
504 
505  // do session limit
506 
507  // @todo move to gui class
508  if (isset($_GET['crs_prev_sess'])) {
509  $ilUser->writePref('crs_sess_show_prev_' . $this->getId(), (string) (int) $_GET['crs_prev_sess']);
510  }
511  if (isset($_GET['crs_next_sess'])) {
512  $ilUser->writePref('crs_sess_show_next_' . $this->getId(), (string) (int) $_GET['crs_next_sess']);
513  }
514 
515  $sessions = ilUtil::sortArray($this->items['sess'], 'start', 'ASC', true, false);
516  $today = new ilDate(date('Ymd', time()), IL_CAL_DATE);
517  $previous = $current = $next = array();
518  foreach ($sessions as $key => $item) {
519  $start = new ilDateTime($item['start'], IL_CAL_UNIX);
520  $end = new ilDateTime($item['end'], IL_CAL_UNIX);
521 
522  if (ilDateTime::_within($today, $start, $end, IL_CAL_DAY)) {
523  $current[] = $item;
524  } elseif (ilDateTime::_before($start, $today, IL_CAL_DAY)) {
525  $previous[] = $item;
526  } elseif (ilDateTime::_after($start, $today, IL_CAL_DAY)) {
527  $next[] = $item;
528  }
529  }
530  $num_previous_remove = max(
531  count($previous) - $this->getNumberOfPreviousSessions(),
532  0
533  );
534  while ($num_previous_remove--) {
535  if (!$ilUser->getPref('crs_sess_show_prev_' . $this->getId())) {
536  array_shift($previous);
537  }
538  $this->items['sess_link']['prev']['value'] = 1;
539  }
540 
541  $num_next_remove = max(
542  count($next) - $this->getNumberOfNextSessions(),
543  0
544  );
545  while ($num_next_remove--) {
546  if (!$ilUser->getPref('crs_sess_show_next_' . $this->getId())) {
547  array_pop($next);
548  }
549  // @fixme
550  $this->items['sess_link']['next']['value'] = 1;
551  }
552 
553  $sessions = array_merge($previous, $current, $next);
554  $this->items['sess'] = $sessions;
555 
556  // #15389 - see ilContainer::getSubItems()
557  include_once('Services/Container/classes/class.ilContainerSorting.php');
558  $sort = ilContainerSorting::_getInstance($this->getId());
559  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
560 
561  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
562  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$_GET["client_id"]
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
$end
Definition: saml1-acs.php:18
const IL_CAL_UNIX
const IL_CAL_DAY
Class for single dates.
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Date and time handling
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
const IL_CAL_DATE
getNumberOfPreviousSessions()
Set number of previous sessions.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ getSubscriptionEnd()

ilObjCourse::getSubscriptionEnd ( )

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

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

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

◆ getSubscriptionLimitationType()

ilObjCourse::getSubscriptionLimitationType ( )

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

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

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

◆ getSubscriptionMaxMembers()

ilObjCourse::getSubscriptionMaxMembers ( )

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

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

445  {
446  return $this->subscription_max_members;
447  }
+ Here is the caller graph for this function:

◆ getSubscriptionMinMembers()

ilObjCourse::getSubscriptionMinMembers ( )

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

References $min_members.

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

893  {
894  return $this->min_members;
895  }
+ Here is the caller graph for this function:

◆ getSubscriptionNotify()

ilObjCourse::getSubscriptionNotify ( )

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

Referenced by cloneSettings(), and updateSettings().

565  {
566  return true;
567  return $this->subscription_notify ? true : false;
568  }
+ Here is the caller graph for this function:

◆ getSubscriptionPassword()

ilObjCourse::getSubscriptionPassword ( )

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

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

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

◆ getSubscriptionStart()

ilObjCourse::getSubscriptionStart ( )

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

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

310  {
311  return $this->subscription_start;
312  }
+ Here is the caller graph for this function:

◆ getSubscriptionType()

ilObjCourse::getSubscriptionType ( )

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

References IL_CRS_SUBSCRIPTION_DIRECT.

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

326  {
327  return $this->subscription_type ? $this->subscription_type : IL_CRS_SUBSCRIPTION_DIRECT;
328  #return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
329  }
const IL_CRS_SUBSCRIPTION_DIRECT
+ Here is the caller graph for this function:

◆ getSubscriptionUnlimitedStatus()

ilObjCourse::getSubscriptionUnlimitedStatus ( )

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

References IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

306  {
307  return $this->subscription_limitation_type == IL_CRS_SUBSCRIPTION_UNLIMITED;
308  }
const IL_CRS_SUBSCRIPTION_UNLIMITED
+ Here is the caller graph for this function:

◆ getSyllabus()

ilObjCourse::getSyllabus ( )

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

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

199  {
200  return $this->syllabus;
201  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilObjCourse::getViewMode ( )

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

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

579  {
580  return $this->view_mode;
581  }
+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjCourse::handleAutoFill ( )

Handle course auto fill.

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

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

2086  {
2087  if (
2088  !$this->enabledWaitingList() or
2089  !$this->hasWaitingListAutoFill()
2090  ) {
2091  $this->course_logger->debug('Waiting list or auto fill disabled.');
2092  return;
2093  }
2094 
2095  $max = $this->getSubscriptionMaxMembers();
2097 
2098  $this->course_logger->debug('Max members: ' . $max);
2099  $this->course_logger->debug('Current members: ' . $now);
2100 
2101  if ($max <= $now) {
2102  return;
2103  }
2104 
2105  // see assignFromWaitingListObject()
2106  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
2107  $waiting_list = new ilCourseWaitingList($this->getId());
2108 
2109  foreach ($waiting_list->getUserIds() as $user_id) {
2110  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
2111  $this->course_logger->warning('Cannot create user instance for id: ' . $user_id);
2112  continue;
2113  }
2114  if ($this->getMembersObject()->isAssigned($user_id)) {
2115  $this->course_logger->warning('User is already assigned to course. uid: ' . $user_id . ' course_id: ' . $this->getRefId());
2116  continue;
2117  }
2118  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
2119  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id, true);
2120  $waiting_list->removeFromList($user_id);
2121  $this->checkLPStatusSync($user_id);
2122 
2123  $this->course_logger->info('Assigned user from waiting list to course: ' . $this->getTitle());
2124  $now++;
2125  if ($now >= $max) {
2126  break;
2127  }
2128  }
2129  }
static lookupNumberOfMembers($a_ref_id)
Lookup number of members ilRbacReview $rbacreview <type> $ilObjDataCache.
const IL_CRS_MEMBER
getId()
get object id public
getTitle()
get object title public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
checkLPStatusSync($a_member_id)
sync course status from lp
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ hasContactData()

ilObjCourse::hasContactData ( )

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

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

1112  {
1113  return strlen($this->getContactName()) or
1114  strlen($this->getContactResponsibility()) or
1115  strlen($this->getContactEmail()) or
1116  strlen($this->getContactPhone()) or
1117  strlen($this->getContactConsultation());
1118  }
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjCourse::hasWaitingListAutoFill ( )

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

References $auto_fill_from_waiting.

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

903  {
904  return (bool) $this->auto_fill_from_waiting;
905  }
+ Here is the caller graph for this function:

◆ initCourseMemberObject()

ilObjCourse::initCourseMemberObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMemberObject().

1484  {
1485  global $ilUser;
1486 
1487  include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
1488  $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(), $ilUser->getId());
1489  return true;
1490  }
getId()
get object id public
$ilUser
Definition: imgupload.php:18
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
+ 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 1497 of file class.ilObjCourse.php.

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

Referenced by getMembersObject().

1498  {
1499  global $ilUser;
1500 
1501  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1502  $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1503  return true;
1504  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
getId()
get object id public
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjCourse::initDefaultRoles ( )

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

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

1533  {
1534  global $rbacadmin,$rbacreview,$ilDB;
1535 
1536  include_once './Services/AccessControl/classes/class.ilObjRole.php';
1538  'il_crs_admin_' . $this->getRefId(),
1539  "Admin of crs obj_no." . $this->getId(),
1540  'il_crs_admin',
1541  $this->getRefId()
1542  );
1544  'il_crs_tutor_' . $this->getRefId(),
1545  "Tutor of crs obj_no." . $this->getId(),
1546  'il_crs_tutor',
1547  $this->getRefId()
1548  );
1550  'il_crs_member_' . $this->getRefId(),
1551  "Member of crs obj_no." . $this->getId(),
1552  'il_crs_member',
1553  $this->getRefId()
1554  );
1555 
1556  return array();
1557  }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
Create styles array
The data for the language used.
global $ilDB
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initWaitingList()

ilObjCourse::initWaitingList ( )

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

References ilObject\getId().

1468  {
1469  include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
1470 
1471  if (!is_object($this->waiting_list_obj)) {
1472  $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1473  }
1474  return true;
1475  }
getId()
get object id public
+ Here is the call graph for this function:

◆ inSubscriptionTime()

ilObjCourse::inSubscriptionTime ( )

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

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

Referenced by register().

358  {
359  if ($this->getSubscriptionUnlimitedStatus()) {
360  return true;
361  }
362  if (time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd()) {
363  return true;
364  }
365  return false;
366  }
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

ilObjCourse::isActivated ( )

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

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

689  {
690  if ($this->getOfflineStatus()) {
691  return false;
692  }
693  if ($this->getActivationUnlimitedStatus()) {
694  return true;
695  }
696  if (time() < $this->getActivationStart() or
697  time() > $this->getActivationEnd()) {
698  return false;
699  }
700  return true;
701  }
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjCourse::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

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

References $reg_access_code_enabled.

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

176  {
177  return (bool) $this->reg_access_code_enabled;
178  }
+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjCourse::isSessionLimitEnabled ( )

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

References $session_limit.

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

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

◆ isSubscriptionMembershipLimited()

ilObjCourse::isSubscriptionMembershipLimited ( )

is membership limited

public

Parameters

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

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

440  {
441  return (bool) $this->subscription_membership_limitation;
442  }
+ Here is the caller graph for this function:

◆ lookupCourseNonMemberTemplatesId()

static ilObjCourse::lookupCourseNonMemberTemplatesId ( )
static

Lookup course non member id.

Returns
int

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

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

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

1606  {
1607  global $ilDB;
1608 
1609  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_crs_non_member', 'text');
1610  $res = $ilDB->query($query);
1612 
1613  return isset($row['obj_id']) ? $row['obj_id'] : 0;
1614  }
foreach($_POST as $key=> $value) $res
$query
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 1886 of file class.ilObjCourse.php.

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1887  {
1888  global $ilDB;
1889 
1890  $query = "SELECT obj_id FROM crs_settings " .
1891  "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
1892  "AND reg_ac = " . $ilDB->quote($a_code, 'text');
1893  $res = $ilDB->query($query);
1894 
1895  $obj_ids = array();
1896  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1897  $obj_ids[] = $row->obj_id;
1898  }
1899  return $obj_ids;
1900  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
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 131 of file class.ilObjCourse.php.

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

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

132  {
133  $query = 'SELECT show_members FROM crs_settings ' .
134  'WHERE obj_id = ' . $GLOBALS['ilDB']->quote($a_obj_id, 'integer');
135  $res = $GLOBALS['ilDB']->query($query);
136  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
137  return (bool) $row->show_members;
138  }
139  return false;
140  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
$query
+ Here is the caller graph for this function:

◆ mayLeave()

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

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

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

Referenced by ilObjCourseAccess\_checkAccess().

2132  {
2133  global $ilUser, $ilDB;
2134 
2135  if (!$a_user_id) {
2136  $a_user_id = $ilUser->getId();
2137  }
2138 
2139  $set = $ilDB->query("SELECT leave_end" .
2140  " FROM crs_settings" .
2141  " WHERE obj_id = " . $ilDB->quote($a_course_id, "integer"));
2142  $row = $ilDB->fetchAssoc($set);
2143  if ($row && $row["leave_end"]) {
2144  // timestamp to date
2145  $limit = date("Ymd", $row["leave_end"]);
2146  if ($limit < date("Ymd")) {
2147  $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
2148  return false;
2149  }
2150  }
2151  return true;
2152  }
Class for single dates.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$ilUser
Definition: imgupload.php:18
const IL_CAL_DATE
global $ilDB
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjCourse::MDUpdateListener (   $a_element)

Overwriten Metadata update listener for ECS functionalities.

public

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

References $ilLog.

1775  {
1776  global $ilLog;
1777 
1778  parent::MDUpdateListener($a_element);
1779 
1780  switch ($a_element) {
1781  case 'General':
1782  // Update ecs content
1783  include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
1784  $ecs = new ilECSCourseSettings($this);
1785  $ecs->handleContentUpdate();
1786  break;
1787 
1788  default:
1789  return true;
1790  }
1791  }
Class ilECSCourseSettings.

◆ prepareAppointments()

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

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

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

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

1811  {
1812  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1813  include_once('./Services/Calendar/classes/class.ilDateTime.php');
1814 
1815  switch ($a_mode) {
1816  case 'create':
1817  case 'update':
1818  if (!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus()) {
1819  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1820  $app->setTitle($this->getTitle());
1821  $app->setSubtitle('crs_cal_activation_start');
1822  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1823  $app->setDescription($this->getLongDescription());
1824  $app->setStart(new ilDateTime($this->getActivationStart(), IL_CAL_UNIX));
1825  $apps[] = $app;
1826 
1827  $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1828  $app->setTitle($this->getTitle());
1829  $app->setSubtitle('crs_cal_activation_end');
1830  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1831  $app->setDescription($this->getLongDescription());
1832  $app->setStart(new ilDateTime($this->getActivationEnd(), IL_CAL_UNIX));
1833  $apps[] = $app;
1834  }
1836  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1837  $app->setTitle($this->getTitle());
1838  $app->setSubtitle('crs_cal_reg_start');
1839  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1840  $app->setDescription($this->getLongDescription());
1841  $app->setStart(new ilDateTime($this->getSubscriptionStart(), IL_CAL_UNIX));
1842  $apps[] = $app;
1843 
1844  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1845  $app->setTitle($this->getTitle());
1846  $app->setSubtitle('crs_cal_reg_end');
1847  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1848  $app->setDescription($this->getLongDescription());
1849  $app->setStart(new ilDateTime($this->getSubscriptionEnd(), IL_CAL_UNIX));
1850  $apps[] = $app;
1851  }
1852  if ($this->getCourseStart() && $this->getCourseEnd()) {
1853  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_START);
1854  $app->setTitle($this->getTitle());
1855  $app->setSubtitle('crs_cal_start');
1856  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1857  $app->setDescription($this->getLongDescription());
1858  $app->setStart($this->getCourseStart());
1859  $app->setFullday(true);
1860  $apps[] = $app;
1861 
1862  $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_END);
1863  $app->setTitle($this->getTitle());
1864  $app->setSubtitle('crs_cal_end');
1865  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1866  $app->setDescription($this->getLongDescription());
1867  $app->setStart($this->getCourseEnd());
1868  $app->setFullday(true);
1869  $apps[] = $app;
1870  }
1871 
1872 
1873  return $apps ? $apps : array();
1874 
1875  case 'delete':
1876  // Nothing to do: The category and all assigned appointments will be deleted.
1877  return array();
1878  }
1879  }
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
Create styles array
The data for the language used.
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourse::read ( )

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

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

737  {
738  parent::read();
739 
740  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
742 
743  $this->__readSettings();
744  }
getId()
get object id public
setOrderType($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:

◆ register()

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

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

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

1910  {
1911  global $ilCtrl, $tree;
1912  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1913  include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
1915 
1916  if ($part->isAssigned($a_user_id)) {
1917  return true;
1918  }
1919 
1920  if (!$a_force_registration) {
1921  // offline
1922  if (!ilObjCourseAccess::_isOnline($this->getId())) {
1924  "Can't register to course, course is offline.",
1926  );
1927  }
1928 
1929  // activation
1930  if (!ilObjCourseAccess::_isActivated($this->getId())) {
1932  "Can't register to course, course is not activated.",
1934  );
1935  }
1936 
1939  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
1940  ', course subscription is deactivated.', ilMembershipRegistrationException::REGISTRATION_CODE_DISABLED);
1941  }
1942  }
1943 
1944  // Time Limitation
1946  if (!$this->inSubscriptionTime()) {
1947  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
1948  ', course is out of registration time.', ilMembershipRegistrationException::OUT_OF_REGISTRATION_PERIOD);
1949  }
1950  }
1951 
1952  // Max members
1953  if ($this->isSubscriptionMembershipLimited()) {
1954  $free = max(0, $this->getSubscriptionMaxMembers() - $part->getCountMembers());
1955  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
1956  $waiting_list = new ilCourseWaitingList($this->getId());
1957  if ($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers())) {
1958  $waiting_list->addToList($a_user_id);
1959  $this->lng->loadLanguageModule("crs");
1960  $info = sprintf(
1961  $this->lng->txt('crs_added_to_list'),
1962  $waiting_list->getPosition($a_user_id)
1963  );
1964  include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
1965  $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
1966  $participants->sendNotification($participants->NOTIFY_WAITING_LIST, $a_user_id);
1967 
1969  }
1970 
1971  if (!$this->enabledWaitingList() && !$free) {
1972  throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
1973  ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
1974  }
1975  }
1976  }
1977 
1978  $part->add($a_user_id, $a_role);
1979  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
1980  $part->sendNotification($part->NOTIFY_ADMINS, $a_user_id);
1981 
1982 
1983  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1985 
1986  return true;
1987  }
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
static _isOnline($a_obj_id)
Check if online setting is active.
getRefId()
get reference id public
static checkForumsExistsInsert($ref_id, $user_id=0)
$info
Definition: index.php:5
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:

◆ setAboStatus()

ilObjCourse::setAboStatus (   $a_status)

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

Referenced by __readSettings().

637  {
638  $this->abo = $a_status;
639  }
+ Here is the caller graph for this function:

◆ setActivationEnd()

ilObjCourse::setActivationEnd (   $a_value)

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

Referenced by __readSettings().

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

◆ setActivationStart()

ilObjCourse::setActivationStart (   $a_value)

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

Referenced by __readSettings().

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

◆ setActivationType()

ilObjCourse::setActivationType (   $a_type)

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

References $a_type, IL_CRS_ACTIVATION_OFFLINE, IL_CRS_ACTIVATION_UNLIMITED, and setOfflineStatus().

Referenced by __readSettings().

251  {
252  // offline is separate property now
254  $this->setOfflineStatus(true);
256  }
257 
258  $this->activation_type = $a_type;
259  }
setOfflineStatus($a_value)
$a_type
Definition: workflow.php:92
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 288 of file class.ilObjCourse.php.

Referenced by __readSettings().

289  {
290  $this->activation_visibility = (bool) $a_value;
291  }
+ Here is the caller graph for this function:

◆ setArchiveEnd()

ilObjCourse::setArchiveEnd (   $a_value)

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

625  {
626  $this->archive_end = $a_value;
627  }

◆ setArchiveStart()

ilObjCourse::setArchiveStart (   $a_value)

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

617  {
618  $this->archive_start = $a_value;
619  }

◆ setArchiveType()

ilObjCourse::setArchiveType (   $a_value)

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

633  {
634  $this->archive_type = $a_value;
635  }

◆ setAutoNotification()

ilObjCourse::setAutoNotification (   $value)

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

Parameters
mixedboolean

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

Referenced by __readSettings().

2008  {
2009  $this->auto_notification = $value;
2010  }
+ Here is the caller graph for this function:

◆ setCancellationEnd()

ilObjCourse::setCancellationEnd ( ilDate  $a_value = null)

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

Referenced by __readSettings().

875  {
876  $this->leave_end = $a_value;
877  }
+ Here is the caller graph for this function:

◆ setContactConsultation()

ilObjCourse::setContactConsultation (   $a_value)

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

Referenced by __readSettings().

219  {
220  $this->contact_consultation = $a_value;
221  }
+ Here is the caller graph for this function:

◆ setContactEmail()

ilObjCourse::setContactEmail (   $a_value)

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

Referenced by __readSettings().

235  {
236  $this->contact_email = $a_value;
237  }
+ Here is the caller graph for this function:

◆ setContactName()

ilObjCourse::setContactName (   $a_cn)

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

Referenced by __readSettings().

211  {
212  $this->contact_name = $a_cn;
213  }
+ Here is the caller graph for this function:

◆ setContactPhone()

ilObjCourse::setContactPhone (   $a_value)

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

Referenced by __readSettings().

227  {
228  $this->contact_phone = $a_value;
229  }
+ Here is the caller graph for this function:

◆ setContactResponsibility()

ilObjCourse::setContactResponsibility (   $a_value)

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

Referenced by __readSettings().

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

◆ setCourseEnd()

ilObjCourse::setCourseEnd ( ilDate  $a_value = null)

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

Referenced by __readSettings().

865  {
866  $this->crs_end = $a_value;
867  }
+ Here is the caller graph for this function:

◆ setCourseStart()

ilObjCourse::setCourseStart ( ilDate  $a_value = null)

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

Referenced by __readSettings().

855  {
856  $this->crs_start = $a_value;
857  }
+ 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 830 of file class.ilObjCourse.php.

Referenced by __readSettings().

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

◆ setImportantInformation()

ilObjCourse::setImportantInformation (   $a_info)

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

Referenced by __readSettings().

195  {
196  $this->important = $a_info;
197  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjCourse::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by __readSettings().

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

◆ setLocationZoom()

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by __readSettings().

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

◆ setLongitude()

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by __readSettings().

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

References $a_type.

Referenced by __readSettings().

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

◆ setMessage()

ilObjCourse::setMessage (   $a_message)

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

Referenced by validate().

677  {
678  $this->message = $a_message;
679  }
+ 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 419 of file class.ilObjCourse.php.

Referenced by __readSettings().

420  {
421  $this->session_next = $a_num;
422  }
+ 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 400 of file class.ilObjCourse.php.

Referenced by __readSettings().

401  {
402  $this->session_prev = $a_num;
403  }
+ Here is the caller graph for this function:

◆ setOfflineStatus()

ilObjCourse::setOfflineStatus (   $a_value)

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

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

285  {
286  $this->activation_offline = (bool) $a_value;
287  }
+ 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 1568 of file class.ilObjCourse.php.

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

1569  {
1570  global $rbacadmin, $rbacreview;
1571 
1572  $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1573  foreach ((array) $parent_roles as $parent_role) {
1574  $rbacadmin->initIntersectionPermissions(
1575  $this->getRefId(),
1576  $parent_role['obj_id'],
1577  $parent_role['parent'],
1578  $this->__getCrsNonMemberTemplateId(),
1579  ROLE_FOLDER_ID
1580  );
1581  }
1582  }
__getCrsNonMemberTemplateId()
get course non-member template private
Create styles array
The data for the language used.
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 166 of file class.ilObjCourse.php.

Referenced by __createDefaultSettings(), and __readSettings().

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

◆ setShowMembers()

ilObjCourse::setShowMembers (   $a_status)

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

Referenced by __readSettings().

645  {
646  $this->show_members = $a_status;
647  }
+ Here is the caller graph for this function:

◆ setShowMembersExport()

ilObjCourse::setShowMembersExport (   $a_mem_export)

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

Referenced by __readSettings().

148  {
149  $this->member_export = $a_mem_export;
150  }
+ Here is the caller graph for this function:

◆ setStatusDetermination()

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

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

References ilObjUserTracking\_enabledLearningProgress().

Referenced by __construct(), and __readSettings().

2018  {
2019  $a_value = (int) $a_value;
2020 
2021  // #13905
2022  if ($a_value == self::STATUS_DETERMINATION_LP) {
2023  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
2025  $a_value = self::STATUS_DETERMINATION_MANUAL;
2026  }
2027  }
2028 
2029  $this->status_dt = $a_value;
2030  }
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 321 of file class.ilObjCourse.php.

Referenced by __readSettings().

322  {
323  $this->subscription_end = $a_value;
324  }
+ Here is the caller graph for this function:

◆ setSubscriptionLimitationType()

ilObjCourse::setSubscriptionLimitationType (   $a_type)

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

References $a_type.

Referenced by __readSettings().

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

◆ setSubscriptionMaxMembers()

ilObjCourse::setSubscriptionMaxMembers (   $a_value)

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

Referenced by __readSettings().

449  {
450  $this->subscription_max_members = $a_value;
451  }
+ Here is the caller graph for this function:

◆ setSubscriptionMinMembers()

ilObjCourse::setSubscriptionMinMembers (   $a_value)

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

Referenced by __readSettings().

885  {
886  if ($a_value !== null) {
887  $a_value = (int) $a_value;
888  }
889  $this->min_members = $a_value;
890  }
+ Here is the caller graph for this function:

◆ setSubscriptionNotify()

ilObjCourse::setSubscriptionNotify (   $a_value)

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

Referenced by __readSettings().

570  {
571  $this->subscription_notify = $a_value ? true : false;
572  }
+ Here is the caller graph for this function:

◆ setSubscriptionPassword()

ilObjCourse::setSubscriptionPassword (   $a_value)

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

Referenced by __readSettings().

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

◆ setSubscriptionStart()

ilObjCourse::setSubscriptionStart (   $a_value)

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

Referenced by __readSettings().

314  {
315  $this->subscription_start = $a_value;
316  }
+ Here is the caller graph for this function:

◆ setSubscriptionType()

ilObjCourse::setSubscriptionType (   $a_value)

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

Referenced by __readSettings().

331  {
332  $this->subscription_type = $a_value;
333  }
+ Here is the caller graph for this function:

◆ setSyllabus()

ilObjCourse::setSyllabus (   $a_syllabus)

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

Referenced by __readSettings().

203  {
204  $this->syllabus = $a_syllabus;
205  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjCourse::setViewMode (   $a_mode)

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

Referenced by __readSettings().

575  {
576  $this->view_mode = $a_mode;
577  }
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjCourse::setWaitingListAutoFill (   $a_value)

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

Referenced by __readSettings().

898  {
899  $this->auto_fill_from_waiting = (bool) $a_value;
900  }
+ Here is the caller graph for this function:

◆ syncMembersStatusWithLP()

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

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

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

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

◆ update()

ilObjCourse::update ( )

update complete object

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

References $ilLog, array, ilObject\getId(), getOrderType(), prepareAppointments(), League\Flysystem\Adapter\Polyfill\update(), ilObject\updateMetaData(), and updateSettings().

1176  {
1177  global $ilAppEventHandler,$ilLog;
1178 
1179  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
1180  $sorting = new ilContainerSortingSettings($this->getId());
1181  $sorting->setSortMode($this->getOrderType());
1182  $sorting->update();
1183 
1184  $this->updateMetaData();
1185  $this->updateSettings();
1186  parent::update();
1187 
1188  $ilAppEventHandler->raise(
1189  'Modules/Course',
1190  'update',
1191  array('object' => $this,
1192  'obj_id' => $this->getId(),
1193  'appointments' => $this->prepareAppointments('update'))
1194  );
1195  }
updateMetaData()
update meta data entry
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
Create styles array
The data for the language used.
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

◆ updateSettings()

ilObjCourse::updateSettings ( )

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

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

Referenced by update().

1198  {
1199  global $ilDB;
1200 
1201  // Due to a bug 3.5.alpha maybe no settings exist. => create default settings
1202 
1203  $query = "SELECT * FROM crs_settings WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
1204  $res = $ilDB->query($query);
1205 
1206  if (!$res->numRows()) {
1207  $this->__createDefaultSettings();
1208  }
1209 
1210  $query = "UPDATE crs_settings SET " .
1211  "syllabus = " . $ilDB->quote($this->getSyllabus(), 'text') . ", " .
1212  "contact_name = " . $ilDB->quote($this->getContactName(), 'text') . ", " .
1213  "contact_responsibility = " . $ilDB->quote($this->getContactResponsibility(), 'text') . ", " .
1214  "contact_phone = " . $ilDB->quote($this->getContactPhone(), 'text') . ", " .
1215  "contact_email = " . $ilDB->quote($this->getContactEmail(), 'text') . ", " .
1216  "contact_consultation = " . $ilDB->quote($this->getContactConsultation(), 'text') . ", " .
1217  "activation_type = " . $ilDB->quote(!$this->getOfflineStatus(), 'integer') . ", " .
1218  "sub_limitation_type = " . $ilDB->quote($this->getSubscriptionLimitationType(), 'integer') . ", " .
1219  "sub_start = " . $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " .
1220  "sub_end = " . $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1221  "sub_type = " . $ilDB->quote($this->getSubscriptionType(), 'integer') . ", " .
1222  "sub_password = " . $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " .
1223  "sub_mem_limit = " . $ilDB->quote((int) $this->isSubscriptionMembershipLimited(), 'integer') . ", " .
1224  "sub_max_members = " . $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1225  "sub_notify = " . $ilDB->quote($this->getSubscriptionNotify(), 'integer') . ", " .
1226  "view_mode = " . $ilDB->quote($this->getViewMode(), 'integer') . ", " .
1227  "abo = " . $ilDB->quote($this->getAboStatus(), 'integer') . ", " .
1228  "waiting_list = " . $ilDB->quote($this->enabledWaitingList(), 'integer') . ", " .
1229  "important = " . $ilDB->quote($this->getImportantInformation(), 'text') . ", " .
1230  "show_members = " . $ilDB->quote($this->getShowMembers(), 'integer') . ", " .
1231  "show_members_export = " . $ilDB->quote($this->getShowMembersExport(), 'integer') . ", " .
1232  "latitude = " . $ilDB->quote($this->getLatitude(), 'text') . ", " .
1233  "longitude = " . $ilDB->quote($this->getLongitude(), 'text') . ", " .
1234  "location_zoom = " . $ilDB->quote($this->getLocationZoom(), 'integer') . ", " .
1235  "enable_course_map = " . $ilDB->quote((int) $this->getEnableCourseMap(), 'integer') . ", " .
1236  'session_limit = ' . $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1237  'session_prev = ' . $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1238  'session_next = ' . $ilDB->quote($this->getNumberOfNextSessions(), 'integer') . ', ' .
1239  'reg_ac_enabled = ' . $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1240  'reg_ac = ' . $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1241  'auto_notification = ' . $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1242  'status_dt = ' . $ilDB->quote((int) $this->getStatusDetermination()) . ', ' .
1243  'mail_members_type = ' . $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ', ' .
1244  'crs_start = ' . $ilDB->quote(($this->getCourseStart() && !$this->getCourseStart()->isNull()) ? $this->getCourseStart()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1245  'crs_end = ' . $ilDB->quote(($this->getCourseEnd() && !$this->getCourseEnd()->isNull()) ? $this->getCourseEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1246  'auto_wait = ' . $ilDB->quote((int) $this->hasWaitingListAutoFill(), 'integer') . ', ' .
1247  'leave_end = ' . $ilDB->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
1248  'min_members = ' . $ilDB->quote((int) $this->getSubscriptionMinMembers(), 'integer') . ' ' .
1249  "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . "";
1250 
1251  $res = $ilDB->manipulate($query);
1252 
1253  // moved activation to ilObjectActivation
1254  if ($this->ref_id) {
1255  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1256  ilObjectActivation::getItem($this->ref_id);
1257 
1258  $item = new ilObjectActivation;
1259  if ($this->getActivationUnlimitedStatus()) {
1261  } else {
1262  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1263  $item->setTimingStart($this->getActivationStart());
1264  $item->setTimingEnd($this->getActivationEnd());
1265  $item->toggleVisible($this->getActivationVisibility());
1266  }
1267 
1268  $item->update($this->ref_id);
1269  }
1270  }
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.
const IL_CAL_UNIX
getLocationZoom()
Get LocationZoom.
foreach($_POST as $key=> $value) $res
getId()
get object id public
getNumberOfNextSessions()
Set number of previous sessions.
$query
getRegistrationAccessCode()
get access code
setTimingType($a_type)
Set timing type.
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
getLatitude()
Get Latitude.
isSubscriptionMembershipLimited()
is membership limited
global $ilDB
getNumberOfPreviousSessions()
Set number of previous sessions.
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 1037 of file class.ilObjCourse.php.

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

1038  {
1039  $this->setMessage('');
1040 
1041  #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and
1042  # $this->getSubscriptionType() == )
1043  #{
1044  # $this->appendMessage($this->lng->txt('crs_select_registration_type'));
1045  #}
1046 
1047  if (($this->getActivationType() == IL_CRS_ACTIVATION_LIMITED) and
1048  $this->getActivationEnd() < $this->getActivationStart()) {
1049  $this->appendMessage($this->lng->txt("activation_times_not_valid"));
1050  }
1052  $this->getSubscriptionStart() > $this->getSubscriptionEnd()) {
1053  $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
1054  }
1055  #if((!$this->getActivationUnlimitedStatus() and
1056  # !$this->getSubscriptionUnlimitedStatus()) and
1057  # ($this->getSubscriptionStart() > $this->getActivationEnd() or
1058  # $this->getSubscriptionStart() < $this->getActivationStart() or
1059  # $this->getSubscriptionEnd() > $this->getActivationEnd() or
1060  # $this->getSubscriptionEnd() < $this->getActivationStart()))
1061  #
1062  #{
1063  # $this->appendMessage($this->lng->txt("subscription_time_not_within_activation"));
1064  #}
1066  $this->appendMessage($this->lng->txt("crs_password_required"));
1067  }
1068  if ($this->isSubscriptionMembershipLimited()) {
1069  if ($this->getSubscriptionMinMembers() <= 0 && $this->getSubscriptionMaxMembers() <= 0) {
1070  $this->appendMessage($this->lng->txt("crs_max_and_min_members_needed"));
1071  }
1072  if ($this->getSubscriptionMaxMembers() <= 0 && $this->enabledWaitingList()) {
1073  $this->appendMessage($this->lng->txt("crs_max_members_needed"));
1074  }
1075  if ($this->getSubscriptionMaxMembers() > 0 && $this->getSubscriptionMinMembers() > $this->getSubscriptionMaxMembers()) {
1076  $this->appendMessage($this->lng->txt("crs_max_and_min_members_invalid"));
1077  }
1078  }
1079  if (!$this->getTitle() || !$this->getStatusDetermination()) {
1080  $this->appendMessage($this->lng->txt('err_check_input'));
1081  }
1082 
1083  // :TODO: checkInput() is not used properly
1084  if (($this->getCourseStart() && !$this->getCourseEnd()) ||
1085  (!$this->getCourseStart() && $this->getCourseEnd()) ||
1086  ($this->getCourseStart() && $this->getCourseEnd() && $this->getCourseStart()->get(IL_CAL_UNIX) > $this->getCourseEnd()->get(IL_CAL_UNIX))) {
1087  $this->appendMessage($this->lng->txt("crs_course_period_not_valid"));
1088  }
1089 
1090  return $this->getMessage() ? false : true;
1091  }
const IL_CRS_ACTIVATION_LIMITED
const IL_CRS_SUBSCRIPTION_LIMITED
getStatusDetermination()
Get status determination mode.
const IL_CAL_UNIX
const IL_CRS_SUBSCRIPTION_PASSWORD
getTitle()
get object title public
setMessage($a_message)
isSubscriptionMembershipLimited()
is membership limited
appendMessage($a_message)
+ Here is the call graph for this function:

◆ validateInfoSettings()

ilObjCourse::validateInfoSettings ( )

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

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

1094  {
1095  global $ilErr;
1096  $error = false;
1097  if ($this->getContactEmail()) {
1098  $emails = explode(",", $this->getContactEmail());
1099 
1100  foreach ($emails as $email) {
1101  $email = trim($email);
1102  if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email))) {
1103  $ilErr->appendMessage($this->lng->txt('contact_email_not_valid') . " '" . $email . "'");
1104  $error = true;
1105  }
1106  }
1107  }
1108  return !$error;
1109  }
static getUserIdByLogin($a_login)
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:193
global $ilErr
Definition: raiseError.php:16
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
+ Here is the call graph for this function:

Field Documentation

◆ $archives_obj

ilObjCourse::$archives_obj

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

◆ $auto_fill_from_waiting

ilObjCourse::$auto_fill_from_waiting
protected

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

Referenced by hasWaitingListAutoFill().

◆ $auto_notification

ilObjCourse::$auto_notification = true
private

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

Referenced by getAutoNotification().

◆ $course_logger

ilObjCourse::$course_logger = null
protected

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

◆ $crs_end

ilObjCourse::$crs_end
protected

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

Referenced by getCourseEnd().

◆ $crs_start

ilObjCourse::$crs_start
protected

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

Referenced by getCourseStart().

◆ $enablemap

ilObjCourse::$enablemap = 0
private

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

Referenced by getEnableCourseMap().

◆ $latitude

ilObjCourse::$latitude = ''
private

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

Referenced by getLatitude().

◆ $leave_end

ilObjCourse::$leave_end
protected

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

Referenced by getCancellationEnd().

◆ $locationzoom

ilObjCourse::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $longitude

ilObjCourse::$longitude = ''
private

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

Referenced by getLongitude().

◆ $mail_members

ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $member_export

ilObjCourse::$member_export = false
protected

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

Referenced by getShowMembersExport().

◆ $member_obj

ilObjCourse::$member_obj = null
private

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

Referenced by getMemberObject().

◆ $members_obj

ilObjCourse::$members_obj = null
private

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

Referenced by getMembersObject().

◆ $min_members

ilObjCourse::$min_members
protected

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

Referenced by getSubscriptionMinMembers().

◆ $reg_access_code

ilObjCourse::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjCourse::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $session_limit

ilObjCourse::$session_limit = 0
private

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

Referenced by isSessionLimitEnabled().

◆ $session_next

ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

ilObjCourse::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

◆ $status_dt

ilObjCourse::$status_dt = null
private

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

Referenced by getStatusDetermination().

◆ CAL_ACTIVATION_END

const ilObjCourse::CAL_ACTIVATION_END = 4

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

◆ CAL_ACTIVATION_START

const ilObjCourse::CAL_ACTIVATION_START = 3

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

◆ CAL_COURSE_END

const ilObjCourse::CAL_COURSE_END = 6

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

◆ CAL_COURSE_START

const ilObjCourse::CAL_COURSE_START = 5

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

◆ CAL_REG_END

const ilObjCourse::CAL_REG_END = 2

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

◆ CAL_REG_START

const ilObjCourse::CAL_REG_START = 1

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

◆ STATUS_DETERMINATION_LP

◆ STATUS_DETERMINATION_MANUAL

const ilObjCourse::STATUS_DETERMINATION_MANUAL = 2

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

Referenced by ilObjCourseGUI\initEditForm().


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