本文整理汇总了PHP中ilObjUser::getDepartment方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::getDepartment方法的具体用法?PHP ilObjUser::getDepartment怎么用?PHP ilObjUser::getDepartment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::getDepartment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userDataArrayForExport
function userDataArrayForExport($user, $b_allowExportPrivacy = false)
{
$userArray = array();
if ($b_allowExportPrivacy == false) {
$userArray["user"] = $user;
} else {
global $ilUser;
$userArray["login"] = "";
$userArray["user"] = "";
$userArray["email"] = "";
$userArray["department"] = "";
if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
$e_user = new ilObjUser($user);
$userArray["login"] = $e_user->getLogin();
$userArray["user"] = $e_user->getLastname() . ', ' . $e_user->getFirstname();
$userArray["email"] = "" . $e_user->getEmail();
$userArray["department"] = "" . $e_user->getDepartment();
}
}
return $userArray;
}
示例2: getHtml
/**
* Get HTML
*/
function getHtml()
{
global $tpl, $lng, $https;
$this->tpl = new ilTemplate("tpl.openlayers_map.html", true, true, "Services/Maps");
$lng->loadLanguageModule("maps");
$tpl->addJavaScript("Services/Maps/js/OpenLayers.js");
$tpl->addJavaScript("Services/Maps/js/ServiceOpenLayers.js");
// add user markers
$cnt = 0;
foreach ($this->user_marker as $user_id) {
if (ilObject::_exists($user_id)) {
$user = new ilObjUser($user_id);
if ($user->getLatitude() != 0 && $user->getLongitude() != 0 && $user->getPref("public_location") == "y") {
$this->tpl->setCurrentBlock("user_marker");
$this->tpl->setVariable("UMAP_ID", $this->getMapId());
$this->tpl->setVariable("CNT", $cnt);
$this->tpl->setVariable("ULAT", htmlspecialchars($user->getLatitude()));
$this->tpl->setVariable("ULONG", htmlspecialchars($user->getLongitude()));
$info = htmlspecialchars($user->getFirstName() . " " . $user->getLastName());
$delim = "<br \\/>";
if ($user->getPref("public_institution") == "y") {
$info .= $delim . htmlspecialchars($user->getInstitution());
$delim = ", ";
}
if ($user->getPref("public_department") == "y") {
$info .= $delim . htmlspecialchars($user->getDepartment());
}
$delim = "<br \\/>";
if ($user->getPref("public_street") == "y") {
$info .= $delim . htmlspecialchars($user->getStreet());
}
if ($user->getPref("public_zip") == "y") {
$info .= $delim . htmlspecialchars($user->getZipcode());
$delim = " ";
}
if ($user->getPref("public_city") == "y") {
$info .= $delim . htmlspecialchars($user->getCity());
}
$delim = "<br \\/>";
if ($user->getPref("public_country") == "y") {
$info .= $delim . htmlspecialchars($user->getCountry());
}
$this->tpl->setVariable("USER_INFO", $info);
$this->tpl->setVariable("IMG_USER", $user->getPersonalPicturePath("xsmall"));
$this->tpl->parseCurrentBlock();
$cnt++;
}
}
}
$this->tpl->setVariable("MAP_ID", $this->getMapId());
$this->tpl->setVariable("WIDTH", $this->getWidth());
$this->tpl->setVariable("HEIGHT", $this->getHeight());
$this->tpl->setVariable("LAT", $this->getLatitude());
$this->tpl->setVariable("LONG", $this->getLongitude());
$this->tpl->setVariable("ZOOM", (int) $this->getZoom());
$nav_control = $this->getEnableNavigationControl() ? "true" : "false";
$this->tpl->setVariable("NAV_CONTROL", $nav_control);
$central_marker = $this->getEnableCentralMarker() ? "true" : "false";
$this->tpl->setVariable("CENTRAL_MARKER", $central_marker);
$replace_marker = $this->getEnableUpdateListener() ? "true" : "false";
$this->tpl->setVariable("REPLACE_MARKER", $replace_marker);
$this->tpl->setVariable("INVALID_ADDRESS_STRING", $lng->txt("invalid_address"));
return $this->tpl->get();
}
示例3: importEndTag
//.........这里部分代码省略.........
if (!is_null($this->userObj->getInstitution())) {
$updateUser->setInstitution($this->userObj->getInstitution());
}
if (!is_null($this->userObj->getStreet())) {
$updateUser->setStreet($this->userObj->getStreet());
}
if (!is_null($this->userObj->getCity())) {
$updateUser->setCity($this->userObj->getCity());
}
if (!is_null($this->userObj->getZipCode())) {
$updateUser->setZipCode($this->userObj->getZipCode());
}
if (!is_null($this->userObj->getCountry())) {
$updateUser->setCountry($this->userObj->getCountry());
}
if (!is_null($this->userObj->getPhoneOffice())) {
$updateUser->setPhoneOffice($this->userObj->getPhoneOffice());
}
if (!is_null($this->userObj->getPhoneHome())) {
$updateUser->setPhoneHome($this->userObj->getPhoneHome());
}
if (!is_null($this->userObj->getPhoneMobile())) {
$updateUser->setPhoneMobile($this->userObj->getPhoneMobile());
}
if (!is_null($this->userObj->getFax())) {
$updateUser->setFax($this->userObj->getFax());
}
if (!is_null($this->userObj->getHobby())) {
$updateUser->setHobby($this->userObj->getHobby());
}
if (!is_null($this->userObj->getComment())) {
$updateUser->setComment($this->userObj->getComment());
}
if (!is_null($this->userObj->getDepartment())) {
$updateUser->setDepartment($this->userObj->getDepartment());
}
if (!is_null($this->userObj->getMatriculation())) {
$updateUser->setMatriculation($this->userObj->getMatriculation());
}
if (!is_null($this->currActive)) {
$updateUser->setActive($this->currActive == "true", is_object($ilUser) ? $ilUser->getId() : 0);
}
if (!is_null($this->userObj->getClientIP())) {
$updateUser->setClientIP($this->userObj->getClientIP());
}
if (!is_null($this->userObj->getTimeLimitUnlimited())) {
$updateUser->setTimeLimitUnlimited($this->userObj->getTimeLimitUnlimited());
}
if (!is_null($this->userObj->getTimeLimitFrom())) {
$updateUser->setTimeLimitFrom($this->userObj->getTimeLimitFrom());
}
if (!is_null($this->userObj->getTimeLimitUntil())) {
$updateUser->setTimeLimitUntil($this->userObj->getTimeLimitUntil());
}
if (!is_null($this->userObj->getTimeLimitMessage())) {
$updateUser->setTimeLimitMessage($this->userObj->getTimeLimitMessage());
}
if (!is_null($this->userObj->getApproveDate())) {
$updateUser->setApproveDate($this->userObj->getApproveDate());
}
if (!is_null($this->userObj->getAgreeDate())) {
$updateUser->setAgreeDate($this->userObj->getAgreeDate());
}
if (!is_null($this->userObj->getLanguage())) {
$updateUser->setLanguage($this->userObj->getLanguage());
}
示例4: exportSelected
function exportSelected($a_exportall = 0, $a_user = array())
{
global $ilDB, $ilUser;
$scos = array();
//get all SCO's of this object
$query = 'SELECT cp_node.cp_node_id ' . 'FROM cp_node, cp_resource, cp_item ' . 'WHERE cp_item.cp_node_id = cp_node.cp_node_id ' . 'AND cp_item.resourceid = cp_resource.id AND scormtype = %s ' . 'AND nodename = %s AND cp_node.slm_id = %s';
$res = $ilDB->queryF($query, array('text', 'text', 'integer'), array('sco', 'item', $this->getId()));
while ($row = $ilDB->fetchAssoc($res)) {
$scos[] = $row['cp_node_id'];
}
$csv = null;
//a module is completed when all SCO's are completed
$user_array = array();
if ($a_exportall == 1) {
$query = 'SELECT user_id ' . 'FROM cmi_node, cp_node ' . 'WHERE cmi_node.cp_node_id = cp_node.cp_node_id AND cp_node.slm_id = %s ' . 'GROUP BY user_id';
$res = $ilDB->queryF($query, array('integer'), array($this->getId()));
while ($row = $ilDB->fetchAssoc($res)) {
$user_array[] = $row['user_id'];
}
} else {
$user_array = $a_user;
}
foreach ($user_array as $user) {
$scos_c = $scos;
//copy SCO_array
//check if all SCO's are completed
for ($i = 0; $i < count($scos); $i++) {
$query = 'SELECT * FROM cmi_node ' . 'WHERE user_id = %s AND cp_node_id = %s ' . 'AND completion_status = %s OR success_status = %s';
$res = $ilDB->queryF($query, array('integer', 'integer', 'text', 'text'), array($user, $scos[$i], 'completed', 'passed'));
$data = $ilDB->fetchAssoc($res);
if (is_array($data) && count($data)) {
//delete from array
$key = array_search($scos[$i], $scos_c);
unset($scos_c[$key]);
}
}
//check for completion
if (count($scos_c) == 0) {
$completion = 1;
} else {
$completion = 0;
}
//write export entry
if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
$e_user = new ilObjUser($user);
$login = $e_user->getLogin();
$firstname = $e_user->getFirstname();
$lastname = $e_user->getLastname();
$email = $e_user->getEmail();
$department = $e_user->getDepartment();
$query = 'SELECT user_id, MAX(c_timestamp) exp_date ' . 'FROM cmi_node, cp_node ' . 'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' . 'AND cp_node.slm_id = %s ' . 'GROUP BY user_id';
$res = $ilDB->queryF($query, array('integer'), array($this->getId()));
$data = $ilDB->fetchAssoc($res);
if (is_array($data) && count($data)) {
$validDate = false;
$datetime = explode(' ', $data['exp_date']);
if (count($datetime) == 2) {
$date = explode('-', $datetime[0]);
if (count($date) == 3 && checkdate($date[1], $date[2], $date[0])) {
$validDate = true;
}
}
if ($validDate) {
$date = date('d.m.Y', strtotime($data['exp_date']));
} else {
$date = '';
}
} else {
$date = '';
}
$csv = $csv . "{$department};{$login};{$lastname};{$firstname};{$email};{$date};{$completion}\n";
}
}
$header = "Department;Login;Lastname;Firstname;Email;Date;Status\n";
$this->sendExportFile($header, $csv);
}
示例5: getHtml
/**
* Get HTML
*/
function getHtml()
{
global $tpl;
$this->tpl = new ilTemplate("tpl.google_map.html", true, true, "Services/GoogleMaps");
$tpl->addJavaScript("//maps.google.com/maps/api/js?sensor=false", false);
$tpl->addJavaScript("Services/GoogleMaps/js/ServiceGoogleMaps.js");
// add user markers
$cnt = 0;
foreach ($this->user_marker as $user_id) {
if (ilObject::_exists($user_id)) {
$user = new ilObjUser($user_id);
if ($user->getLatitude() != 0 && $user->getLongitude() != 0 && $user->getPref("public_location") == "y") {
$this->tpl->setCurrentBlock("user_marker");
$this->tpl->setVariable("UMAP_ID", $this->getMapId());
$this->tpl->setVariable("CNT", $cnt);
$this->tpl->setVariable("ULAT", htmlspecialchars($user->getLatitude()));
$this->tpl->setVariable("ULONG", htmlspecialchars($user->getLongitude()));
$info = htmlspecialchars($user->getFirstName() . " " . $user->getLastName());
$delim = "<br \\/>";
if ($user->getPref("public_institution") == "y") {
$info .= $delim . htmlspecialchars($user->getInstitution());
$delim = ", ";
}
if ($user->getPref("public_department") == "y") {
$info .= $delim . htmlspecialchars($user->getDepartment());
}
$delim = "<br \\/>";
if ($user->getPref("public_street") == "y") {
$info .= $delim . htmlspecialchars($user->getStreet());
}
if ($user->getPref("public_zip") == "y") {
$info .= $delim . htmlspecialchars($user->getZipcode());
$delim = " ";
}
if ($user->getPref("public_city") == "y") {
$info .= $delim . htmlspecialchars($user->getCity());
}
$delim = "<br \\/>";
if ($user->getPref("public_country") == "y") {
$info .= $delim . htmlspecialchars($user->getCountry());
}
$this->tpl->setVariable("USER_INFO", $info);
$this->tpl->setVariable("IMG_USER", $user->getPersonalPicturePath("xsmall"));
$this->tpl->parseCurrentBlock();
$cnt++;
}
}
}
$this->tpl->setVariable("MAP_ID", $this->getMapId());
$this->tpl->setVariable("WIDTH", $this->getWidth());
$this->tpl->setVariable("HEIGHT", $this->getHeight());
$this->tpl->setVariable("LAT", $this->getLatitude());
$this->tpl->setVariable("LONG", $this->getLongitude());
$this->tpl->setVariable("ZOOM", (int) $this->getZoom());
$type_control = $this->getEnableTypeControl() ? "true" : "false";
$this->tpl->setVariable("TYPE_CONTROL", $type_control);
$nav_control = $this->getEnableNavigationControl() ? "true" : "false";
$this->tpl->setVariable("NAV_CONTROL", $nav_control);
$update_listener = $this->getEnableUpdateListener() ? "true" : "false";
$this->tpl->setVariable("UPDATE_LISTENER", $update_listener);
$large_map_control = $this->getEnableLargeMapControl() ? "true" : "false";
$this->tpl->setVariable("LARGE_CONTROL", $large_map_control);
$central_marker = $this->getEnableCentralMarker() ? "true" : "false";
$this->tpl->setVariable("CENTRAL_MARKER", $central_marker);
return $this->tpl->get();
}
示例6: parseUserPlaceholders
/**
* Return all Placeholders of user data
*
* @param ilObjUser $user
* @return array
*/
protected function parseUserPlaceholders(ilObjUser $user)
{
return array('USER_LOGIN' => $this->anonymized ? 'johndoe' : $user->getLogin(), 'USER_TITLE' => $this->anonymized ? 'Mister' : $user->getUTitle(), 'USER_FULLNAME' => $this->anonymized ? 'John Doe' : $user->getFullname(), 'USER_FIRSTNAME' => $this->anonymized ? 'John' : $user->getFirstname(), 'USER_LASTNAME' => $this->anonymized ? 'Doe' : $user->getLastname(), 'USER_BIRTHDAY' => $user->getBirthday(), 'USER_INSTITUTION' => $user->getInstitution(), 'USER_DEPARTMENT' => $user->getDepartment(), 'USER_STREET' => $this->anonymized ? 'Manhattan Street' : $user->getStreet(), 'USER_CITY' => $this->anonymized ? 'New York' : $user->getCity(), 'USER_ZIPCODE' => $this->anonymized ? 10026 : $user->getZipcode(), 'USER_COUNTRY' => $this->anonymized ? 'USA' : $user->getCountry());
}