Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
service.php
1<?php
10
12
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)
Definition loader.php:69
static getTypeIdByRecipientTypeId($recipientTypeId)
Definition service.php:84