Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
service.php
1
<?php
9
namespace
Bitrix\Sender\Integration\Crm\ReturnCustomer
;
10
11
use
Bitrix\Main\Loader
;
12
13
use
Bitrix\Sender\Recipient
;
14
use
Bitrix\Sender\Integration
;
15
16
use Bitrix\Crm;
17
22
class
Service
23
{
29
public
static
function
canUse
()
30
{
31
return
(
Loader::includeModule
(
'crm'
));
32
}
33
39
public
static
function
isAvailable
()
40
{
41
return
self::canUse() && Integration\Bitrix24\Service::isRcAvailable();
42
}
43
49
public
static
function
canCurrentUserUse
()
50
{
51
//TODO: add Security\Access::getInstance()->canModifyRc()
52
return
self::canUse();
53
}
54
55
56
62
public
static
function
isLeadEnabled
()
63
{
64
return
Crm\Settings\LeadSettings::isEnabled();
65
}
66
73
public
static
function
getTypeIdByRecipientType
($recipientType)
74
{
75
return
self::getTypeIdByRecipientTypeId(Recipient\
Type::getId
($recipientType));
76
}
77
84
public
static
function
getTypeIdByRecipientTypeId
($recipientTypeId)
85
{
86
$map = [
87
Recipient\Type::CRM_CONTACT_ID => \CCrmOwnerType::Contact,
88
Recipient\Type::CRM_COMPANY_ID => \CCrmOwnerType::Company,
89
Recipient\Type::CRM_LEAD_ID => \CCrmOwnerType::Lead,
90
];
91
92
return
isset($map[$recipientTypeId]) ? $map[$recipientTypeId] :
null
;
93
}
94
}
Bitrix\Main\Engine\CurrentUser\getId
getId()
Definition
currentuser.php:45
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Definition
loader.php:69
Bitrix\Sender\Integration\Bitrix24\Service
Definition
service.php:30
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\isLeadEnabled
static isLeadEnabled()
Definition
service.php:62
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\canCurrentUserUse
static canCurrentUserUse()
Definition
service.php:49
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\getTypeIdByRecipientTypeId
static getTypeIdByRecipientTypeId($recipientTypeId)
Definition
service.php:84
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\canUse
static canUse()
Definition
service.php:29
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\isAvailable
static isAvailable()
Definition
service.php:39
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\getTypeIdByRecipientType
static getTypeIdByRecipientType($recipientType)
Definition
service.php:73
Bitrix\Sender\Integration\Crm\ReturnCustomer
Definition
messagebase.php:9
Bitrix\Sender\Integration
Bitrix\Sender\Recipient
Definition
agent.php:8
modules
sender
lib
integration
crm
returncustomer
service.php
Создано системой
1.10.0