1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
converttoservicegroupchild.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Grid\Panel\UI\Item\Group;
4
5use Bitrix\Catalog\Config\State;
6use Bitrix\Catalog\Grid\ProductAction;
7use Bitrix\Iblock\Grid\Panel\UI\Actions\Helpers\ItemFinder;
8use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\ElementGroup\BaseGroupChild;
9use Bitrix\Main\Filter\Filter;
10use Bitrix\Main\Grid\Panel\Actions;
11use Bitrix\Main\Grid\Panel\Snippet;
12use Bitrix\Main\Grid\Panel\Snippet\Onchange;
13use Bitrix\Main\HttpRequest;
14use Bitrix\Main\Loader;
15use Bitrix\Main\Localization\Loc;
16use Bitrix\Main\Result;
17
18Loader::requireModule('iblock');
19
21{
22 use ItemFinder;
23
24 public static function getId(): string
25 {
26 return 'convert_to_service';
27 }
28
29 public function getName(): string
30 {
31 return Loc::getMessage('CATALOG_GRID_PANEL_UI_PRODUCT_ACTION_CONVERT_TO_SERVICE_NAME');
32 }
33
34 public function processRequest(HttpRequest $request, bool $isSelectedAllRows, ?Filter $filter = null): ?Result
35 {
36 $result = new Result();
37
38 [$elementIds, $sectionIds] = $this->prepareItemIds($request, $isSelectedAllRows, $filter);
39
40 if ($elementIds)
41 {
42 $result->addErrors(
44 );
45 }
46
47 if ($sectionIds)
48 {
49 $result->addErrors(
51 );
52 }
53
54 return $result;
55 }
56
57 protected function getOnchange(): Onchange
58 {
59 $confirmMessage =
60 State::isUsedInventoryManagement()
61 ? Loc::getMessage('CATALOG_GRID_PANEL_UI_PRODUCT_ACTION_CONVERT_TO_SERVICE_CONFIRM_WITH_INVENTORY')
62 : Loc::getMessage('CATALOG_GRID_PANEL_UI_PRODUCT_ACTION_CONVERT_TO_SERVICE_CONFIRM_WITHOUT_INVENTORY')
63 ;
64
65 return new Onchange([
66 [
67 'ACTION' => Actions::RESET_CONTROLS,
68 ],
69 [
70 'ACTION' => Actions::CREATE,
71 'DATA' => [
72 (new Snippet)->getSendSelectedButton($confirmMessage),
73 ],
74 ],
75 ]);
76 }
77}
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
processRequest(HttpRequest $request, bool $isSelectedAllRows, ?Filter $filter=null)
Определения converttoservicegroupchild.php:34
static convertToServiceSectionList(int $iblockId, array $sections)
Определения productaction.php:377
static convertToServiceElementList(int $iblockId, array $elementIds)
Определения productaction.php:387
$result
Определения get_property_values.php:14
$filter
Определения iblock_catalog_list.php:54
getErrors()
Определения errorableimplementation.php:34