Collaboration diagram for ilCourseParticipants:Public Member Functions | |
| isGroupingMember ($a_usr_id, $a_field= '') | |
| Check grouping membership. | |
| isAssigned ($a_usr_id) | |
| check if user is assigned | |
| getRoles () | |
| Get course roles. | |
| getAssignedRoles ($a_usr_id) | |
| Get assigned roles. | |
| updateRoleAssignments ($a_usr_id, $a_roles) | |
| Update role assignments. | |
| checkLastAdmin ($a_usr_ids) | |
| Check if user for deletion are last admins. | |
| isBlocked ($a_usr_id) | |
| Check if user is blocked. | |
| hasPassed ($a_usr_id) | |
| Check if user has passed course. | |
| isNotificationEnabled ($a_usr_id) | |
| check if notification is enabled | |
| getNotificationRecipients () | |
| Get admin, tutor which have notification enabled. | |
| getCountMembers () | |
| Get number of members (not participants). | |
| getCountParticipants () | |
| Get number of participants. | |
| getParticipants () | |
| Get all participants ids. | |
| getMembers () | |
| Get all members ids (admins and tutors are not members) Use get participants to fetch all. | |
| getAdmins () | |
| Get all admins ids. | |
| getTutors () | |
| Get all tutors ids. | |
| isAdmin ($a_usr_id) | |
| is user admin | |
| isTutor ($a_usr_id) | |
| is user tutor | |
| isMember ($a_usr_id) | |
| is user member | |
| updatePassed ($a_usr_id, $a_passed) | |
| Update passed status. | |
| updateNotification ($a_usr_id, $a_notification) | |
| Update notification status. | |
| updateBlocked ($a_usr_id, $a_blocked) | |
| Update blocked status. | |
| add ($a_usr_id, $a_role) | |
| Add user to course. | |
| delete ($a_usr_id) | |
| Drop user from all course roles. | |
| deleteParticipants ($a_user_ids) | |
| Delete users. | |
| addDesktopItem ($a_usr_id) | |
| Add desktop item. | |
| dropDesktopItem ($a_usr_id) | |
| Drop desktop item. | |
| getSubscribers () | |
| getCountSubscribers () | |
| getSubscriberData ($a_usr_id) | |
| assignSubscribers ($a_usr_ids) | |
| assignSubscriber ($a_usr_id) | |
| autoFillSubscribers () | |
| addSubscriber ($a_usr_id) | |
| updateSubscriptionTime ($a_usr_id, $a_subtime) | |
| deleteSubscriber ($a_usr_id) | |
| deleteSubscribers ($a_usr_ids) | |
| isSubscriber ($a_usr_id) | |
| _isSubscriber ($a_obj_id, $a_usr_id) | |
| __readSubscribers () | |
| __readSubscriberData ($a_usr_id) | |
| sendNotification ($a_type, $a_usr_id) | |
| sendUnsubscribeNotificationToAdmins ($a_usr_id) | |
| sendSubscriptionRequestToAdmins ($a_usr_id) | |
| sendNotificationToAdmins ($a_usr_id) | |
| __buildStatusBody (&$user_obj) | |
Static Public Member Functions | |
| static | _getInstanceByObjId ($a_course_id) |
| Get singleton instance. | |
| _isParticipant ($a_ref_id, $a_usr_id) | |
| Static function to check if a user is a prticipant of a course. | |
| static | _isBlocked ($a_course_id, $a_usr_id) |
| Check if user is blocked. | |
| static | _hasPassed ($a_course_id, $a_usr_id) |
| Check if user has passed course. | |
| static | _deleteAllEntries ($a_course_id) |
| Delete all entries Normally called for course deletion. | |
| static | _deleteUser ($a_usr_id) |
| Delete user data. | |
Protected Attributes | |
| $ilDB = null | |
| $lng = null | |
| $course_id = 0 | |
| $course_ref_id = 0 | |
| $course_roles = array() | |
| $course_role_data = array() | |
| $participants = array() | |
| $participants_status = array() | |
| $members = array() | |
| $tutors = array() | |
| $admins = array() | |
| $subscribers = array() | |
Private Member Functions | |
| __construct ($a_course_id) | |
| Contructor. | |
| readParticipants () | |
| Read participants. | |
| readParticipantsStatus () | |
| Read stati of participants (blocked, notification, passed). | |
Static Private Attributes | |
| static | $instances = array() |
Definition at line 37 of file class.ilCourseParticipants.php.
| ilCourseParticipants::__construct | ( | $ | a_course_id | ) | [private] |
Contructor.
public
Definition at line 64 of file class.ilCourseParticipants.php.
References $ilDB, $lng, ilObject::_getAllReferences(), readParticipants(), and readParticipantsStatus().
{
global $ilDB,$lng;
$this->NOTIFY_DISMISS_SUBSCRIBER = 1;
$this->NOTIFY_ACCEPT_SUBSCRIBER = 2;
$this->NOTIFY_DISMISS_MEMBER = 3;
$this->NOTIFY_BLOCK_MEMBER = 4;
$this->NOTIFY_UNBLOCK_MEMBER = 5;
$this->NOTIFY_ACCEPT_USER = 6;
$this->NOTIFY_ADMINS = 7;
$this->NOTIFY_STATUS_CHANGED = 8;
$this->NOTIFY_SUBSCRIPTION_REQUEST = 9;
$this->ilDB = $ilDB;
$this->lng = $lng;
$this->course_id = $a_course_id;
$ref_ids = ilObject::_getAllReferences($this->course_id);
$this->course_ref_id = current($ref_ids);
$this->readParticipants();
$this->readParticipantsStatus();
}
Here is the call graph for this function:| ilCourseParticipants::__buildStatusBody | ( | &$ | user_obj | ) |
Definition at line 1243 of file class.ilCourseParticipants.php.
References $ilDB, hasPassed(), isAdmin(), isBlocked(), isMember(), isNotificationEnabled(), and isTutor().
Referenced by sendNotification().
{
global $ilDB;
$body = $this->lng->txt('crs_status_changed_body').':<br />';
$body .= $this->lng->txt('login').': '.$user_obj->getLogin().'<br />';
$body .= $this->lng->txt('role').': ';
if($this->isAdmin($user_obj->getId()))
{
$body .= $this->lng->txt('crs_member').'<br />';
}
if($this->isTutor($user_obj->getId()))
{
$body .= $this->lng->txt('crs_tutor').'<br />';
}
if($this->isMember($user_obj->getId()))
{
$body .= $this->lng->txt('crs_member').'<br />';
}
$body .= $this->lng->txt('status').': ';
if($this->isNotificationEnabled($user_obj->getId()))
{
$body .= $this->lng->txt("crs_notify").'<br />';
}
else
{
$body .= $this->lng->txt("crs_no_notify").'<br />';
}
if($this->isBlocked($user_obj->getId()))
{
$body .= $this->lng->txt("crs_blocked").'<br />';
}
else
{
$body .= $this->lng->txt("crs_unblocked").'<br />';
}
$passed = $this->hasPassed($user_obj->getId()) ? $this->lng->txt('yes') : $this->lng->txt('no');
$body .= $this->lng->txt('crs_passed').': '.$passed.'<br />';
return $body;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::__readSubscriberData | ( | $ | a_usr_id | ) |
Definition at line 1068 of file class.ilCourseParticipants.php.
References $data, $ilDB, and $res.
Referenced by getSubscriberData().
{
global $ilDB;
$query = "SELECT * FROM crs_subscribers ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id)."";
$res = $this->ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$data["time"] = $row->sub_time;
$data["usr_id"] = $row->usr_id;
}
return $data ? $data : array();
}
Here is the caller graph for this function:| ilCourseParticipants::__readSubscribers | ( | ) |
Definition at line 1045 of file class.ilCourseParticipants.php.
References $ilDB, $res, deleteSubscriber(), and ilObjectFactory::getInstanceByObjId().
Referenced by autoFillSubscribers(), and getSubscribers().
{
global $ilDB;
$this->subscribers = array();
$query = "SELECT usr_id FROM crs_subscribers ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"ORDER BY sub_time ";
$res = $this->ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
// DELETE SUBSCRIPTION IF USER HAS BEEN DELETED
if(!ilObjectFactory::getInstanceByObjId($row->usr_id,false))
{
$this->deleteSubscriber($row->usr_id);
}
$this->subscribers[] = $row->usr_id;
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| static ilCourseParticipants::_deleteAllEntries | ( | $ | a_course_id | ) | [static] |
Delete all entries Normally called for course deletion.
public
| int | course_id |
Definition at line 186 of file class.ilCourseParticipants.php.
References $ilDB.
Referenced by ilObjCourse::delete(), and ilSoapCourseAdministration::updateCourse().
{
global $ilDB;
$query = "DELETE FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($a_course_id)." ";
$ilDB->query($query);
$query = "DELETE FROM crs_subscribers ".
"WHERE obj_id = ".$ilDB->quote($a_course_id)."";
$ilDB->query($query);
return true;
}
Here is the caller graph for this function:| static ilCourseParticipants::_deleteUser | ( | $ | a_usr_id | ) | [static] |
Delete user data.
public
| int | user id |
Definition at line 211 of file class.ilCourseParticipants.php.
References $ilDB.
{
global $ilDB;
$query = "DELETE FROM crs_members WHERE usr_id = ".$ilDB->quote($a_usr_id)."";
$ilDB->query($query);
$query = "DELETE FROM crs_subscribers WHERE usr_id = ".$ilDB->quote($a_usr_id)."";
$ilDB->query($query);
include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
ilCourseWaitingList::_deleteUser($a_usr_id);
}
| static ilCourseParticipants::_getInstanceByObjId | ( | $ | a_course_id | ) | [static] |
Get singleton instance.
public
| int | course_id |
Definition at line 99 of file class.ilCourseParticipants.php.
Referenced by ilMemberExport::__construct(), ilLPStatusManualByTutor::__getCourseInProgress(), ilLPStatusManual::__getCourseInProgress(), ilObjCourseGUI::__showWaitingList(), ilCourseObjectiveResult::__updatePassed(), ilObjCourseGrouping::_checkGroupingDependencies(), ilLPStatusCollection::_getCompleted(), ilLPStatusCollection::_getFailed(), ilLPStatusObjectives::_getInProgress(), ilLPStatusCollection::_getInProgress(), ilLPStatusObjectives::_getNotAttempted(), ilLPStatusManualByTutor::_getNotAttempted(), ilLPStatusManual::_getNotAttempted(), ilLPStatusEvent::_getNotAttempted(), ilLPStatusCollection::_getNotAttempted(), ilFeedbackGUI::_isRequiredFeedbackOnLogin(), ilSoapCourseAdministration::assignCourseMember(), ilFeedback::canVote(), ilEventAdministrationGUI::editMembers(), ilEventAdministrationGUI::eventsList(), ilSoapCourseAdministration::excludeCourseMember(), ilEventAdministrationGUI::exportCSV(), ilObjUser::getCourseMemberships(), ilUserImportParser::getCourseMembersObjectForRole(), ilObjCourseListGUI::getProperties(), ilCourseXMLParser::ilCourseXMLParser(), ilObjCourse::initCourseMemberObject(), ilSoapCourseAdministration::isAssignedToCourse(), ilEventAdministrationGUI::printViewMembers(), ilMailSearchCoursesGUI::showMyCourses(), and ilEventAdministrationGUI::updateMembers().
{
if(isset(self::$instances[$a_course_id]) and self::$instances[$a_course_id])
{
return self::$instances[$a_course_id];
}
return self::$instances[$a_course_id] = new ilCourseParticipants($a_course_id);
}
Here is the caller graph for this function:| static ilCourseParticipants::_hasPassed | ( | $ | a_course_id, | |
| $ | a_usr_id | |||
| ) | [static] |
Check if user has passed course.
public
| int | course_id | |
| int | user id |
Definition at line 165 of file class.ilCourseParticipants.php.
Referenced by ilObjCourse::_checkCondition().
{
global $ilDB;
$query = "SELECT * FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($a_course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND passed = '1'";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}
Here is the caller graph for this function:| static ilCourseParticipants::_isBlocked | ( | $ | a_course_id, | |
| $ | a_usr_id | |||
| ) | [static] |
Check if user is blocked.
public
| int | course id | |
| int | usr_id |
Definition at line 144 of file class.ilCourseParticipants.php.
Referenced by ilObjCourseAccess::_checkAccess(), and ilRepositoryExplorer::isClickable().
{
global $ilDB;
$query = "SELECT * FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($a_course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND blocked = '1'";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}
Here is the caller graph for this function:| ilCourseParticipants::_isParticipant | ( | $ | a_ref_id, | |
| $ | a_usr_id | |||
| ) | [static] |
Static function to check if a user is a prticipant of a course.
public
| int | course ref_id | |
| int | user id |
Definition at line 116 of file class.ilCourseParticipants.php.
Referenced by ilObjCourseAccess::_checkAccess().
{
global $rbacreview,$ilObjDataCache,$ilDB,$ilLog;
$rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
if(!isset($rolf['ref_id']) or !$rolf['ref_id'])
{
$course_title = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($a_ref_id));
$ilLog->write(__METHOD__.': Found course without role folder. Course ref_id: '.$a_ref_id.', course title: '.$course_title);
$ilLog->logStack();
return false;
}
$local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
$user_roles = $rbacreview->assignedRoles($a_usr_id);
return count(array_intersect((array) $local_roles,(array) $user_roles)) ? true : false;
}
Here is the caller graph for this function:| ilCourseParticipants::_isSubscriber | ( | $ | a_obj_id, | |
| $ | a_usr_id | |||
| ) |
Definition at line 1029 of file class.ilCourseParticipants.php.
Referenced by ilObjCourseListGUI::getProperties().
{
global $ilDB;
$query = "SELECT * FROM crs_subscribers ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND obj_id = ".$ilDB->quote($a_obj_id)."";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return true;
}
return false;
}
Here is the caller graph for this function:| ilCourseParticipants::add | ( | $ | a_usr_id, | |
| $ | a_role | |||
| ) |
Add user to course.
public
| int | user id | |
| int | role IL_CRS_ADMIN || IL_CRS_TUTOR || IL_CRS_MEMBER |
Definition at line 670 of file class.ilCourseParticipants.php.
References addDesktopItem(), and isAssigned().
Referenced by assignSubscriber().
{
global $rbacadmin;
if($this->isAssigned($a_usr_id))
{
return false;
}
switch($a_role)
{
case IL_CRS_ADMIN:
$this->admins[] = $a_usr_id;
break;
case IL_CRS_TUTOR:
$this->tutors[] = $a_usr_id;
break;
case IL_CRS_MEMBER:
$this->members[] = $a_usr_id;
break;
}
$this->participants[] = $a_usr_id;
$rbacadmin->assignUser($this->course_role_data[$a_role],$a_usr_id);
$this->addDesktopItem($a_usr_id);
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::addDesktopItem | ( | $ | a_usr_id | ) |
Add desktop item.
public
| int | usr_id |
Definition at line 750 of file class.ilCourseParticipants.php.
References ilObjUser::_addDesktopItem(), and ilObjUser::_isDesktopItem().
Referenced by add().
{
if(!ilObjUser::_isDesktopItem($a_usr_id, $this->course_ref_id,'crs'))
{
ilObjUser::_addDesktopItem($a_usr_id, $this->course_ref_id,'crs');
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::addSubscriber | ( | $ | a_usr_id | ) |
| ilCourseParticipants::assignSubscriber | ( | $ | a_usr_id | ) |
Definition at line 896 of file class.ilCourseParticipants.php.
References $ilErr, add(), deleteSubscriber(), ilObjectFactory::getInstanceByObjId(), isAssigned(), and isSubscriber().
Referenced by assignSubscribers(), and autoFillSubscribers().
{
global $ilErr;
$ilErr->setMessage("");
if(!$this->isSubscriber($a_usr_id))
{
$ilErr->appendMessage($this->lng->txt("crs_user_notsubscribed"));
return false;
}
if($this->isAssigned($a_usr_id))
{
$tmp_obj = ilObjectFactory::getInstanceByObjId($a_usr_id);
$ilErr->appendMessage($tmp_obj->getLogin().": ".$this->lng->txt("crs_user_already_assigned"));
return false;
}
if(!$tmp_obj =& ilObjectFactory::getInstanceByObjId($a_usr_id))
{
$ilErr->appendMessage($this->lng->txt("crs_user_not_exists"));
return false;
}
$this->add($tmp_obj->getId(),IL_CRS_MEMBER);
$this->deleteSubscriber($a_usr_id);
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::assignSubscribers | ( | $ | a_usr_ids | ) |
Definition at line 880 of file class.ilCourseParticipants.php.
References assignSubscriber().
{
if(!is_array($a_usr_ids) or !count($a_usr_ids))
{
return false;
}
foreach($a_usr_ids as $id)
{
if(!$this->assignSubscriber($id))
{
return false;
}
}
return true;
}
Here is the call graph for this function:| ilCourseParticipants::autoFillSubscribers | ( | ) |
Definition at line 928 of file class.ilCourseParticipants.php.
References __readSubscribers(), assignSubscriber(), and sendNotification().
{
$this->__readSubscribers();
$counter = 0;
foreach($this->subscribers as $subscriber)
{
if(!$this->assignSubscriber($subscriber))
{
continue;
}
else
{
$this->sendNotification($this->NOTIFY_ACCEPT_SUBSCRIBER,$subscriber);
}
++$counter;
}
return $counter;
}
Here is the call graph for this function:| ilCourseParticipants::checkLastAdmin | ( | $ | a_usr_ids | ) |
Check if user for deletion are last admins.
public
| array | array of user ids for deletion |
Definition at line 361 of file class.ilCourseParticipants.php.
References getAdmins().
{
foreach($this->getAdmins() as $admin_id)
{
if(!in_array($admin_id,$a_usr_ids))
{
return true;
}
}
return false;
}
Here is the call graph for this function:| ilCourseParticipants::delete | ( | $ | a_usr_id | ) |
Drop user from all course roles.
public
| int | usr_id |
Definition at line 704 of file class.ilCourseParticipants.php.
References $ilDB, dropDesktopItem(), readParticipants(), and readParticipantsStatus().
{
global $rbacadmin,$ilDB;
$this->dropDesktopItem($a_usr_id);
foreach($this->course_roles as $role_id)
{
$rbacadmin->deassignUser($role_id,$a_usr_id);
}
$query = "DELETE FROM crs_members ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND obj_id = ".$ilDB->quote($this->course_id);
$ilDB->query($query);
$this->readParticipants();
$this->readParticipantsStatus();
return true;
}
Here is the call graph for this function:| ilCourseParticipants::deleteParticipants | ( | $ | a_user_ids | ) |
Delete users.
public
| array | user ids |
Definition at line 732 of file class.ilCourseParticipants.php.
{
foreach($a_user_ids as $user_id)
{
$this->delete($user_id);
}
return true;
}
| ilCourseParticipants::deleteSubscriber | ( | $ | a_usr_id | ) |
Definition at line 974 of file class.ilCourseParticipants.php.
Referenced by __readSubscribers(), assignSubscriber(), and deleteSubscribers().
{
global $ilDB;
$query = "DELETE FROM crs_subscribers ".
"WHERE usr_id = ".$a_usr_id." ".
"AND obj_id = ".$ilDB->quote($this->course_id)." ";
$res = $ilDB->query($query);
return true;
}
Here is the caller graph for this function:| ilCourseParticipants::deleteSubscribers | ( | $ | a_usr_ids | ) |
Definition at line 987 of file class.ilCourseParticipants.php.
References $ilErr, and deleteSubscriber().
{
global $ilErr;
if(!is_array($a_usr_ids) or !count($a_usr_ids))
{
$ilErr->setMessage('');
$ilErr->appendMessage($this->lng->txt("no_usr_ids_given"));
return false;
}
foreach($a_usr_ids as $id)
{
if(!$this->deleteSubscriber($id))
{
$ilErr->appendMessage($this->lng->txt("error_delete_subscriber"));
return false;
}
}
return true;
}
Here is the call graph for this function:| ilCourseParticipants::dropDesktopItem | ( | $ | a_usr_id | ) |
Drop desktop item.
public
| int | usr_id |
Definition at line 767 of file class.ilCourseParticipants.php.
References ilObjUser::_dropDesktopItem(), and ilObjUser::_isDesktopItem().
Referenced by delete().
{
if(ilObjUser::_isDesktopItem($a_usr_id, $this->course_ref_id,'crs'))
{
ilObjUser::_dropDesktopItem($a_usr_id, $this->course_ref_id,'crs');
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::getAdmins | ( | ) |
Get all admins ids.
public
Definition at line 498 of file class.ilCourseParticipants.php.
Referenced by checkLastAdmin().
{
return $this->admins ? $this->admins : array();
}
Here is the caller graph for this function:| ilCourseParticipants::getAssignedRoles | ( | $ | a_usr_id | ) |
Get assigned roles.
public
| int | user_id |
Definition at line 305 of file class.ilCourseParticipants.php.
{
global $rbacreview;
foreach($this->course_roles as $role)
{
if($rbacreview->isAssigned($a_usr_id,$role))
{
$assigned[] = $role;
}
}
return $assigned ? $assigned : array();
}
| ilCourseParticipants::getCountMembers | ( | ) |
Get number of members (not participants).
public
Definition at line 451 of file class.ilCourseParticipants.php.
{
return count($this->members);
}
| ilCourseParticipants::getCountParticipants | ( | ) |
Get number of participants.
public
Definition at line 462 of file class.ilCourseParticipants.php.
{
return count($this->participants);
}
| ilCourseParticipants::getCountSubscribers | ( | ) |
Definition at line 868 of file class.ilCourseParticipants.php.
References getSubscribers().
{
return count($this->getSubscribers());
}
Here is the call graph for this function:| ilCourseParticipants::getMembers | ( | ) |
Get all members ids (admins and tutors are not members) Use get participants to fetch all.
public
Definition at line 488 of file class.ilCourseParticipants.php.
{
return $this->members ? $this->members : array();
}
| ilCourseParticipants::getNotificationRecipients | ( | ) |
Get admin, tutor which have notification enabled.
public
Definition at line 427 of file class.ilCourseParticipants.php.
References $ilDB, $res, isAdmin(), and isTutor().
Referenced by sendSubscriptionRequestToAdmins(), and sendUnsubscribeNotificationToAdmins().
{
global $ilDB;
$query = "SELECT * FROM crs_members ".
"WHERE notification = 1 ".
"AND obj_id = ".$ilDB->quote($this->course_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($this->isAdmin($row->usr_id) or $this->isTutor($row->usr_id))
{
$recp[] = $row->usr_id;
}
}
return $recp ? $recp : array();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::getParticipants | ( | ) |
Get all participants ids.
public
Definition at line 476 of file class.ilCourseParticipants.php.
Referenced by isGroupingMember().
{
return $this->participants ? $this->participants : array();
}
Here is the caller graph for this function:| ilCourseParticipants::getRoles | ( | ) |
Get course roles.
public
Definition at line 293 of file class.ilCourseParticipants.php.
Referenced by updateRoleAssignments().
{
return $this->course_roles ? $this->course_roles : array();
}
Here is the caller graph for this function:| ilCourseParticipants::getSubscriberData | ( | $ | a_usr_id | ) |
Definition at line 873 of file class.ilCourseParticipants.php.
References __readSubscriberData().
{
return $this->__readSubscriberData($a_usr_id);
}
Here is the call graph for this function:| ilCourseParticipants::getSubscribers | ( | ) |
Definition at line 861 of file class.ilCourseParticipants.php.
References __readSubscribers().
Referenced by getCountSubscribers().
{
$this->__readSubscribers();
return $this->subscribers;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::getTutors | ( | ) |
Get all tutors ids.
public
Definition at line 508 of file class.ilCourseParticipants.php.
{
return $this->tutors ? $this->tutors : array();
}
| ilCourseParticipants::hasPassed | ( | $ | a_usr_id | ) |
Check if user has passed course.
public
| int | user_id |
Definition at line 396 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody().
{
if(isset($this->participants_status[$a_usr_id]))
{
return $this->participants_status[$a_usr_id]['passed'] ? true : false;
}
return false;
}
Here is the caller graph for this function:| ilCourseParticipants::isAdmin | ( | $ | a_usr_id | ) |
is user admin
public
| int | usr_id |
Definition at line 520 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody(), getNotificationRecipients(), and sendNotificationToAdmins().
{
return in_array($a_usr_id,$this->admins) ? true : false;
}
Here is the caller graph for this function:| ilCourseParticipants::isAssigned | ( | $ | a_usr_id | ) |
check if user is assigned
public
Definition at line 281 of file class.ilCourseParticipants.php.
Referenced by add(), and assignSubscriber().
{
return in_array($a_usr_id,$this->participants);
}
Here is the caller graph for this function:| ilCourseParticipants::isBlocked | ( | $ | a_usr_id | ) |
Check if user is blocked.
public
| int | user_id |
Definition at line 380 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody().
{
if(isset($this->participants_status[$a_usr_id]))
{
return $this->participants_status[$a_usr_id]['blocked'] ? true : false;
}
return false;
}
Here is the caller graph for this function:| ilCourseParticipants::isGroupingMember | ( | $ | a_usr_id, | |
| $ | a_field = '' | |||
| ) |
Check grouping membership.
public
Definition at line 232 of file class.ilCourseParticipants.php.
References $ilDB, $res, ilObjectFactory::getInstanceByObjId(), getParticipants(), and ilUtil::quoteArray().
{
global $rbacreview,$ilObjDataCache,$ilDB;
// Used for membership limitations -> check membership by given field
if($a_field)
{
include_once './Services/User/classes/class.ilObjUser.php';
$tmp_user =& ilObjectFactory::getInstanceByObjId($a_usr_id);
switch($a_field)
{
case 'login':
$and = "AND login = ".$ilDB->quote($tmp_user->getLogin())." ";
break;
case 'email':
$and = "AND email = ".$ilDB->quote($tmp_user->getEmail())." ";
break;
case 'matriculation':
$and = "AND matriculation = ".$ilDB->quote($tmp_user->getMatriculation())." ";
break;
default:
$and = "AND usr_id = '".$a_usr_id."'";
break;
}
if(!$this->getParticipants())
{
return false;
}
$query = "SELECT * FROM usr_data as ud ".
"WHERE usr_id IN (".implode(",",ilUtil::quoteArray($this->getParticipants())).") ".
$and;
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}
}
Here is the call graph for this function:| ilCourseParticipants::isMember | ( | $ | a_usr_id | ) |
is user member
public
| int | usr_id |
Definition at line 544 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody().
{
return in_array($a_usr_id,$this->members) ? true : false;
}
Here is the caller graph for this function:| ilCourseParticipants::isNotificationEnabled | ( | $ | a_usr_id | ) |
check if notification is enabled
public
Definition at line 412 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody().
{
if(isset($this->participants_status[$a_usr_id]))
{
return $this->participants_status[$a_usr_id]['notification'] ? true : false;
}
return false;
}
Here is the caller graph for this function:| ilCourseParticipants::isSubscriber | ( | $ | a_usr_id | ) |
Definition at line 1009 of file class.ilCourseParticipants.php.
Referenced by assignSubscriber().
{
global $ilDB;
$query = "SELECT * FROM crs_subscribers ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND obj_id = ".$ilDB->quote($this->course_id)."";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return true;
}
return false;
}
Here is the caller graph for this function:| ilCourseParticipants::isTutor | ( | $ | a_usr_id | ) |
is user tutor
public
| int | usr_id |
Definition at line 532 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody(), getNotificationRecipients(), and sendNotificationToAdmins().
{
return in_array($a_usr_id,$this->tutors) ? true : false;
}
Here is the caller graph for this function:| ilCourseParticipants::readParticipants | ( | ) | [private] |
Read participants.
private
Definition at line 787 of file class.ilCourseParticipants.php.
References $ilLog, and $title.
Referenced by __construct(), delete(), and updateRoleAssignments().
{
global $rbacreview,$ilObjDataCache,$ilLog;
$rolf = $rbacreview->getRoleFolderOfObject($this->course_ref_id);
if(!isset($rolf['ref_id']) or !$rolf['ref_id'])
{
$course_title = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($this->course_ref_id));
$ilLog->write(__METHOD__.': Found course without role folder. Course ref_id: '.$this->course_ref_id.', course title: '.$course_title);
$ilLog->logStack();
return false;
}
$this->course_roles = $rbacreview->getRolesOfRoleFolder($rolf['ref_id'],false);
$users = array();
$this->participants = array();
$this->members = $this->admins = $this->tutors = array();
foreach($this->course_roles as $role_id)
{
$title = $ilObjDataCache->lookupTitle($role_id);
switch(substr($title,0,8))
{
case 'il_crs_m':
$this->course_role_data[IL_CRS_MEMBER] = $role_id;
$this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),$this->participants));
$this->members = array_unique(array_merge($assigned,$this->members));
break;
case 'il_crs_a':
$this->course_role_data[IL_CRS_ADMIN] = $role_id;
$this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),$this->participants));
$this->admins = $rbacreview->assignedUsers($role_id);
break;
case 'il_crs_t':
$this->course_role_data[IL_CRS_TUTOR] = $role_id;
$this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),$this->participants));
$this->tutors = $rbacreview->assignedUsers($role_id);
break;
default:
$this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),$this->participants));
$this->members = array_unique(array_merge($assigned,$this->members));
break;
}
}
}
Here is the caller graph for this function:| ilCourseParticipants::readParticipantsStatus | ( | ) | [private] |
Read stati of participants (blocked, notification, passed).
private
Definition at line 843 of file class.ilCourseParticipants.php.
Referenced by __construct(), delete(), and updateRoleAssignments().
{
global $ilDB;
$query = "SELECT * FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ";
$res = $ilDB->query($query);
$this->participants_status = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->participants_status[$row->usr_id]['blocked'] = $row->blocked;
$this->participants_status[$row->usr_id]['notification'] = $row->notification;
$this->participants_status[$row->usr_id]['passed'] = $row->passed;
}
}
Here is the caller graph for this function:| ilCourseParticipants::sendNotification | ( | $ | a_type, | |
| $ | a_usr_id | |||
| ) |
Definition at line 1087 of file class.ilCourseParticipants.php.
References __buildStatusBody(), ilObjectFactory::getInstanceByObjId(), sendNotificationToAdmins(), and sendSubscriptionRequestToAdmins().
Referenced by autoFillSubscribers().
{
global $ilObjDataCache,$ilUser;
$tmp_user =& ilObjectFactory::getInstanceByObjId($a_usr_id,false);
$link = ("\n\n".$this->lng->txt('crs_mail_permanent_link'));
$link .= ("\n\n".ILIAS_HTTP_PATH."/goto.php?target=crs_".$this->course_ref_id."&client_id=".CLIENT_ID);
switch($a_type)
{
case $this->NOTIFY_DISMISS_SUBSCRIBER:
$subject = $this->lng->txt("crs_reject_subscriber");
$body = $this->lng->txt("crs_reject_subscriber_body");
break;
case $this->NOTIFY_ACCEPT_SUBSCRIBER:
$subject = $this->lng->txt("crs_accept_subscriber");
$body = $this->lng->txt("crs_accept_subscriber_body");
$body .= $link;
break;
case $this->NOTIFY_DISMISS_MEMBER:
$subject = $this->lng->txt("crs_dismiss_member");
$body = $this->lng->txt("crs_dismiss_member_body");
break;
case $this->NOTIFY_BLOCK_MEMBER:
$subject = $this->lng->txt("crs_blocked_member");
$body = $this->lng->txt("crs_blocked_member_body");
break;
case $this->NOTIFY_UNBLOCK_MEMBER:
$subject = $this->lng->txt("crs_unblocked_member");
$body = $this->lng->txt("crs_unblocked_member_body");
$body .= $link;
break;
case $this->NOTIFY_ACCEPT_USER:
$subject = $this->lng->txt("crs_added_member");
$body = $this->lng->txt("crs_added_member_body");
$body .= $link;
break;
case $this->NOTIFY_STATUS_CHANGED:
$subject = $this->lng->txt("crs_status_changed");
$body = $this->__buildStatusBody($tmp_user);
$body .= $link;
break;
case $this->NOTIFY_SUBSCRIPTION_REQUEST:
$this->sendSubscriptionRequestToAdmins($a_usr_id);
return true;
break;
case $this->NOTIFY_ADMINS:
$this->sendNotificationToAdmins($a_usr_id);
return true;
break;
}
$subject = sprintf($subject,$ilObjDataCache->lookupTitle($this->course_id));
$body = sprintf($body,$ilObjDataCache->lookupTitle($this->course_id));
include_once("Services/Mail/classes/class.ilMail.php");
$mail = new ilMail($ilUser->getId());
$mail->sendMail($tmp_user->getLogin(),'','',$subject,$body,array(),array('system'));
unset($tmp_user);
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::sendNotificationToAdmins | ( | $ | a_usr_id | ) |
Definition at line 1208 of file class.ilCourseParticipants.php.
References $ilDB, $res, ilObjCourse::_isSubscriptionNotificationEnabled(), ilObjectFactory::getInstanceByObjId(), isAdmin(), and isTutor().
Referenced by sendNotification().
{
global $ilDB,$ilObjDataCache;
if(!ilObjCourse::_isSubscriptionNotificationEnabled($this->course_id))
{
return true;
}
include_once("Services/Mail/classes/class.ilFormatMail.php");
$mail =& new ilFormatMail($a_usr_id);
$subject = sprintf($this->lng->txt("crs_new_subscription"),$ilObjDataCache->lookupTitle($this->course_id));
$body = sprintf($this->lng->txt("crs_new_subscription_body"),$ilObjDataCache->lookupTitle($this->course_id));
$body .= ("\n\n".ILIAS_HTTP_PATH."/goto.php?target=crs_".$this->course_ref_id."&client_id=".CLIENT_ID);
$query = "SELECT usr_id FROM crs_members ".
"WHERE notification = '1' ".
"AND obj_id = ".$ilDB->quote($this->course_id)."";
$res = $this->ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($this->isAdmin($row->usr_id) or $this->isTutor($row->usr_id))
{
$tmp_user =& ilObjectFactory::getInstanceByObjId($row->usr_id,false);
$message = $mail->sendMail($tmp_user->getLogin(),'','',$subject,$body,array(),array('system'));
unset($tmp_user);
}
}
unset($mail);
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::sendSubscriptionRequestToAdmins | ( | $ | a_usr_id | ) |
Definition at line 1182 of file class.ilCourseParticipants.php.
References $ilDB, ilObjCourse::_isSubscriptionNotificationEnabled(), ilObjectFactory::getInstanceByObjId(), and getNotificationRecipients().
Referenced by sendNotification().
{
global $ilDB,$ilObjDataCache,$ilUser;
if(!ilObjCourse::_isSubscriptionNotificationEnabled($this->course_id))
{
return true;
}
include_once("Services/Mail/classes/class.ilMail.php");
$mail = new ilMail($ilUser->getId());
$subject = sprintf($this->lng->txt("crs_new_subscription_request"),$ilObjDataCache->lookupTitle($this->course_id));
$body = sprintf($this->lng->txt("crs_new_subscription_request_body"),$ilObjDataCache->lookupTitle($this->course_id));
$body .= ("\n\n".$this->lng->txt('crs_new_subscription_request_body2'));
$body .= ("\n\n".ILIAS_HTTP_PATH."/goto.php?target=crs_".$this->course_ref_id."&client_id=".CLIENT_ID);
foreach($this->getNotificationRecipients() as $usr_id)
{
$tmp_user =& ilObjectFactory::getInstanceByObjId($usr_id,false);
$message = $mail->sendMail($tmp_user->getLogin(),'','',$subject,$body,array(),array('system'));
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseParticipants::sendUnsubscribeNotificationToAdmins | ( | $ | a_usr_id | ) |
Definition at line 1154 of file class.ilCourseParticipants.php.
References $ilDB, ilObjCourse::_isSubscriptionNotificationEnabled(), ilObjectFactory::getInstanceByObjId(), and getNotificationRecipients().
{
global $ilDB,$ilObjDataCache;
if(!ilObjCourse::_isSubscriptionNotificationEnabled($this->course_id))
{
return true;
}
include_once("Services/Mail/classes/class.ilFormatMail.php");
$mail =& new ilFormatMail($a_usr_id);
$subject = sprintf($this->lng->txt("crs_cancel_subscription"),$ilObjDataCache->lookupTitle($this->course_id));
$body = sprintf($this->lng->txt("crs_cancel_subscription_body"),$ilObjDataCache->lookupTitle($this->course_id));
$body .= ("\n\n".$this->lng->txt('crs_mail_permanent_link'));
$body .= ("\n\n".ILIAS_HTTP_PATH."/goto.php?target=crs_".$this->course_ref_id."&client_id=".CLIENT_ID);
foreach($this->getNotificationRecipients() as $usr_id)
{
$tmp_user =& ilObjectFactory::getInstanceByObjId($usr_id,false);
$message = $mail->sendMail($tmp_user->getLogin(),'','',$subject,$body,array(),array('system'));
unset($tmp_user);
}
return true;
}
Here is the call graph for this function:| ilCourseParticipants::updateBlocked | ( | $ | a_usr_id, | |
| $ | a_blocked | |||
| ) |
Update blocked status.
public
| int | usr_id | |
| bool | blocked |
Definition at line 633 of file class.ilCourseParticipants.php.
{
global $ilDB;
$this->participants_status[$a_usr_id]['blocked'] = (int) $a_blocked;
$query = "SELECT * FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
$res = $ilDB->query($query);
if($res->numRows())
{
$query = "UPDATE crs_members SET ".
"blocked = ".$ilDB->quote((int) $a_blocked)." ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
}
else
{
$query = "INSERT INTO crs_members SET ".
"blocked = ".$ilDB->quote((int) $a_blocked).", ".
"obj_id = ".$ilDB->quote($this->course_id).", ".
"usr_id = ".$ilDB->quote($a_usr_id);
}
$res = $ilDB->query($query);
return true;
}
| ilCourseParticipants::updateNotification | ( | $ | a_usr_id, | |
| $ | a_notification | |||
| ) |
Update notification status.
public
| int | usr_id | |
| bool | passed |
Definition at line 595 of file class.ilCourseParticipants.php.
{
global $ilDB;
$this->participants_status[$a_usr_id]['notification'] = (int) $a_notification;
$query = "SELECT * FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
$res = $ilDB->query($query);
if($res->numRows())
{
$query = "UPDATE crs_members SET ".
"notification = ".$ilDB->quote((int) $a_notification)." ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
}
else
{
$query = "INSERT INTO crs_members SET ".
"notification = ".$ilDB->quote((int) $a_notification).", ".
"obj_id = ".$ilDB->quote($this->course_id).", ".
"usr_id = ".$ilDB->quote($a_usr_id);
}
$res = $ilDB->query($query);
return true;
}
| ilCourseParticipants::updatePassed | ( | $ | a_usr_id, | |
| $ | a_passed | |||
| ) |
Update passed status.
public
| int | usr_id | |
| bool | passed |
Definition at line 557 of file class.ilCourseParticipants.php.
{
global $ilDB;
$this->participants_status[$a_usr_id]['passed'] = (int) $a_passed;
$query = "SELECT * FROM crs_members ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
$res = $ilDB->query($query);
if($res->numRows())
{
$query = "UPDATE crs_members SET ".
"passed = ".$ilDB->quote((int) $a_passed)." ".
"WHERE obj_id = ".$ilDB->quote($this->course_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
}
else
{
$query = "INSERT INTO crs_members SET ".
"passed = ".$ilDB->quote((int) $a_passed).", ".
"obj_id = ".$ilDB->quote($this->course_id).", ".
"usr_id = ".$ilDB->quote($a_usr_id);
}
$res = $ilDB->query($query);
return true;
}
| ilCourseParticipants::updateRoleAssignments | ( | $ | a_usr_id, | |
| $ | a_roles | |||
| ) |
Update role assignments.
public
| int | usr_id | |
| array | array of new roles |
Definition at line 327 of file class.ilCourseParticipants.php.
References getRoles(), readParticipants(), and readParticipantsStatus().
{
global $rbacreview,$rbacadmin;
$roles = $a_roles ? $a_roles : array();
foreach($this->getRoles() as $role_id)
{
if($rbacreview->isAssigned($a_usr_id,$role_id))
{
if(!in_array($role_id,$roles))
{
$rbacadmin->deassignUser($role_id,$a_usr_id);
}
}
else
{
if(in_array($role_id,$roles))
{
$rbacadmin->assignUser($role_id,$a_usr_id);
}
}
}
$this->readParticipants();
$this->readParticipantsStatus();
}
Here is the call graph for this function:| ilCourseParticipants::updateSubscriptionTime | ( | $ | a_usr_id, | |
| $ | a_subtime | |||
| ) |
Definition at line 960 of file class.ilCourseParticipants.php.
References $ilDB.
{
global $ilDB;
$query = "UPDATE crs_subscribers ".
"SET sub_time = ".$ilDB->quote($a_subtime)." ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND obj_id = ".$ilDB->quote($this->course_id)." ";
$this->db->query($query);
return true;
}
ilCourseParticipants::$admins = array() [protected] |
Definition at line 53 of file class.ilCourseParticipants.php.
ilCourseParticipants::$course_id = 0 [protected] |
Definition at line 44 of file class.ilCourseParticipants.php.
ilCourseParticipants::$course_ref_id = 0 [protected] |
Definition at line 45 of file class.ilCourseParticipants.php.
ilCourseParticipants::$course_role_data = array() [protected] |
Definition at line 47 of file class.ilCourseParticipants.php.
ilCourseParticipants::$course_roles = array() [protected] |
Definition at line 46 of file class.ilCourseParticipants.php.
ilCourseParticipants::$ilDB = null [protected] |
Definition at line 41 of file class.ilCourseParticipants.php.
Referenced by __buildStatusBody(), __construct(), __readSubscriberData(), __readSubscribers(), _deleteAllEntries(), _deleteUser(), _hasPassed(), _isBlocked(), _isParticipant(), _isSubscriber(), addSubscriber(), delete(), deleteSubscriber(), getNotificationRecipients(), isGroupingMember(), isSubscriber(), readParticipantsStatus(), sendNotificationToAdmins(), sendSubscriptionRequestToAdmins(), sendUnsubscribeNotificationToAdmins(), updateBlocked(), updateNotification(), updatePassed(), and updateSubscriptionTime().
ilCourseParticipants::$instances = array() [static, private] |
Definition at line 39 of file class.ilCourseParticipants.php.
ilCourseParticipants::$lng = null [protected] |
Definition at line 42 of file class.ilCourseParticipants.php.
Referenced by __construct().
ilCourseParticipants::$members = array() [protected] |
Definition at line 51 of file class.ilCourseParticipants.php.
ilCourseParticipants::$participants = array() [protected] |
Definition at line 49 of file class.ilCourseParticipants.php.
ilCourseParticipants::$participants_status = array() [protected] |
Definition at line 50 of file class.ilCourseParticipants.php.
ilCourseParticipants::$subscribers = array() [protected] |
Definition at line 55 of file class.ilCourseParticipants.php.
ilCourseParticipants::$tutors = array() [protected] |
Definition at line 52 of file class.ilCourseParticipants.php.
1.7.1