ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjCourse Class Reference

Class ilObjCourse. More...

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

Public Member Functions

 ilObjCourse ($a_id=0, $a_call_by_reference=true)
 Constructor public.
 getRegistrationAccessCode ()
 get access code
 setRegistrationAccessCode ($a_code)
 Set refistration access code.
 isRegistrationAccessCodeEnabled ()
 Check if access code is enabled.
 enableRegistrationAccessCode ($a_status)
 En/disable registration access code.
 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
 isSessionLimitEnabled ()
 enableSubscriptionMembershipLimitation ($a_status)
 enable max members
 setNumberOfPreviousSessions ($a_num)
 Set number of previous sessions.
 getNumberOfPreviousSessions ()
 Set number of previous sessions.
 setNumberOfNextSessions ($a_num)
 Set number of previous sessions.
 getNumberOfNextSessions ()
 Set number of previous sessions.
 isSubscriptionMembershipLimited ()
 is membership limited
 getSubscriptionMaxMembers ()
 setSubscriptionMaxMembers ($a_value)
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false)
 Get subitems of container.
 getSubscriptionNotify ()
 setSubscriptionNotify ($a_value)
 setViewMode ($a_mode)
 getViewMode ()
 Get container view mode.
 _lookupViewMode ($a_id)
 _lookupAboStatus ($a_id)
 getArchiveStart ()
 setArchiveStart ($a_value)
 getArchiveEnd ()
 setArchiveEnd ($a_value)
 getArchiveType ()
 setArchiveType ($a_value)
 setAboStatus ($a_status)
 getAboStatus ()
 setShowMembers ($a_status)
 getShowMembers ()
 setMailToMembersType ($a_type)
 Set mail to members type.
 getMailToMembersType ()
 Get mail to members type.
 getMessage ()
 setMessage ($a_message)
 appendMessage ($a_message)
 isActivated ($a_check_archive=false)
 _isActivated ($a_obj_id)
 Is activated.
 _registrationEnabled ($a_obj_id)
 Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
 isArchived ()
 allowAbo ()
 read ($a_force_db=false)
 read object data from db into object
 create ($a_upload=false)
 setLatitude ($a_latitude)
 Set Latitude.
 getLatitude ()
 Get Latitude.
 setLongitude ($a_longitude)
 Set Longitude.
 getLongitude ()
 Get Longitude.
 setLocationZoom ($a_locationzoom)
 Set LocationZoom.
 getLocationZoom ()
 Get LocationZoom.
 setEnableCourseMap ($a_enablemap)
 Set Enable Course Map.
 getEnableCourseMap ()
 Get Enable Course Map.
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone course (no member data)
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (start objects, preconditions)
 cloneAutoGeneratedRoles ($new_obj)
 Clone automatic genrated roles (permissions and template permissions)
 validate ()
 validateInfoSettings ()
 hasContactData ()
 delete ()
 delete course and all related data
 update ()
 update complete object
 updateSettings ()
 cloneSettings ($new_obj)
 Clone entries in settings table.
 __createDefaultSettings ()
 __readSettings ()
 initWaitingList ()
 getMemberObject ()
 Get course member object.
 getMembersObject ()
 initCourseArchiveObject ()
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public
 __setCourseStatus ()
 set course status
 __getCrsNonMemberTemplateId ()
 get course non-member template private
 getLocalCourseRoles ($a_translate=false)
 get ALL local roles of course, also those created and defined afterwards only fetch data once from database.
 getDefaultCourseRoles ($a_crs_id="")
 get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member public
 __getLocalRoles ()
 __deleteSettings ()
 getDefaultMemberRole ()
 getDefaultTutorRole ()
 getDefaultAdminRole ()
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id=0)
 _deleteUser ($a_usr_id)
 MDUpdateListener ($a_element)
 Overwriten Metadata update listener for ECS functionalities.
 addAdditionalSubItemInformation (&$a_item_data)
 Add additional information to sub item, e.g.
 register ($a_user_id, $a_role=ilCourseConstants::CRS_MEMBER, $a_force_registration=false)
 getAutoNotification ()
 Returns automatic notification status from $this->auto_notification.
 setAutoNotification ($value)
 Sets automatic notification status in $this->auto_notification, using given $status.
 setStatusDetermination ($a_value)
 Set status determination mode.
 getStatusDetermination ()
 Get status determination mode.
 syncMembersStatusWithLP ()
 Set course status for all members by lp status.
 checkLPStatusSync ($a_member_id)
 sync course status from lp
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor public.
 createContainerDirectory ()
 Create directory for the container.
 getContainerDirectory ()
 Get the container directory.
 _getContainerDirectory ($a_id)
 Get the container directory.
 getBigIconPath ()
 Get path for big icon.
 getSmallIconPath ()
 Get path for small icon.
 getTinyIconPath ()
 Get path for tiny icon.
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems).
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems).
 getStyleSheetId ()
 get ID of assigned style sheet object
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting.
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path
 saveIcons ($a_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons
 removeBigIcon ()
 remove big icon
 removeSmallIcon ()
 remove small icon
 removeTinyIcon ()
 remove tiny icon
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 clone all objects according to this container
 getOrderType ()
 Get order type default implementation.
 setOrderType ($a_value)
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container.
 gotItems ()
 Check whether we got any items.
 getGroupedObjTypes ()
 Get grouped repository object types.
 enablePageEditing ()
 Check whether page editing is allowed for container.
 create ()
 Create.
 read ()
 read
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getRefId ()
 get reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions
 getTitle ()
 get object title public
 getUntranslatedTitle ()
 get untranslated object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getLongDescription ()
 get object long description (stored in object_description)
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 getDiskUsage ()
 Gets the disk usage of the object in bytes.
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _lookupOwner ($a_id)
 lookup object owner
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static)
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 createReference ()
 creates reference for object
 countReferences ()
 count references of object
 createRoleFolder ()
 creates a local role folder
 applyDidacticTemplate ($a_tpl_id)
 Apply template.
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts.
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getXMLZip ()
 getHTMLDirectory ()
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ...
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container.
 cloneMetaData ($target_obj)
 Copy meta data.
 _lookupCreationDate ($a_id)
 Lookup creation date.
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register ($a_user_id)
 Register an user.

Static Public Member Functions

static lookupShowMembersEnabled ($a_obj_id)
 Check if show member is enabled.
static _isSubscriptionNotificationEnabled ($a_course_id)
 Check if subscription notification is enabled.
static lookupObjectsByCode ($a_code)
- Static Public Member Functions inherited from ilContainer
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description)
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
static _getAllReferences ($a_id)
 get all reference ids of object
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB.
static _lookupType ($a_id, $a_reference=false)
 lookup object type
static _lookupObjectId ($a_ref_id)
 lookup object id
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
static getLongDescriptions (array $a_obj_ids)
 Get long description data.
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns.
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course.

Data Fields

const CAL_REG_START = 1
const CAL_REG_END = 2
const CAL_ACTIVATION_START = 3
const CAL_ACTIVATION_END = 4
const STATUS_DETERMINATION_LP = 1
const STATUS_DETERMINATION_MANUAL = 2
 $archives_obj
- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
const VIEW_OBJECTIVE = 1
const VIEW_TIMING = 2
const VIEW_ARCHIVE = 3
const VIEW_SIMPLE = 4
const VIEW_BY_TYPE = 5
const VIEW_INHERIT = 6
const VIEW_ILINC = 7
const VIEW_DEFAULT = self::VIEW_BY_TYPE
const SORT_TITLE = 0
const SORT_MANUAL = 1
const SORT_ACTIVATION = 2
const SORT_INHERIT = 3
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title
const DESC_LENGTH = 128
 $ilias
 $lng
 $id
 $ref_id
 $type
 $title
 $untranslatedTitle
 $desc
 $long_desc
 $owner
 $create_date
 $last_update
 $import_id
 $register = false
 $referenced
 $objectList
 $max_title
 $max_desc
 $add_dots
 $obj_data_record
 object_data record

