Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/components/bitrix/catalog.store.field.config.list/ |
Upload File : |
<?php use Bitrix\Catalog\Access\AccessController; use Bitrix\Catalog\Access\ActionDictionary; use Bitrix\Catalog\Document\StoreDocumentTableManager; use Bitrix\Catalog\StoreTable; use Bitrix\Main\Localization\Loc; if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die(); } class CatalogStoreFieldConfigList extends CBitrixComponent { public function onPrepareComponentParams($arParams) { if (!isset($arParams['ENTITY_ID'])) { $arParams['ENTITY_ID'] = StoreTable::getUfId(); } if (!isset($arParams['HELPDESK_ARTICLE_ID'])) { $arParams['HELPDESK_ARTICLE_ID'] = '17415624'; } elseif (!is_numeric($arParams['HELPDESK_ARTICLE_ID'])) { $arParams['HELPDESK_ARTICLE_ID'] = (int)$arParams['HELPDESK_ARTICLE_ID']; } return parent::onPrepareComponentParams($arParams); } public function executeComponent() { $template = ''; if (!$this->checkRights()) { $template = 'error'; $this->arResult['ERROR'] = Loc::getMessage('CATALOG_COMPONENT_STORE_FIELD_CONFIG_LIST_ERROR_ACCESS_DENIED'); } $this->includeComponentTemplate($template); } private function checkRights(): bool { $entityId = $this->arParams['ENTITY_ID']; if ($entityId === StoreTable::getUfId()) { return AccessController::getCurrent()->check(ActionDictionary::ACTION_STORE_MODIFY); } if (in_array($entityId, StoreDocumentTableManager::getUfEntityIds(), true)) { $documentType = StoreDocumentTableManager::getTypeByUfId($entityId); if ($documentType) { return AccessController ::getCurrent() ->checkByValue(ActionDictionary::ACTION_STORE_DOCUMENT_MODIFY, $documentType) ; } } return false; } }