本文整理汇总了PHP中CEventMessage::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventMessage::Update方法的具体用法?PHP CEventMessage::Update怎么用?PHP CEventMessage::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEventMessage
的用法示例。
在下文中一共展示了CEventMessage::Update方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendMessage
function appendMessage($ID)
{
$LID = $this->getSitesByMessage($ID);
$LID[] = WIZARD_SITE_ID;
$em = new CEventMessage();
$arFields = array("LID" => $LID);
return $em->Update($ID, $arFields);
}
示例2: CreateForm
function CreateForm($arForm, $arFormFields, $langFile)
{
if (!CModule::IncludeModule("form")) {
return false;
}
// set defaults
$arFieldDefaults = array("ACTIVE" => "Y", "C_SORT" => 0, "ADDITIONAL" => "N", "TITLE_TYPE" => "text", "IN_RESULTS_TABLE" => "Y", "IN_EXCEL_TABLE" => "Y");
foreach ($arFormFields as $key => $arField) {
if ($arFormFields['ADDITIONAL'] == 'Y' && !is_set($arFormFields['C_SORT'])) {
$arFormFields['C_SORT'] = 5000;
}
$arFieldDefaults["C_SORT"] += 100;
$arFormFields[$key] = array_merge($arFieldDefaults, $arField);
$arFormFields[$key]["TITLE"] = GetMessage($arField["SID"] . "_QUESTION");
}
$rsLanguage = CLanguage::GetList($by, $order, array());
while ($arLanguage = $rsLanguage->Fetch()) {
WizardServices::IncludeServiceLang($langFile, $arLanguage["LID"]);
$arForm["arMENU"][$arLanguage["LID"]] = GetMessage(substr($arForm["SID"], 0, -3) . "_MENU_NAME");
}
$dbForm = CForm::GetBySID($arForm["SID"]);
if ($dbForm->Fetch()) {
return;
}
WizardServices::IncludeServiceLang("status.php");
if ($formID = CForm::Set($arForm, false, "N")) {
// setup form fields
foreach ($arFormFields as $key => $arField) {
$arField["FORM_ID"] = $formID;
$fieldID = CFormField::Set($arField, false, "N");
}
if ($arTemplates = CForm::SetMailTemplate($formID)) {
CForm::Set(array('SID' => $arForm['SID'], 'arMAIL_TEMPLATE' => $arTemplates), $formID, 'N');
}
$arStatuses = array(array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_NEW"), "C_SORT" => 100, "ACTIVE" => "Y", "DEFAULT_VALUE" => "Y", "CSS" => "statusgray", "arPERMISSION_VIEW" => array(0), "arPERMISSION_MOVE" => array(0), "arPERMISSION_EDIT" => array(0), "arPERMISSION_DELETE" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_RECEIVED"), "C_SORT" => 200, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusblue", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_DONE"), "C_SORT" => 300, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusgreen", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_REFUSE"), "C_SORT" => 400, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusred", "arPERMISSION_VIEW" => array(0)));
foreach ($arStatuses as $key => $arStatus) {
if ($STATUS_ID = CFormStatus::Set($arStatus, false, "N")) {
if ($arStatus['DEFAULT_VALUE'] == 'N' && ($arTemplates = CFormStatus::SetMailTemplate($formID, $STATUS_ID))) {
foreach ($arTemplates as $TEMPLATE_ID) {
if (null == $em) {
$em = new CEventMessage();
}
$em->Update($TEMPLATE_ID, array('MESSAGE' => GetMessage('STATUS_MESSAGE')));
}
CFormStatus::Set(array('FORM_ID' => $formID, 'arMAIL_TEMPLATE' => $arTemplates), $STATUS_ID, 'N');
}
}
}
}
return $formID;
}
示例3: updateEventMessageByFilter
public function updateEventMessageByFilter($filter, $fields)
{
$by = "site_id";
$order = "desc";
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$dbRes = \CEventMessage::GetList($by, $order, $filter);
while ($aItem = $dbRes->getNext()) {
$event = new \CEventMessage();
if (!$event->Update($aItem["ID"], $fields)) {
$this->throwException(__METHOD__, $event->LAST_ERROR);
}
}
return true;
}
示例4: IntVal
$ID = IntVal($ID);
$emessage = new CEventMessage();
switch ($_REQUEST['action']) {
case "delete":
$DB->StartTransaction();
if (!$emessage->Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
} else {
$DB->Commit();
}
break;
case "activate":
case "deactivate":
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!$emessage->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . ':' . $emessage->LAST_ERROR, $ID);
}
break;
}
}
}
$rsData = CEventMessage::GetList($by, $order, $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// LIST
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
// Header
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "id", "default" => true, "align" => "right"), array("id" => "TIMESTAMP_X", "content" => GetMessage('TIMESTAMP'), "default" => true, "align" => "center"), array("id" => "ACTIVE", "content" => GetMessage('ACTIVE'), "sort" => "active", "default" => true, "align" => "center"), array("id" => "LID", "content" => GetMessage('LANG'), "default" => true, "align" => "center"), array("id" => "EVENT_NAME", "content" => GetMessage("EVENT_TYPE"), "sort" => "event_name", "default" => true), array("id" => "EVENT_TYPE", "content" => GetMessage("EVENT_TYPE")), array("id" => "SUBJECT", "content" => GetMessage('SUBJECT'), "sort" => "subject", "default" => true), array("id" => "EMAIL_FROM", "content" => GetMessage("F_FROM"), "sort" => "from"), array("id" => "EMAIL_TO", "content" => GetMessage("F_TO"), "sort" => "to"), array("id" => "BCC", "content" => GetMessage("F_BCC"), "sort" => "bcc"), array("id" => "BODY_TYPE", "content" => GetMessage("F_BODY_TYPE"), "sort" => "body_type")));
$arText_HTML = array("text" => GetMessage("MAIN_TEXT"), "html" => GetMessage("MAIN_HTML"));
$arEventTypes = array();
示例5: SetMailTemplate
function SetMailTemplate($WEB_FORM_ID, $ADD_NEW_TEMPLATE = "Y", $old_SID = "", $bReturnFullInfo = false)
{
global $DB, $MESS, $strError;
$err_mess = CAllForm::err_mess() . "<br>Function: SetMailTemplates<br>Line: ";
$arrReturn = array();
$WEB_FORM_ID = intval($WEB_FORM_ID);
$q = CForm::GetByID($WEB_FORM_ID);
if ($arrForm = $q->Fetch()) {
$MAIL_EVENT_TYPE = "FORM_FILLING_" . $arrForm["SID"];
if (strlen($old_SID) > 0) {
$old_MAIL_EVENT_TYPE = "FORM_FILLING_" . $old_SID;
}
$et = new CEventType();
$em = new CEventMessage();
if (strlen($MAIL_EVENT_TYPE) > 0) {
$et->Delete($MAIL_EVENT_TYPE);
}
$z = CLanguage::GetList($v1, $v2);
$OLD_MESS = $MESS;
while ($arLang = $z->Fetch()) {
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/admin/form_mail.php", $arLang["LID"]);
$str = "";
$str .= "#RS_FORM_ID# - " . GetMessage("FORM_L_FORM_ID") . "\n";
$str .= "#RS_FORM_NAME# - " . GetMessage("FORM_L_NAME") . "\n";
$str .= "#RS_FORM_SID# - " . GetMessage("FORM_L_SID") . "\n";
$str .= "#RS_RESULT_ID# - " . GetMessage("FORM_L_RESULT_ID") . "\n";
$str .= "#RS_DATE_CREATE# - " . GetMessage("FORM_L_DATE_CREATE") . "\n";
$str .= "#RS_USER_ID# - " . GetMessage("FORM_L_USER_ID") . "\n";
$str .= "#RS_USER_EMAIL# - " . GetMessage("FORM_L_USER_EMAIL") . "\n";
$str .= "#RS_USER_NAME# - " . GetMessage("FORM_L_USER_NAME") . "\n";
$str .= "#RS_USER_AUTH# - " . GetMessage("FORM_L_USER_AUTH") . "\n";
$str .= "#RS_STAT_GUEST_ID# - " . GetMessage("FORM_L_STAT_GUEST_ID") . "\n";
$str .= "#RS_STAT_SESSION_ID# - " . GetMessage("FORM_L_STAT_SESSION_ID") . "\n";
$strFIELDS = "";
$w = CFormField::GetList($WEB_FORM_ID, "ALL", $by, $order, array(), $is_filtered);
while ($wr = $w->Fetch()) {
if (strlen($wr["RESULTS_TABLE_TITLE"]) > 0) {
$FIELD_TITLE = $wr["RESULTS_TABLE_TITLE"];
} elseif (strlen($wr["TITLE"]) > 0) {
$FIELD_TITLE = $wr["TITLE_TYPE"] == "html" ? htmlspecialcharsback(strip_tags($wr["TITLE"])) : $wr["TITLE"];
} else {
$FIELD_TITLE = TrimEx($wr["FILTER_TITLE"], ":");
}
$str .= "#" . $wr["SID"] . "# - " . $FIELD_TITLE . "\n";
$str .= "#" . $wr["SID"] . "_RAW# - " . $FIELD_TITLE . " (" . GetMessage('FORM_L_RAW') . ")\n";
$strFIELDS .= $FIELD_TITLE . "\n*******************************\n#" . $wr["SID"] . "#\n\n";
}
$et->Add(array("LID" => $arLang["LID"], "EVENT_NAME" => $MAIL_EVENT_TYPE, "NAME" => GetMessage("FORM_FILLING") . " \"" . $arrForm["SID"] . "\"", "DESCRIPTION" => $str));
}
// задаем новый тип событи¤ дл¤ старых шаблонов
if (strlen($old_MAIL_EVENT_TYPE) > 0 && $old_MAIL_EVENT_TYPE != $MAIL_EVENT_TYPE) {
$e = $em->GetList($by = "id", $order = "desc", array("EVENT_NAME" => $old_MAIL_EVENT_TYPE));
while ($er = $e->Fetch()) {
$em->Update($er["ID"], array("EVENT_NAME" => $MAIL_EVENT_TYPE));
}
if (strlen($old_MAIL_EVENT_TYPE) > 0) {
$et->Delete($old_MAIL_EVENT_TYPE);
}
}
if ($ADD_NEW_TEMPLATE == "Y") {
$z = CSite::GetList($v1, $v2);
while ($arSite = $z->Fetch()) {
$arrSiteLang[$arSite["ID"]] = $arSite["LANGUAGE_ID"];
}
$arrFormSite = CForm::GetSiteArray($WEB_FORM_ID);
if (is_array($arrFormSite) && count($arrFormSite) > 0) {
foreach ($arrFormSite as $sid) {
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/admin/form_mail.php", $arrSiteLang[$sid]);
$SUBJECT = "#SERVER_NAME#: " . GetMessage("FORM_FILLING_S") . " [#RS_FORM_ID#] #RS_FORM_NAME#";
$MESSAGE = "#SERVER_NAME#\n\n" . GetMessage("FORM_FILLING") . ": [#RS_FORM_ID#] #RS_FORM_NAME#\n-------------------------------------------------------\n\n" . GetMessage("FORM_DATE_CREATE") . "#RS_DATE_CREATE#\n" . GetMessage("FORM_RESULT_ID") . "#RS_RESULT_ID#\n" . GetMessage("FORM_USER") . "[#RS_USER_ID#] #RS_USER_NAME# #RS_USER_AUTH#\n" . GetMessage("FORM_STAT_GUEST_ID") . "#RS_STAT_GUEST_ID#\n" . GetMessage("FORM_STAT_SESSION_ID") . "#RS_STAT_SESSION_ID#\n\n\n{$strFIELDS}\n" . GetMessage("FORM_VIEW") . "\nhttp://#SERVER_NAME#/bitrix/admin/form_result_view.php?lang=" . $arrSiteLang[$sid] . "&WEB_FORM_ID=#RS_FORM_ID#&RESULT_ID=#RS_RESULT_ID#\n\n-------------------------------------------------------\n" . GetMessage("FORM_GENERATED_AUTOMATICALLY") . "\n\t\t\t\t\t\t";
// добавл¤ем новый шаблон
$arFields = array("ACTIVE" => "Y", "EVENT_NAME" => $MAIL_EVENT_TYPE, "LID" => $sid, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#DEFAULT_EMAIL_FROM#", "SUBJECT" => $SUBJECT, "MESSAGE" => $MESSAGE, "BODY_TYPE" => "text");
$TEMPLATE_ID = $em->Add($arFields);
if ($bReturnFullInfo) {
$arrReturn[] = array('ID' => $TEMPLATE_ID, 'FIELDS' => $arFields);
} else {
$arrReturn[] = $TEMPLATE_ID;
}
}
}
}
$MESS = $OLD_MESS;
}
return $arrReturn;
}
示例6: SetMailTemplate
public static function SetMailTemplate($WEB_FORM_ID, $STATUS_ID, $ADD_NEW_TEMPLATE="Y", $old_SID="", $bReturnFullInfo = false)
{
global $DB, $MESS, $strError;
$err_mess = (CAllForm::err_mess())."<br>Function: SetMailTemplate<br>Line: ";
$arrReturn = array();
$WEB_FORM_ID = intval($WEB_FORM_ID);
$q = CForm::GetByID($WEB_FORM_ID);
if ($arrForm = $q->Fetch())
{
$dbRes = CFormStatus::GetByID($STATUS_ID);
if ($arrStatus = $dbRes->Fetch())
{
$MAIL_EVENT_TYPE = "FORM_STATUS_CHANGE_".$arrForm["SID"]."_".$arrStatus['ID'];
if (strlen($old_SID)>0)
$old_MAIL_EVENT_TYPE = "FORM_STATUS_CHANGE_".$old_SID."_".$arrStatus['ID'];
$et = new CEventType;
$em = new CEventMessage;
if (strlen($MAIL_EVENT_TYPE)>0)
$et->Delete($MAIL_EVENT_TYPE);
$z = CLanguage::GetList($v1, $v2);
$OLD_MESS = $MESS;
$MESS = array();
while ($arLang = $z->Fetch())
{
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_mail.php", $arLang["LID"]);
$str = "";
$str .= "#EMAIL_TO# - ".GetMessage("FORM_L_EMAIL_TO")."\n";
$str .= "#RS_FORM_ID# - ".GetMessage("FORM_L_FORM_ID")."\n";
$str .= "#RS_FORM_NAME# - ".GetMessage("FORM_L_NAME")."\n";
$str .= "#RS_FORM_SID# - ".GetMessage("FORM_L_SID")."\n";
$str .= "#RS_RESULT_ID# - ".GetMessage("FORM_L_RESULT_ID")."\n";
$str .= "#RS_DATE_CREATE# - ".GetMessage("FORM_L_DATE_CREATE")."\n";
$str .= "#RS_USER_ID# - ".GetMessage("FORM_L_USER_ID")."\n";
$str .= "#RS_USER_EMAIL# - ".GetMessage("FORM_L_USER_EMAIL")."\n";
$str .= "#RS_USER_NAME# - ".GetMessage("FORM_L_USER_NAME")."\n";
$str .= "#RS_STATUS_ID# - ".GetMessage("FORM_L_STATUS_ID")."\n";
$str .= "#RS_STATUS_NAME# - ".GetMessage("FORM_L_STATUS_NAME")."\n";
$et->Add(
Array(
"LID" => $arLang["LID"],
"EVENT_NAME" => $MAIL_EVENT_TYPE,
"NAME" => str_replace(array('#FORM_SID#', '#STATUS_NAME#'), array($arrForm['SID'], $arrStatus['TITLE']), GetMessage("FORM_CHANGE_STATUS")),
"DESCRIPTION" => $str
)
);
}
// create new event type for old templates
if (strlen($old_MAIL_EVENT_TYPE)>0 && $old_MAIL_EVENT_TYPE!=$MAIL_EVENT_TYPE)
{
$e = $em->GetList($by="id",$order="desc",array("EVENT_NAME"=>$old_MAIL_EVENT_TYPE));
while ($er=$e->Fetch())
{
$em->Update($er["ID"],array("EVENT_NAME"=>$MAIL_EVENT_TYPE));
}
if (strlen($old_MAIL_EVENT_TYPE)>0)
$et->Delete($old_MAIL_EVENT_TYPE);
}
if ($ADD_NEW_TEMPLATE=="Y")
{
$z = CSite::GetList($v1, $v2);
while ($arSite = $z->Fetch()) $arrSiteLang[$arSite["ID"]] = $arSite["LANGUAGE_ID"];
$arrFormSite = CForm::GetSiteArray($WEB_FORM_ID);
if (is_array($arrFormSite) && count($arrFormSite)>0)
{
foreach($arrFormSite as $sid)
{
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_mail.php", $arrSiteLang[$sid]);
$SUBJECT = GetMessage("FORM_CHANGE_STATUS_S");
$MESSAGE = GetMessage("FORM_CHANGE_STATUS_B");
// добавляем новый шаблон
$arFields = Array(
"ACTIVE" => "Y",
"EVENT_NAME" => $MAIL_EVENT_TYPE,
"LID" => $sid,
"EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#",
"EMAIL_TO" => "#EMAIL_TO#",
"SUBJECT" => $SUBJECT,
"MESSAGE" => $MESSAGE,
"BODY_TYPE" => "text"
);
//echo '<pre>'; print_r($arFields); echo '</pre>';
$TEMPLATE_ID = $em->Add($arFields);
if ($bReturnFullInfo)
$arrReturn[] = array(
'ID' => $TEMPLATE_ID,
'FIELDS' => $arFields,
);
else
$arrReturn[] = $TEMPLATE_ID;
}
//.........这里部分代码省略.........
示例7: intval
IncludeModuleLangFile(__FILE__);
$strError = "";
$bVarsFromForm = false;
$ID = intval($ID);
$COPY_ID = intval($COPY_ID);
$message = null;
if ($COPY_ID > 0) {
$ID = $COPY_ID;
}
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB"), "ICON" => "message_edit", "TITLE" => GetMessage("MAIN_TAB_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
if ($REQUEST_METHOD == "POST" && (strlen($save) > 0 || strlen($apply) > 0) && $isAdmin && check_bitrix_sessid()) {
$em = new CEventMessage();
$arFields = array("ACTIVE" => $ACTIVE, "EVENT_NAME" => $EVENT_NAME, "LID" => $LID, "EMAIL_FROM" => $EMAIL_FROM, "EMAIL_TO" => $EMAIL_TO, "BCC" => $BCC, "CC" => $CC, "REPLY_TO" => $REPLY_TO, "IN_REPLY_TO" => $IN_REPLY_TO, "PRIORITY" => $PRIORITY, "FIELD1_NAME" => $FIELD1_NAME, "FIELD1_VALUE" => $FIELD1_VALUE, "FIELD2_NAME" => $FIELD2_NAME, "FIELD2_VALUE" => $FIELD2_VALUE, "SUBJECT" => $SUBJECT, "MESSAGE" => $MESSAGE, "BODY_TYPE" => $BODY_TYPE);
if ($ID > 0 && $COPY_ID <= 0) {
$res = $em->Update($ID, $arFields);
} else {
$ID = $em->Add($arFields);
$res = $ID > 0;
$new = "Y";
}
if (!$res) {
$bVarsFromForm = true;
} else {
if (strlen($save) > 0) {
if (!empty($_REQUEST["type"])) {
LocalRedirect(BX_ROOT . "/admin/type_edit.php?EVENT_NAME=" . $EVENT_NAME . "&lang=" . LANGUAGE_ID);
} else {
LocalRedirect(BX_ROOT . "/admin/message_admin.php?lang=" . LANGUAGE_ID);
}
} else {
示例8: array
$db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_C_SITE"]));
while ($ar_msg = $db_msg->Fetch()) {
unset($ar_msg["TIMESTAMP_X"]);
$ar_msg["LID"] = $LID;
$em->Add($ar_msg);
}
} elseif ($_POST["SITE_MESSAGE_LINK"] == "E" && $_POST["SITE_MESSAGE_LINK_E_SITE"] != '') {
$db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_E_SITE"]));
while ($ar_msg = $db_msg->Fetch()) {
$msg_id = $ar_msg["ID"];
$db_msg_sites = CEventMessage::GetSite($ar_msg["ID"]);
$ar_msg = array("NAME" => $ar_msg["NAME"], "LID" => array($LID));
while ($ar_msg_sites = $db_msg_sites->Fetch()) {
$ar_msg["LID"][] = $ar_msg_sites["SITE_ID"];
}
$em->Update($msg_id, $ar_msg);
}
}
if ($bNew && $_POST["START_SITE_WIZARD"] == "Y") {
$rsSite = CSite::GetList($by = "sort", $order = "asc", array("ID" => $LID));
$arSite = $rsSite->GetNext();
$siteDir = "/" . ltrim(rtrim($arSite["DIR"], "/") . "/", "/");
$p = CSite::GetSiteDocRoot($LID) . $siteDir;
CheckDirPath($p);
$indexContent = '<' . '?' . 'define("B_PROLOG_INCLUDED", true);' . 'define("WIZARD_DEFAULT_SITE_ID", "' . $LID . '");' . 'define("WIZARD_DEFAULT_TONLY", true);' . 'define("PRE_LANGUAGE_ID","' . $arSite["LANGUAGE_ID"] . '");' . 'define("PRE_INSTALL_CHARSET","' . $arSite["CHARSET"] . '");' . 'include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/install/wizard/wizard.php");' . '?' . '>';
$handler = fopen($p . "index.php", "wb");
fwrite($handler, $indexContent);
fclose($handler);
$u = "";
$domains = explode("\n", str_replace("\r", "", $arSite["DOMAINS"]));
if (!empty($domains) && $domains[0] != '') {
示例9: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arFilter = array("ACTIVE" => "Y");
$rsMess = CEventMessage::GetList($by = "id", $order = "desc", $arFilter);
$arMess = array();
while ($arMessage = $rsMess->Fetch()) {
if ($arMessage["EVENT_NAME"] == "SONET_NEW_MESSAGE") {
continue;
}
$str_LID = array();
$db_LID = CEventMessage::GetLang($arMessage["ID"]);
while ($ar_LID = $db_LID->Fetch()) {
$str_LID[] = $ar_LID["LID"];
}
if (!in_array(WIZARD_SITE_ID, $str_LID)) {
$str_LID[] = WIZARD_SITE_ID;
}
$arMess[] = array("ID" => $arMessage["ID"], "ACTIVE" => $arMessage["ACTIVE"], "LID" => $str_LID);
}
$em = new CEventMessage();
foreach ($arMess as $arM) {
$arFields = array("ACTIVE" => $arM["ACTIVE"], "LID" => $arM["LID"]);
$res = $em->Update($arM["ID"], $arFields);
}
$em->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "SONET_NEW_MESSAGE", "LID" => array(WIZARD_SITE_ID), "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("EXTRANET_NEW_MESSAGE_SUBJECT"), "MESSAGE" => str_replace("/company/personal/", WIZARD_SITE_DIR . "contacts/personal/", GetMessage("EXTRANET_NEW_MESSAGE_MESSAGE")), "BODY_TYPE" => "text"));