Protected Member Functions

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

Private Attributes

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

Additional Inherited Members

- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
- Protected Attributes inherited from ilContainer
 $order_type = 0
 $hiddenfilesfound = false

Detailed Description

Class ilObjCourse.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilObjCourse.php 58184 2015-02-25 09:41:15Z gitmgr

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

Member Function Documentation

ilObjCourse::__createDefaultSettings ( )

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

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

Referenced by create(), and updateSettings().

{
global $ilDB;
include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
$query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility,".
"contact_phone,contact_email,contact_consultation,activation_type,activation_start,".
"activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit,".
"sub_max_members,sub_notify,view_mode,archive_start,archive_end,archive_type,abo," .
"latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, ".
"session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) ".
"VALUES( ".
$ilDB->quote($this->getId() ,'integer').", ".
$ilDB->quote($this->getSyllabus() ,'text').", ".
$ilDB->quote($this->getContactName() ,'text').", ".
$ilDB->quote($this->getContactResponsibility() ,'text').", ".
$ilDB->quote($this->getContactPhone() ,'text').", ".
$ilDB->quote($this->getContactEmail() ,'text').", ".
$ilDB->quote($this->getContactConsultation() ,'text').", ".
$ilDB->quote(0 ,'integer').", ".
$ilDB->quote($this->getActivationStart() ,'integer').", ".
$ilDB->quote($this->getActivationEnd() ,'integer').", ".
$ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED ,'integer').", ".
$ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
$ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
$ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT ,'integer').", ".
$ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
"0, ".
$ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
"1, ".
"0, ".
$ilDB->quote($this->getArchiveStart() ,'integer').", ".
$ilDB->quote($this->getArchiveEnd() ,'integer').", ".
$ilDB->quote(IL_CRS_ARCHIVE_NONE ,'integer').", ".
$ilDB->quote($this->ABO_ENABLED ,'integer').", ".
$ilDB->quote($this->getLatitude() ,'text').", ".
$ilDB->quote($this->getLongitude() ,'text').", ".
$ilDB->quote($this->getLocationZoom() ,'integer').", ".
$ilDB->quote($this->getEnableCourseMap() ,'integer').", ".
#"objective_view = '0', ".
"1, ".
"1,".
$ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
$ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
$ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
$ilDB->quote((int)$this->getAutoNotification(),'integer').', '.
$ilDB->quote((int)$this->getStatusDetermination(),'integer').', '.
$ilDB->quote((int) $this->getMailToMembersType(),'integer').' '.
")";
$res = $ilDB->manipulate($query);
$this->__readSettings();
include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
$sorting = new ilContainerSortingSettings($this->getId());
$sorting->setSortMode(ilContainer::SORT_MANUAL);
$sorting->update();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::__deleteSettings ( )

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

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

Referenced by delete().

