本文整理汇总了PHP中ilObjUser::_lookupLogin方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::_lookupLogin方法的具体用法?PHP ilObjUser::_lookupLogin怎么用?PHP ilObjUser::_lookupLogin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::_lookupLogin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $ilAccess;
// rollback command
if ($a_set["nr"] > 0) {
$ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]);
$this->tpl->setCurrentBlock("command");
$this->tpl->setVariable("TXT_COMMAND", $lng->txt("cont_rollback"));
$this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTarget($this->getParentObject(), "rollbackConfirmation"));
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this->getParentObject(), "old_nr", "");
}
if (!$this->rselect) {
$this->tpl->setVariable("RSELECT", 'checked="checked"');
$this->rselect = true;
} else {
if (!$this->lselect) {
$this->tpl->setVariable("LSELECT", 'checked="checked"');
$this->lselect = true;
}
}
$this->tpl->setVariable("NR", $a_set["nr"]);
$this->tpl->setVariable("TXT_HDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["hdate"], IL_CAL_DATETIME)));
$ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]);
$ilCtrl->setParameter($this->getParentObject(), "history_mode", "1");
$this->tpl->setVariable("HREF_OLD_PAGE", $ilCtrl->getLinkTarget($this->getParentObject(), "preview"));
$ilCtrl->setParameter($this->getParentObject(), "history_mode", "");
if (ilObject::_exists($a_set["user"])) {
// user name
$user = ilObjUser::_lookupName($a_set["user"]);
$login = ilObjUser::_lookupLogin($a_set["user"]);
//$this->tpl->setVariable("TXT_LINKED_USER",
// $user["lastname"].", ".$user["firstname"]." [".$login."]");
// profile link
include_once "./Services/User/classes/class.ilUserUtil.php";
$name_pres = ilUserUtil::getNamePresentation($a_set["user"], true, true, $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd()));
//$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user", $a_set["user"]);
//$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url",
// rawurlencode($ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())));
//$this->tpl->setVariable("USER_LINK",
// $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
//$img = ilObjUser::_getPersonalPicturePath($a_set["user"], "xxsmall");
//$this->tpl->setVariable("IMG_USER", $img);
$this->tpl->setVariable("TXT_USER", $name_pres);
}
$ilCtrl->setParameter($this->getParentObject(), "old_nr", "");
}
示例2: owner
function owner()
{
$this->__initSubTabs("owner");
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "owner"));
$form->setTitle($this->lng->txt("info_owner_of_object"));
$login = new ilTextInputGUI($this->lng->txt("login"), "owner");
$login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
$login->setRequired(true);
$login->setSize(50);
$login->setInfo($this->lng->txt("chown_warning"));
$login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
$form->addItem($login);
$form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
$this->tpl->setContent($form->getHTML());
}
示例3: sendMailToSelectedUsers
/**
* show send mail
*
* @access public
* @param
* @return
*/
public function sendMailToSelectedUsers()
{
if (isset($_GET['member_id'])) {
$_POST['participants'] = array($_GET['member_id']);
} else {
$_POST['participants'] = array_unique(array_merge((array) $_POST['admins'], (array) $_POST['tutors'], (array) $_POST['members'], (array) $_POST['roles'], (array) $_POST['waiting'], (array) $_POST['subscribers']));
}
if (!count($_POST['participants'])) {
ilUtil::sendFailure($GLOBALS['lng']->txt("no_checkbox"), TRUE);
$this->ctrl->returnToParent($this);
return false;
}
foreach ($_POST['participants'] as $usr_id) {
$rcps[] = ilObjUser::_lookupLogin($usr_id);
}
require_once 'Services/Mail/classes/class.ilMailFormCall.php';
ilUtil::redirect(ilMailFormCall::getRedirectTarget($this->getCurrentObject(), 'members', array(), array('type' => 'new', 'rcp_to' => implode(',', $rcps), 'sig' => $this->createMailSignature())));
return true;
}
示例4: adoptMembers
/**
* Take over course members to addressbook
*/
public function adoptMembers()
{
global $lng;
$ids = (int) $_GET['search_members'] ? array((int) $_GET['search_members']) : $_POST['search_members'];
if ($ids) {
foreach ($ids as $member) {
$login = ilObjUser::_lookupLogin($member);
if (!$this->abook->checkEntry($login)) {
$name = ilObjUser::_lookupName($member);
$email = '';
if (ilObjUser::_lookupPref((int) $member, 'public_email') == 'y') {
$email = ilObjUser::_lookupEmail($member);
}
$this->abook->addEntry($login, $name["firstname"], $name["lastname"], $email);
}
}
ilUtil::sendInfo($lng->txt("mail_members_added_addressbook"));
} else {
ilUtil::sendInfo($lng->txt("mail_select_one_entry"));
}
$this->showMembers();
}
示例5: showResults
//.........这里部分代码省略.........
}
include_once 'Services/Search/classes/class.ilQueryParser.php';
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilSearchResult.php';
$all_results = new ilSearchResult();
$query_parser = new ilQueryParser(addcslashes($_SESSION['mail_search_search'], '%_'));
$query_parser->setCombination(QP_COMBINATION_AND);
$query_parser->setMinWordLength(3);
$query_parser->parse();
$user_search =& ilObjectSearchFactory::_getUserSearchInstance($query_parser);
$user_search->enableActiveCheck(true);
$user_search->setFields(array('login'));
$result_obj = $user_search->performSearch();
$all_results->mergeEntries($result_obj);
$user_search->setFields(array('firstname'));
$result_obj = $user_search->performSearch();
$all_results->mergeEntries($result_obj);
$user_search->setFields(array('lastname'));
$result_obj = $user_search->performSearch();
$all_results->mergeEntries($result_obj);
$all_results->setMaxHits(100000);
$all_results->preventOverwritingMaxhits(true);
$all_results->filter(ROOT_FOLDER_ID, true);
// Filter users (depends on setting in user accounts)
include_once 'Services/User/classes/class.ilUserFilter.php';
$users = ilUserFilter::getInstance()->filter($all_results->getResultIds());
if (count($users)) {
$tbl_users = new ilTable2GUI($this);
$tbl_users->setTitle($lng->txt('system') . ': ' . $lng->txt('persons'));
$tbl_users->setRowTemplate('tpl.mail_search_users_row.html', 'Services/Contact');
$result = array();
$counter = 0;
foreach ($users as $user) {
$login = ilObjUser::_lookupLogin($user);
if ($_GET["ref"] != "wsp") {
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_usr[]', $login) . ilUtil::formCheckbox(0, 'search_name_cc[]', $login) . ilUtil::formCheckbox(0, 'search_name_bcc[]', $login);
} else {
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_usr[]', $user);
}
$result[$counter]['login'] = $login;
if (in_array(ilObjUser::_lookupPref($user, 'public_profile'), array('y', "g"))) {
$name = ilObjUser::_lookupName($user);
$result[$counter]['firstname'] = $name['firstname'];
$result[$counter]['lastname'] = $name['lastname'];
} else {
$result[$counter]['firstname'] = '';
$result[$counter]['lastname'] = '';
}
if (ilObjUser::_lookupPref($user, 'public_email') == 'y') {
$has_mail_usr = true;
$result[$counter]['email'] = ilObjUser::_lookupEmail($user);
}
++$counter;
}
if ($_GET["ref"] != "wsp") {
$tbl_users->addColumn($this->lng->txt('mail_to') . '/' . $this->lng->txt('cc') . '/' . $this->lng->txt('bc'), 'check', '10%');
} else {
$tbl_users->addColumn("", "", "1%");
}
$tbl_users->addColumn($this->lng->txt('login'), 'login', '15%');
$tbl_users->addColumn($this->lng->txt('firstname'), 'firstname', '15%');
$tbl_users->addColumn($this->lng->txt('lastname'), 'lastname', '15%');
if ($has_mail_usr == true) {
foreach ($result as $key => $val) {
if ($val['email'] == '') {
$result[$key]['email'] = ' ';
示例6: getMemberListData
/**
* get member list data
*/
function getMemberListData($a_eph_id, $a_ass_id)
{
global $ilDB;
$mem = array();
// first get list of members from member table
$set = $ilDB->query("SELECT * FROM rep_robj_xeph_members " . "WHERE obj_id = " . $ilDB->quote($a_eph_id, "integer"));
while ($rec = $ilDB->fetchAssoc($set)) {
if (ilObject::_exists($rec["user_id"]) && ilObject::_lookupType($rec["user_id"]) == "usr") {
$name = ilObjUser::_lookupName($rec["user_id"]);
$login = ilObjUser::_lookupLogin($rec["user_id"]);
$mem[$rec["user_id"]] = array("name" => $name["lastname"] . ", " . $name["firstname"], "login" => $login, "user_id" => $rec["user_id"], "lastname" => $name["lastname"], "firstname" => $name["firstname"]);
}
}
$q = "SELECT * FROM rep_robj_xeph_ass_stat " . "WHERE ass_id = " . $ilDB->quote($a_ass_id, "integer");
$set = $ilDB->query($q);
while ($rec = $ilDB->fetchAssoc($set)) {
if (isset($mem[$rec["user_id"]])) {
$mem[$rec["user_id"]]["sent_time"] = $rec["sent_time"];
$mem[$rec["user_id"]]["submission"] = ilEphAssignment::getLastSubmission($a_ass_id, $rec["user_id"]);
$mem[$rec["user_id"]]["status_time"] = $rec["status_time"];
$mem[$rec["user_id"]]["feedback_time"] = $rec["feedback_time"];
$mem[$rec["user_id"]]["notice"] = $rec["notice"];
$mem[$rec["user_id"]]["status"] = $rec["status"];
}
}
return $mem;
}
示例7: testCreateSetLookupDelete
/**
* Creates a user, sets preferences, lookups data, delete user
* @group IL_Init
*/
public function testCreateSetLookupDelete()
{
include_once "./Services/User/classes/class.ilObjUser.php";
// delete all aatestuser from previous runs
while (($i = ilObjUser::_lookupId("aatestuser")) > 0) {
$user = new ilObjUser($i);
$user->delete();
}
$user = new ilObjUser();
// creation
$d = array("login" => "aatestuser", "passwd_type" => IL_PASSWD_PLAIN, "passwd" => "password", "gender" => "m", "firstname" => "Max", "lastname" => "Mutzke", "email" => "de@de.de", "client_ip" => "1.2.3.4", "ext_account" => "ext_mutzke");
$user->assignData($d);
$user->create();
$user->saveAsNew();
$user->setLanguage("no");
$user->writePrefs();
$id = $user->getId();
$value .= $user->getFirstname() . "-";
// update
$user->setFirstname("Maxi");
$user->update();
$value .= $user->getFirstname() . "-";
// other update methods
$user->refreshLogin();
// lookups
$value .= ilObjUser::_lookupEmail($id) . "-";
$value .= ilObjUser::_lookupGender($id) . "-";
$value .= ilObjUser::_lookupClientIP($id) . "-";
$n = ilObjUser::_lookupName($id);
$value .= $n["lastname"] . "-";
ilObjUser::_lookupFields($id);
$value .= ilObjUser::_lookupLogin($id) . "-";
$value .= ilObjUser::_lookupExternalAccount($id) . "-";
$value .= ilObjUser::_lookupId("aatestuser") . "-";
ilObjUser::_lookupLastLogin($id);
$value .= ilObjUser::_lookupLanguage($id) . "-";
ilObjUser::_readUsersProfileData(array($id));
if (ilObjUser::_loginExists("aatestuser")) {
$value .= "le-";
}
// preferences...
$user->writePref("testpref", "pref1");
$value .= ilObjUser::_lookupPref($id, "testpref") . "-";
$user->deletePref("testpref");
if (ilObjUser::_lookupPref($id, "testpref") == "") {
$value .= "pref2" . "-";
}
// activation
$user->setActive(false);
if (!ilObjUser::getStoredActive($id)) {
}
$value .= "act1-";
$user->setActive(true);
if (ilObjUser::getStoredActive($id)) {
}
$value .= "act2-";
ilObjUser::_toggleActiveStatusOfUsers(array($id), false);
if (!ilObjUser::getStoredActive($id)) {
}
$value .= "act3-";
// deletion
$user->delete();
$this->assertEquals("Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-{$id}-no-le-" . "pref1-pref2-act1-act2-act3-", $value);
}
示例8: getManagedUsers
/**
* Get all managed consultation hours users for current users
* @return array
*/
public static function getManagedUsers()
{
global $ilDB, $ilUser;
$all = array();
$set = $ilDB->query('SELECT user_id FROM cal_ch_settings' . ' WHERE admin_id = ' . $ilDB->quote($ilUser->getId(), 'integer'));
while ($row = $ilDB->fetchAssoc($set)) {
$all[$row['user_id']] = ilObjUser::_lookupLogin($row['user_id']);
}
return $all;
}
示例9: sendNotification
/**
* @param $a_action
* @param $a_table_id
* @param null $a_record_id
*/
public static function sendNotification($a_action, $a_table_id, $a_record_id = NULL)
{
global $ilUser, $ilAccess;
// If coming from trash, never send notifications and don't load dcl Object
if ($_GET['ref_id'] == SYSTEM_FOLDER_ID) {
return;
}
$dclObj = new ilObjDataCollection($_GET['ref_id']);
if ($dclObj->getNotification() != 1) {
return;
}
$obj_table = ilDataCollectionCache::getTableCache($a_table_id);
$obj_dcl = $obj_table->getCollectionObject();
// recipients
require_once './Services/Notification/classes/class.ilNotification.php';
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_DATA_COLLECTION, $obj_dcl->getId(), true);
if (!sizeof($users)) {
return;
}
ilNotification::updateNotificationTime(ilNotification::TYPE_DATA_COLLECTION, $obj_dcl->getId(), $users);
//FIXME $_GET['ref_id]
require_once './Services/Link/classes/class.ilLink.php';
$link = ilLink::_getLink($_GET['ref_id']);
// prepare mail content
// use language of recipient to compose message
require_once './Services/Language/classes/class.ilLanguageFactory.php';
// send mails
require_once './Services/Mail/classes/class.ilMail.php';
require_once './Services/User/classes/class.ilObjUser.php';
require_once './Services/Language/classes/class.ilLanguageFactory.php';
require_once './Services/User/classes/class.ilUserUtil.php';
require_once './Services/User/classes/class.ilUserUtil.php';
require_once './Modules/DataCollection/classes/class.ilDataCollectionTable.php';
foreach (array_unique($users) as $idx => $user_id) {
// the user responsible for the action should not be notified
// FIXME $_GET['ref_id]
if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $_GET['ref_id'])) {
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('dcl');
$subject = sprintf($ulng->txt('dcl_change_notification_subject'), $obj_dcl->getTitle());
// update/delete
$message = $ulng->txt("dcl_hello") . " " . ilObjUser::_lookupFullname($user_id) . ",\n\n";
$message .= $ulng->txt('dcl_change_notification_dcl_' . $a_action) . ":\n\n";
$message .= $ulng->txt('obj_dcl') . ": " . $obj_dcl->getTitle() . "\n\n";
$message .= $ulng->txt('dcl_table') . ": " . $obj_table->getTitle() . "\n\n";
$message .= $ulng->txt('dcl_record') . ":\n";
$message .= "------------------------------------\n";
if ($a_record_id) {
$record = ilDataCollectionCache::getRecordCache($a_record_id);
if (!$record->getTableId()) {
$record->setTableId($a_table_id);
}
// $message .= $ulng->txt('dcl_record_id').": ".$a_record_id.":\n";
$t = "";
foreach ($record->getTable()->getVisibleFields() as $field) {
if ($record->getRecordField($field->getId())) {
$t .= $field->getTitle() . ": " . $record->getRecordField($field->getId())->getPlainText() . "\n";
}
}
$message .= $t . "\n";
}
$message .= "------------------------------------\n";
$message .= $ulng->txt('dcl_changed_by') . ": " . $ilUser->getFullname() . " " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
$message .= $ulng->txt('dcl_change_notification_link') . ": " . $link . "\n\n";
$message .= $ulng->txt('dcl_change_why_you_receive_this_email');
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
} else {
unset($users[$idx]);
}
}
}
示例10: parse
/**
* parse table
*
* @access public
* @return
*/
public function parse()
{
$this->init();
foreach ($this->getParticipants() as $participant_id) {
$usr_data = $this->session_participants->getUser($participant_id);
$tmp_data['id'] = $participant_id;
$name = ilObjUser::_lookupName($participant_id);
$tmp_data['name'] = $name['lastname'];
$tmp_data['lastname'] = $name['lastname'];
$tmp_data['firstname'] = $name['firstname'];
$tmp_data['login'] = ilObjUser::_lookupLogin($participant_id);
$tmp_data['mark'] = $usr_data['mark'];
$tmp_data['comment'] = $usr_data['comment'];
$tmp_data['participated'] = $this->session_participants->hasParticipated($participant_id);
$tmp_data['registered'] = $this->session_participants->isRegistered($participant_id);
$part[] = $tmp_data;
}
$this->setData($part ? $part : array());
}
示例11: verifyEndTag
/**
* handler for end of element when in verify mode.
*/
function verifyEndTag($a_xml_parser, $a_name)
{
global $lng, $ilAccess, $ilSetting, $ilObjDataCache;
switch ($a_name) {
case "Role":
$this->roles[$this->current_role_id]["name"] = $this->cdata;
$this->roles[$this->current_role_id]["type"] = $this->current_role_type;
$this->roles[$this->current_role_id]["action"] = $this->current_role_action;
break;
case "User":
$this->userObj->setFullname();
if ($this->user_id != -1 && $this->action == "Update") {
$user_exists = !is_null(ilObjUser::_lookupLogin($this->user_id));
} else {
$user_exists = ilObjUser::getUserIdByLogin($this->userObj->getLogin()) != 0;
}
if (is_null($this->userObj->getLogin())) {
$this->logFailure("---", sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Login", "Insert"));
}
switch ($this->action) {
case "Insert":
if ($user_exists and $this->conflict_rule == IL_FAIL_ON_CONFLICT) {
$this->logWarning($this->userObj->getLogin(), $lng->txt("usrimport_cant_insert"));
}
if (is_null($this->userObj->getGender()) && $this->isFieldRequired("gender")) {
$this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Gender", "Insert"));
}
if (is_null($this->userObj->getFirstname())) {
$this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Firstname", "Insert"));
}
if (is_null($this->userObj->getLastname())) {
$this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Lastname", "Insert"));
}
if (count($this->roles) == 0) {
$this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Role", "Insert"));
} else {
$has_global_role = false;
foreach ($this->roles as $role) {
if ($role['type'] == 'Global') {
$has_global_role = true;
break;
}
}
if (!$has_global_role) {
$this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_global_role_for_action_required"), "Insert"));
}
}
break;
case "Update":
if (!$user_exists) {
$this->logWarning($this->userObj->getLogin(), $lng->txt("usrimport_cant_update"));
} elseif ($this->user_id != -1 && !is_null($this->userObj->getLogin())) {
$someonesId = ilObjUser::_lookupId($this->userObj->getLogin());
if (is_numeric($someonesId) && $someonesId != $this->user_id) {
$this->logFailure($this->userObj->getLogin(), $lng->txt("usrimport_login_is_not_unique"));
}
}
break;
case "Delete":
if (!$user_exists) {
$this->logWarning($this->userObj->getLogin(), $lng->txt("usrimport_cant_delete"));
}
break;
}
// init role array for next user
$this->roles = array();
break;
case "Login":
if (array_key_exists($this->cdata, $this->logins)) {
$this->logWarning($this->cdata, $lng->txt("usrimport_login_is_not_unique"));
} else {
$this->logins[$this->cdata] = $this->cdata;
}
$this->userObj->setLogin($this->cdata);
break;
case "Password":
switch ($this->currPasswordType) {
case "ILIAS2":
$this->userObj->setPasswd($this->cdata, IL_PASSWD_CRYPT);
break;
case "ILIAS3":
$this->userObj->setPasswd($this->cdata, IL_PASSWD_MD5);
break;
case "PLAIN":
$this->userObj->setPasswd($this->cdata, IL_PASSWD_PLAIN);
$this->acc_mail->setUserPassword($this->currPassword);
break;
default:
$this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_attribute_value_illegal"), "Type", "Password", $this->currPasswordType));
break;
}
break;
case "Firstname":
$this->userObj->setFirstname($this->cdata);
break;
case "Lastname":
$this->userObj->setLastname($this->cdata);
//.........这里部分代码省略.........
示例12: getLogin
/**
* Returns the login for the specified user id, or null if
* the user does not exist.
*/
protected function getLogin($userId)
{
$login = ilObjUser::_lookupLogin($userId);
$this->writelog('getLogin(' . $userId . '):' . var_export($login, true));
return $login;
}
示例13: eventsListObject
/**
* list sessions of all user
*
* @access public
* @param
* @return
*/
public function eventsListObject()
{
global $ilErr, $ilAccess, $ilUser, $tree;
if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
$ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
}
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
$this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
include_once 'Modules/Session/classes/class.ilEventParticipants.php';
$this->tpl->addBlockfile("EVENTS_TABLE", "events_table", "tpl.table.html");
$this->tpl->addBlockfile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
$members_obj = $this->initContainer(true);
$members = $members_obj->getParticipants();
$members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
// Table
$tbl = new ilTableGUI();
$tbl->setTitle($this->lng->txt("event_overview"), 'icon_usr.png', $this->lng->txt('obj_usr'));
$this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
$course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
$events = array();
foreach ($tree->getSubtree($tree->getNodeData($course_ref_id), false, 'sess') as $event_id) {
$tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
if (!is_object($tmp_event) or $tmp_event->getType() != 'sess') {
continue;
}
$events[] = $tmp_event;
}
$headerNames = array();
$headerVars = array();
$colWidth = array();
$headerNames[] = $this->lng->txt('name');
$headerVars[] = "name";
$colWidth[] = '20%';
for ($i = 1; $i <= count($events); $i++) {
$headerNames[] = $i;
$headerVars[] = "event_" . $i;
$colWidth[] = 80 / count($events) . "%";
}
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$tbl->setHeaderNames($headerNames);
$tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this, 'eventsList'));
$tbl->setColumnWidth($colWidth);
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setLimit($ilUser->getPref("hits_per_page"));
$tbl->setMaxCount(count($members));
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
$sliced_users = array_slice($members, $_GET['offset'], $_SESSION['tbl_limit']);
$tbl->disable('sort');
$tbl->render();
$counter = 0;
foreach ($sliced_users as $user_id) {
foreach ($events as $event_obj) {
$this->tpl->setCurrentBlock("eventcols");
$event_part = new ilEventParticipants($this->object->getId());
$this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png'));
$this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ? $this->lng->txt('event_participated') : $this->lng->txt('event_not_participated'));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("tbl_content");
$name = ilObjUser::_lookupName($user_id);
$this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
$this->tpl->setVariable("LASTNAME", $name['lastname']);
$this->tpl->setVariable("FIRSTNAME", $name['firstname']);
$this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
$this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
$this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
$this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
$this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
$i = 1;
foreach ($events as $event_obj) {
$this->tpl->setCurrentBlock("legend_loop");
$this->tpl->setVariable("LEGEND_CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
$this->tpl->setVariable("LEGEND_DIGIT", $i++);
$this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
$this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
$this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
$this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
$this->tpl->parseCurrentBlock();
}
}
示例14: showUser
public function showUser()
{
global $ilCtrl, $ilToolbar;
$this->ctrl->setParameter($this, "mail_id", $_GET["mail_id"]);
$this->tpl->setTitle($this->lng->txt("mail"));
//$ilToolbar->addButton($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "showMail"));
$this->tpl->setVariable("TBL_TITLE", $this->lng->txt("profile_of") . " " . ilObjUser::_lookupLogin($_GET["user"]));
$this->tpl->setVariable("TBL_TITLE_IMG", ilUtil::getImagePath("icon_usr.svg"));
$this->tpl->setVariable("TBL_TITLE_IMG_ALT", $this->lng->txt("public_profile"));
include_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
$profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
$profile_gui->setBackUrl($this->ctrl->getLinkTarget($this, "showMail"));
$this->tpl->setContent($ilCtrl->getHTML($profile_gui));
$this->tpl->show();
return true;
}
示例15: exportCSV
/**
* Events List CSV Export
*
* @access public
* @param
*
*/
public function exportCSV()
{
global $tree, $ilAccess;
include_once 'Services/Utilities/classes/class.ilCSVWriter.php';
include_once 'Modules/Session/classes/class.ilEventParticipants.php';
$members = $this->members_obj->getParticipants();
$members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
$events = array();
foreach ($tree->getSubtree($tree->getNodeData($this->course_ref_id), false, 'sess') as $event_id) {
$tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
if (!is_object($tmp_event) or !$ilAccess->checkAccess('write', '', $event_id)) {
continue;
}
$events[] = $tmp_event;
}
$this->csv = new ilCSVWriter();
$this->csv->addColumn($this->lng->txt("lastname"));
$this->csv->addColumn($this->lng->txt("firstname"));
$this->csv->addColumn($this->lng->txt("login"));
foreach ($events as $event_obj) {
// TODO: do not export relative dates
$this->csv->addColumn($event_obj->getTitle() . ' (' . $event_obj->getFirstAppointment()->appointmentToString() . ')');
}
$this->csv->addRow();
foreach ($members as $user_id) {
$name = ilObjUser::_lookupName($user_id);
$this->csv->addColumn($name['lastname']);
$this->csv->addColumn($name['firstname']);
$this->csv->addColumn(ilObjUser::_lookupLogin($user_id));
foreach ($events as $event_obj) {
$event_part = new ilEventParticipants((int) $event_obj->getId());
$this->csv->addColumn($event_part->hasParticipated($user_id) ? $this->lng->txt('event_participated') : $this->lng->txt('event_not_participated'));
}
$this->csv->addRow();
}
$date = new ilDate(time(), IL_CAL_UNIX);
ilUtil::deliverData($this->csv->getCSVString(), $date->get(IL_CAL_FKT_DATE, 'Y-m-d') . "_course_events.csv", "text/csv");
}