Public Member Functions | Static Public Member Functions | Data Fields

ilObjCourse Class Reference

Inheritance diagram for ilObjCourse:
Collaboration diagram for ilObjCourse:

Public Member Functions

 ilObjCourse ($a_id=0, $a_call_by_reference=true)
 Constructor public.
 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 ()
 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 ()
 getSubscriptionMaxMembers ()
 setSubscriptionMaxMembers ($a_value)
 getSubscriptionNotify ()
 setSubscriptionNotify ($a_value)
 setViewMode ($a_mode)
 getViewMode ()
 _lookupViewMode ($a_id)
 getOrderType ()
 setOrderType ($a_value)
 getArchiveStart ()
 setArchiveStart ($a_value)
 getArchiveEnd ()
 setArchiveEnd ($a_value)
 getArchiveType ()
 setArchiveType ($a_value)
 setAboStatus ($a_status)
 getAboStatus ()
 setShowMembers ($a_status)
 getShowMembers ()
 getMessage ()
 setMessage ($a_message)
 appendMessage ($a_message)
 getMembers ()
 isActivated ($a_check_archive=false)
 _isActivated ($a_obj_id)
 Static version of isActive() to avoid instantiation of course object.
 _registrationEnabled ($a_obj_id)
 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 ()
 initCourseMemberObject ()
 initCourseItemObject ($a_child_id=0)
 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
 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)
 _deleteUser ($a_usr_id)

Static Public Member Functions

static _isSubscriptionNotificationEnabled ($a_course_id)
 Check if subscription notification is enabled.

Data Fields

 $members_obj
 $archives_obj
 $items_obj

Detailed Description

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


Member Function Documentation

ilObjCourse::__createDefaultSettings (  ) 

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

References $res, getActivationEnd(), getActivationStart(), getArchiveEnd(), getArchiveStart(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getEnableCourseMap(), ilObject::getId(), getLatitude(), getLocationZoom(), getLongitude(), getSubscriptionEnd(), getSubscriptionMaxMembers(), getSubscriptionPassword(), getSubscriptionStart(), and getSyllabus().

Referenced by create(), and updateSettings().

        {
                global $ilDB;

                $query = "INSERT INTO crs_settings SET ".
                        "obj_id = ".$ilDB->quote($this->getId()).", ".
                        "syllabus = ".$ilDB->quote($this->getSyllabus()).", ".
                        "contact_name = ".$ilDB->quote($this->getContactName()).", ".
                        "contact_responsibility = ".$ilDB->quote($this->getContactResponsibility()).", ".
                        "contact_phone = ".$ilDB->quote($this->getContactPhone()).", ".
                        "contact_email = ".$ilDB->quote($this->getContactEmail()).", ".
                        "contact_consultation = ".$ilDB->quote($this->getContactConsultation()).", ".
                        "activation_type = ".$ilDB->quote(IL_CRS_ACTIVATION_UNLIMITED).", ".
                        #"activation_unlimited = '1', ".
                        "activation_start = ".$ilDB->quote($this->getActivationStart()).", ".
                        "activation_end = ".$ilDB->quote($this->getActivationEnd()).", ".
                        #"activation_offline = '1', ".
                        "subscription_limitation_type = ".$ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED).", ".
                        #"subscription_unlimited = '1', ".
                        "subscription_start = ".$ilDB->quote($this->getSubscriptionStart()).", ".
                        "subscription_end = ".$ilDB->quote($this->getSubscriptionEnd()).", ".
                        "subscription_type = ".$ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT).", ".
                        "subscription_password = ".$ilDB->quote($this->getSubscriptionPassword()).", ".
                        "subscription_max_members = ".$ilDB->quote($this->getSubscriptionMaxMembers()).", ".
                        "subscription_notify = '1', ".
                        "view_mode = '0', ".
                        "sortorder = ".$ilDB->quote(IL_CRS_SORT_TITLE).", ".
                        "archive_start = ".$ilDB->quote($this->getArchiveStart()).", ".
                        "archive_end = ".$ilDB->quote($this->getArchiveEnd()).", ".
                        "archive_type = ".$ilDB->quote(IL_CRS_ARCHIVE_NONE).", ".
                        "abo = ".$ilDB->quote($this->ABO_ENABLED).", ".
                        "latitude = ".$ilDB->quote($this->getLatitude()).", ".
                        "longitude = ".$ilDB->quote($this->getLongitude()).", ".
                        "location_zoom = ".$ilDB->quote($this->getLocationZoom()).", ".
                        "enable_course_map = ".$ilDB->quote($this->getEnableCourseMap()).", ".
                        #"objective_view = '0', ".
                        "waiting_list = '1', ".
                        "show_members = '1'";

                $res = $ilDB->query($query);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjCourse::__deleteSettings (  ) 

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

