1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
storeprofitdashboard.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Integration\Report\Dashboard;
4
5use Bitrix\Catalog\Config\State;
6use Bitrix\Catalog\Integration\Report\Dashboard\Group\Group;
7use Bitrix\Catalog\Integration\Report\Dashboard\Group\StoreGroup;
8use Bitrix\Catalog\Integration\Report\Filter\StoreProfitFilter;
9use Bitrix\Catalog\Integration\Report\View\StoreProfit\StoreProfitGraph;
10use Bitrix\Catalog\Integration\Report\View\StoreProfit\StoreProfitGrid;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Report\VisualConstructor\AnalyticBoard;
13
15{
16 public const BOARD_VERSION = 'v2';
17 public const BOARD_KEY = 'catalog_warehouse_profit';
18
19 public const ACCESS_BOARD_ID = 3;
20
21 private bool $isBatchMethodSelected;
22
23 public function __construct()
24 {
25 parent::__construct();
26
27 $this->isBatchMethodSelected = State::isProductBatchMethodSelected();
28 }
29
30 public function getBoardKey(): string
31 {
32 return static::BOARD_KEY;
33 }
34
35 public function getAccessBoardId(): int
36 {
37 return self::ACCESS_BOARD_ID;
38 }
39
40 public function getBoardVersion(): string
41 {
42 // we have to swap the versions to clear the dashboard's cache (or use different caches if it has already been cached) when we turn batch methods on and off
43 if ($this->isBatchMethodSelected)
44 {
45 return 'active_' . self::BOARD_VERSION;
46 }
47
48 return 'inactive_' . self::BOARD_VERSION;
49 }
50
52 {
53 $analyticBoard = parent::getAnalyticBoard();
54 $analyticBoard->setFilter(new StoreProfitFilter($this->getBoardKey()));
55
56 return $analyticBoard;
57 }
58
59 protected static function getDefaultGroup(): Group
60 {
61 return (new StoreGroup());
62 }
63
68 protected static function getDefaultViewList(): array
69 {
70 if (!State::isProductBatchMethodSelected())
71 {
72 return [
73 new StoreProfitGrid(),
74 ];
75 }
76
77 return [
78 new StoreProfitGraph(),
79 new StoreProfitGrid(),
80 ];
81 }
82
83 public function getBoardTitle(): ?string
84 {
85 return Loc::getMessage('STORE_PROFIT_DASHBOARD_TITLE');
86 }
87}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804