Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
storesalefilter.php
1<?php
2
4
7
9{
10 public const REPORT_INTERVAL_FIELD_NAME = 'REPORT_INTERVAL';
11
12 protected static function getStoreFilterContext(): string
13 {
14 return 'report_store_sale_filter_stores';
15 }
16
17 protected static function getProductFilterContext(): string
18 {
19 return 'report_store_sale_filter_products';
20 }
21
22 public static function getFieldsList()
23 {
24 $fieldsList = parent::getFieldsList();
25 $fieldsList[static::REPORT_INTERVAL_FIELD_NAME] = static::getReportIntervalField();
26
27 return $fieldsList;
28 }
29
35 public static function getReportIntervalField(): array
36 {
37 return [
38 'id' => static::REPORT_INTERVAL_FIELD_NAME,
39 'name' => Loc::getMessage('SALE_FILTER_REPORT_INTERVAL_TITLE'),
40 'default' => true,
41 'type' => 'date',
42 'required' => true,
43 'valueRequired' => true,
44 'exclude' => [
45 DateType::NONE,
46 DateType::CURRENT_DAY,
47 DateType::CURRENT_WEEK,
48 DateType::YESTERDAY,
49 DateType::TOMORROW,
50 DateType::PREV_DAYS,
51 DateType::NEXT_DAYS,
52 DateType::NEXT_WEEK,
53 DateType::NEXT_MONTH,
54 DateType::LAST_MONTH,
55 DateType::LAST_WEEK,
56 DateType::EXACT,
57 ]
58 ];
59 }
60
64 public static function getPresetsList()
65 {
66 $presets = [];
67
68 $presets['filter_last_month'] = [
69 'name' => Loc::getMessage('SALE_FILTER_REPORT_INTERVAL_MONTH_PRESET_TITLE'),
70 'fields' => [
71 static::REPORT_INTERVAL_FIELD_NAME . '_datesel' => DateType::CURRENT_MONTH,
72 ],
73 'default' => true,
74 ];
75
76 return $presets;
77 }
78}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29