Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
storeprofitdashboard.php
1
<?php
2
3
namespace
Bitrix\Catalog\Integration\Report\Dashboard
;
4
5
use
Bitrix\Catalog\Config\State
;
6
use
Bitrix\Catalog\Integration\Report\Dashboard\Group\Group
;
7
use
Bitrix\Catalog\Integration\Report\Dashboard\Group\StoreGroup
;
8
use
Bitrix\Catalog\Integration\Report\Filter\StoreProfitFilter
;
9
use
Bitrix\Catalog\Integration\Report\View\StoreProfit\StoreProfitGraph
;
10
use
Bitrix\Catalog\Integration\Report\View\StoreProfit\StoreProfitGrid
;
11
use
Bitrix\Main\Localization\Loc
;
12
use
Bitrix\Report\VisualConstructor\AnalyticBoard
;
13
14
class
StoreProfitDashboard
extends
CatalogDashboard
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
51
public
function
getAnalyticBoard
():
AnalyticBoard
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
}
Bitrix\Catalog\Config\State
Definition
state.php:21
Bitrix\Catalog\Integration\Report\Dashboard\CatalogDashboard
Definition
catalogdashboard.php:23
Bitrix\Catalog\Integration\Report\Dashboard\Group\StoreGroup
Definition
storegroup.php:8
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard
Definition
storeprofitdashboard.php:15
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\BOARD_KEY
const BOARD_KEY
Definition
storeprofitdashboard.php:17
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\__construct
__construct()
Definition
storeprofitdashboard.php:23
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getAccessBoardId
getAccessBoardId()
Definition
storeprofitdashboard.php:35
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\ACCESS_BOARD_ID
const ACCESS_BOARD_ID
Definition
storeprofitdashboard.php:19
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getBoardTitle
getBoardTitle()
Definition
storeprofitdashboard.php:83
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getDefaultViewList
static getDefaultViewList()
Definition
storeprofitdashboard.php:68
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getDefaultGroup
static getDefaultGroup()
Definition
storeprofitdashboard.php:59
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getAnalyticBoard
getAnalyticBoard()
Definition
storeprofitdashboard.php:51
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getBoardKey
getBoardKey()
Definition
storeprofitdashboard.php:30
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\getBoardVersion
getBoardVersion()
Definition
storeprofitdashboard.php:40
Bitrix\Catalog\Integration\Report\Dashboard\StoreProfitDashboard\BOARD_VERSION
const BOARD_VERSION
Definition
storeprofitdashboard.php:16
Bitrix\Catalog\Integration\Report\Filter\StoreProfitFilter
Definition
storeprofitfilter.php:9
Bitrix\Catalog\Integration\Report\View\StoreProfit\StoreProfitGraph
Definition
storeprofitgraph.php:14
Bitrix\Catalog\Integration\Report\View\StoreProfit\StoreProfitGrid
Definition
storeprofitgrid.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Report\VisualConstructor\AnalyticBoard
Definition
analyticboard.php:14
Bitrix\Catalog\Integration\Report\Dashboard\Group\Group
Definition
group.php:6
Bitrix\Catalog\Integration\Report\Dashboard
Definition
catalogdashboard.php:3
modules
catalog
lib
integration
report
dashboard
storeprofitdashboard.php
Создано системой
1.10.0