$result = '<div class="bx-user-image-default-100"></div>'; } else { $result = $arUser[$key]; } break; case 'PERSONAL_PHONE': case 'WORK_PHONE': case 'PERSONAL_MOBILE': case 'UF_PHONE_INNER': $result = $arUser[$key] ? '<nobr><a href="callto:' . urlencode($arUser[$key]) . '">' . htmlspecialcharsbx($arUser[$key]) . '</a></nobr>' : ''; break; case 'PERSONAL_BIRTHDAY': $result = FormatDateEx($arResult['USERS'][$i][$key], false, $arParams['DATE_FORMAT' . ($arParams['SHOW_YEAR'] == 'N' || $arParams['SHOW_YEAR'] == 'M' && $arUser['PERSONAL_GENDER'] == 'F' ? '_NO_YEAR' : '')]); break; case 'DATE_REGISTER': $result = FormatDateEx($arResult['USERS'][$i][$key], false, $arParams['DATE_TIME_FORMAT']); break; default: if (substr($key, 0, 3) == 'UF_' && is_array($arResult['USER_PROPERTIES'][$key])) { ob_start(); $arResult['USER_PROPERTIES'][$key]['VALUE'] = $arUser[$key]; $APPLICATION->IncludeComponent('bitrix:system.field.view', $arResult['USER_PROPERTIES'][$key]['USER_TYPE_ID'], array('arUserField' => $arResult['USER_PROPERTIES'][$key])); $result = ob_get_contents(); ob_end_clean(); } else { $result = htmlspecialcharsbx($arUser[$key]); } break; } echo $result; ?>
} else { ?> <a href="<?php echo $APPLICATION->GetCurPageParam('department=' . $arResult['CURRENT_USER']['DEPARTMENT_TOP'], array('department')); ?> "><?php echo GetMessage('INTR_ISBN_TPL_FILTER_MINE'); ?> </a><br /><?php } } ?> </div><?php } foreach ($arResult['USERS'] as $arUser) { $birthday = FormatDateEx($arUser['PERSONAL_BIRTHDAY'], false, $arParams['DATE_FORMAT' . ($arParams['SHOW_YEAR'] == 'Y' || $arParams['SHOW_YEAR'] == 'M' && $arUser['PERSONAL_GENDER'] == 'M' ? '' : '_NO_YEAR')]); ?> <div class="bx-user-info"> <div class="bx-user-info-inner"> <div class="bx-user-image<?php echo $arUser['PERSONAL_PHOTO'] ? '' : ' bx-user-image-default'; ?> "><a href="<?php echo $arUser['DETAIL_URL']; ?> "><?php echo $arUser['PERSONAL_PHOTO'] ? $arUser['PERSONAL_PHOTO'] : ''; ?> </a></div> <div class="bx-user-birthday<?php echo $arUser['IS_BIRTHDAY'] ? ' bx-user-birthday-today' : '';
echo '<a href="http://', urlencode($value), '" target="_blank">', htmlspecialcharsbx($value), '</a>'; break; case 'PERSONAL_PHONE': case 'WORK_PHONE': case 'PERSONAL_MOBILE': $value_encoded = preg_replace('/[^\\d\\+]+/', '', $value); echo '<a href="callto:', $value_encoded, '">', htmlspecialcharsbx($value), '</a>'; break; case 'PERSONAL_GENDER': echo $value == 'F' ? GetMessage('INTR_ISP_GENDER_F') : ($value == 'M' ? GetMessage('INTR_ISP_GENDER_M') : ''); break; case 'PERSONAL_BIRTHDAY': echo FormatDateEx($value, false, $arParams['DATE_FORMAT' . ($arParams['SHOW_YEAR'] == 'N' || $arParams['SHOW_YEAR'] == 'M' && $arUser['PERSONAL_GENDER'] == 'F' ? '_NO_YEAR' : '')]); break; case 'DATE_REGISTER': echo FormatDateEx($value, false, $arParams['DATE_TIME_FORMAT']); break; case 'UF_DEPARTMENT': $bFirst = true; if (is_array($value) && count($value) > 0) { foreach ($value as $dept_id => $dept_name) { if (!$bFirst && $dept_name) { echo ', '; } else { $bFirst = false; } if (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) { echo htmlspecialcharsbx($dept_name); } else { if (strlen(trim($arParams["PATH_TO_CONPANY_DEPARTMENT"])) > 0) { echo '<a href="', CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_CONPANY_DEPARTMENT"], array("ID" => $dept_id)), '">', htmlspecialcharsbx($dept_name), '</a>';
$arUser = $arResult['USERS'][$arEntry['PROPERTY_USER_VALUE']]; ?> <div class="bx-user-info"> <div class="bx-user-info-inner"> <div class="bx-user-image<?php echo $arUser['PERSONAL_PHOTO'] ? '' : ' bx-user-image-default'; ?> "><a href="<?php echo $arUser['DETAIL_URL']; ?> "><?php echo $arUser['PERSONAL_PHOTO'] ? $arUser['PERSONAL_PHOTO'] : ''; ?> </a></div> <div class="bx-user-date intranet-date"><?php echo FormatDateEx($arEntry['DATE_ACTIVE_FROM'], false, $arParams['DATE_FORMAT']); ?> </div> <div class="bx-user-name"> <?php $APPLICATION->IncludeComponent("bitrix:main.user.link", '', array("ID" => $arUser["ID"], "HTML_ID" => "structure_informer_new_" . $arUser["ID"], "NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"], "LOGIN" => $arUser["LOGIN"], "USE_THUMBNAIL_LIST" => "N", "INLINE" => "Y", "PROFILE_URL" => $arUser["DETAIL_URL"], "PATH_TO_SONET_MESSAGES_CHAT" => $arParams["~PM_URL"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["~PATH_TO_CONPANY_DEPARTMENT"], "PATH_TO_VIDEO_CALL" => $arParams["~PATH_TO_VIDEO_CALL"]), false, array("HIDE_ICONS" => "Y")); ?> </div> <div class="bx-user-post"><?php echo htmlspecialcharsbx($arUser['WORK_POSITION']); ?> </div> <div class="bx-users-delimiter"></div> </div> </div> <?php
echo $arResult['ENTRIES_NAV']; ?> </div> <?php } else { ?> <a name="nav_start"></a> <?php } ?> <div class="bx-events-layout"> <?php foreach ($arResult['ENTRIES'] as $arEntry) { $arUser = $arResult['USERS'][$arEntry['PROPERTY_USER_VALUE']]; $arUser['UF_DEPARTMENT'] = array($arEntry['PROPERTY_DEPARTMENT_VALUE'] => $arResult['DEPARTMENTS'][$arEntry['PROPERTY_DEPARTMENT_VALUE']]); $arUser['WORK_POSITION'] = $arEntry['PROPERTY_POST_VALUE']; $arUser['SUBTITLE'] = FormatDateEx($arEntry['DATE_ACTIVE_FROM'], false, $arParams['DATE_FORMAT']) . ' - ' . ToLower($arEntry['PROPERTY_STATE_VALUE'] ? $arEntry['PROPERTY_STATE_VALUE'] : ($arEntry['PREVIEW_TEXT'] ? $arEntry['PREVIEW_TEXT'] : $arEntry['NAME'])); $APPLICATION->IncludeComponent('bitrix:intranet.system.person', '', array('USER' => $arUser, 'USER_PROPERTY' => $arParams['USER_PROPERTY'], 'PM_URL' => $arParams['PM_URL'], 'STRUCTURE_PAGE' => $arParams['STRUCTURE_PAGE'], 'STRUCTURE_FILTER' => $arParams['STRUCTURE_FILTER'], 'USER_PROP' => $arResult['USER_PROP'], 'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE'], 'SHOW_LOGIN' => $arParams['SHOW_LOGIN'], "DATE_FORMAT" => $arParams["DATE_FORMAT"], "DATE_FORMAT_NO_YEAR" => $arParams["DATE_FORMAT_NO_YEAR"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["~PATH_TO_CONPANY_DEPARTMENT"], "PATH_TO_VIDEO_CALL" => $arParams["~PATH_TO_VIDEO_CALL"]), null, array('HIDE_ICONS' => 'Y')); } ?> </div> <?php if ($arParams['SHOW_NAV_BOTTOM'] == 'Y') { ?> <div class="bx-users-nav"><?php echo $arResult['ENTRIES_NAV']; ?> </div> <?php } }
$items = $arResult['ITEMS']; $nameFormat = $arResult['NAME_FORMAT']; $dateFormat = $arResult['DATE_FORMAT']; $count = count($items); for ($i = 0; $i < $count; $i++) { $item = $items[$i]; $isBirthday = isset($item['IS_BIRTHDAY']) && $item['IS_BIRTHDAY']; $className = 'sidebar-widget-item'; if ($isBirthday) { $className .= ' today-birth'; } if ($i === $count - 1) { $className .= ' widget-last-item'; } $name = CUser::FormatName($nameFormat, array('LOGIN' => '', 'NAME' => isset($item['NAME']) ? $item['NAME'] : '', 'LAST_NAME' => isset($item['LAST_NAME']) ? $item['LAST_NAME'] : '', 'SECOND_NAME' => isset($item['SECOND_NAME']) ? $item['SECOND_NAME'] : ''), false, false); $text = isset($item['IS_BIRTHDAY']) && $item['IS_BIRTHDAY'] ? FormatDate('today') . '!' : (isset($item['BIRTHDATE']) ? FormatDateEx($item['BIRTHDATE'], false, $dateFormat) : ''); $url = ''; $imageID = $item['IMAGE_ID']; if ($imageID > 0) { $file = new CFile(); $imageFileArray = $file->GetFileArray($imageID); if (is_array($imageFileArray)) { $imageFile = $file->ResizeImageGet($imageFileArray, array('width' => 58, 'height' => 58), BX_RESIZE_IMAGE_EXACT, true); $url = is_array($imageFile) ? $imageFile['src'] : ''; } } $avatarStyle = $url !== '' ? 'background:url(\'' . htmlspecialcharsbx($url) . '\') no-repeat center center;' : ''; ?> <a class="<?php echo $className; ?>