1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
messagebase.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Sender\Integration\Crm\ReturnCustomer
;
10
11
use
Bitrix\Main\Localization\Loc
;
12
use
Bitrix\Main\Result
;
13
use
Bitrix\Main\UI\Extension
;
14
use
Bitrix\Sender\Entity
;
15
use
Bitrix\Sender\Message
;
16
17
Loc::loadMessages(__FILE__);
18
23
class
MessageBase
implements
Message\iBase
,
Message\iReturnCustomer
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
33
protected
$configurationId
;
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
{
75
$this->
setConfigurationOptions
();
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
112
return
$this->configuration
;
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
138
$params
=
\Bitrix\Main\Web\Json::encode
(
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
160
public
function
saveConfiguration
(
Message
\
Configuration
$configuration
)
161
{
162
return
Entity\Message::create()
163
->setCode($this->
getCode
())
164
->saveConfiguration($this->configuration);
165
}
166
173
public
function
removeConfiguration
($id)
174
{
175
$result
=
Entity\Message::removeById
($id);
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
}
Bitrix\Main\Config\Configuration
Определения
configuration.php:9
Bitrix\Main\Localization\Loc
Определения
loc.php:12
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
Bitrix\Main\UI\Extension
Определения
extension.php:11
Bitrix\Main\Web\Json\encode
static encode($data, $options=null)
Определения
json.php:22
Bitrix\Sender\Entity\Message\removeById
static removeById($id)
Определения
message.php:146
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase
Определения
messagebase.php:24
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\CODE
const CODE
Определения
messagebase.php:25
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\__construct
__construct()
Определения
messagebase.php:38
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\CODE_RC_LEAD
const CODE_RC_LEAD
Определения
messagebase.php:26
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\getSmsSender
getSmsSender()
Определения
messagebase.php:197
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\setConfigurationOptions
setConfigurationOptions()
Определения
messagebase.php:62
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\getName
getName()
Определения
messagebase.php:47
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\removeConfiguration
removeConfiguration($id)
Определения
messagebase.php:173
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\CODE_RC_DEAL
const CODE_RC_DEAL
Определения
messagebase.php:27
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\createDaysAgoView
createDaysAgoView()
Определения
messagebase.php:115
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\loadConfiguration
loadConfiguration($id=null)
Определения
messagebase.php:73
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\$configuration
$configuration
Определения
messagebase.php:30
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\getCode
getCode()
Определения
messagebase.php:52
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\$configurationId
$configurationId
Определения
messagebase.php:33
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\copyConfiguration
copyConfiguration($id)
Определения
messagebase.php:185
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\saveConfiguration
saveConfiguration(Message\Configuration $configuration)
Определения
messagebase.php:160
Bitrix\Sender\Integration\Crm\ReturnCustomer\MessageBase\getSupportedTransports
getSupportedTransports()
Определения
messagebase.php:57
$userList
$userList
Определения
discount_coupon_list.php:276
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Sender\Message\iBase
Определения
ibase.php:16
Bitrix\Sender\Message\iReturnCustomer
Определения
ireturncustomer.php:16
htmlspecialcharsbx
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения
tools.php:2701
Bitrix\Main\$GLOBALS
$GLOBALS['____1690880296']
Определения
license.php:1
Bitrix\Sender\Entity
Определения
ad.php:8
Bitrix\Sender\Integration\Crm\ReturnCustomer
Определения
messagebase.php:9
Bitrix\Sender\Message
Определения
adapter.php:9
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
sender
lib
integration
crm
returncustomer
messagebase.php
Создано системой
1.14.0