Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
enum.php
1
<?php
2
3
4
namespace
Bitrix\Sale\Controller
;
5
6
7
use
Bitrix\Main\Localization\Loc
;
8
use
Bitrix\Sale\Rest\Entity\BusinessValuePersonDomainType
;
9
use
Bitrix\Sale\Rest\Entity\RelationType
;
10
use
Bitrix\Sale\Result
;
11
12
class
Enum
extends
ControllerBase
13
{
14
public
function
getRelationTypesAction
()
15
{
16
$r=[];
17
foreach
(RelationType::getAllDescriptions() as $id=>$name)
18
{
19
$r[] = [
'ID'
=>RelationType::resolveName($id),
'NAME'
=>$name];
20
}
21
return
[
'ENUM'
=>$r];
22
}
23
24
public
function
getBusinessValuePersonDomainTypesAction
()
25
{
26
$r=[];
27
foreach
(
BusinessValuePersonDomainType::getAllDescriptions
() as $id=>$name)
28
{
29
$r[] = [
'ID'
=>
BusinessValuePersonDomainType::resolveName
($id),
'NAME'
=>$name];
30
}
31
return
[
'ENUM'
=>$r];
32
}
33
34
public
function
getPaymentIsCashTypesAction
()
35
{
36
$messages =
Loc::loadLanguageFile
($_SERVER[
"DOCUMENT_ROOT"
].
'/bitrix/modules/sale/admin/pay_system_edit.php'
);
37
38
$r[] = [
'ID'
=>
'N'
,
'NAME'
=>$messages[
'SPS_IS_CASH_TYPE_NO_CASH'
]];
39
$r[] = [
'ID'
=>
'Y'
,
'NAME'
=>$messages[
'SPS_IS_CASH_TYPE_CASH'
]];
40
$r[] = [
'ID'
=>
'A'
,
'NAME'
=>$messages[
'SPS_IS_CASH_TYPE_ACQUIRING'
]];
41
42
return
[
'ENUM'
=>$r];
43
}
44
45
public
function
getPropertyTypesAction
()
46
{
47
$r = [];
48
$property =
new
Property
();
49
50
foreach
($property->getTypes()[
'ENUM'
] as $name=>$description)
51
{
52
if
($name ==
'LOCATION'
)
53
continue
;
54
if
($name ==
'FILE'
)
55
continue
;
56
57
$r[$name] = $description;
58
59
}
60
return
[
'ENUM'
=>$r];
61
}
62
63
public
function
getStatusTypesAction
()
64
{
65
$messages =
Loc::loadLanguageFile
($_SERVER[
"DOCUMENT_ROOT"
].
'/bitrix/modules/sale/admin/status_edit.php'
);
66
67
$r[] = [
'ID'
=>
'O'
,
'NAME'
=>$messages[
'SSEN_TYPE_O'
]];
68
$r[] = [
'ID'
=>
'D'
,
'NAME'
=>$messages[
'SSEN_TYPE_D'
]];
69
70
return
[
'ENUM'
=>$r];
71
}
72
73
protected
function
checkPermissionEntity
($name, $arguments=[])
74
{
75
return
new
Result
();
76
}
77
}
Bitrix\Iblock\Property
Definition
property.php:27
Bitrix\Main\DB\Result
Definition
result.php:19
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadLanguageFile
static loadLanguageFile($file, $language=null, $normalize=true)
Definition
loc.php:224
Bitrix\Sale\Controller\ControllerBase
Definition
controllerbase.php:15
Bitrix\Sale\Controller\Enum
Definition
enum.php:13
Bitrix\Sale\Controller\Enum\getPropertyTypesAction
getPropertyTypesAction()
Definition
enum.php:45
Bitrix\Sale\Controller\Enum\getRelationTypesAction
getRelationTypesAction()
Definition
enum.php:14
Bitrix\Sale\Controller\Enum\getBusinessValuePersonDomainTypesAction
getBusinessValuePersonDomainTypesAction()
Definition
enum.php:24
Bitrix\Sale\Controller\Enum\getPaymentIsCashTypesAction
getPaymentIsCashTypesAction()
Definition
enum.php:34
Bitrix\Sale\Controller\Enum\checkPermissionEntity
checkPermissionEntity($name, $arguments=[])
Definition
enum.php:73
Bitrix\Sale\Controller\Enum\getStatusTypesAction
getStatusTypesAction()
Definition
enum.php:63
Bitrix\Sale\Rest\Entity\BusinessValuePersonDomainType
Definition
businessvaluepersondomaintype.php:10
Bitrix\Sale\Rest\Entity\BusinessValuePersonDomainType\resolveName
static resolveName($typeID)
Definition
businessvaluepersondomaintype.php:31
Bitrix\Sale\Rest\Entity\BusinessValuePersonDomainType\getAllDescriptions
static getAllDescriptions()
Definition
businessvaluepersondomaintype.php:75
Bitrix\Sale\Rest\Entity\RelationType
Definition
relationtype.php:7
Bitrix\Sale\Controller
modules
sale
lib
controller
enum.php
Создано системой
1.10.0