Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sectiondictionary.php
1<?php
3
9
10Loc::loadMessages(__FILE__);
12{
13 const MAILING = 1;
14 const ADS = 2;
15 const SEGMENT = 3;
16 const RC = 4;
17 const TEMPLATE = 5;
18 const BLACKLIST = 6;
19 const START = 7;
20 const SETTINGS = 8;
21
22 public static function getMap()
23 {
24 return [
25 self::MAILING => [
26 PermissionDictionary::MAILING_VIEW,
27 PermissionDictionary::MAILING_EMAIL_EDIT,
28 PermissionDictionary::MAILING_SMS_EDIT,
29 PermissionDictionary::MAILING_MESSENGER_EDIT,
30 PermissionDictionary::MAILING_AUDIO_CALL_EDIT,
31 PermissionDictionary::MAILING_INFO_CALL_EDIT,
32 PermissionDictionary::MAILING_PAUSE_START_STOP,
33 PermissionDictionary::MAILING_CLIENT_VIEW,
34 ],
35 self::ADS => [
36 PermissionDictionary::ADS_VIEW,
37 PermissionDictionary::ADS_YANDEX_EDIT,
38 PermissionDictionary::ADS_GOOGLE_EDIT_MSGVER_1,
39 PermissionDictionary::ADS_VK_EDIT,
40 PermissionDictionary::ADS_FB_INSTAGRAM_EDIT,
41 PermissionDictionary::ADS_LOOK_ALIKE_VK_EDIT,
42 PermissionDictionary::ADS_LOOK_ALIKE_FB_EDIT,
43 PermissionDictionary::ADS_PAUSE_START_STOP,
44 PermissionDictionary::ADS_CLIENT_VIEW,
45 PermissionDictionary::ADS_MARKETING_FB_EDIT,
46 PermissionDictionary::ADS_MARKETING_INSTAGRAM_EDIT,
47 PermissionDictionary::ADS_MASTER_YANDEX_EDIT,
48 ],
49 self::SEGMENT => [
50 PermissionDictionary::SEGMENT_EDIT,
51 PermissionDictionary::SEGMENT_VIEW,
52 PermissionDictionary::SEGMENT_CLIENT_EDIT,
53 PermissionDictionary::SEGMENT_CLIENT_VIEW,
54 PermissionDictionary::SEGMENT_LEAD_EDIT,
55 PermissionDictionary::SEGMENT_CLIENT_PERSONAL_EDIT,
56 PermissionDictionary::SEGMENT_CLIENT_OWN_CATEGORY,
57 ],
58 self::RC => [
59 PermissionDictionary::RC_EDIT,
60 PermissionDictionary::RC_PAUSE_START_STOP,
61 PermissionDictionary::RC_VIEW,
62 ],
63 self::TEMPLATE => [
64 PermissionDictionary::TEMPLATE_EDIT,
65 PermissionDictionary::TEMPLATE_VIEW,
66 ],
67 self::BLACKLIST => [
68 PermissionDictionary::BLACKLIST_EDIT,
69 PermissionDictionary::BLACKLIST_VIEW,
70 ],
71 self::START => [
72 PermissionDictionary::START_VIEW,
73 ],
74 self::SETTINGS => [
75 PermissionDictionary::SETTINGS_EDIT,
76// PermissionDictionary::SETTINGS_VIEW,
77 ],
78 ];
79 }
80
85 public static function getAdsAccessMap()
86 {
87 return [
88 PermissionDictionary::ADS_YANDEX_EDIT => MessageBase::CODE_ADS_YA,
89 PermissionDictionary::ADS_VK_EDIT => MessageBase::CODE_ADS_VK,
90 PermissionDictionary::ADS_LOOK_ALIKE_VK_EDIT => MessageBase::CODE_ADS_LOOKALIKE_VK,
91 PermissionDictionary::ADS_FB_INSTAGRAM_EDIT => Message\iMarketing::CODE_FACEBOOK,
92 PermissionDictionary::ADS_LOOK_ALIKE_FB_EDIT => MessageBase::CODE_ADS_LOOKALIKE_FB,
93 PermissionDictionary::ADS_MARKETING_FB_EDIT => MessageBase::CODE_ADS_FB,
94 PermissionDictionary::ADS_MARKETING_INSTAGRAM_EDIT => Message\iMarketing::CODE_FACEBOOK,
95 PermissionDictionary::ADS_MASTER_YANDEX_EDIT => MessageBase::CODE_MASTER_YANDEX,
96 ];
97 }
98
103 public static function getLegacyMap()
104 {
105 return [
106 self::MAILING => Permission::ENTITY_LETTER,
107 self::ADS => Permission::ENTITY_AD,
108 self::SEGMENT => Permission::ENTITY_SEGMENT,
109 self::RC => Permission::ENTITY_RC,
110 self::TEMPLATE => Permission::ENTITY_SEGMENT,
111 self::BLACKLIST => Permission::ENTITY_BLACKLIST,
112 self::START => Permission::ENTITY_LETTER,
113 self::SETTINGS => Permission::ENTITY_SETTINGS,
114 ];
115 }
116 protected static function getClassName()
117 {
118 return __CLASS__;
119 }
120
125 public static function getList(): array
126 {
127 $class = new \ReflectionClass(__CLASS__);
128 return array_flip($class->getConstants());
129 }
130
136 public static function getTitle(int $value)
137 {
138 $sectionsList = self::getList();
139
140 if (!array_key_exists($value, $sectionsList))
141 {
142 return '';
143 }
144 $title = $sectionsList[$value];
145
146 return Loc::getMessage("SENDER_CONFIG_SECTIONS_".$title) ?? '';
147 }
148}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29