• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/event_calendar.php
  • Класс: CEventCalendar
  • Вызов: CEventCalendar::HandleUserSearch
function HandleUserSearch($name, $from, $to, $arFoundUsers = false, $eventId = false, &$bAddCurUser = false)
{
	$eventId = intval($eventId);
	if ($arFoundUsers === false)
		$arFoundUsers = CSocNetUser::SearchUser($name);

	if (!is_array($arFoundUsers) || count($arFoundUsers) <= 0)
		return array();

	$arUsers = array();
	foreach ($arFoundUsers as $userId => $userName)
	{
		$userId = intval($userId);
		if ($userId == $this->userId)
			$bAddCurUser = true;

		if ($userId <= 0 || in_array($userId, $arUsers) || $userId == $this->userId)
			continue;

		$r = CUser::GetList("id", "asc", array("ID_EQUAL_EXACT"=>$userId, "ACTIVE" => "Y"));

		if (!$User = $r->Fetch())
			continue;
		$name = trim($User['NAME'].' '.$User['LAST_NAME']);
		if ($name == '')
			$name = trim($User['LOGIN']);

		$arUsers[] = array(
			'id' => $userId,
			'name' => $name,
			'status' => 'Q',
			'busy' => $this->GetGuestAccessibility(array('userId' => $userId, 'from' => $from, 'to' => $to))
		);
	}
	return $arUsers;
}