Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
contractordataprovider.php
1
<?php
2
3
namespace
Bitrix\Catalog\Filter\DataProvider
;
4
5
use
Bitrix\Catalog\ContractorTable
;
6
use
Bitrix\Main\Localization\Loc
;
7
8
class
ContractorDataProvider
extends
\Bitrix\Main\Filter\EntityDataProvider
9
{
10
public
function
getSettings
()
11
{
12
// TODO: Implement getSettings() method.
13
}
14
15
public
function
prepareFields
()
16
{
17
$fields = [
18
'PERSON_TYPE'
=> $this->
createField
(
'PERSON_TYPE'
, [
19
"name"
=>
Loc::getMessage
(
'CONTRACTOR_TYPE'
),
20
"type"
=>
"list"
,
21
"default"
=>
true
,
22
'partial'
=>
true
,
23
]),
24
'PERSON_NAME'
=> $this->
createField
(
'PERSON_NAME'
, [
25
"name"
=>
Loc::getMessage
(
'CONTRACTOR_PERSON_TITLE'
),
26
"default"
=>
true
,
27
]),
28
'COMPANY'
=> $this->
createField
(
'COMPANY'
, [
29
"name"
=>
Loc::getMessage
(
'CONTRACTOR_COMPANY'
),
30
]),
31
'PHONE'
=> $this->
createField
(
'PHONE'
, [
32
"name"
=>
Loc::getMessage
(
'CONTRACTOR_PHONE'
),
33
]),
34
'EMAIL'
=> $this->
createField
(
'EMAIL'
, [
35
"name"
=>
Loc::getMessage
(
'CONTRACTOR_EMAIL'
),
36
]),
37
'INN'
=> $this->
createField
(
'INN'
, [
38
"name"
=>
Loc::getMessage
(
'CONTRACTOR_INN'
),
39
]),
40
'KPP'
=> $this->
createField
(
'KPP'
, [
41
"name"
=>
Loc::getMessage
(
'CONTRACTOR_KPP'
),
42
]),
43
];
44
45
return
$fields;
46
}
47
48
protected
function
getFieldName
($fieldID)
49
{
50
return
Loc::getMessage
(
"CONTRACTOR_{$fieldID}"
);
51
}
52
53
public
function
prepareFieldData
($fieldID)
54
{
55
if
($fieldID ===
'PERSON_TYPE'
)
56
{
57
return
[
'items'
=>
ContractorTable::getTypeDescriptions
()];
58
}
59
}
60
61
public
function
getGridColumns
()
62
{
63
$columns = [
64
[
"id"
=>
"ID"
,
"name"
=>
"ID"
,
"sort"
=>
"ID"
,
"default"
=>
true
],
65
[
'id'
=>
'PERSON_TYPE'
,
'name'
=>
Loc::getMessage
(
'CONTRACTOR_TYPE'
),
'sort'
=>
'PERSON_TYPE'
,
'default'
=>
true
],
66
[
'id'
=>
'PERSON_NAME'
,
'name'
=>
Loc::getMessage
(
'CONTRACTOR_PERSON_TITLE'
),
'sort'
=>
'PERSON_NAME'
,
'default'
=>
true
],
67
[
"id"
=>
"COMPANY"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_COMPANY"
),
"sort"
=>
"COMPANY"
,
"default"
=>
true
],
68
[
"id"
=>
"EMAIL"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_EMAIL"
),
"sort"
=>
"EMAIL"
,
"default"
=>
true
],
69
[
"id"
=>
"PHONE"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_PHONE"
),
"sort"
=>
"PHONE"
,
"default"
=>
false
],
70
[
"id"
=>
"POST_INDEX"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_POST_INDEX"
),
"sort"
=>
"POST_INDEX"
,
"default"
=>
false
],
71
[
"id"
=>
"INN"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_INN"
),
"sort"
=>
"INN"
,
"default"
=>
false
],
72
[
"id"
=>
"KPP"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_KPP"
),
"sort"
=>
"KPP"
,
"default"
=>
false
],
73
[
"id"
=>
"ADDRESS"
,
"name"
=>
Loc::getMessage
(
"CONTRACTOR_ADDRESS"
),
"sort"
=>
"ADDRESS"
,
"default"
=>
true
],
74
];
75
76
return
$columns;
77
}
78
}
Bitrix\Catalog\ContractorTable
Definition
contractortable.php:55
Bitrix\Catalog\ContractorTable\getTypeDescriptions
static getTypeDescriptions()
Definition
contractortable.php:379
Bitrix\Catalog\Filter\DataProvider\ContractorDataProvider
Definition
contractordataprovider.php:9
Bitrix\Catalog\Filter\DataProvider\ContractorDataProvider\prepareFieldData
prepareFieldData($fieldID)
Definition
contractordataprovider.php:53
Bitrix\Catalog\Filter\DataProvider\ContractorDataProvider\getFieldName
getFieldName($fieldID)
Definition
contractordataprovider.php:48
Bitrix\Catalog\Filter\DataProvider\ContractorDataProvider\getSettings
getSettings()
Definition
contractordataprovider.php:10
Bitrix\Catalog\Filter\DataProvider\ContractorDataProvider\getGridColumns
getGridColumns()
Definition
contractordataprovider.php:61
Bitrix\Catalog\Filter\DataProvider\ContractorDataProvider\prepareFields
prepareFields()
Definition
contractordataprovider.php:15
Bitrix\Main\Filter\EntityDataProvider
Definition
entitydataprovider.php:7
Bitrix\Main\Filter\EntityDataProvider\createField
createField($fieldID, array $params=null)
Definition
entitydataprovider.php:25
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\Catalog\Filter\DataProvider
Definition
agentcontractdataprovider.php:3
modules
catalog
lib
filter
dataprovider
contractordataprovider.php
Создано системой
1.10.0