Inheritance diagram for ilObjCourse:
Collaboration diagram for ilObjCourse:Public Member Functions | |
| ilObjCourse ($a_id=0, $a_call_by_reference=true) | |
| Constructor public. | |
| setId ($a_id) | |
| set object id public | |
| getDescription () | |
| get object description | |
| setDescription ($a_description) | |
| set object description | |
| getTitle () | |
| get object title public | |
| setTitle ($a_title) | |
| set object title | |
| getSyllabus () | |
| setSyllabus ($a_syllabus) | |
| getContactName () | |
| setContactName ($a_cn) | |
| getContactConsultation () | |
| setContactConsultation ($a_value) | |
| getContactPhone () | |
| setContactPhone ($a_value) | |
| getcontactEmail () | |
| setContactEmail ($a_value) | |
| getContactResponsibility () | |
| setContactResponsibility ($a_value) | |
| getActivationUnlimitedStatus () | |
| setActivationUnlimitedStatus ($a_unlimited) | |
| getActivationStart () | |
| setActivationStart ($a_value) | |
| getActivationEnd () | |
| setActivationEnd ($a_value) | |
| getOfflineStatus () | |
| setOfflineStatus ($a_value) | |
| getSubscriptionUnlimitedStatus () | |
| setSubscriptionUnlimitedStatus ($a_unlimited) | |
| getSubscriptionStart () | |
| setSubscriptionStart ($a_value) | |
| getSubscriptionEnd () | |
| getSubscriptionType () | |
| setSubscriptionType ($a_value) | |
| setSubscriptionEnd ($a_value) | |
| getSubscriptionPassword () | |
| setSubscriptionPassword ($a_value) | |
| setObjectiveViewStatus ($a_status) | |
| enabledObjectiveView () | |
| enabledWaitingList () | |
| enableWaitingList ($a_status) | |
| inSubscriptionTime () | |
| getSubscriptionMaxMembers () | |
| setSubscriptionMaxMembers ($a_value) | |
| getSubscriptionNotify () | |
| setSubscriptionNotify ($a_value) | |
| getOrderType () | |
| setOrderType ($a_value) | |
| getArchiveStart () | |
| setArchiveStart ($a_value) | |
| getArchiveEnd () | |
| setArchiveEnd ($a_value) | |
| getArchiveType () | |
| setArchiveType ($a_value) | |
| setAboStatus ($a_status) | |
| getAboStatus () | |
| 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) | |
| validate () | |
| ilClone ($a_parent_ref) | |
| copy all properties and subobjects of a course. | |
| delete () | |
| delete course and all related data | |
| 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 happend, each object may decide how it reacts. | |
| update () | |
| update meta data only | |
| updateSettings () | |
| __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 private | |
| __getLocalRoles () | |
| __deleteSettings () | |
| getDefaultMemberRole () | |
| getDefaultTutorRole () | |
| getDefaultAdminRole () | |
| _checkCondition ($a_obj_id, $a_operator, $a_value) | |
| _deleteUser ($a_usr_id) | |
| _goto ($a_target) | |
Data Fields | |
| $members_obj | |
| $archives_obj | |
| $items_obj | |
Definition at line 37 of file class.ilObjCourse.php.
| ilObjCourse::__createDefaultSettings | ( | ) |
Definition at line 793 of file class.ilObjCourse.php.
References $query, $res, getContactConsultation(), getContactName(), getContactPhone(), getContactResponsibility(), getSubscriptionMaxMembers(), and getSyllabus().
Referenced by create(), and updateSettings().
{
global $ilDB;
$query = "INSERT INTO crs_settings SET ".
"obj_id = '".$this->getId()."', ".
"syllabus = '".ilUtil::prepareDBString($this->getSyllabus())."', ".
"contact_name = '".ilUtil::prepareDBString($this->getContactName())."', ".
"contact_responsibility = '".ilUtil::prepareDBString($this->getContactResponsibility())."', ".
"contact_phone = '".ilUtil::prepareDBString($this->getContactPhone())."', ".
"contact_email = '".ilUtil::prepareDBString($this->getContactEmail())."', ".
"contact_consultation = '".ilUtil::prepareDBString($this->getContactConsultation())."', ".
"activation_unlimited = '1', ".
"activation_start = '".$this->getActivationStart()."', ".
"activation_end = '".$this->getActivationEnd()."', ".
"activation_offline = '1', ".
"subscription_unlimited = '1', ".
"subscription_start = '".$this->getSubscriptionStart()."', ".
"subscription_end = '".$this->getSubscriptionEnd()."', ".
"subscription_type = '".(int) $this->SUBSCRIPTION_DEACTIVATED."', ".
"subscription_password = '".ilUtil::prepareDBString($this->getSubscriptionPassword())."', ".
"subscription_max_members = '".(int) $this->getSubscriptionMaxMembers()."', ".
"subscription_notify = '1', ".
"sortorder = '".(int) $this->SORT_MANUAL."', ".
"archive_start = '".$this->getArchiveStart()."', ".
"archive_end = '".$this->getArchiveEnd()."', ".
"archive_type = '".(int) $this->ARCHIVE_DISABLED."', ".
"abo = '".(int) $this->ABO_ENABLED."', ".
"objective_view = '0', ".
"waiting_list = '1'";
$res = $ilDB->query($query);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjCourse::__deleteSettings | ( | ) |
| ilObjCourse::__getCrsNonMemberTemplateId | ( | ) |
get course non-member template private
| return | obj_id of roletemplate containing permissionsettings for non-member roles of a course. |
Definition at line 1077 of file class.ilObjCourse.php.
References $q, $res, and $row.
Referenced by __setCourseStatus().
{
$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::__getDefaultCourseRoles | ( | $ | a_crs_id = "" |
) |
get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_member private
| 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 1096 of file class.ilObjCourse.php.
References $rbacadmin, $rbacreview, $role_id, and 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::__getLocalRoles | ( | ) |
Definition at line 1139 of file class.ilObjCourse.php.
References $rbacreview, and 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 828 of file class.ilObjCourse.php.
References $query, $res, $row, enableWaitingList(), setAboStatus(), setActivationEnd(), setActivationStart(), setActivationUnlimitedStatus(), setArchiveEnd(), setArchiveStart(), setArchiveType(), setContactConsultation(), setContactEmail(), setContactName(), setContactPhone(), setContactResponsibility(), setObjectiveViewStatus(), setOfflineStatus(), setOrderType(), setSubscriptionEnd(), setSubscriptionMaxMembers(), setSubscriptionNotify(), setSubscriptionPassword(), setSubscriptionStart(), setSubscriptionType(), setSubscriptionUnlimitedStatus(), and setSyllabus().
Referenced by read().
{
global $ilDB;
$query = "SELECT * FROM crs_settings WHERE obj_id = '".$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->setActivationUnlimitedStatus($row->activation_unlimited);
$this->setActivationStart($row->activation_start);
$this->setActivationEnd($row->activation_end);
$this->setOfflineStatus($row->activation_offline);
$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->setOrderType($row->sortorder);
$this->setArchiveStart($row->archive_start);
$this->setArchiveEnd($row->archive_end);
$this->setArchiveType($row->archive_type);
$this->setAboStatus($row->abo);
$this->setObjectiveViewStatus($row->objective_view);
$this->enableWaitingList($row->waiting_list);
}
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 1002 of file class.ilObjCourse.php.
References $rbacadmin, $rbacreview, $rbacsystem, __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 1210 of file class.ilObjCourse.php.
References ilObject::$ilias, and ilCourseMembers::_hasPassed().
{
global $ilias;
include_once "./course/classes/class.ilCourseMembers.php";
switch($a_operator)
{
case 'passed':
return ilCourseMembers::_hasPassed($a_obj_id,$ilias->account->getId());
default:
return true;
}
}
Here is the call graph for this function:| ilObjCourse::_deleteUser | ( | $ | a_usr_id | ) |
Definition at line 1226 of file class.ilObjCourse.php.
Referenced by ilObjUser::delete().
{
// Delete all user related data
// delete lm_history
include_once './course/classes/class.ilCourseLMHistory.php';
ilCourseLMHistory::_deleteUser($a_usr_id);
include_once './course/classes/class.ilCourseMembers.php';
ilCourseMembers::_deleteUser($a_usr_id);
// Course objectives
include_once './course/classes/class.ilCourseObjectiveResult.php';
ilCourseObjectiveResult::_deleteUser($a_usr_id);
}
Here is the caller graph for this function:| ilObjCourse::_goto | ( | $ | a_target | ) |
Definition at line 1241 of file class.ilObjCourse.php.
References $_GET, $ilAccess, $ilErr, and ilObject::$lng.
| ilObjCourse::_isActivated | ( | $ | a_obj_id | ) |
Static version of isActive() to avoid instantiation of course object.
| int | id of user |
Definition at line 379 of file class.ilObjCourse.php.
References $query, $res, $row, and $start.
Referenced by ilObjCourseAccess::_checkAccess(), ilObjCourseListGUI::getProperties(), and ilRepositoryExplorer::isClickable().
{
global $ilDB;
$query = "SELECT * FROM crs_settings ".
"WHERE obj_id = '".$a_obj_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$offline = $row->activation_offline;
$unlimited = $row->activation_unlimited;
$start = $row->activation_start;
$end = $row->activation_end;
}
if($offline)
{
return false;
}
if($unlimited)
{
return true;
}
if(time() < $start or
time() > $end)
{
return false;
}
return true;
}
Here is the caller graph for this function:| ilObjCourse::_registrationEnabled | ( | $ | a_obj_id | ) |
Definition at line 410 of file class.ilObjCourse.php.
References $query, $res, and $row.
Referenced by ilObjCourseAccess::_checkAccess(), and ilObjCourseGUI::viewObject().
{
global $ilDB;
$query = "SELECT * FROM crs_settings ".
"WHERE obj_id = '".$a_obj_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$reg_unlimited = $row->subscription_unlimited;
$reg_start = $row->subscription_start;
$reg_end = $row->subscription_end;
$reg_type = $row->subscription_type;
}
if($reg_type == 1) // means deactivated
{
return false;
}
if($reg_unlimited)
{
return true;
}
if(time() > $reg_start and time() < $reg_end)
{
return true;
}
return false;
}
Here is the caller graph for this function:| ilObjCourse::allowAbo | ( | ) |
Definition at line 454 of file class.ilObjCourse.php.
{
return $this->ABO == $this->ABO_ENABLED;
}
| ilObjCourse::appendMessage | ( | $ | a_message | ) |
Definition at line 333 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::create | ( | $ | a_upload = false |
) |
Definition at line 465 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
Reimplemented from ilObject.
Definition at line 592 of file class.ilObjCourse.php.
References __deleteSettings(), ilObjCourseGrouping::_deleteAll(), ilCourseObjective::_deleteAll(), ilObject::deleteMetaData(), ilObject::getId(), initCourseArchiveObject(), initCourseItemObject(), and initCourseMemberObject().
{
// 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();
$this->initCourseMemberObject();
$this->members_obj->deleteAllEntries();
$this->initCourseArchiveObject();
$this->archives_obj->deleteAll();
include_once './course/classes/class.ilCourseObjective.php';
ilCourseObjective::_deleteAll($this->getId());
include_once './course/classes/class.ilObjCourseGrouping.php';
ilObjCourseGrouping::_deleteAll($this->getId());
return true;
}
Here is the call graph for this function:| ilObjCourse::enabledObjectiveView | ( | ) |
Definition at line 240 of file class.ilObjCourse.php.
Referenced by ilClone(), and updateSettings().
{
return (bool) $this->objective_view;
}
Here is the caller graph for this function:| ilObjCourse::enabledWaitingList | ( | ) |
Definition at line 245 of file class.ilObjCourse.php.
Referenced by updateSettings().
{
return (bool) $this->waiting_list;
}
Here is the caller graph for this function:| ilObjCourse::enableWaitingList | ( | $ | a_status | ) |
Definition at line 250 of file class.ilObjCourse.php.
Referenced by __readSettings(), and ilClone().
{
$this->waiting_list = (bool) $a_status;
}
Here is the caller graph for this function:| ilObjCourse::getAboStatus | ( | ) |
Definition at line 320 of file class.ilObjCourse.php.
Referenced by ilClone(), and updateSettings().
{
return $this->abo;
}
Here is the caller graph for this function:| ilObjCourse::getActivationEnd | ( | ) |
Definition at line 180 of file class.ilObjCourse.php.
Referenced by ilClone(), isActivated(), 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 172 of file class.ilObjCourse.php.
Referenced by ilClone(), isActivated(), and validate().
{
return $this->activation_start ? $this->activation_start : time();
}
Here is the caller graph for this function:| ilObjCourse::getActivationUnlimitedStatus | ( | ) |
Definition at line 164 of file class.ilObjCourse.php.
Referenced by ilClone(), isActivated(), updateSettings(), and validate().
{
return $this->activation_unlimited ? true : false;
}
Here is the caller graph for this function:| ilObjCourse::getArchiveEnd | ( | ) |
Definition at line 300 of file class.ilObjCourse.php.
Referenced by ilClone(), isArchived(), 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 292 of file class.ilObjCourse.php.
Referenced by ilClone(), isArchived(), and validate().
{
return $this->archive_start ? $this->archive_start : time();
}
Here is the caller graph for this function:| ilObjCourse::getArchiveType | ( | ) |
Definition at line 308 of file class.ilObjCourse.php.
Referenced by ilClone(), isArchived(), and updateSettings().
{
return $this->archive_type ? $this->archive_type : $this->ARCHIVE_DISABLED;
}
Here is the caller graph for this function:| ilObjCourse::getContactConsultation | ( | ) |
Definition at line 132 of file class.ilObjCourse.php.
Referenced by __createDefaultSettings(), ilClone(), and updateSettings().
{
return $this->contact_consultation;
}
Here is the caller graph for this function:| ilObjCourse::getcontactEmail | ( | ) |
Definition at line 148 of file class.ilObjCourse.php.
{
return $this->contact_email;
}
| ilObjCourse::getContactName | ( | ) |
Definition at line 124 of file class.ilObjCourse.php.
Referenced by __createDefaultSettings(), ilClone(), and updateSettings().
{
return $this->contact_name;
}
Here is the caller graph for this function:| ilObjCourse::getContactPhone | ( | ) |
Definition at line 140 of file class.ilObjCourse.php.
Referenced by __createDefaultSettings(), ilClone(), and updateSettings().
{
return $this->contact_phone;
}
Here is the caller graph for this function:| ilObjCourse::getContactResponsibility | ( | ) |
Definition at line 156 of file class.ilObjCourse.php.
Referenced by __createDefaultSettings(), ilClone(), and updateSettings().
{
return $this->contact_responsibility;
}
Here is the caller graph for this function:| ilObjCourse::getDefaultAdminRole | ( | ) |
Definition at line 1192 of file class.ilObjCourse.php.
References $role_id, __getLocalRoles(), and ilObjectFactory::getInstanceByObjId().
{
$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:| ilObjCourse::getDefaultMemberRole | ( | ) |
Definition at line 1160 of file class.ilObjCourse.php.
References $role_id, __getLocalRoles(), and ilObjectFactory::getInstanceByObjId().
{
$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:| ilObjCourse::getDefaultTutorRole | ( | ) |
Definition at line 1176 of file class.ilObjCourse.php.
References $role_id, __getLocalRoles(), and ilObjectFactory::getInstanceByObjId().
{
$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:| ilObjCourse::getDescription | ( | ) |
get object description
public
Reimplemented from ilObject.
Definition at line 93 of file class.ilObjCourse.php.
{
return parent::getDescription();
}
| ilObjCourse::getMembers | ( | ) |
Definition at line 342 of file class.ilObjCourse.php.
{
return $this->members_obj->getMembers();
}
| ilObjCourse::getMessage | ( | ) |
Definition at line 325 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 188 of file class.ilObjCourse.php.
Referenced by ilClone(), isActivated(), and updateSettings().
{
return $this->offline_status ? true : false;
}
Here is the caller graph for this function:| ilObjCourse::getOrderType | ( | ) |
Definition at line 284 of file class.ilObjCourse.php.
Referenced by ilClone(), and updateSettings().
{
return $this->order_type ? $this->order_type : $this->SORT_TITLE;
}
Here is the caller graph for this function:| ilObjCourse::getSubscriptionEnd | ( | ) |
Definition at line 212 of file class.ilObjCourse.php.
Referenced by ilClone(), inSubscriptionTime(), 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::getSubscriptionMaxMembers | ( | ) |
Definition at line 268 of file class.ilObjCourse.php.
Referenced by __createDefaultSettings(), ilClone(), updateSettings(), and validate().
{
return $this->subscription_max_members;
}
Here is the caller graph for this function:| ilObjCourse::getSubscriptionNotify | ( | ) |
Definition at line 276 of file class.ilObjCourse.php.
Referenced by ilClone(), and updateSettings().
{
return $this->subscription_notify ? true : false;
}
Here is the caller graph for this function:| ilObjCourse::getSubscriptionPassword | ( | ) |
Definition at line 228 of file class.ilObjCourse.php.
Referenced by ilClone(), updateSettings(), and validate().
{
return $this->subscription_password;
}
Here is the caller graph for this function:| ilObjCourse::getSubscriptionStart | ( | ) |
Definition at line 204 of file class.ilObjCourse.php.
Referenced by ilClone(), inSubscriptionTime(), and validate().
{
return $this->subscription_start ? $this->subscription_start : time();
}
Here is the caller graph for this function:| ilObjCourse::getSubscriptionType | ( | ) |
Definition at line 216 of file class.ilObjCourse.php.
Referenced by ilClone(), updateSettings(), and validate().
{
return $this->subscription_type ? $this->subscription_type : $this->SUBSCRIPTION_DEACTIVATED;
}
Here is the caller graph for this function:| ilObjCourse::getSubscriptionUnlimitedStatus | ( | ) |
Definition at line 196 of file class.ilObjCourse.php.
Referenced by ilClone(), inSubscriptionTime(), updateSettings(), and validate().
{
return $this->subscription_unlimited ? true : false;
}
Here is the caller graph for this function:| ilObjCourse::getSyllabus | ( | ) |
Definition at line 116 of file class.ilObjCourse.php.
Referenced by __createDefaultSettings(), ilClone(), and updateSettings().
{
return $this->syllabus;
}
Here is the caller graph for this function:| ilObjCourse::getTitle | ( | ) |
get object title public
Reimplemented from ilObject.
Definition at line 106 of file class.ilObjCourse.php.
{
return parent::getTitle();
}
| ilObjCourse::ilClone | ( | $ | a_parent_ref | ) |
copy all properties and subobjects of a course.
public
Reimplemented from ilObject.
Definition at line 537 of file class.ilObjCourse.php.
References $rbacadmin, enabledObjectiveView(), enableWaitingList(), getAboStatus(), getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), getArchiveEnd(), getArchiveStart(), getArchiveType(), getContactConsultation(), getContactName(), getContactPhone(), getContactResponsibility(), ilObjectFactory::getInstanceByRefId(), getOfflineStatus(), getOrderType(), getSubscriptionEnd(), getSubscriptionMaxMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSubscriptionUnlimitedStatus(), and getSyllabus().
{
global $rbacadmin;
// always call parent ilClone function first!!
$new_ref_id = parent::ilClone($a_parent_ref);
// put here crs specific stuff
$new_course =& ilObjectFactory::getInstanceByRefId($new_ref_id);
$new_course->initDefaultRoles();
$new_course->initCourseMemberObject();
$new_course->members_obj->add($this->ilias->account,$new_course->members_obj->ROLE_ADMIN);
$new_course->__createDefaultSettings();
$new_course->setSyllabus($this->getSyllabus());
$new_course->setContactName($this->getContactName());
$new_course->setContactConsultation($this->getContactConsultation());
$new_course->setContactPhone($this->getContactPhone());
$new_course->setContactEmail($this->getContactEmail());
$new_course->setContactResponsibility($this->getContactResponsibility());
$new_course->setActivationUnlimitedStatus($this->getActivationUnlimitedStatus());
$new_course->setActivationStart($this->getActivationStart());
$new_course->setActivationEnd($this->getActivationEnd());
$new_course->setOfflineStatus($this->getOfflineStatus());
$new_course->setSubscriptionUnlimitedStatus($this->getSubscriptionUnlimitedStatus());
$new_course->setSubscriptionStart($this->getSubscriptionStart());
$new_course->setSubscriptionEnd($this->getSubscriptionEnd());
$new_course->setSubscriptionType($this->getSubscriptionType());
$new_course->setSubscriptionPassword($this->getSubscriptionPassword());
$new_course->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
$new_course->setSubscriptionNotify($this->getSubscriptionNotify());
$new_course->enableWaitingList($this->enableWaitingList());
$new_course->setOrderType($this->getOrderType());
$new_course->setArchiveStart($this->getArchiveStart());
$new_course->setArchiveEnd($this->getArchiveEnd());
$new_course->setArchiveType($this->getArchiveType());
$new_course->setAboStatus($this->getAboStatus());
$new_course->setObjectiveViewStatus($this->enabledObjectiveView());
$new_course->update();
// ... and finally always return new reference ID!!
return $new_ref_id;
}
Here is the call graph for this function:| ilObjCourse::ilObjCourse | ( | $ | a_id = 0, |
|
| $ | a_call_by_reference = true | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 49 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->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 899 of file class.ilObjCourse.php.
Referenced by delete().
{
include_once "./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 888 of file class.ilObjCourse.php.
Referenced by delete().
{
include_once "./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 877 of file class.ilObjCourse.php.
Referenced by delete(), ilObjCourse(), and validate().
{
include_once "./course/classes/class.ilCourseMembers.php";
if(!is_object($this->members_obj))
{
$this->members_obj =& new ilCourseMembers($this);
}
return true;
}
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
Reimplemented from ilObject.
Definition at line 913 of file class.ilObjCourse.php.
References $ops, $query, $rbacadmin, $rbacreview, $res, __setCourseStatus(), ilObject::createRoleFolder(), ilObject::getId(), and ilObject::getRefId().
{
global $rbacadmin,$rbacreview;
$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->copyRolePermission($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->copyRolePermission($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->copyRolePermission($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 865 of file class.ilObjCourse.php.
References ilObject::getId().
{
include_once "./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 255 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 348 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 441 of file class.ilObjCourse.php.
References getArchiveEnd(), getArchiveStart(), and getArchiveType().
Referenced by isActivated().
{
if($this->getArchiveType() == $this->ARCHIVE_DISABLED)
{
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::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 happend, each object may decide how it reacts.
public
| string | event | |
| integer | reference id of object where the event occured | |
| array | passes optional paramters if required |
Reimplemented from ilObject.
Definition at line 638 of file class.ilObjCourse.php.
References $_GET, $tree, and ilObject::getType().
{
global $tree;
switch ($a_event)
{
case "link":
break;
case "cut":
break;
case "copy":
break;
case "paste":
break;
case "new":
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id==$_GET["ref_id"])
{
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if($parent_type == $this->getType())
{
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
}
Here is the call graph for this function:| ilObjCourse::read | ( | $ | a_force_db = false |
) |
read object data from db into object
| boolean | public |
Reimplemented from ilObject.
Definition at line 459 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 316 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 184 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 176 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->activation_start = $a_value;
}
Here is the caller graph for this function:| ilObjCourse::setActivationUnlimitedStatus | ( | $ | a_unlimited | ) |
Definition at line 168 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->activation_unlimited = (bool) $a_unlimited;
}
Here is the caller graph for this function:| ilObjCourse::setArchiveEnd | ( | $ | a_value | ) |
Definition at line 304 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 296 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 312 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 136 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 152 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 128 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 144 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 160 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->contact_responsibility = $a_value;
}
Here is the caller graph for this function:| ilObjCourse::setDescription | ( | $ | a_desc | ) |
set object description
public
| string | $a_desc object description |
Reimplemented from ilObject.
Definition at line 97 of file class.ilObjCourse.php.
{
parent::setDescription($a_description);
// $this->__initMetaObject();
// $this->meta_data->setDescription($a_description);
return true;
}
| ilObjCourse::setId | ( | $ | a_id | ) |
set object id public
| integer | $a_id object id |
Reimplemented from ilObject.
Definition at line 84 of file class.ilObjCourse.php.
{
parent::setId($a_id);
// unset($this->meta_data);
#$this->__initMetaObject();
}
| ilObjCourse::setMessage | ( | $ | a_message | ) |
Definition at line 329 of file class.ilObjCourse.php.
Referenced by validate().
{
$this->message = $a_message;
}
Here is the caller graph for this function:| ilObjCourse::setObjectiveViewStatus | ( | $ | a_status | ) |
Definition at line 236 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->objective_view = $a_status;
}
Here is the caller graph for this function:| ilObjCourse::setOfflineStatus | ( | $ | a_value | ) |
Definition at line 192 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->offline_status = $a_value ? true : false;
}
Here is the caller graph for this function:| ilObjCourse::setOrderType | ( | $ | a_value | ) |
Definition at line 288 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->order_type = $a_value;
}
Here is the caller graph for this function:| ilObjCourse::setSubscriptionEnd | ( | $ | a_value | ) |
Definition at line 224 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->subscription_end = $a_value;
}
Here is the caller graph for this function:| ilObjCourse::setSubscriptionMaxMembers | ( | $ | a_value | ) |
Definition at line 272 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 280 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 232 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 208 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 220 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->subscription_type = $a_value;
}
Here is the caller graph for this function:| ilObjCourse::setSubscriptionUnlimitedStatus | ( | $ | a_unlimited | ) |
Definition at line 200 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->subscription_unlimited = (bool) $a_unlimited;
}
Here is the caller graph for this function:| ilObjCourse::setSyllabus | ( | $ | a_syllabus | ) |
Definition at line 120 of file class.ilObjCourse.php.
Referenced by __readSettings().
{
$this->syllabus = $a_syllabus;
}
Here is the caller graph for this function:| ilObjCourse::setTitle | ( | $ | a_title | ) |
set object title
public
| string | $a_title object title |
Reimplemented from ilObject.
Definition at line 110 of file class.ilObjCourse.php.
{
parent::setTitle($a_title);
// $this->__initMetaObject();
// $this->meta_data->setTitle($a_title);
}
| ilObjCourse::update | ( | ) |
update meta data only
update complete object
Reimplemented from ilObject.
Definition at line 719 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 749 of file class.ilObjCourse.php.
References $query, $res, __createDefaultSettings(), enabledObjectiveView(), enabledWaitingList(), getAboStatus(), getActivationUnlimitedStatus(), getArchiveType(), getContactConsultation(), getContactName(), getContactPhone(), getContactResponsibility(), getOfflineStatus(), getOrderType(), getSubscriptionMaxMembers(), getSubscriptionNotify(), getSubscriptionPassword(), getSubscriptionType(), getSubscriptionUnlimitedStatus(), and getSyllabus().
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 = '".$this->getId()."'";
$res = $ilDB->query($query);
if(!$res->numRows())
{
$this->__createDefaultSettings();
}
$query = "UPDATE crs_settings SET ".
"syllabus = '".ilUtil::prepareDBString($this->getSyllabus())."', ".
"contact_name = '".ilUtil::prepareDBString($this->getContactName())."', ".
"contact_responsibility = '".ilUtil::prepareDBString($this->getContactResponsibility())."', ".
"contact_phone = '".ilUtil::prepareDBString($this->getContactPhone())."', ".
"contact_email = '".ilUtil::prepareDBString($this->getContactEmail())."', ".
"contact_consultation = '".ilUtil::prepareDBString($this->getContactConsultation())."', ".
"activation_unlimited = '".(int) $this->getActivationUnlimitedStatus()."', ".
"activation_start = '".$this->getActivationStart()."', ".
"activation_end = '".$this->getActivationEnd()."', ".
"activation_offline = '".(int) $this->getOfflineStatus()."', ".
"subscription_unlimited = '".(int) $this->getSubscriptionUnlimitedStatus()."', ".
"subscription_start = '".$this->getSubscriptionStart()."', ".
"subscription_end = '".$this->getSubscriptionEnd()."', ".
"subscription_type = '".(int) $this->getSubscriptionType()."', ".
"subscription_password = '".ilUtil::prepareDBString($this->getSubscriptionPassword())."', ".
"subscription_max_members = '".(int) $this->getSubscriptionMaxMembers()."', ".
"subscription_notify = '".(int) $this->getSubscriptionNotify()."', ".
"sortorder = '".(int) $this->getOrderType()."', ".
"archive_start = '".$this->getArchiveStart()."', ".
"archive_end = '".$this->getArchiveEnd()."', ".
"archive_type = '".(int) $this->getArchiveType()."', ".
"abo = '".(int) $this->getAboStatus()."', ".
"objective_view = '".(int) $this->enabledObjectiveView()."', ".
"waiting_list = '".(int) $this->enabledWaitingList()."' ".
"WHERE obj_id = '".$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 476 of file class.ilObjCourse.php.
References appendMessage(), getActivationEnd(), getActivationStart(), getActivationUnlimitedStatus(), getArchiveEnd(), getArchiveStart(), getMessage(), getSubscriptionEnd(), getSubscriptionMaxMembers(), getSubscriptionPassword(), getSubscriptionStart(), getSubscriptionType(), getSubscriptionUnlimitedStatus(), ilObjUser::getUserIdByLogin(), initCourseMemberObject(), ilUtil::is_email(), and setMessage().
{
$this->initCourseMemberObject();
$this->setMessage('');
if(!$this->getSubscriptionType())
{
$this->appendMessage($this->lng->txt('crs_select_registration_type'));
}
if(!$this->getActivationUnlimitedStatus() and $this->getActivationEnd() < $this->getActivationStart())
{
$this->appendMessage($this->lng->txt("activation_times_not_valid"));
}
if(!$this->getSubscriptionUnlimitedStatus() 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() == $this->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->getSubscriptionMaxMembers() and
# $this->getSubscriptionMaxMembers() < $this->members_obj->getCountMembers())
#{
# $this->appendMessage($this->lng->txt("crs_max_members_smaller_members"));
#}
if($this->getArchiveStart() > $this->getArchiveEnd())
{
$this->appendMessage($this->lng->txt("archive_times_not_valid"));
}
if($this->getContactEmail() and
!(ilUtil::is_email($this->getContactEmail()) or
ilObjUser::getUserIdByLogin($this->getContactEmail())))
{
$this->appendMessage($this->lng->txt("contact_email_not_valid"));
}
return $this->getMessage() ? false : true;
}
Here is the call graph for this function:| ilObjCourse::$archives_obj |
Definition at line 40 of file class.ilObjCourse.php.
| ilObjCourse::$items_obj |
Definition at line 41 of file class.ilObjCourse.php.
| ilObjCourse::$members_obj |
Definition at line 39 of file class.ilObjCourse.php.
1.7.1