1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1
<?php
8
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()
Определения
currentuser.php:49
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Определения
loader.php:67
Bitrix\Sender\Integration\Bitrix24\Service\isRcAvailable
static isRcAvailable()
Определения
service.php:98
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\isLeadEnabled
static isLeadEnabled()
Определения
service.php:62
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\canCurrentUserUse
static canCurrentUserUse()
Определения
service.php:49
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\getTypeIdByRecipientTypeId
static getTypeIdByRecipientTypeId($recipientTypeId)
Определения
service.php:84
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\canUse
static canUse()
Определения
service.php:29
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\isAvailable
static isAvailable()
Определения
service.php:39
Bitrix\Sender\Integration\Crm\ReturnCustomer\Service\getTypeIdByRecipientType
static getTypeIdByRecipientType($recipientType)
Определения
service.php:73
Bitrix\Sender\Recipient\Type\CRM_COMPANY_ID
const CRM_COMPANY_ID
Определения
type.php:24
Bitrix\Sender\Recipient\Type\CRM_LEAD_ID
const CRM_LEAD_ID
Определения
type.php:26
Bitrix\Sender\Recipient\Type\CRM_CONTACT_ID
const CRM_CONTACT_ID
Определения
type.php:25
$map
$map
Определения
config.php:5
Bitrix\Main\Service
Bitrix\Sender\Recipient
Определения
agent.php:8
bitrix
modules
sender
lib
integration
crm
returncustomer
service.php
Создано системой
1.14.0