References ilObject::getId().

Referenced by delete().

        {
                global $ilDB;
                
                $query = "DELETE FROM crs_settings ".
                        "WHERE obj_id = ".$ilDB->quote($this->getId())." ";

                $this->ilias->db->query($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:
return obj_id of roletemplate containing permissionsettings for non-member roles of a course.

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

References $res.

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);
                $row = $res->fetchRow(DB_FETCHMODE_ASSOC);

                return $row["obj_id"];
        }

Here is the caller graph for this function:

ilObjCourse::__getLocalRoles (  ) 

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

References $res, enableWaitingList(), ilObject::getId(), setAboStatus(), setActivationEnd(), setActivationStart(), setActivationType(), setArchiveEnd(), setArchiveStart(), setArchiveType(), setContactConsultation(), setContactEmail(), setContactName(), setContactPhone(), setContactResponsibility(), setEnableCourseMap(), setImportantInformation(), setLatitude(), setLocationZoom(), setLongitude(), setOrderType(), setShowMembers(), setSubscriptionEnd(), setSubscriptionLimitationType(), setSubscriptionMaxMembers(), setSubscriptionNotify(), setSubscriptionPassword(), setSubscriptionStart(), setSubscriptionType(), setSyllabus(), and setViewMode().

Referenced by read().

        {
                global $ilDB;

                $query = "SELECT * FROM crs_settings WHERE obj_id = ".$ilDB->quote($this->getId())."";

                $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->setActivationType($row->activation_type);
                        #$this->setActivationUnlimitedStatus($row->activation_unlimited);
                        $this->setActivationStart($row->activation_start);
                        $this->setActivationEnd($row->activation_end);
                        #$this->setOfflineStatus($row->activation_offline);
                        $this->setSubscriptionLimitationType($row->subscription_limitation_type);
                        #$this->setSubscriptionUnlimitedStatus($row->subscription_unlimited);
                        $this->setSubscriptionStart($row->subscription_start);
                        $this->setSubscriptionEnd($row->subscription_end);
                        $this->setSubscriptionType($row->subscription_type);
                        $this->setSubscriptionPassword($row->subscription_password);
                        $this->setSubscriptionMaxMembers($row->subscription_max_members);
                        $this->setSubscriptionNotify($row->subscription_notify);
                        $this->setViewMode($row->view_mode);
                        $this->setOrderType($row->sortorder);
                        $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);
                }
                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 1192 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 
)

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

References ilCourseParticipants::_hasPassed().

        {
                global $ilUser;

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

Here is the call graph for this function:

ilObjCourse::_deleteUser ( a_usr_id  ) 

Definition at line 1420 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';
                ilCourseLMHistory::_deleteUser($a_usr_id);

                include_once './Modules/Course/classes/class.ilCourseParticipants.php';
                ilCourseParticipants::_deleteUser($a_usr_id);

                // Course objectives
                include_once './Modules/Course/classes/class.ilCourseObjectiveResult.php';
                ilCourseObjectiveResult::_deleteUser($a_usr_id);
        }

Here is the caller graph for this function:

