Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
converttoproductgroupchild.php
1<?php
2
4
6use Bitrix\Iblock\Grid\Panel\UI\Actions\Helpers\ItemFinder;
16
17Loader::requireModule('iblock');
18
20{
21 use ItemFinder;
22
23 public static function getId(): string
24 {
25 return 'convert_to_product';
26 }
27
28 public function getName(): string
29 {
30 return Loc::getMessage('CATALOG_GRID_PANEL_UI_PRODUCT_ACTION_CONVERT_TO_PRODUCT_NAME');
31 }
32
33 public function processRequest(HttpRequest $request, bool $isSelectedAllRows, ?Filter $filter = null): ?Result
34 {
35 $result = new Result();
36
37 [$elementIds, $sectionIds] = $this->prepareItemIds($request, $isSelectedAllRows, $filter);
38
39 if ($elementIds)
40 {
41 $result->addErrors(
43 );
44 }
45
46 if ($sectionIds)
47 {
48 $result->addErrors(
50 );
51 }
52
53 return $result;
54 }
55
56 protected function getOnchange(): Onchange
57 {
58 $confirmMessage = Loc::getMessage('CATALOG_GRID_PANEL_UI_PRODUCT_ACTION_CONVERT_TO_PRODUCT_CONFIRM');
59
60 return new Onchange([
61 [
62 'ACTION' => Actions::RESET_CONTROLS,
63 ],
64 [
65 'ACTION' => Actions::CREATE,
66 'DATA' => [
67 (new Snippet)->getSendSelectedButton($confirmMessage),
68 ],
69 ],
70 ]);
71 }
72}
processRequest(HttpRequest $request, bool $isSelectedAllRows, ?Filter $filter=null)
static convertToProductSectionList(int $iblockId, array $sections)
static convertToProductElementList(int $iblockId, array $elementIds)
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29