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