1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
messagebase.php
См. документацию.
1<?php
8
10
16
17Loc::loadMessages(__FILE__);
18
24{
25 const CODE = self::CODE_UNDEFINED;
26 const CODE_RC_LEAD = 'rc_lead';
27 const CODE_RC_DEAL = 'rc_deal';
28
30 protected $configuration;
31
34
38 public function __construct()
39 {
40 $this->configuration = new Message\Configuration();
41 }
42
47 public function getName()
48 {
49 return Loc::getMessage('SENDER_INTEGRATION_CRM_RC_MESSAGE_NAME');
50 }
51
52 public function getCode()
53 {
54 return static::CODE;
55 }
56
57 public function getSupportedTransports()
58 {
59 return array(static::CODE);
60 }
61
62 protected function setConfigurationOptions()
63 {
64 }
65
73 public function loadConfiguration($id = null)
74 {
76 Entity\Message::create()
77 ->setCode($this->getCode())
78 ->loadConfiguration($id, $this->configuration);
79
80 $assignOption = $this->configuration->getOption('ASSIGNED_BY');
81 if ($assignOption)
82 {
83 $assignOption->setView(
84 function () use ($assignOption)
85 {
86 $userList = $assignOption->getValue();
87 $userList = $userList ? explode(',', $userList) : [];
88
89 ob_start();
90 $GLOBALS['APPLICATION']->includeComponent(
91 "bitrix:main.user.selector",
92 ".default",
93 [
94 "ID" => "sender-crm-rc-message",
95 "INPUT_NAME" => "%INPUT_NAME%[]",
96 "LIST" => $userList,
97 'API_VERSION' => '3',
98 "SELECTOR_OPTIONS" => array(
99 'context' => 'SENDER_USER',
100 'allowAddSocNetGroup' => 'N',
101 'departmentSelectDisable' => 'Y'
102 )
103 ]
104 );
105
106 return ob_get_clean();
107 }
108 );
109 }
110 $this->createDaysAgoView();
111
113 }
114
115 protected function createDaysAgoView()
116 {
117 $dealDaysAgoOption = $this->configuration->getOption('DEAL_DAYS_AGO');
118 $formPreviousOption = $this->configuration->getOption('FROM_PREVIOUS');
119
120 if($dealDaysAgoOption && $formPreviousOption)
121 {
122 $dealDaysAgoOption->setView(
123 function() use ($dealDaysAgoOption, $formPreviousOption)
124 {
125 $prefix = 'CONFIGURATION_';
126 $daysAgoCode = htmlspecialcharsbx($prefix.$dealDaysAgoOption->getCode());
127 $fromPreviousCode = htmlspecialcharsbx($prefix.$formPreviousOption->getCode());
128 ob_start();
129 Extension::load("sender.rc_editor");
130
131 echo "<input type='number' step='1' id='" . $daysAgoCode . "'
132 name='" . $daysAgoCode . "'
133 class='bx-sender-form-control' value='" . (int)$dealDaysAgoOption->getValue() . "'
134 min='" . htmlspecialcharsbx($dealDaysAgoOption->getMinValue()) . "'
135 max='" . htmlspecialcharsbx($dealDaysAgoOption->getMaxValue()) . "'
136 />";
137
139 [
140 'elementId' => $daysAgoCode,
141 'conditionElementId' => $fromPreviousCode
142 ]
143 );
144
145 echo "<script>new BX.Sender.RcEditor(".$params.")</script>";
146
147 return ob_get_clean();
148 }
149 );
150 }
151 }
152
161 {
162 return Entity\Message::create()
163 ->setCode($this->getCode())
164 ->saveConfiguration($this->configuration);
165 }
166
173 public function removeConfiguration($id)
174 {
176 return $result->isSuccess();
177 }
178
185 public function copyConfiguration($id)
186 {
187 return Entity\Message::create()
188 ->setCode($this->getCode())
189 ->copyConfiguration($id);
190 }
191
197 public function getSmsSender()
198 {
199 return $this->configuration->getOption('SENDER')->getValue();
200 }
201}
static encode($data, $options=null)
Определения json.php:22
static removeById($id)
Определения message.php:146
saveConfiguration(Message\Configuration $configuration)
Определения messagebase.php:160
$userList
Определения discount_coupon_list.php:276
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
$GLOBALS['____1690880296']
Определения license.php:1
Определения ad.php:8
Определения adapter.php:9
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799