Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
converttoservicegroupchild.php
1<?php
2
4
7use Bitrix\Iblock\Grid\Panel\UI\Actions\Helpers\ItemFinder;
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}
processRequest(HttpRequest $request, bool $isSelectedAllRows, ?Filter $filter=null)
static convertToServiceSectionList(int $iblockId, array $sections)
static convertToServiceElementList(int $iblockId, array $elementIds)
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29