1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?php
8
9namespace Bitrix\Sender\Integration\Crm\ReturnCustomer;
10
11use Bitrix\Main\Loader;
12
13use Bitrix\Sender\Recipient;
14use Bitrix\Sender\Integration;
15
16use Bitrix\Crm;
17
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}
static includeModule($moduleName)
Определения loader.php:67
static getTypeIdByRecipientTypeId($recipientTypeId)
Определения service.php:84
static getTypeIdByRecipientType($recipientType)
Определения service.php:73
const CRM_COMPANY_ID
Определения type.php:24
const CRM_LEAD_ID
Определения type.php:26
const CRM_CONTACT_ID
Определения type.php:25
$map
Определения config.php:5
Определения agent.php:8