• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/controller/license.php
  • Класс: BitrixIntranetControllerLicense
  • Вызов: License::getVoximplantInfo
private function getVoximplantInfo()
{
	$telephonyInfo = [];

	if (Loader::includeModule("voximplant"))
	{
		if (
			CVoxImplantPhone::getRentedNumbersCount() > 0
			|| CVoxImplantSip::hasConnection()
			|| (new CVoxImplantAccount())->getAccountBalance(false) > 0
		)
		{
			$telephonyInfo['isConnected'] = true;
			$viBalance = "";
			$viBalanceFormatted = "";
			$ViAccount = new CVoxImplantAccount();
			$viLang = $ViAccount->GetAccountLang();
			$viCurrency = $ViAccount->GetAccountCurrency();

			if ( $viLang != 'ua')
			{
				$viBalance = $ViAccount->GetAccountBalance();
				if (Loader::includeModule('currency'))
				{
					$viCurrency = ($viCurrency === 'RUR' ? 'RUB' : $viCurrency);
					$viBalanceFormatted = CCurrencyLang::CurrencyFormat($viBalance, $viCurrency);
				}
				else
				{
					$viBalanceFormatted = Loc::getMessage("INTRANET_LICENSE_CURRENCY_".$viCurrency,
						array("#NUM#" => number_format($viBalance, 2, '.', ' '))
					);
				}
			}

			$viLimit = CVoxImplantAccount::GetRecordLimit();

			$telephonyInfo['limit'] = $viLimit;
			$telephonyInfo['lang'] = $viLang;
			$telephonyInfo['balanceFormatted'] = $viBalanceFormatted;
		}
		else
		{
			$telephonyInfo['isConnected'] = false;
		}

		$telephonyInfo['buyPath'] = '/telephony/?analyticsLabel[headerPopup]=Y';
	}

	return $telephonyInfo;
}