ilObjCourse::_isActivated ( a_obj_id  ) 

Static version of isActive() to avoid instantiation of course object.

Parameters:
int id of user
Returns:
boolean

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

References $res, and ilObject::$type.

Referenced by ilObjCourseAccess::_checkAccess(), ilObjCourseListGUI::getProperties(), and ilRepositoryExplorer::isClickable().

        {
                global $ilDB;

                $query = "SELECT * FROM crs_settings ".
                        "WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $type = $row->activation_type;
                        $start = $row->activation_start;
                        $end = $row->activation_end;
                }
                switch($type)
                {
                        case IL_CRS_ACTIVATION_OFFLINE:
                                return false;

                        case IL_CRS_ACTIVATION_UNLIMITED:
                                return true;

                        case IL_CRS_ACTIVATION_LIMITED:
                                if(time() < $start or
                                   time() > $end)
                                {
                                        return false;
                                }
                                return true;
                                
                        default:
                                return false;
                }
        }

Here is the caller graph for this function:

static ilObjCourse::_isSubscriptionNotificationEnabled ( a_course_id  )  [static]

Check if subscription notification is enabled.

public

Parameters:
int course_id

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

References $res.

Referenced by ilCourseParticipants::sendNotificationToAdmins(), ilCourseParticipants::sendSubscriptionRequestToAdmins(), and ilCourseParticipants::sendUnsubscribeNotificationToAdmins().

        {
                global $ilDB;
                
                $query = "SELECT * FROM crs_settings ".
                        "WHERE obj_id = ".$ilDB->quote($a_course_id)." ".
                        "AND subscription_notify = 1";
                $res = $ilDB->query($query);
                return $res->numRows() ? true : false;
        }

Here is the caller graph for this function:

ilObjCourse::_lookupViewMode ( a_id  ) 

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

References $res.

Referenced by ilLPObjSettings::_checkObjectives().

        {
                global $ilDB;

                $query = "SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id)." ";
                $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  ) 

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

References $res, and ilObject::$type.

Referenced by ilObjCourseAccess::_checkAccess().

        {
                global $ilDB;

                $query = "SELECT * FROM crs_settings ".
                        "WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $type = $row->subscription_limitation_type;
                        $reg_start = $row->subscription_start;
                        $reg_end = $row->subscription_end;
                }

                switch($type)
                {
                        case IL_CRS_SUBSCRIPTION_UNLIMITED:
                                return true;

                        case IL_CRS_SUBSCRIPTION_DEACTIVATED:
                                return false;

                        case IL_CRS_SUBSCRIPTION_LIMITED:
                                if(time() > $reg_start and
                                   time() < $reg_end)
                                {
                                        return true;
                                }
                        default:
                                return false;
                }
                return false;
        }

Here is the caller graph for this function:

ilObjCourse::allowAbo (  ) 

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

        {
                return $this->ABO == $this->ABO_ENABLED;
        }

ilObjCourse::appendMessage ( a_message  ) 

Definition at line 389 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::cloneAutoGeneratedRoles ( new_obj  ) 

Clone automatic genrated roles (permissions and template permissions).

public

Parameters:
object new course object

Definition at line 705 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:
int target ref id of new course
int copy id

Reimplemented from ilObject.

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

