1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
barcodescanner.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Controller;
4
5use Bitrix\Main\Error;
6use Bitrix\Main\Loader;
7use Bitrix\Main\Localization\Loc;
8use Bitrix\Pull\Event;
9use Bitrix\Catalog\Access\AccessController;
10use Bitrix\Catalog\Access\ActionDictionary;
11
13{
18 public function sendMobilePushAction(string $id): ?array
19 {
20 if (!Loader::includeModule('catalog') || !AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_READ))
21 {
22 $this->addError(new Error(Loc::getMessage('BARCODE_SCANNER_ACCESS_DENIED')));
23 return null;
24 }
25
26 if (!Loader::includeModule('pull'))
27 {
28 $this->addError(new Error(Loc::getMessage('BARCODE_SCANNER_PULL_MODULE_REQUIRED')));
29 return null;
30 }
31
35 (new \CPushManager())->sendMessage([
36 [
37 'USER_ID' => $this->getCurrentUser()->getId(),
38 'APP_ID' => 'Bitrix24',
39 'EXPIRY' => 0,
40 'PARAMS'=> [
41 'TYPE' => 'CATALOG_BARCODE_SCANNER',
42 'ID'=> $id,
43 ],
44 'ADVANCED_PARAMS' => [
45 'senderName' => Loc::getMessage('BARCODE_SCANNER_PUSH_TITLE'),
46 'senderMessage' => Loc::getMessage('BARCODE_SCANNER_PUSH_TEXT')
47 ]
48 ]
49 ]);
50
54 Event::add(
55 $this->getCurrentUser()->getId(),
56 [
57 'module_id' => 'catalog',
58 'command' => 'OpenBarcodeScanner',
59 'params' => [
60 'id' => $id,
61 ]
62 ]
63 );
64
65 return [];
66 }
67}
sendMobilePushAction(string $id)
Определения barcodescanner.php:18
addError(Error $error)
Определения controller.php:1070
Определения error.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804