本文整理汇总了PHP中CIntranetUtils::IsUserHonoured方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::IsUserHonoured方法的具体用法?PHP CIntranetUtils::IsUserHonoured怎么用?PHP CIntranetUtils::IsUserHonoured使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIntranetUtils
的用法示例。
在下文中一共展示了CIntranetUtils::IsUserHonoured方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$arDepCache[] = $arSect['ID'];
$arDepCacheValue[$arSect['ID']] = $arSect['NAME'];
}
}
foreach ($arUser['UF_DEPARTMENT'] as $key => $sect) {
$arDep[$sect] = $arDepCacheValue[$sect];
}
}
$arUser['UF_DEPARTMENT'] = $arDep;
$arUser["DETAIL_URL"] = $arItem["URL"];
$arUser['IS_ONLINE'] = $bSoNet && $arUser['IS_ONLINE'] == "Y";
if ($arUser['PERSONAL_BIRTHDAY']) {
$arBirthDate = ParseDateTime($arUser['PERSONAL_BIRTHDAY'], CSite::GetDateFormat('SHORT'));
$arUser['IS_BIRTHDAY'] = intval($arBirthDate['MM']) == date('n') && intval($arBirthDate['DD']) == date('j');
}
$arUser['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
$arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
$arResult["SEARCH"][$i]["USER"] = $arUser;
}
}
}
$arResult['USER_PROP'] = array();
$arRes = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", 0, LANGUAGE_ID);
if (!empty($arRes)) {
foreach ($arRes as $key => $val) {
$arResult['USER_PROP'][$val["FIELD_NAME"]] = strLen($val["EDIT_FORM_LABEL"]) > 0 ? $val["EDIT_FORM_LABEL"] : $val["FIELD_NAME"];
}
}
}
$arrDropdown = array();
$arResult["DROPDOWN_SONET"] = array();
示例2: array
}
}
if (StrLen($arResult["FatalError"]) <= 0) {
$arResult["Urls"]["User"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["UserMessages"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MESSAGES_USERS_MESSAGES"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["VideoCall"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_VIDEO_CALL"], array("user_id" => $arResult["User"]["ID"]));
if (!CModule::IncludeModule("video")) {
$arResult["CurrentUserPerms"]["Operations"]["videocall"] = false;
}
$arResult["IS_ONLINE"] = $arResult["User"]["IS_ONLINE"] == "Y";
if ($arResult["User"]['PERSONAL_BIRTHDAY'] != '') {
$arBirthDate = ParseDateTime($arResult["User"]['PERSONAL_BIRTHDAY'], CSite::GetDateFormat('SHORT'));
$arResult['IS_BIRTHDAY'] = intval($arBirthDate['MM']) == date('n') && intval($arBirthDate['DD']) == date('j');
}
if (CModule::IncludeModule('intranet')) {
$arResult['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arResult["User"]['ID']);
$arResult['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arResult["User"]['ID']);
}
if (intval($arResult["User"]["PERSONAL_PHOTO"]) <= 0) {
switch ($arResult["User"]["PERSONAL_GENDER"]) {
case "M":
$suffix = "male";
break;
case "F":
$suffix = "female";
break;
default:
$suffix = "unknown";
}
$arResult["User"]["PERSONAL_PHOTO"] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID);
}
示例3: array
$strUserIDs .= ($strUserIDs ? '|' : '') . $arUser['ID'];
}
if (!is_array($arCacheData[$arUser['ID']])) {
$arCacheData[$arUser['ID']] = array();
}
$arUser['IS_ONLINE'] = $arResult['bUsersCached'] ? false : CIntranetUtils::IsOnline($arUser['LAST_ACTIVITY_DATE']);
$arUser['IS_BIRTHDAY'] = CIntranetUtils::IsToday($arUser['PERSONAL_BIRTHDAY']);
if (array_key_exists('IS_ABSENT', $arCacheData[$arUser['ID']])) {
$arUser['IS_ABSENT'] = $arCacheData[$arUser['ID']]['IS_ABSENT'];
} else {
$arUser['IS_ABSENT'] = $arCacheData[$arUser['ID']]['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
}
if (array_key_exists('IS_FEATURED', $arCacheData[$arUser['ID']])) {
$arUser['IS_FEATURED'] = $arCacheData[$arUser['ID']]['IS_FEATURED'];
} else {
$arUser['IS_FEATURED'] = $arCacheData[$arUser['ID']]['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
}
if ($arUser['PERSONAL_PHOTO']) {
$arImage = CIntranetUtils::InitImage($arUser['PERSONAL_PHOTO'], 100);
$arUser['PERSONAL_PHOTO'] = $arImage['IMG'];
//$arUser['PERSONAL_PHOTO'] = CFile::ShowImage($arUser['PERSONAL_PHOTO'], 100, 100);
}
if ($bLoadDepartments && is_array($arUser['UF_DEPARTMENT']) && count($arUser['UF_DEPARTMENT']) > 0) {
if (array_key_exists('UF_DEPARTMENT', $arCacheData[$arUser['ID']])) {
$arUser['UF_DEPARTMENT'] = $arCacheData[$arUser['ID']]['UF_DEPARTMENT'];
} else {
$arUser['UF_DEPARTMENT'] = $arCacheData[$arUser['ID']]['UF_DEPARTMENT'] = CIntranetUtils::GetDepartmentsData($arUser['UF_DEPARTMENT']);
}
}
$arResult['USERS'][$key] = $arUser;
}
示例4: array
$arResult["Urls"]["Log"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG"], array());
$arResult["Urls"]["LogGroups"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG"], array());
$arResult["Urls"]["LogGroups"] .= (StrPos($arResult["Urls"]["LogGroups"], "?") !== false ? "&" : "?") . "flt_entity_type=" . SONET_ENTITY_GROUP;
$arResult["Urls"]["LogUsers"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG"], array());
$arResult["Urls"]["LogUsers"] .= (StrPos($arResult["Urls"]["LogUsers"], "?") !== false ? "&" : "?") . "flt_entity_type=" . SONET_ENTITY_USER;
$arResult["Urls"]["Activity"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_ACTIVITY"], array());
$arResult["Urls"]["VideoCall"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_VIDEO_CALL"], array("user_id" => $arResult["User"]["ID"]));
$arResult["ALLOW_CREATE_GROUP"] = CSocNetUser::IsCurrentUserModuleAdmin() || $GLOBALS["APPLICATION"]->GetGroupRight("socialnetwork", false, "Y", "Y", array(SITE_ID, false)) >= "K";
if (!CModule::IncludeModule("video")) {
$arResult["CurrentUserPerms"]["Operations"]["videocall"] = false;
} elseif (!CVideo::CanUserMakeCall()) {
$arResult["CurrentUserPerms"]["Operations"]["videocall"] = false;
}
$arResult["IS_ONLINE"] = $arResult["User"]["IS_ONLINE"] == "Y";
if (CModule::IncludeModule('intranet')) {
$arResult['IS_HONOURED'] = CIntranetUtils::IsUserHonoured($arResult["User"]["ID"]);
$arResult['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arResult["User"]["ID"], $arParams['CALENDAR_USER_IBLOCK_ID']);
//departments and managers
$obCache = new CPHPCache();
$path = "/user_card_" . intval($arResult["User"]["ID"] / 100);
if ($arParams["CACHE_TIME"] == 0 || $obCache->StartDataCache($arParams["CACHE_TIME"], $arResult["User"]["ID"], $path)) {
if ($arParams["CACHE_TIME"] > 0 && defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->StartTagCache($path);
$GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_CARD_" . intval($arResult["User"]["ID"] / 100));
}
//departments
$arResult['DEPARTMENTS'] = array();
$dbRes = CIntranetUtils::GetSubordinateDepartmentsList($arResult["User"]["ID"]);
while ($arRes = $dbRes->GetNext()) {
$arRes['URL'] = str_replace('#ID#', $arRes['ID'], $arParams['PATH_TO_CONPANY_DEPARTMENT']);
$arResult['DEPARTMENTS'][$arRes['ID']] = $arRes;
示例5: executeComponent
//.........这里部分代码省略.........
if ($bDisable) {
$dbUsers = new CDBResult();
$dbUsers->initFromArray(array());
} else {
$arListParams = array('SELECT' => array('UF_*'), 'ONLINE_INTERVAL' => static::LAST_ACTIVITY);
if (!$this->bExcel && $this->arParams['USERS_PER_PAGE'] > 0) {
$arListParams['NAV_PARAMS'] = array('nPageSize' => $this->arParams['USERS_PER_PAGE'], 'bShowAll' => false);
}
$dbUsers = $obUser->GetList($sortBy = 'last_name', $sortDir = 'asc', $this->arFilter, $arListParams);
}
$strUserIDs = '';
while ($arUser = $dbUsers->Fetch()) {
$this->arResult['USERS'][$arUser['ID']] = $arUser;
$strUserIDs .= ($strUserIDs === '' ? '' : '|') . $arUser['ID'];
}
$structure = CIntranetUtils::getStructure();
$this->arResult['DEPARTMENTS'] = $structure['DATA'];
$this->setDepWhereUserIsHead();
$arAdmins = array();
/** @noinspection PhpUndefinedVariableInspection */
$rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array(static::ADMIN_GROUP_ID)), array("SELECT" => array("ID")));
while ($ar = $rsUsers->Fetch()) {
$arAdmins[$ar["ID"]] = $ar["ID"];
}
$extranetUsers = array();
if (CModule::IncludeModule('extranet') && ($extranetGroupID = CExtranet::GetExtranetUserGroupID())) {
$rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array($extranetGroupID)), array("SELECT" => array("ID")));
while ($ar = $rsUsers->Fetch()) {
$extranetUsers[$ar["ID"]] = $ar["ID"];
}
}
$displayPhoto = $this->displayPersonalPhoto();
foreach ($this->arResult['USERS'] as $key => &$arUser) {
// cache optimization
foreach ($arUser as $k => $value) {
if (is_array($value) && count($value) <= 0 || !is_array($value) && strlen($value) <= 0 || !in_array($k, $arSelect) && substr($k, 0, 3) != 'UF_') {
unset($arUser[$k]);
} elseif ($k == "PERSONAL_COUNTRY" || $k == "WORK_COUNTRY") {
$arUser[$k] = GetCountryByID($value);
}
}
$arUser['IS_ONLINE'] = $arUser['IS_ONLINE'] == 'Y' ? true : false;
if ($this->arParams['bCache']) {
$this->getCacheManager()->registerTag('intranet_user_' . $arUser['ID']);
}
$arUser['DETAIL_URL'] = str_replace(array('#ID#', '#USER_ID#'), $arUser['ID'], $this->arParams['DETAIL_URL']);
$arUser['ADMIN'] = isset($arAdmins[$arUser['ID']]);
//is user admin/extranet
$arUser['ACTIVITY_STATUS'] = 'active';
$arUser['EXTRANET'] = false;
if (isset($extranetUsers[$arUser['ID']]) && empty($arUser['UF_DEPARTMENT'][0])) {
$arUser["ACTIVITY_STATUS"] = 'extranet';
$arUser['EXTRANET'] = true;
}
if ($arUser["ACTIVE"] == "N") {
$arUser["ACTIVITY_STATUS"] = 'fired';
}
if (!empty($arUser["CONFIRM_CODE"])) {
$arUser["ACTIVITY_STATUS"] = 'inactive';
}
$arUser['SHOW_USER'] = $this->arParams["SHOW_USER"];
$arUser['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
$arDep = array();
foreach ((array) $arUser['UF_DEPARTMENT'] as $sect) {
$arDep[$sect] = $this->arResult['DEPARTMENTS'][$sect]['NAME'];
}
$arUser['UF_DEPARTMENT'] = $arDep;
if (!$this->bExcel && $displayPhoto) {
$this->resizePersonalPhoto($arUser);
}
if (count($arUser['UF_DEPARTMENT']) <= 0 && !$arUser['EXTRANET']) {
unset($this->arResult['USERS'][$key]);
}
}
unset($arUser, $key);
$this->arResult["USERS_NAV"] = $bNav ? $dbUsers->GetPageNavStringEx($navComponentObject = null, $this->arParams["NAV_TITLE"]) : '';
if ($this->arParams['bCache']) {
$this->getCacheManager()->endTagCache();
$this->obCache->endDataCache(array('USERS' => $this->arResult['USERS'], 'STR_USER_ID' => $strUserIDs, 'DEPARTMENTS' => $this->arResult['DEPARTMENTS'], 'DEPARTMENT_HEAD' => $this->arResult['DEPARTMENT_HEAD'], 'USERS_NAV' => $this->arResult['USERS_NAV']));
}
}
$this->initSonetUserPerms(array_keys($this->arResult['USERS']));
$this->workWithNonCacheAttr($bFromCache, $strUserIDs);
if (!$this->bExcel) {
$this->arResult['bAdmin'] = $this->getUser()->canDoOperation('edit_all_users') || $this->getUser()->canDoOperation('edit_subordinate_users');
$this->IncludeComponentTemplate();
} else {
$this->getApplication()->restartBuffer();
// hack. any '.default' customized template should contain 'excel' page
$this->setTemplateName('.default');
Header("Content-Type: application/force-download");
Header("Content-Type: application/octet-stream");
Header("Content-Type: application/download");
Header("Content-Disposition: attachment;filename=users.xls");
Header("Content-Transfer-Encoding: binary");
$this->IncludeComponentTemplate('excel');
die;
}
return;
}