• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/hrxml.php
  • Класс: CUserHRXMLImport
  • Вызов: CUserHRXMLImport::Init
function Init($arParams = array())
{
	CModule::IncludeModule('iblock');
	$this->__user = new CUser();
	$this->__element = new CIBlockElement();
	$this->__section = new CIBlockSection();

	$this->arParams = $arParams;
	$this->arParams['DEFAULT_EMAIL'] = trim($this->arParams['DEFAULT_EMAIL']);
	if (empty($this->arParams['DEFAULT_EMAIL']))
	{
		$this->arParams['DEFAULT_EMAIL'] = COption::GetOptionString(
			'main', 'email_from',
			"admin@".$_SERVER['SERVER_NAME']
		);
	}
	if (empty($this->arParams['DEFAULT_EMAIL']))
	{
		$this->errors[] = GetMessage('ERROR_DEFAULT_EMAIL_MISSING');
		return false;
	}

	$this->PersonIDSchemeName = COption::GetOptionString("intranet", "import_PersonIDSchemeName", "");
	global $APPLICATION;
	if (toUpper(LANG_CHARSET) != "UTF-8")
		$this->PersonIDSchemeName = $APPLICATION->ConvertCharset($this->PersonIDSchemeName, LANG_CHARSET, 'utf-8');

	if (empty($this->PersonIDSchemeName))
	{
		$this->errors[] = GetMessage('ERROR_PersonIDSchemeName_MISSING');
		return false;
	}

	$this->arSectionCache = &$this->next_step['_TEMPORARY']['DEPARTMENTS'];

	$this->DEPARTMENTS_IBLOCK_ID = $this->arParams['DEPARTMENTS_IBLOCK_ID'];
	$this->ABSENCE_IBLOCK_ID = $this->arParams['ABSENCE_IBLOCK_ID'];
	$this->STATE_HISTORY_IBLOCK_ID = $this->arParams['STATE_HISTORY_IBLOCK_ID'];
	$this->VACANCY_IBLOCK_ID = $this->arParams['VACANCY_IBLOCK_ID'];

	$def_group = COption::GetOptionString("main", "new_user_registration_def_group", "");

	if ($def_group != "")
		$this->arUserGroups = explode(",", $def_group);
	
	return true;
}