3namespace Bitrix\Socialnetwork;
6use Bitrix\Main\ModuleManager;
8use Bitrix\Main\Localization\Loc;
18 if ($authId ==
'email')
20 $result[
'message'] = (!ModuleManager::isModuleInstalled(
'mail'));
28 $extranetSiteId =
false;
29 if (Loader::includeModule(
'extranet'))
31 $extranetSiteId = \CExtranet::getExtranetSiteId();
35 $res = \CSocNetLog::getSite($logId);
36 while ($logSite =
$res->fetch())
38 $logSiteId[] = $logSite[
"LID"];
43 &&
count($logSiteId) == 1
44 && $logSiteId[0] == $extranetSiteId
52 if (!Loader::includeModule(
'mail'))
59 || intval(
$fields[
"logEntryId"]) <= 0
61 || !isset(
$fields[
"logEntryUrl"])
68 if (!is_array(
$fields[
"userId"]))
78 $nameTemplate = \CSite::getNameFormat(
"",
$fields[
"siteId"]);
81 if (!empty(
$fields[
"authorId"]))
84 if ($author =
$res->fetch())
86 $authorName = \CUser::formatName(
100 $authorName =
'"'.$authorName.
'"';
119 || !in_array(mb_strtoupper(
$fields[
"type"]),
array(
"LOG_ENTRY",
"LOG_COMMENT"))
122 $fields[
"type"] =
"LOG_COMMENT";
125 $arEmail = \Bitrix\Mail\User::getUserData(
$fields[
"userId"], $nameTemplate);
131 $arLogEntry = \CSocNetLog::getByID(intval(
$fields[
"logEntryId"]));
137 $logEntryTitle = str_replace(
array(
"\r\n",
"\n"),
" ", ($arLogEntry[
"TITLE"] !=
'__EMPTY__' ? $arLogEntry[
"TITLE"] : $arLogEntry[
"MESSAGE"]));
138 $logEntryTitle = truncateText($logEntryTitle, 100);
140 switch(mb_strtoupper(
$fields[
"type"]))
143 $mailMessageId =
"<LOG_COMMENT_".$fields[
"logCommentId"].
"@".
$GLOBALS[
"SERVER_NAME"].
">";
144 $mailTemplateType =
"SONET_LOG_NEW_COMMENT";
147 $mailMessageId =
"<LOG_ENTRY_".$fields[
"logEntryId"].
"@".
$GLOBALS[
"SERVER_NAME"].
">";
148 $mailTemplateType =
"SONET_LOG_NEW_ENTRY";
151 $mailMessageInReplyTo =
"<LOG_ENTRY_".$fields[
"logEntryId"].
"@".
$GLOBALS[
"SERVER_NAME"].
">";
152 $defaultEmailFrom = \Bitrix\Mail\User::getDefaultEmailFrom();
157 $nameFormatted = str_replace(
array(
'<',
'>',
'"'),
'',
$user[
"NAME_FORMATTED"]);
167 $res = \Bitrix\Mail\User::getReplyTo(
183 $authorName = str_replace(
array(
'<',
'>',
'"'),
'', $authorName);
188 "=Reply-To" => $authorName.
' <'.$replyTo.
'>',
189 "=Message-Id" => $mailMessageId,
190 "=In-Reply-To" => $mailMessageInReplyTo,
191 "EMAIL_FROM" => $authorName.
' <'.$defaultEmailFrom.
'>',
192 "EMAIL_TO" => (!empty($nameFormatted) ?
''.$nameFormatted.
' <'.
$email.
'>' :
$email),
194 "COMMENT_ID" => (isset(
$fields[
"logCommentId"]) ? intval(
$fields[
"logCommentId"]) :
false),
195 "LOG_ENTRY_ID" => intval(
$fields[
"logEntryId"]),
196 "LOG_ENTRY_TITLE" => $logEntryTitle,
197 "URL" =>
$fields[
"logEntryUrl"]
212 if (mb_substr(
$key, 0, 1) ==
"=")
214 $fields1[mb_substr(
$key, 1)] = $value;
224 foreach ($fields1 as
$key => $value)
226 if ($insert[0] <>
'')
231 if ($insert[1] <>
'')
235 $insert[1] .= $value;
241 foreach ($fields1 as
$key => $value)
247 $update .=
$key.
"=".$value.
" ";
253 static $parser =
null;
258 !is_array($fieldList)
259 || !is_array($codeList)
265 foreach($codeList as
$code)
269 || empty($fieldList[
$code])
275 if ($parser ===
null)
277 $parser = new \CTextParser();
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static processEqualityFieldsToUpdate($fields1, &$update)
static getSiteIdByLogId($logId)
static getPermissionsByExternalAuthId($authId)
static detectTags($fieldList, $codeList=array())
static getEqualityFields(&$fields)
static processEqualityFieldsToInsert($fields1, &$insert)
static notifyMail($fields)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if($request->getPost('Update') !==null) elseif( $request->getPost( 'Apply') !==null) elseif($request->getPost('RestoreDefaults') !==null) $backUrl
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
check_email($email, $strict=false, $domainCheck=false)
$GLOBALS['____1690880296']
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"