{
global $ilDB;
$query = "DELETE FROM crs_settings ".
"WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::__getCrsNonMemberTemplateId ( )

get course non-member template private

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

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

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by __setCourseStatus().

{
global $ilDB;
$q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
$res = $this->ilias->db->query($q);
return $row["obj_id"];
}

+ Here is the caller graph for this function:

ilObjCourse::__getLocalRoles ( )

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

References ilObject\getRefId().

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

{
global $rbacreview;
// GET role_objects of predefined roles
$rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
return $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::__readSettings ( )

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

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

Referenced by __createDefaultSettings(), and read().

{
global $ilDB;
$query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setSyllabus($row->syllabus);
$this->setContactName($row->contact_name);
$this->setContactResponsibility($row->contact_responsibility);
$this->setContactPhone($row->contact_phone);
$this->setContactEmail($row->contact_email);
$this->setContactConsultation($row->contact_consultation);
$this->setOfflineStatus(!(bool)$row->activation_type); // see below
$this->setSubscriptionLimitationType($row->sub_limitation_type);
$this->setSubscriptionStart($row->sub_start);
$this->setSubscriptionEnd($row->sub_end);
$this->setSubscriptionType($row->sub_type);
$this->setSubscriptionPassword($row->sub_password);
$this->setSubscriptionMaxMembers($row->sub_max_members);
$this->setSubscriptionNotify($row->sub_notify);
$this->setViewMode($row->view_mode);
$this->setArchiveStart($row->archive_start);
$this->setArchiveEnd($row->archive_end);
$this->setArchiveType($row->archive_type);
$this->setAboStatus($row->abo);
$this->enableWaitingList($row->waiting_list);
$this->setImportantInformation($row->important);
$this->setShowMembers($row->show_members);
$this->setLatitude($row->latitude);
$this->setLongitude($row->longitude);
$this->setLocationZoom($row->location_zoom);
$this->setEnableCourseMap($row->enable_course_map);
$this->enableSessionLimit($row->session_limit);
$this->setNumberOfPreviousSessions($row->session_prev);
$this->setNumberOfNextSessions($row->session_next);
$this->enableRegistrationAccessCode($row->reg_ac_enabled);
$this->setAutoNotification($row->auto_notification == 1 ? true : false);
$this->setStatusDetermination((int) $row->status_dt);
$this->setMailToMembersType($row->mail_members_type);
}
// moved activation to ilObjectActivation
if($this->ref_id)
{
include_once "./Services/Object/classes/class.ilObjectActivation.php";
$activation = ilObjectActivation::getItem($this->ref_id);
switch($activation["timing_type"])
{
$this->setActivationStart($activation["timing_start"]);
$this->setActivationEnd($activation["timing_end"]);
$this->setActivationVisibility($activation["visible"]);
break;
default:
break;
}
}
else
{
// #13176 - there should always be default
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::__setCourseStatus ( )

set course status

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

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

private

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

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

Referenced by initDefaultRoles().

{
global $rbacadmin, $rbacreview, $rbacsystem;
//get Rolefolder of course
$rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
//define all relevant roles for which rights are needed to be changed
$arr_parentRoles = $rbacreview->getParentRoleIds($this->getRefId());
$arr_relevantParentRoleIds = array_diff(array_keys($arr_parentRoles),$this->getDefaultCourseRoles());
$template_id = $this->__getCrsNonMemberTemplateId();
//get defined operations from template
if (is_null($template_id))
{
$template_ops = array();
} else {
$template_ops = $rbacreview->getOperationsOfRole($template_id, 'crs', ROLE_FOLDER_ID);
}
foreach ($arr_relevantParentRoleIds as $parentRole)
{
if ($rbacreview->isProtected($arr_parentRoles[$parentRole]['parent'],$parentRole))
{
continue;
}
$granted_permissions = array();
// Delete the linked role for the parent role
// (just in case if it already exists).
$rbacadmin->deleteLocalRole($parentRole,$rolf_data["child"]);
// Grant permissions on the course object for
// the parent role. In the foreach loop we
// compute the intersection of the role
// template il_crs_non_member and the
// permission template of the parent role.
$current_ops = $rbacreview->getRoleOperationsOnObject($parentRole, $this->getRefId());
$rbacadmin->revokePermission($this->getRefId(), $parentRole);
foreach ($template_ops as $template_op)
{
if (in_array($template_op,$current_ops))
{
array_push($granted_permissions,$template_op);
}
}
if (!empty($granted_permissions))
{
$rbacadmin->grantPermission($parentRole, $granted_permissions, $this->getRefId());
}
// Create a linked role for the parent role and
// initialize it with the intersection of
// il_crs_non_member and the permission
// template of the parent role
if (! is_null($template_id))
{
$rbacadmin->copyRolePermissionIntersection(
$template_id, ROLE_FOLDER_ID,
$parentRole, $arr_parentRoles[$parentRole]['parent'],
$rolf_data["child"], $parentRole
);
}
$rbacadmin->assignRoleToFolder($parentRole,$rolf_data["child"],"false");
}//END foreach
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References $ilUser, and ilParticipants\_hasPassed().

{
global $ilUser;
$a_usr_id = $a_usr_id ? $a_usr_id : $ilUser->getId();
include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
switch($a_operator)
{
case 'passed':
return ilCourseParticipants::_hasPassed($a_obj_id,$a_usr_id);
default:
return true;
}
}

+ Here is the call graph for this function:

ilObjCourse::_deleteUser (   $a_usr_id)

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

Referenced by ilObjUser\delete().

{
// Delete all user related data
// delete lm_history
include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
include_once './Modules/Course/classes/class.ilCourseParticipants.php';
// Course objectives
include_once './Modules/Course/classes/class.ilCourseObjectiveResult.php';
}

+ Here is the caller graph for this function:

ilObjCourse::_isActivated (   $a_obj_id)

Is activated.

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

Parameters
intid of user
Returns
boolean

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

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

{
include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
}

+ Here is the caller graph for this function:

static ilObjCourse::_isSubscriptionNotificationEnabled (   $a_course_id)
static

Check if subscription notification is enabled.

public

Parameters
intcourse_id

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

References $query, and $res.

{
global $ilDB;
$query = "SELECT * FROM crs_settings ".
"WHERE obj_id = ".$ilDB->quote($a_course_id ,'integer')." ".
"AND sub_notify = 1";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}
ilObjCourse::_lookupAboStatus (   $a_id)

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

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

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

{
global $ilDB;
$query = "SELECT abo FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->abo;
}
return false;
}

+ Here is the caller graph for this function:

ilObjCourse::_lookupViewMode (   $a_id)

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

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

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

{
global $ilDB;
$query = "SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->view_mode;
}
return false;
}

+ Here is the caller graph for this function:

ilObjCourse::_registrationEnabled (   $a_obj_id)

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

Parameters
intid of user
Returns
boolean

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

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

{
include_once("./Modules/Course/classes/class.ilObjCourseAccess.php");
}

+ Here is the caller graph for this function:

ilObjCourse::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

Reimplemented from ilContainer.

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

{
include_once './Services/Object/classes/class.ilObjectActivation.php';
}
ilObjCourse::allowAbo ( )

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

{
return $this->ABO == $this->ABO_ENABLED;
}
ilObjCourse::appendMessage (   $a_message)

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

References getMessage().

Referenced by validate().

{
if($this->getMessage())
{
$this->message .= "<br /> ";
}
$this->message .= $a_message;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::checkLPStatusSync (   $a_member_id)

sync course status from lp

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

Parameters
int$a_member_id

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

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

{
// #11113
include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
{
include_once("Services/Tracking/classes/class.ilLPStatus.php");
$has_completed = ilLPStatus::_hasUserCompleted($this->getId(), $a_member_id);
$this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
}
}

+ Here is the call graph for this function:

ilObjCourse::cloneAutoGeneratedRoles (   $new_obj)

Clone automatic genrated roles (permissions and template permissions)

public

Parameters
objectnew course object

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

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

Referenced by cloneObject().

{
global $ilLog,$rbacadmin,$rbacreview;
$admin = $this->getDefaultAdminRole();
$new_admin = $new_obj->getDefaultAdminRole();
$source_rolf = $rbacreview->getRoleFolderIdOfObject($this->getRefId());
$target_rolf = $rbacreview->getRoleFolderIdOfObject($new_obj->getRefId());
if(!$admin || !$new_admin || !$source_rolf || !$target_rolf)
{
$ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_admin');
}
$rbacadmin->copyRolePermissions($admin,$source_rolf,$target_rolf,$new_admin,true);
$ilLog->write(__METHOD__.' : Finished copying of role crs_admin.');
$tutor = $this->getDefaultTutorRole();
$new_tutor = $new_obj->getDefaultTutorRole();
if(!$tutor || !$new_tutor)
{
$ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_tutor');
}
$rbacadmin->copyRolePermissions($tutor,$source_rolf,$target_rolf,$new_tutor,true);
$ilLog->write(__METHOD__.' : Finished copying of role crs_tutor.');
$member = $this->getDefaultMemberRole();
$new_member = $new_obj->getDefaultMemberRole();
if(!$member || !$new_member)
{
$ilLog->write(__METHOD__.' : Error cloning auto generated role: il_crs_member');
}
$rbacadmin->copyRolePermissions($member,$source_rolf,$target_rolf,$new_member,true);
$ilLog->write(__METHOD__.' : Finished copying of role crs_member.');
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (start objects, preconditions)

public

Parameters
inttarget ref id of new course
intcopy id

Reimplemented from ilContainer.

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

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

{
parent::cloneDependencies($a_target_id,$a_copy_id);
// Clone course start objects
include_once('Modules/Course/classes/class.ilCourseStart.php');
$start = new ilCourseStart($this->getRefId(),$this->getId());
$start->cloneDependencies($a_target_id,$a_copy_id);
// Clone course item settings
include_once('Services/Object/classes/class.ilObjectActivation.php');
ilObjectActivation::cloneDependencies($this->getRefId(),$a_target_id,$a_copy_id);
// Clone course learning objectives
include_once('Modules/Course/classes/class.ilCourseObjective.php');
$crs_objective = new ilCourseObjective($this);
$crs_objective->ilClone($a_target_id,$a_copy_id);
return true;
}

+ Here is the call graph for this function:

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

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

Reimplemented from ilContainer.

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

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

{
global $ilDB,$ilUser;
$new_obj = parent::cloneObject($a_target_id,$a_copy_id);
$this->cloneAutoGeneratedRoles($new_obj);
$this->cloneMetaData($new_obj);
// Assign admin
$new_obj->getMemberObject()->add($ilUser->getId(),IL_CRS_ADMIN);
// #14596
$cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
if($cwo->isRootNode($this->getRefId()))
{
$this->setOfflineStatus(true);
}
// Copy settings
$this->cloneSettings($new_obj);
// Course Defined Fields
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
// Clone course files
include_once('Modules/Course/classes/class.ilCourseFile.php');
ilCourseFile::_cloneFiles($this->getId(),$new_obj->getId());
// Copy learning progress settings
include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
$obj_settings = new ilLPObjSettings($this->getId());
$obj_settings->cloneSettings($new_obj->getId());
unset($obj_settings);
// clone icons
global $ilLog;
$ilLog->write(__METHOD__.': '.$this->getBigIconPath().' '.$this->getSmallIconPath());
$new_obj->saveIcons($this->getBigIconPath(),
$this->getSmallIconPath(),
$this->getTinyIconPath());
// clone certificate (#11085)
include_once "./Services/Certificate/classes/class.ilCertificate.php";
include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
$cert = new ilCertificate(new ilCourseCertificateAdapter($this));
$newcert = new ilCertificate(new ilCourseCertificateAdapter($new_obj));
$cert->cloneCertificate($newcert);
return $new_obj;
}

+ Here is the call graph for this function:

ilObjCourse::cloneSettings (   $new_obj)

Clone entries in settings table.

public

Parameters
ilObjCoursenew course object

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

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

Referenced by cloneObject().

{
$new_obj->setSyllabus($this->getSyllabus());
$new_obj->setContactName($this->getContactName());
$new_obj->setContactResponsibility($this->getContactResponsibility());
$new_obj->setContactPhone($this->getContactPhone());
$new_obj->setContactEmail($this->getContactEmail());
$new_obj->setContactConsultation($this->getContactConsultation());
$new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
$new_obj->setActivationType($this->getActivationType());
$new_obj->setActivationStart($this->getActivationStart());
$new_obj->setActivationEnd($this->getActivationEnd());
$new_obj->setActivationVisibility($this->getActivationVisibility());
$new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
$new_obj->setSubscriptionStart($this->getSubscriptionStart());
$new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
$new_obj->setSubscriptionType($this->getSubscriptionType());
$new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
$new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
$new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
$new_obj->setSubscriptionNotify($this->getSubscriptionNotify());
$new_obj->setViewMode($this->getViewMode());
$new_obj->setOrderType($this->getOrderType());
$new_obj->setArchiveStart($this->getArchiveStart());
$new_obj->setArchiveEnd($this->getArchiveEnd());
$new_obj->setArchiveType($this->getArchiveType());
$new_obj->setAboStatus($this->getAboStatus());
$new_obj->enableWaitingList($this->enabledWaitingList());
$new_obj->setImportantInformation($this->getImportantInformation());
$new_obj->setShowMembers($this->getShowMembers());
$new_obj->enableSessionLimit($this->isSessionLimitEnabled());
$new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
$new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
$new_obj->setAutoNotification( $this->getAutoNotification() );
$new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
$new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
$new_obj->setStatusDetermination($this->getStatusDetermination());
$new_obj->setMailToMembersType($this->getMailToMembersType());
$new_obj->update();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::create (   $a_upload = false)

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

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

{
global $ilAppEventHandler;
parent::create($a_upload);
if(!$a_upload)
{
$this->createMetaData();
}
$ilAppEventHandler->raise('Modules/Course',
'create',
array('object' => $this,
'obj_id' => $this->getId(),
'appointments' => $this->prepareAppointments('create')));
}

+ Here is the call graph for this function:

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

Reimplemented from ilObject.

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

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

{
global $ilAppEventHandler;
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
// delete meta data
$this->deleteMetaData();
// put here course specific stuff
$this->__deleteSettings();
include_once('Modules/Course/classes/class.ilCourseParticipants.php');
$this->archives_obj->deleteAll();
include_once './Modules/Course/classes/class.ilCourseObjective.php';
include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
include_once './Modules/Course/classes/class.ilCourseFile.php';
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
$ilAppEventHandler->raise('Modules/Course',
'delete',
array('object' => $this,
'obj_id' => $this->getId(),
'appointments' => $this->prepareAppointments('delete')));
return true;
}

+ Here is the call graph for this function:

ilObjCourse::enabledObjectiveView ( )

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

References IL_CRS_VIEW_OBJECTIVE.

{
return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
}
ilObjCourse::enabledWaitingList ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::enableRegistrationAccessCode (   $a_status)

En/disable registration access code.

Parameters
object$a_status
Returns

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

Referenced by __readSettings().

{
$this->reg_access_code_enabled = $a_status;
}

+ Here is the caller graph for this function:

ilObjCourse::enableSessionLimit (   $a_status)

en/disable limited number of sessions

Returns
Parameters
object$a_status

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

Referenced by __readSettings().

{
$this->session_limit = $a_status;
}

+ Here is the caller graph for this function:

ilObjCourse::enableSubscriptionMembershipLimitation (   $a_status)

enable max members

public

Parameters
boolstatus
Returns

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

Referenced by __readSettings().

{
$this->subscription_membership_limitation = $a_status;
}

+ Here is the caller graph for this function:

ilObjCourse::enableWaitingList (   $a_status)

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

Referenced by __readSettings().

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

+ Here is the caller graph for this function:

ilObjCourse::getAboStatus ( )

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

Referenced by cloneSettings(), and updateSettings().

{
return $this->abo;
}

+ Here is the caller graph for this function:

ilObjCourse::getActivationEnd ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getActivationStart ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getActivationType ( )

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

Referenced by cloneSettings(), and validate().

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

+ Here is the caller graph for this function:

ilObjCourse::getActivationUnlimitedStatus ( )

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

References IL_CRS_ACTIVATION_UNLIMITED.

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

{
return $this->activation_type == IL_CRS_ACTIVATION_UNLIMITED;
}

+ Here is the caller graph for this function:

ilObjCourse::getActivationVisibility ( )

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

Referenced by cloneSettings(), and updateSettings().

{
return $this->activation_visibility;
}

+ Here is the caller graph for this function:

ilObjCourse::getArchiveEnd ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getArchiveStart ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getArchiveType ( )

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

References IL_CRS_ARCHIVE_DOWNLOAD, and IL_CRS_ARCHIVE_NONE.

Referenced by cloneSettings(), and updateSettings().

{
return $this->archive_type ? IL_CRS_ARCHIVE_DOWNLOAD : IL_CRS_ARCHIVE_NONE;
}

+ Here is the caller graph for this function:

ilObjCourse::getAutoNotification ( )

Returns automatic notification status from $this->auto_notification.

Returns
boolean

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

References $auto_notification.

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

+ Here is the caller graph for this function:

ilObjCourse::getContactConsultation ( )

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

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

{
return $this->contact_consultation;
}

+ Here is the caller graph for this function:

ilObjCourse::getContactEmail ( )

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

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

{
return $this->contact_email;
}

+ Here is the caller graph for this function:

ilObjCourse::getContactName ( )

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

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

{
return $this->contact_name;
}

+ Here is the caller graph for this function:

ilObjCourse::getContactPhone ( )

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

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

{
return $this->contact_phone;
}

+ Here is the caller graph for this function:

ilObjCourse::getContactResponsibility ( )

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

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

{
return $this->contact_responsibility;
}

+ Here is the caller graph for this function:

ilObjCourse::getDefaultAdminRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

{
$local_roles = $this->__getLocalRoles();
foreach($local_roles as $role_id)
{
if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
{
if(!strcmp($tmp_role->getTitle(),"il_crs_admin_".$this->getRefId()))
{
return $role_id;
}
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::getDefaultCourseRoles (   $a_crs_id = "")

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

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

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

References ilObject\getRefId().

Referenced by __setCourseStatus().

{
global $rbacadmin, $rbacreview;
if (strlen($a_crs_id) > 0)
{
$crs_id = $a_crs_id;
}
else
{
$crs_id = $this->getRefId();
}
$rolf = $rbacreview->getRoleFolderOfObject($crs_id);
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
$role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
$crs_Member ="il_crs_member_".$crs_id;
$crs_Admin ="il_crs_admin_".$crs_id;
$crs_Tutor ="il_crs_tutor_".$crs_id;
if (strcmp($role_Obj->getTitle(), $crs_Member) == 0 )
{
$arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
}
if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0)
{
$arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
}
if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0)
{
$arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
}
}
return $arr_crsDefaultRoles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::getDefaultMemberRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

{
$local_roles = $this->__getLocalRoles();
foreach($local_roles as $role_id)
{
if(substr($title,0,8) == 'il_crs_m')
{
return $role_id;
}
}
return 0;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::getDefaultTutorRole ( )

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

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

Referenced by cloneAutoGeneratedRoles().

{
$local_roles = $this->__getLocalRoles();
foreach($local_roles as $role_id)
{
if($tmp_role =& ilObjectFactory::getInstanceByObjId($role_id,false))
{
if(!strcmp($tmp_role->getTitle(),"il_crs_tutor_".$this->getRefId()))
{
return $role_id;
}
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::getEnableCourseMap ( )

Get Enable Course Map.

Returns
boolean Enable Course Map

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

References $enablemap.

Referenced by __createDefaultSettings(), and updateSettings().

{
}

+ Here is the caller graph for this function:

ilObjCourse::getImportantInformation ( )

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

Referenced by cloneSettings(), and updateSettings().

{
return $this->important;
}

+ Here is the caller graph for this function:

ilObjCourse::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

Referenced by __createDefaultSettings(), and updateSettings().

{
}

+ Here is the caller graph for this function:

ilObjCourse::getLocalCourseRoles (   $a_translate = false)

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

info is stored in object variable public

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

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

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

{
global $rbacadmin,$rbacreview;
if (empty($this->local_roles))
{
$this->local_roles = array();
$rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
if ($rbacreview->isAssignable($role_id,$rolf["ref_id"]) == true)
{
$role_Obj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
if ($a_translate)
{
$role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
}
else
{
$role_name = $role_Obj->getTitle();
}
$this->local_roles[$role_name] = $role_Obj->getId();
}
}
}
return $this->local_roles;
}

+ Here is the call graph for this function:

ilObjCourse::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

References $locationzoom.

Referenced by __createDefaultSettings(), and updateSettings().

{
}

+ Here is the caller graph for this function:

ilObjCourse::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

Referenced by __createDefaultSettings(), and updateSettings().

{
}

+ Here is the caller graph for this function:

ilObjCourse::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

References $mail_members.

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

{
}

+ Here is the caller graph for this function:

ilObjCourse::getMemberObject ( )

Get course member object.

Returns
ilCourseParticipant

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

References $member_obj, and initCourseMemberObject().

{
if(!$this->member_obj instanceof ilCourseParticipant)
{
}
}

+ Here is the call graph for this function:

ilObjCourse::getMembersObject ( )
Deprecated:
Returns
ilCourseParticipants

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

References $members_obj, and initCourseMembersObject().

Referenced by checkLPStatusSync(), and syncMembersStatusWithLP().

{
if(!$this->members_obj instanceof ilCourseParticipants)
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::getMessage ( )

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

Referenced by appendMessage(), and validate().

{
return $this->message;
}

+ Here is the caller graph for this function:

ilObjCourse::getNumberOfNextSessions ( )

Set number of previous sessions.

Returns

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

References $session_next.

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

{
}

+ Here is the caller graph for this function:

ilObjCourse::getNumberOfPreviousSessions ( )

Set number of previous sessions.

Returns

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

References $session_prev.

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

{
}

+ Here is the caller graph for this function:

ilObjCourse::getOfflineStatus ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getRegistrationAccessCode ( )

get access code

Returns

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

References $reg_access_code.

Referenced by __createDefaultSettings(), and updateSettings().

+ Here is the caller graph for this function:

ilObjCourse::getShowMembers ( )

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

Referenced by cloneSettings(), and updateSettings().

{
return $this->show_members;
}

+ Here is the caller graph for this function:

ilObjCourse::getStatusDetermination ( )

Get status determination mode.

Returns
int

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

References $status_dt.

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

{
}

+ Here is the caller graph for this function:

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

Get subitems of container.

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

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

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

{
global $ilUser;
// Caching
if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]))
{
return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
}
// Results are stored in $this->items
parent::getSubItems($a_admin_panel_enabled,$a_include_side_block);
// No sessions
if(!is_array($this->items['sess']) or !$this->items['sess'])
{
return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
}
// No session limit
if(!$this->isSessionLimitEnabled() or $a_admin_panel_enabled)
{
return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
}
if($a_include_side_block)
{
return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
}
// @todo move to gui class
if(isset($_GET['crs_prev_sess']))
{
$ilUser->writePref('crs_sess_show_prev_'.$this->getId(), (string) (int) $_GET['crs_prev_sess']);
}
if(isset($_GET['crs_next_sess']))
{
$ilUser->writePref('crs_sess_show_next_'.$this->getId(), (string) (int) $_GET['crs_next_sess']);
}
$sessions = ilUtil::sortArray($this->items['sess'],'start','ASC',true,false);
$today = new ilDate(date('Ymd',time()),IL_CAL_DATE);
$previous = $current = $next = array();
foreach($sessions as $key => $item)
{
$start = new ilDateTime($item['start'],IL_CAL_UNIX);
$end = new ilDateTime($item['end'],IL_CAL_UNIX);
if(ilDateTime::_within($today, $start, $end, IL_CAL_DAY))
{
$current[] = $item;
}
elseif(ilDateTime::_before($start, $today, IL_CAL_DAY))
{
$previous[] = $item;
}
elseif(ilDateTime::_after($start, $today, IL_CAL_DAY))
{
$next[] = $item;
}
}
$num_previous_remove = max(
count($previous) - $this->getNumberOfPreviousSessions(),
0
);
while($num_previous_remove--)
{
if(!$ilUser->getPref('crs_sess_show_prev_'.$this->getId()))
{
array_shift($previous);
}
$this->items['sess_link']['prev']['value'] = 1;
}
$num_next_remove = max(
count($next) - $this->getNumberOfNextSessions(),
0
);
while($num_next_remove--)
{
if(!$ilUser->getPref('crs_sess_show_next_'.$this->getId()))
{
array_pop($next);
}
// @fixme
$this->items['sess_link']['next']['value'] = 1;
}
$sessions = array_merge($previous,$current,$next);
$this->items['sess'] = $sessions;
// #15389 - see ilContainer::getSubItems()
include_once('Services/Container/classes/class.ilContainerSorting.php');
$this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block] = $sort->sortItems($this->items);
return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
}

+ Here is the call graph for this function:

ilObjCourse::getSubscriptionEnd ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionLimitationType ( )

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

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

{
return $this->subscription_limitation_type;
}

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionMaxMembers ( )

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

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

{
return $this->subscription_max_members;
}

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionNotify ( )

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

Referenced by cloneSettings(), and updateSettings().

{
return true;
return $this->subscription_notify ? true : false;
}

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionPassword ( )

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

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

{
return $this->subscription_password;
}

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionStart ( )

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionType ( )

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

References IL_CRS_SUBSCRIPTION_DIRECT.

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

{
return $this->subscription_type ? $this->subscription_type : IL_CRS_SUBSCRIPTION_DIRECT;
#return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
}

+ Here is the caller graph for this function:

ilObjCourse::getSubscriptionUnlimitedStatus ( )

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

References IL_CRS_SUBSCRIPTION_UNLIMITED.

Referenced by inSubscriptionTime().

{
return $this->subscription_limitation_type == IL_CRS_SUBSCRIPTION_UNLIMITED;
}

+ Here is the caller graph for this function:

ilObjCourse::getSyllabus ( )

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

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

{
return $this->syllabus;
}

+ Here is the caller graph for this function:

ilObjCourse::getViewMode ( )

Get container view mode.

Reimplemented from ilContainer.

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

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

{
return $this->view_mode;
}

+ Here is the caller graph for this function:

ilObjCourse::hasContactData ( )

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

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

{
return strlen($this->getContactName()) or
strlen($this->getContactResponsibility()) or
strlen($this->getContactEmail()) or
strlen($this->getContactPhone()) or
strlen($this->getContactConsultation());
}

+ Here is the call graph for this function:

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

Constructor public.

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

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

References setStatusDetermination().

{
#define("ILIAS_MODULE","course");
#define("KEEP_IMAGE_PATH",1);
$this->SUBSCRIPTION_DEACTIVATED = 1;
$this->SUBSCRIPTION_CONFIRMATION = 2;
$this->SUBSCRIPTION_DIRECT = 3;
$this->SUBSCRIPTION_PASSWORD = 4;
$this->SUBSCRIPTION_AUTOSUBSCRIPTION = 5;
$this->ARCHIVE_DISABLED = 1;
$this->ARCHIVE_READ = 2;
$this->ARCHIVE_DOWNLOAD = 3;
$this->ABO_ENABLED = 1;
$this->ABO_DISABLED = 0;
$this->SHOW_MEMBERS_ENABLED = 1;
$this->SHOW_MEMBERS_DISABLED = 0;
$this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
$this->type = "crs";
parent::__construct($a_id,$a_call_by_reference);
}

+ Here is the call graph for this function:

ilObjCourse::initCourseArchiveObject ( )

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

Referenced by delete().

{
include_once "./Modules/Course/classes/class.ilCourseArchives.php";
if(!is_object($this->archives_obj))
{
$this->archives_obj =& new ilCourseArchives($this);
}
return true;
}

+ Here is the caller graph for this function:

ilObjCourse::initCourseMemberObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMemberObject().

{
global $ilUser;
include_once "./Modules/Course/classes/class.ilCourseParticipant.php";
$this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(),$ilUser->getId());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::initCourseMembersObject ( )
protected

Init course member object ilObjUser $ilUser.

Returns
<type>

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

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

Referenced by getMembersObject().

{
global $ilUser;
include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
$this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::initDefaultRoles ( )

init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public

Returns
array empty array

Reimplemented from ilObject.

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

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

{
global $rbacadmin,$rbacreview,$ilDB;
$rolf_obj = $this->createRoleFolder();
// CREATE ADMIN ROLE
$role_obj = $rolf_obj->createRole("il_crs_admin_".$this->getRefId(),"Admin of course obj_no.".$this->getId());
$admin_id = $role_obj->getId();
// SET PERMISSION TEMPLATE OF NEW LOCAL ADMIN ROLE
$query = "SELECT obj_id FROM object_data ".
" WHERE type='rolt' AND title='il_crs_admin'";
$res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
// SET OBJECT PERMISSIONS OF COURSE OBJECT
$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"crs",$rolf_obj->getRefId());
$rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
// SET OBJECT PERMISSIONS OF ROLE FOLDER OBJECT
//$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"rolf",$rolf_obj->getRefId());
//$rbacadmin->grantPermission($role_obj->getId(),$ops,$rolf_obj->getRefId());
// CREATE TUTOR ROLE
// CREATE ROLE AND ASSIGN ROLE TO ROLEFOLDER...
$role_obj = $rolf_obj->createRole("il_crs_tutor_".$this->getRefId(),"Tutors of course obj_no.".$this->getId());
$member_id = $role_obj->getId();
// SET PERMISSION TEMPLATE OF NEW LOCAL ROLE
$query = "SELECT obj_id FROM object_data ".
" WHERE type='rolt' AND title='il_crs_tutor'";
$res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
// SET OBJECT PERMISSIONS OF COURSE OBJECT
$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"crs",$rolf_obj->getRefId());
$rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
// SET OBJECT PERMISSIONS OF ROLE FOLDER OBJECT
//$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"rolf",$rolf_obj->getRefId());
//$rbacadmin->grantPermission($role_obj->getId(),$ops,$rolf_obj->getRefId());
// CREATE MEMBER ROLE
// CREATE ROLE AND ASSIGN ROLE TO ROLEFOLDER...
$role_obj = $rolf_obj->createRole("il_crs_member_".$this->getRefId(),"Member of course obj_no.".$this->getId());
$member_id = $role_obj->getId();
// SET PERMISSION TEMPLATE OF NEW LOCAL ROLE
$query = "SELECT obj_id FROM object_data ".
" WHERE type='rolt' AND title='il_crs_member'";
$res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
// SET OBJECT PERMISSIONS OF COURSE OBJECT
$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"crs",$rolf_obj->getRefId());
$rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
// SET OBJECT PERMISSIONS OF ROLE FOLDER OBJECT
//$ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"rolf",$rolf_obj->getRefId());
//$rbacadmin->grantPermission($role_obj->getId(),$ops,$rolf_obj->getRefId());
unset($role_obj);
unset($rolf_obj);
// Break inheritance, create local roles and initialize permission
// settings depending on course status.
return true;
}

+ Here is the call graph for this function:

ilObjCourse::initWaitingList ( )

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

References ilObject\getId().

{
include_once "./Modules/Course/classes/class.ilCourseWaitingList.php";
if(!is_object($this->waiting_list_obj))
{
$this->waiting_list_obj = new ilCourseWaitingList($this->getId());
}
return true;
}

+ Here is the call graph for this function:

ilObjCourse::inSubscriptionTime ( )

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

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

Referenced by register().

{
{
return true;
}
if(time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd())
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::isActivated (   $a_check_archive = false)

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

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

{
if($a_check_archive)
{
if($this->isArchived())
{
return true;
}
}
if($this->getOfflineStatus())
{
return false;
}
{
return true;
}
if(time() < $this->getActivationStart() or
time() > $this->getActivationEnd())
{
return false;
}
return true;
}

+ Here is the call graph for this function:

ilObjCourse::isArchived ( )

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

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

Referenced by isActivated().

{
{
return false;
}
if(time() < $this->getArchiveStart() or time() > $this->getArchiveEnd())
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

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

References $reg_access_code_enabled.

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

{
}

+ Here is the caller graph for this function:

ilObjCourse::isSessionLimitEnabled ( )

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

References $session_limit.

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

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

+ Here is the caller graph for this function:

ilObjCourse::isSubscriptionMembershipLimited ( )

is membership limited

public

Parameters
@return

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

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

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

+ Here is the caller graph for this function:

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

Implements ilMembershipRegistrationCodes.

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

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

{
global $ilDB;
$query = "SELECT obj_id FROM crs_settings ".
"WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
"AND reg_ac = ".$ilDB->quote($a_code,'text');
$res = $ilDB->query($query);
$obj_ids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids;
}

+ Here is the caller graph for this function:

static ilObjCourse::lookupShowMembersEnabled (   $a_obj_id)
static

Check if show member is enabled.

Parameters
int$a_obj_id
Returns
bool

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

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

Referenced by ilParticipants\hasParticipantListAccess().

{
$query = 'SELECT show_members FROM crs_settings '.
'WHERE obj_id = '.$GLOBALS['ilDB']->quote($a_obj_id,'integer');
$res = $GLOBALS['ilDB']->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->show_members;
}
return false;
}

+ Here is the caller graph for this function:

ilObjCourse::MDUpdateListener (   $a_element)

Overwriten Metadata update listener for ECS functionalities.

public

Reimplemented from ilObject.

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

References $ilLog.

{
global $ilLog;
switch($a_element)
{
case 'General':
// Update ecs content
include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
$ecs = new ilECSCourseSettings($this);
$ecs->handleContentUpdate();
break;
default:
return true;
}
}
ilObjCourse::prepareAppointments (   $a_mode = 'create')
protected

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

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

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

{
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
include_once('./Services/Calendar/classes/class.ilDateTime.php');
switch($a_mode)
{
case 'create':
case 'update':
if(!$this->getActivationUnlimitedStatus() and !$this->getOfflineStatus())
{
$app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
$app->setTitle($this->getTitle());
$app->setSubtitle('crs_cal_activation_start');
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setDescription($this->getLongDescription());
$app->setStart(new ilDateTime($this->getActivationStart(),IL_CAL_UNIX));
$apps[] = $app;
$app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
$app->setTitle($this->getTitle());
$app->setSubtitle('crs_cal_activation_end');
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setDescription($this->getLongDescription());
$app->setStart(new ilDateTime($this->getActivationEnd(),IL_CAL_UNIX));
$apps[] = $app;
}
{
$app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
$app->setTitle($this->getTitle());
$app->setSubtitle('crs_cal_reg_start');
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setDescription($this->getLongDescription());
$app->setStart(new ilDateTime($this->getSubscriptionStart(),IL_CAL_UNIX));
$apps[] = $app;
$app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
$app->setTitle($this->getTitle());
$app->setSubtitle('crs_cal_reg_end');
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setDescription($this->getLongDescription());
$app->setStart(new ilDateTime($this->getSubscriptionEnd(),IL_CAL_UNIX));
$apps[] = $app;
}
return $apps ? $apps : array();
case 'delete':
// Nothing to do: The category and all assigned appointments will be deleted.
return array();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::read (   $a_force_db = false)

read object data from db into object

Parameters
booleanpublic

Reimplemented from ilObject.

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

References __readSettings(), and ilContainer\read().

{
parent::read($a_force_db);
$this->__readSettings();
}

+ Here is the call graph for this function:

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

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

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

{
global $ilCtrl, $tree;
include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
if($part->isAssigned($a_user_id))
{
return true;
}
if(!$a_force_registration)
{
// Availability
{
include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
{
throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
', course subscription is deactivated.', '456');
}
}
// Time Limitation
{
if( !$this->inSubscriptionTime() )
{
throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
', course is out of registration time.', '789');
}
}
// Max members
{
$free = max(0,$this->getSubscriptionMaxMembers() - $part->getCountMembers());
include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
$waiting_list = new ilCourseWaitingList($this->getId());
if($this->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
{
$waiting_list->addToList($a_user_id);
$this->lng->loadLanguageModule("crs");
$info = sprintf($this->lng->txt('crs_added_to_list'),
$waiting_list->getPosition($a_user_id));
include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
$participants->sendNotification($participants->NOTIFY_WAITING_LIST,$a_user_id);
throw new ilMembershipRegistrationException($info, '124');
}
if(!$this->enabledWaitingList() && !$free)
{
throw new ilMembershipRegistrationException('Cant registrate to course '.$this->getId().
', membership is limited.', '123');
}
}
}
$part->add($a_user_id,$a_role);
$part->sendNotification($part->NOTIFY_ACCEPT_USER, $a_user_id);
$part->sendNotification($part->NOTIFY_ADMINS,$a_user_id);
include_once './Modules/Forum/classes/class.ilForumNotification.php';
return true;
}

+ Here is the call graph for this function:

ilObjCourse::setAboStatus (   $a_status)

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

Referenced by __readSettings().

{
$this->abo = $a_status;
}

+ Here is the caller graph for this function:

ilObjCourse::setActivationEnd (   $a_value)

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

Referenced by __readSettings().

{
$this->activation_end = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setActivationStart (   $a_value)

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

Referenced by __readSettings().

{
$this->activation_start = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setActivationType (   $a_type)

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

References IL_CRS_ACTIVATION_OFFLINE, IL_CRS_ACTIVATION_UNLIMITED, and setOfflineStatus().

Referenced by __readSettings().

{
// offline is separate property now
{
$this->setOfflineStatus(true);
}
$this->activation_type = $a_type;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::setActivationVisibility (   $a_value)

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

Referenced by __readSettings().

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

+ Here is the caller graph for this function:

ilObjCourse::setArchiveEnd (   $a_value)

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

Referenced by __readSettings().

{
$this->archive_end = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setArchiveStart (   $a_value)

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

Referenced by __readSettings().

{
$this->archive_start = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setArchiveType (   $a_value)

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

Referenced by __readSettings().

{
$this->archive_type = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setAutoNotification (   $value)

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

Parameters
mixedboolean

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

Referenced by __readSettings().

{
$this->auto_notification = $value;
}

+ Here is the caller graph for this function:

ilObjCourse::setContactConsultation (   $a_value)

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

Referenced by __readSettings().

{
$this->contact_consultation = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setContactEmail (   $a_value)

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

Referenced by __readSettings().

{
$this->contact_email = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setContactName (   $a_cn)

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

Referenced by __readSettings().

{
$this->contact_name = $a_cn;
}

+ Here is the caller graph for this function:

ilObjCourse::setContactPhone (   $a_value)

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

Referenced by __readSettings().

{
$this->contact_phone = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setContactResponsibility (   $a_value)

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

Referenced by __readSettings().

{
$this->contact_responsibility = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setEnableCourseMap (   $a_enablemap)

Set Enable Course Map.

Parameters
boolean$a_enablemapEnable Course Map

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

Referenced by __readSettings().

{
$this->enablemap = $a_enablemap;
}

+ Here is the caller graph for this function:

ilObjCourse::setImportantInformation (   $a_info)

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

Referenced by __readSettings().

{
$this->important = $a_info;
}

+ Here is the caller graph for this function:

ilObjCourse::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by __readSettings().

{
$this->latitude = $a_latitude;
}

+ Here is the caller graph for this function:

ilObjCourse::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by __readSettings().

{
$this->locationzoom = $a_locationzoom;
}

+ Here is the caller graph for this function:

ilObjCourse::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by __readSettings().

{
$this->longitude = $a_longitude;
}

+ Here is the caller graph for this function:

ilObjCourse::setMailToMembersType (   $a_type)

Set mail to members type.

See Also
ilCourseConstants
Parameters
type$a_type

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

Referenced by __readSettings().

{
$this->mail_members = $a_type;
}

+ Here is the caller graph for this function:

ilObjCourse::setMessage (   $a_message)

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

Referenced by validate().

{
$this->message = $a_message;
}

+ Here is the caller graph for this function:

ilObjCourse::setNumberOfNextSessions (   $a_num)

Set number of previous sessions.

Returns
Parameters
int$a_num

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

Referenced by __readSettings().

{
$this->session_next = $a_num;
}

+ Here is the caller graph for this function:

ilObjCourse::setNumberOfPreviousSessions (   $a_num)

Set number of previous sessions.

Returns
Parameters
int$a_num

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

Referenced by __readSettings().

{
$this->session_prev = $a_num;
}

+ Here is the caller graph for this function:

ilObjCourse::setOfflineStatus (   $a_value)

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

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

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

+ Here is the caller graph for this function:

ilObjCourse::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

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

Referenced by __createDefaultSettings(), and __readSettings().

{
$this->reg_access_code = $a_code;
}

+ Here is the caller graph for this function:

ilObjCourse::setShowMembers (   $a_status)

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

Referenced by __readSettings().

{
$this->show_members = $a_status;
}

+ Here is the caller graph for this function:

ilObjCourse::setStatusDetermination (   $a_value)

Set status determination mode.

Parameters
int$a_value

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

References ilObjUserTracking\_enabledLearningProgress(), and STATUS_DETERMINATION_MANUAL.

Referenced by __readSettings(), and ilObjCourse().

{
$a_value = (int)$a_value;
// #13905
if($a_value == self::STATUS_DETERMINATION_LP)
{
include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
{
}
}
$this->status_dt = $a_value;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionEnd (   $a_value)

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

Referenced by __readSettings().

{
$this->subscription_end = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionLimitationType (   $a_type)

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

Referenced by __readSettings().

{
$this->subscription_limitation_type = $a_type;
}

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionMaxMembers (   $a_value)

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

Referenced by __readSettings().

{
$this->subscription_max_members = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionNotify (   $a_value)

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

Referenced by __readSettings().

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

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionPassword (   $a_value)

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

Referenced by __readSettings().

{
$this->subscription_password = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionStart (   $a_value)

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

Referenced by __readSettings().

{
$this->subscription_start = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setSubscriptionType (   $a_value)

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

Referenced by __readSettings().

{
$this->subscription_type = $a_value;
}

+ Here is the caller graph for this function:

ilObjCourse::setSyllabus (   $a_syllabus)

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

Referenced by __readSettings().

{
$this->syllabus = $a_syllabus;
}

+ Here is the caller graph for this function:

ilObjCourse::setViewMode (   $a_mode)

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

Referenced by __readSettings().

{
$this->view_mode = $a_mode;
}

+ Here is the caller graph for this function:

ilObjCourse::syncMembersStatusWithLP ( )

Set course status for all members by lp status.

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

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

{
include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
foreach($this->getMembersObject()->getParticipants() as $user_id)
{
// #15529 - force raise on sync
ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, false, true);
}
}

+ Here is the call graph for this function:

ilObjCourse::update ( )

update complete object

Reimplemented from ilContainer.

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

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

{
global $ilAppEventHandler,$ilLog;
include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
$sorting = new ilContainerSortingSettings($this->getId());
$sorting->setSortMode($this->getOrderType());
$sorting->update();
$this->updateMetaData();
$this->updateSettings();
$ilAppEventHandler->raise('Modules/Course',
'update',
array('object' => $this,
'obj_id' => $this->getId(),
'appointments' => $this->prepareAppointments('update')));
}

+ Here is the call graph for this function:

ilObjCourse::updateSettings ( )

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

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

Referenced by update().

{
global $ilDB;
// Due to a bug 3.5.alpha maybe no settings exist. => create default settings
$query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
$res = $ilDB->query($query);
if(!$res->numRows())
{
}
$query = "UPDATE crs_settings SET ".
"syllabus = ".$ilDB->quote($this->getSyllabus() ,'text').", ".
"contact_name = ".$ilDB->quote($this->getContactName() ,'text').", ".
"contact_responsibility = ".$ilDB->quote($this->getContactResponsibility() ,'text').", ".
"contact_phone = ".$ilDB->quote($this->getContactPhone() ,'text').", ".
"contact_email = ".$ilDB->quote($this->getContactEmail() ,'text').", ".
"contact_consultation = ".$ilDB->quote($this->getContactConsultation() ,'text').", ".
"activation_type = ".$ilDB->quote(!$this->getOfflineStatus() ,'integer').", ".
"sub_limitation_type = ".$ilDB->quote($this->getSubscriptionLimitationType() ,'integer').", ".
"sub_start = ".$ilDB->quote($this->getSubscriptionStart() ,'integer').", ".
"sub_end = ".$ilDB->quote($this->getSubscriptionEnd() ,'integer').", ".
"sub_type = ".$ilDB->quote($this->getSubscriptionType() ,'integer').", ".
"sub_password = ".$ilDB->quote($this->getSubscriptionPassword() ,'text').", ".
"sub_mem_limit = ".$ilDB->quote((int) $this->isSubscriptionMembershipLimited() ,'integer').", ".
"sub_max_members = ".$ilDB->quote($this->getSubscriptionMaxMembers() ,'integer').", ".
"sub_notify = ".$ilDB->quote($this->getSubscriptionNotify() ,'integer').", ".
"view_mode = ".$ilDB->quote($this->getViewMode() ,'integer').", ".
"archive_start = ".$ilDB->quote($this->getArchiveStart() ,'integer').", ".
"archive_end = ".$ilDB->quote($this->getArchiveEnd() ,'integer').", ".
"archive_type = ".$ilDB->quote($this->getArchiveType() ,'integer').", ".
"abo = ".$ilDB->quote($this->getAboStatus() ,'integer').", ".
"waiting_list = ".$ilDB->quote($this->enabledWaitingList() ,'integer').", ".
"important = ".$ilDB->quote($this->getImportantInformation() ,'text').", ".
"show_members = ".$ilDB->quote($this->getShowMembers() ,'integer').", ".
"latitude = ".$ilDB->quote($this->getLatitude() ,'text').", ".
"longitude = ".$ilDB->quote($this->getLongitude() ,'text').", ".
"location_zoom = ".$ilDB->quote($this->getLocationZoom() ,'integer').", ".
"enable_course_map = ".$ilDB->quote((int) $this->getEnableCourseMap() ,'integer').", ".
'session_limit = '.$ilDB->quote($this->isSessionLimitEnabled(),'integer').', '.
'session_prev = '.$ilDB->quote($this->getNumberOfPreviousSessions(),'integer').', '.
'session_next = '.$ilDB->quote($this->getNumberOfNextSessions(),'integer').', '.
'reg_ac_enabled = '.$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
'reg_ac = '.$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
'auto_notification = '.$ilDB->quote( (int)$this->getAutoNotification(), 'integer').', '.
'status_dt = '.$ilDB->quote((int) $this->getStatusDetermination()).', '.
'mail_members_type = '.$ilDB->quote((int) $this->getMailToMembersType(),'integer').' '.
"WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')."";
$res = $ilDB->manipulate($query);
// moved activation to ilObjectActivation
if($this->ref_id)
{
include_once "./Services/Object/classes/class.ilObjectActivation.php";
$item = new ilObjectActivation;
{
}
else
{
$item->setTimingStart($this->getActivationStart());
$item->setTimingEnd($this->getActivationEnd());
$item->toggleVisible($this->getActivationVisibility());
}
$item->update($this->ref_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourse::validate ( )

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

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

{
$this->setMessage('');
#if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and
# $this->getSubscriptionType() == )
#{
# $this->appendMessage($this->lng->txt('crs_select_registration_type'));
#}
$this->getActivationEnd() < $this->getActivationStart())
{
$this->appendMessage($this->lng->txt("activation_times_not_valid"));
}
{
$this->appendMessage($this->lng->txt("subscription_times_not_valid"));
}
#if((!$this->getActivationUnlimitedStatus() and
# !$this->getSubscriptionUnlimitedStatus()) and
# ($this->getSubscriptionStart() > $this->getActivationEnd() or
# $this->getSubscriptionStart() < $this->getActivationStart() or
# $this->getSubscriptionEnd() > $this->getActivationEnd() or
# $this->getSubscriptionEnd() < $this->getActivationStart()))
#
#{
# $this->appendMessage($this->lng->txt("subscription_time_not_within_activation"));
#}
{
$this->appendMessage($this->lng->txt("crs_password_required"));
}
if($this->isSubscriptionMembershipLimited() and ($this->getSubscriptionMaxMembers() <= 0 or !is_numeric($this->getSubscriptionMaxMembers())))
{
$this->appendMessage($this->lng->txt("max_members_not_numeric"));
}
if(($this->getViewMode() == IL_CRS_VIEW_ARCHIVE) and
$this->getArchiveStart() > $this->getArchiveEnd())
{
$this->appendMessage($this->lng->txt("archive_times_not_valid"));
}
if(!$this->getTitle() || !$this->getStatusDetermination())
{
$this->appendMessage($this->lng->txt('err_check_input'));
}
return $this->getMessage() ? false : true;
}

+ Here is the call graph for this function:

ilObjCourse::validateInfoSettings ( )

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

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

{
global $ilErr;
$error = false;
if($this->getContactEmail()) {
$emails = split(",",$this->getContactEmail());
foreach ($emails as $email) {
$email = trim($email);
if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email)))
{
$ilErr->appendMessage($this->lng->txt('contact_email_not_valid')." '".$email."'");
$error = true;
}
}
}
return !$error;
}

+ Here is the call graph for this function:

Field Documentation

ilObjCourse::$archives_obj

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

ilObjCourse::$auto_notification = true
private

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

Referenced by getAutoNotification().

ilObjCourse::$enablemap = 0
private

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

Referenced by getEnableCourseMap().

ilObjCourse::$latitude = ''
private

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

Referenced by getLatitude().

ilObjCourse::$locationzoom = 0
private

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

Referenced by getLocationZoom().

ilObjCourse::$longitude = ''
private

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

Referenced by getLongitude().

ilObjCourse::$mail_members = ilCourseConstants::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

ilObjCourse::$member_obj = null
private

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

Referenced by getMemberObject().

ilObjCourse::$members_obj = null
private

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

Referenced by getMembersObject().

ilObjCourse::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

ilObjCourse::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

ilObjCourse::$session_limit = 0
private

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

Referenced by isSessionLimitEnabled().

ilObjCourse::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

ilObjCourse::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

ilObjCourse::$status_dt = null
private

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

Referenced by getStatusDetermination().

const ilObjCourse::CAL_ACTIVATION_END = 4

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

const ilObjCourse::CAL_ACTIVATION_START = 3

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

const ilObjCourse::CAL_REG_END = 2

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

const ilObjCourse::CAL_REG_START = 1

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

const ilObjCourse::STATUS_DETERMINATION_MANUAL = 2

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

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


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