• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/contactcenter.php
  • Класс: BitrixIntranetContactCenter
  • Вызов: ContactCenter::getCrmShopListItems
private function getCrmShopListItems(): array
{
	$items = [];

	if (!Loader::includeModule('landing'))
	{
		return $items;
	}

	$shopItem = [
		"NAME" => Loc::getMessage("CONTACT_CENTER_CRM_SHOP_ITEM"),
		"LOGO_CLASS" => "ui-icon intranet-contact-center-crm-shop-item intranet-contact-center-crm-shop-item-color",
		"COLOR_CLASS" => "intranet-contact-center-crm-shop-item-color",
		"IS_NEW" => true,
	];
	$site = $this->getCrmShopSiteInfo();
	if ($site !== null)
	{
		$sitePublicUrl = null;
		if ($site['ACTIVE'] !== 'N')
		{
			$sitePublicUrl = BitrixLandingSite::getPublicUrl($site['ID']);
		}
		$shopItem["SELECTED"] = true;
		$shopItem["LIST"] = [];
		$dealsUrl = CComponentEngine::makePathFromTemplate('#SITE_DIR#crm/deal/?redirect_to');
		if ($dealsUrl)
		{
			$shopItem["LIST"][] = [
				"ONCLICK" => "window.open('".CUtil::JSEscape($dealsUrl)."', '_blank');",
				"NAME" => Loc::getMessage('CONTACT_CENTER_CRM_SHOP_ITEM_DEALS'),
			];
		}
		if (Loader::includeModule('salescenter'))
		{
			$paySystemPath = CComponentEngine::makeComponentPath('bitrix:salescenter.paysystem.panel');
			$paySystemPath = getLocalPath('components'.$paySystemPath.'/slider.php');
			$paySystemPath = new BitrixMainWebUri($paySystemPath);
			$paySystemPath->addParams([
				'analyticsLabel' => 'contactCenterClickPaymentTile',
				'type' => 'main',
				'mode' => 'main'
			]);
			$shopItem["LIST"][] = [
				"ONCLICK" => "BX.SidePanel.Instance.open('".CUtil::JSEscape($paySystemPath->getUri())."');",
				"NAME" => Loc::getMessage('CONTACT_CENTER_CRM_SHOP_ITEM_PAYSYSTEMS'),
			];
		}

		$shopItem['LIST'][] = [
			'NAME' => Loc::getMessage('CONTACT_CENTER_CRM_SHOP_ITEM_GO_TO_SITE'),
			'ONCLICK' => $site['ACTIVE'] === 'Y' ? "window.open('".CUtil::JSEscape($sitePublicUrl)."', '_blank');" : null,
			'DISABLED' => $site['ACTIVE'] !== 'Y',
		];

		$shopItem["LIST"][] = [
			"NAME" => Loc::getMessage('CONTACT_CENTER_CRM_SHOP_ITEM_HELP'),
			"ONCLICK" => "top.BX.Helper.show('redirect=detail&code=13651476')",
			"DELIMITER_BEFORE" => true,
		];
	}
	else
	{
		$shopItem["SELECTED"] = false;
		$shopItem["SIDEPANEL_PARAMS"] = [
			'allowChangeHistory' => false,
			'width' => 1200,
			'data' => [
				'rightBoundary' => 0,
			],
		];
		$shopItem["LINK"] = '/shop/stores/site/edit/0/?super=Y';
	}

	$items['crm_shop'] = $shopItem;

	return $items;
}