1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
converttoproductitem.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Grid\Row\Actions\Item;
4
5use Bitrix\Catalog\Grid\ProductAction;
6use Bitrix\Main\HttpRequest;
7use Bitrix\Main\Localization\Loc;
8use Bitrix\Main\Result;
9use CUtil;
10
11final class ConvertToProductItem extends BaseItem
12{
13 public static function getId(): ?string
14 {
15 return 'convert_to_product';
16 }
17
18 protected function getText(): string
19 {
20 return Loc::getMessage('CATALOG_GRID_ROW_ACTIONS_CONVERT_TO_PRODUCT_TEXT');
21 }
22
23 public function getControl(array $rawFields): ?array
24 {
25 $id = (int)($rawFields['ID'] ?? 0);
26 if ($id <= 0)
27 {
28 return null;
29 }
30
31 $actionId = self::getId();
32 $data = CUtil::PhpToJSObject([
33 'id' => $id,
34 ]);
35 $confirmMessage = \CUtil::JSEscape(
36 Loc::getMessage('CATALOG_GRID_ROW_ACTIONS_CONVERT_TO_PRODUCT_CONFIRM_MESSAGE_MSGVER_1')
37 );
38
39 $confirmButtonMessage = \CUtil::JSEscape(
40 Loc::getMessage('CATALOG_GRID_ROW_ACTIONS_CONVERT_TO_PRODUCT_CONFIRM_BUTTON')
41 );
42 $backButtonMessage = \CUtil::JSEscape(
43 Loc::getMessage('CATALOG_GRID_ROW_ACTIONS_CONVERT_TO_PRODUCT_BACK_BUTTON')
44 );
45
46 $this->onclick = "IblockGridInstance.sendSmallPopupWithConfirm('{$actionId}', {$data}, '{$confirmMessage}', '{$confirmButtonMessage}', '{$backButtonMessage}')";
47
48 return parent::getControl($rawFields);
49 }
50
52 {
53 $id = $request->getPost('id');
54 if (empty($id) || !is_numeric($id))
55 {
56 return null;
57 }
58 $id = (int)$id;
59
61 }
62}
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
static convertToProductElementList(int $iblockId, array $elementIds)
Определения productaction.php:392
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804