References ilEvent::_cloneEvent(), ilObject::getId(), ilObject::getRefId(), and initCourseItemObject().

        {
                global $ilObjDataCache;
                
                // 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
                $this->initCourseItemObject();
                $this->items_obj->cloneDependencies($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);
                
                include_once('Services/Tracking/classes/class.ilLPCollections.php');
                $lp_collection = new ilLPCollections($this->getId());
                $lp_collection->cloneCollections($a_target_id,$a_copy_id);              
                
                // Clone events including assigned materials
                include_once('Modules/Course/classes/Event/class.ilEvent.php');
                ilEvent::_cloneEvent($this->getId(),$ilObjDataCache->lookupObjId($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:
int target ref_id
int copy id

Reimplemented from ilObject.

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

References ilCourseDefinedFieldDefinition::_clone(), ilCourseFile::_cloneFiles(), cloneAutoGeneratedRoles(), ilObject::cloneMetaData(), cloneSettings(), and ilObject::getId().

        {
                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->initCourseMemberObject();
                $new_obj->members_obj->add($ilUser->getId(),IL_CRS_ADMIN);
                
                // 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);
                
                return $new_obj;
        }

Here is the call graph for this function:

ilObjCourse::cloneSettings ( new_obj  ) 

Clone entries in settings table.

public

Parameters:
object new course object

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

References enabledWaitingList(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationType(), getArchiveEnd(), getArchiveStart(), getArchiveType(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getImportantInformation(), getOrderType(), getShowMembers(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSyllabus(), and getViewMode().

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->setActivationType($this->getActivationType());
                $new_obj->setActivationStart($this->getActivationStart());
                $new_obj->setActivationEnd($this->getActivationEnd());
                $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->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->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 529 of file class.ilObjCourse.php.

References __createDefaultSettings(), ilObject::create(), and ilObject::createMetaData().

        {
                parent::create($a_upload);

                if(!$a_upload)
                {
                        $this->createMetaData();
                }
                $this->__createDefaultSettings();
        }

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

References __deleteSettings(), ilEvent::_deleteAll(), ilObjCourseGrouping::_deleteAll(), ilCourseObjective::_deleteAll(), ilCourseParticipants::_deleteAllEntries(), ilCourseDefinedFieldDefinition::_deleteByContainer(), ilCourseFile::_deleteByCourse(), ilObject::deleteMetaData(), ilObject::getId(), initCourseArchiveObject(), and initCourseItemObject().

        {
                // always call parent delete function first!!
                if (!parent::delete())
                {
                        return false;
                }


                // delete meta data
                $this->deleteMetaData();

                // put here course specific stuff

                $this->__deleteSettings();

                $this->initCourseItemObject();
                $this->items_obj->deleteAllEntries();

                include_once('Modules/Course/classes/class.ilCourseParticipants.php');
                ilCourseParticipants::_deleteAllEntries($this->getId());

                $this->initCourseArchiveObject();
                $this->archives_obj->deleteAll();

                include_once './Modules/Course/classes/class.ilCourseObjective.php';
                ilCourseObjective::_deleteAll($this->getId());

                include_once './Modules/Course/classes/class.ilObjCourseGrouping.php';
                ilObjCourseGrouping::_deleteAll($this->getId());

                include_once './Modules/Course/classes/Event/class.ilEvent.php';
                ilEvent::_deleteAll($this->getId());

                include_once './Modules/Course/classes/class.ilCourseFile.php';
                ilCourseFile::_deleteByCourse($this->getId());
                
                include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
                ilCourseDefinedFieldDefinition::_deleteByContainer($this->getId());
                
                return true;
        }

Here is the call graph for this function:

ilObjCourse::enabledObjectiveView (  ) 

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

        {
                return $this->view_mode == IL_CRS_VIEW_OBJECTIVE;
        }

ilObjCourse::enabledWaitingList (  ) 

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

Referenced by cloneSettings(), and updateSettings().

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

Here is the caller graph for this function:

ilObjCourse::enableWaitingList ( a_status  ) 

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

Referenced by __createDefaultSettings(), cloneSettings(), isActivated(), 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 177 of file class.ilObjCourse.php.

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

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

Here is the caller graph for this function:

ilObjCourse::getActivationType (  ) 

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

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

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

Here is the caller graph for this function:

ilObjCourse::getActivationUnlimitedStatus (  ) 

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

Referenced by isActivated().

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

Here is the caller graph for this function:

ilObjCourse::getArchiveEnd (  ) 

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

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::getContactConsultation (  ) 

Definition at line 131 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 147 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 123 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 139 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 155 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 1386 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:
returns the 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 1288 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 1354 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_member_".$this->getRefId()))
                                {
                                        return $role_id;
                                }
                        }
                }
                return false;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjCourse::getDefaultTutorRole (  ) 

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

Referenced by __createDefaultSettings(), and updateSettings().

        {
                return $this->enablemap;
        }

Here is the caller graph for this function:

ilObjCourse::getImportantInformation (  ) 

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

Referenced by __createDefaultSettings(), and updateSettings().

        {
                return $this->latitude;
        }

Here is the caller graph for this function:

ilObjCourse::getLocationZoom (  ) 

Get LocationZoom.

Returns:
int LocationZoom

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

Referenced by __createDefaultSettings(), and updateSettings().

        {
                return $this->locationzoom;
        }

Here is the caller graph for this function:

ilObjCourse::getLongitude (  ) 

Get Longitude.

Returns:
string Longitude

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

Referenced by __createDefaultSettings(), and updateSettings().

        {
                return $this->longitude;
        }

Here is the caller graph for this function:

ilObjCourse::getMembers (  ) 

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

        {
                return $this->members_obj->getMembers();
        }

ilObjCourse::getMessage (  ) 

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

Referenced by appendMessage(), and validate().

        {
                return $this->message;
        }

Here is the caller graph for this function:

ilObjCourse::getOfflineStatus (  ) 

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

Referenced by isActivated().

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

Here is the caller graph for this function:

ilObjCourse::getOrderType (  ) 

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

Referenced by cloneSettings(), and updateSettings().

        {
                return $this->order_type ? $this->order_type : IL_CRS_SORT_TITLE;
        }

Here is the caller graph for this function:

ilObjCourse::getShowMembers (  ) 

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

Referenced by cloneSettings(), and updateSettings().

        {
                return $this->show_members;
        }

Here is the caller graph for this function:

ilObjCourse::getSubscriptionEnd (  ) 

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

Referenced by __createDefaultSettings(), cloneSettings(), inSubscriptionTime(), 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 199 of file class.ilObjCourse.php.

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

        {
                return $this->subscription_limitation_type;
        }

Here is the caller graph for this function:

ilObjCourse::getSubscriptionMaxMembers (  ) 

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

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

        {
                return $this->subscription_max_members;
        }

Here is the caller graph for this function:

ilObjCourse::getSubscriptionNotify (  ) 

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

Referenced by cloneSettings(), and updateSettings().

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

Here is the caller graph for this function:

ilObjCourse::getSubscriptionPassword (  ) 

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

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

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

Here is the caller graph for this function:

ilObjCourse::getSubscriptionType (  ) 

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

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

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

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

        {
                return $this->syllabus;
        }

Here is the caller graph for this function:

ilObjCourse::getViewMode (  ) 

Definition at line 313 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 810 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:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

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

References ilObject::ilObject(), and initCourseMemberObject().

        {
                #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->SORT_MANUAL = 1;
                $this->SORT_TITLE = 2;
                $this->SORT_ACTIVATION = 3;
                $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->type = "crs";
                $this->ilObject($a_id,$a_call_by_reference);

                if($a_id)
                {
                        #$this->__initMetaObject();
                        $this->initCourseMemberObject();
                }
                else
                {

                }

        }

Here is the call graph for this function:

ilObjCourse::initCourseArchiveObject (  ) 

Definition at line 1089 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::initCourseItemObject ( a_child_id = 0  ) 

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

Referenced by cloneDependencies(), and delete().

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

Here is the caller graph for this function:

ilObjCourse::initCourseMemberObject (  ) 

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

References ilCourseParticipants::_getInstanceByObjId(), and ilObject::getId().

Referenced by ilObjCourse(), and validate().

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

References $res, __setCourseStatus(), ilObject::createRoleFolder(), 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.
                $this->__setCourseStatus();

                return true;
        }

Here is the call graph for this function:

ilObjCourse::initWaitingList (  ) 

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

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

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

Here is the call graph for this function:

ilObjCourse::isActivated ( a_check_archive = false  ) 

Definition at line 404 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;
                }
                if($this->getActivationUnlimitedStatus())
                {
                        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 505 of file class.ilObjCourse.php.

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

Referenced by isActivated().

        {
                if($this->getViewMode() != IL_CRS_VIEW_ARCHIVE)
                {
                        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::read ( a_force_db = false  ) 

read object data from db into object

Parameters:
boolean public

Reimplemented from ilObject.

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

References __readSettings().

        {
                parent::read($a_force_db);

                $this->__readSettings();
        }

Here is the call graph for this function:

ilObjCourse::setAboStatus ( a_status  ) 

Definition at line 364 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 189 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 181 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 168 of file class.ilObjCourse.php.

Referenced by __readSettings().

        {
                $this->activation_type = $a_type;
        }

Here is the caller graph for this function:

ilObjCourse::setArchiveEnd ( a_value  ) 

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

Referenced by __readSettings().

        {
                $this->archive_type = $a_value;
        }

Here is the caller graph for this function:

ilObjCourse::setContactConsultation ( a_value  ) 

Definition at line 135 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 151 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 127 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 143 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 159 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_enablemap Enable Course Map

Definition at line 605 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 111 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_latitude Latitude

Definition at line 545 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_locationzoom LocationZoom

Definition at line 585 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_longitude Longitude

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

Referenced by __readSettings().

        {
                $this->longitude = $a_longitude;
        }

Here is the caller graph for this function:

ilObjCourse::setMessage ( a_message  ) 

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

Referenced by validate().

        {
                $this->message = $a_message;
        }

Here is the caller graph for this function:

ilObjCourse::setOrderType ( a_value  ) 

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

Referenced by __readSettings().

        {
                $this->order_type = $a_value;
        }

Here is the caller graph for this function:

ilObjCourse::setShowMembers ( a_status  ) 

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

Referenced by __readSettings().

        {
                $this->show_members = $a_status;
        }

Here is the caller graph for this function:

ilObjCourse::setSubscriptionEnd ( a_value  ) 

Definition at line 223 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 203 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 276 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 304 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 240 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 215 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 232 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 119 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 309 of file class.ilObjCourse.php.

Referenced by __readSettings().

        {
                $this->view_mode = $a_mode;
        }

Here is the caller graph for this function:

ilObjCourse::update (  ) 

update complete object

Reimplemented from ilObject.

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

References ilObject::updateMetaData(), and updateSettings().

        {
                $this->updateMetaData();
                $this->updateSettings();
                parent::update();
        }

Here is the call graph for this function:

ilObjCourse::updateSettings (  ) 

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

References $res, __createDefaultSettings(), enabledWaitingList(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationType(), getArchiveEnd(), getArchiveStart(), getArchiveType(), getContactConsultation(), getContactEmail(), getContactName(), getContactPhone(), getContactResponsibility(), getEnableCourseMap(), ilObject::getId(), getImportantInformation(), getLatitude(), getLocationZoom(), getLongitude(), getOrderType(), getShowMembers(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSyllabus(), and getViewMode().

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())." ";
                $res = $ilDB->query($query);

                if(!$res->numRows())
                {
                        $this->__createDefaultSettings();
                }

                $query = "UPDATE crs_settings SET ".
                        "syllabus = ".$ilDB->quote($this->getSyllabus()).", ".
                        "contact_name = ".$ilDB->quote($this->getContactName()).", ".
                        "contact_responsibility = ".$ilDB->quote($this->getContactResponsibility()).", ".
                        "contact_phone = ".$ilDB->quote($this->getContactPhone()).", ".
                        "contact_email = ".$ilDB->quote($this->getContactEmail()).", ".
                        "contact_consultation = ".$ilDB->quote($this->getContactConsultation()).", ".
                        "activation_type = ".$ilDB->quote($this->getActivationType()).", ".
                        #"activation_unlimited = '".(int) $this->getActivationUnlimitedStatus()."', ".
                        "activation_start = ".$ilDB->quote($this->getActivationStart()).", ".
                        "activation_end = ".$ilDB->quote($this->getActivationEnd()).", ".
                        #"activation_offline = '".(int) $this->getOfflineStatus()."', ".
                        "subscription_limitation_type = ".$ilDB->quote($this->getSubscriptionLimitationType()).", ".
                        #"subscription_unlimited = '".(int) $this->getSubscriptionUnlimitedStatus()."', ".
                        "subscription_start = ".$ilDB->quote($this->getSubscriptionStart()).", ".
                        "subscription_end = ".$ilDB->quote($this->getSubscriptionEnd()).", ".
                        "subscription_type = ".$ilDB->quote($this->getSubscriptionType()).", ".
                        "subscription_password = ".$ilDB->quote($this->getSubscriptionPassword()).", ".
                        "subscription_max_members = ".$ilDB->quote($this->getSubscriptionMaxMembers()).", ".
                        "subscription_notify = ".$ilDB->quote($this->getSubscriptionNotify()).", ".
                        "view_mode = ".$ilDB->quote($this->getViewMode()).", ".
                        "sortorder = ".$ilDB->quote($this->getOrderType()).", ".
                        "archive_start = ".$ilDB->quote($this->getArchiveStart()).", ".
                        "archive_end = ".$ilDB->quote($this->getArchiveEnd()).", ".
                        "archive_type = ".$ilDB->quote($this->getArchiveType()).", ".
                        "abo = ".$ilDB->quote($this->getAboStatus()).", ".
                        #"objective_view = '".(int) $this->enabledObjectiveView()."', ".
                        "waiting_list = ".$ilDB->quote($this->enabledWaitingList()).", ".
                        "important = ".$ilDB->quote($this->getImportantInformation()).", ".
                        "show_members = ".$ilDB->quote($this->getShowMembers()).", ".
                        "latitude = ".$ilDB->quote($this->getLatitude()).", ".
                        "longitude = ".$ilDB->quote($this->getLongitude()).", ".
                        "location_zoom = ".$ilDB->quote($this->getLocationZoom()).", ".
                        "enable_course_map = ".$ilDB->quote($this->getEnableCourseMap())." ".
                        "WHERE obj_id = ".$ilDB->quote($this->getId())."";

                $res = $ilDB->query($query);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjCourse::validate (  ) 

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

References appendMessage(), getActivationEnd(), getActivationStart(), getActivationType(), getArchiveEnd(), getArchiveStart(), getMessage(), getSubscriptionEnd(), getSubscriptionLimitationType(), getSubscriptionMaxMembers(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getViewMode(), initCourseMemberObject(), and setMessage().

        {
                $this->initCourseMemberObject();

                $this->setMessage('');

                #if(($this->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) and
                #   $this->getSubscriptionType() == )
                #{
                #       $this->appendMessage($this->lng->txt('crs_select_registration_type'));
                #}

                if(($this->getActivationType() == IL_CRS_ACTIVATION_LIMITED) and
                   $this->getActivationEnd() < $this->getActivationStart())
                {
                        $this->appendMessage($this->lng->txt("activation_times_not_valid"));
                }
                if(($this->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_LIMITED) and
                   $this->getSubscriptionStart() > $this->getSubscriptionEnd())
                {
                        $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"));
                #}
                if($this->getSubscriptionType() == IL_CRS_SUBSCRIPTION_PASSWORD and !$this->getSubscriptionPassword())
                {
                        $this->appendMessage($this->lng->txt("crs_password_required"));
                }
                if($this->getSubscriptionMaxMembers() and !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"));
                }
                return $this->getMessage() ? false : true;
        }

Here is the call graph for this function:

ilObjCourse::validateInfoSettings (  ) 

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

ilObjCourse::$items_obj

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

ilObjCourse::$members_obj

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


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