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/rospirotorg.ru/bitrix/modules/sale/lib/controller/ |
Upload File : |
<?php namespace Bitrix\Sale\Controller; use Bitrix\Main\Engine\Response\DataType\Page; use Bitrix\Main\Error; use Bitrix\Main\UI\PageNavigation; use Bitrix\Sale\Result; use Bitrix\Sale\TradingPlatformTable; class TradePlatform extends ControllerBase { public function getFieldsAction(): array { $view = $this->getViewManager() ->getView($this); return ['TRADE_PLATFORM'=>$view->prepareFieldInfos( $view->getFields() )]; } /** * @param array $select * @param array $filter * @param array $order * @param PageNavigation $pageNavigation * @return Page * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException */ public function listAction(PageNavigation $pageNavigation, array $select = [], array $filter = [], array $order = []): Page { $select = empty($select) ? ['*'] : $select; $order = empty($order) ? ['ID'=>'ASC'] : $order; $tradingPlatforms = TradingPlatformTable::getList( [ 'select' => $select, 'filter' => $filter, 'order' => $order, 'offset' => $pageNavigation->getOffset(), 'limit' => $pageNavigation->getLimit(), ] )->fetchAll(); return new Page('TRADE_PLATFORMS', $tradingPlatforms, function() use ($filter) { return TradingPlatformTable::getCount($filter); }); } protected function checkReadPermissionEntity(): Result { $r = new Result(); $saleModulePermissions = self::getApplication()->GetGroupRight("sale"); if ($saleModulePermissions == "D") { $r->addError(new Error('Access Denied', 200040300010)); } return $r; } }