Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
storeprofitdashboard.php
1<?php
2
4
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 {
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}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29