本文整理汇总了PHP中CEventMessage::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventMessage::GetList方法的具体用法?PHP CEventMessage::GetList怎么用?PHP CEventMessage::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEventMessage
的用法示例。
在下文中一共展示了CEventMessage::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendOnAfterResultStatusChange
function sendOnAfterResultStatusChange($WEB_FORM_ID, $RESULT_ID, $NEW_STATUS_ID = false, $CHECK_RIGHTS = 'Y')
{
$NEW_STATUS_ID = intval($NEW_STATUS_ID);
$dbRes = CForm::GetByID($WEB_FORM_ID);
if (!($arForm = $dbRes->Fetch())) {
return;
}
CTimeZone::Disable();
$dbRes = CFormResult::GetByID($RESULT_ID);
CTimeZone::Enable();
if (!($arResult = $dbRes->Fetch()) || !$arResult['USER_ID']) {
return;
}
$dbRes = CUser::GetByID($arResult['USER_ID']);
if (!($arUser = $dbRes->Fetch())) {
return;
}
if (!$NEW_STATUS_ID) {
$NEW_STATUS_ID = CFormStatus::GetDefault($WEB_FORM_ID);
}
$dbRes = CFormStatus::GetByID($NEW_STATUS_ID);
if (!($arStatus = $dbRes->Fetch()) || strlen($arStatus['MAIL_EVENT_TYPE']) <= 0) {
return;
}
$arTemplates = CFormStatus::GetMailTemplateArray($NEW_STATUS_ID);
if (!is_array($arTemplates) || count($arTemplates) <= 0) {
return;
}
$arEventFields = array("EMAIL_TO" => $arUser['EMAIL'], "RS_FORM_ID" => $arForm["ID"], "RS_FORM_NAME" => $arForm["NAME"], "RS_FORM_VARNAME" => $arForm["SID"], "RS_FORM_SID" => $arForm["SID"], "RS_RESULT_ID" => $arResult["ID"], "RS_DATE_CREATE" => $arResult["DATE_CREATE"], "RS_USER_ID" => $arResult['USER_ID'], "RS_USER_EMAIL" => $arUser['EMAIL'], "RS_USER_NAME" => $arUser["NAME"] . " " . $arUser["LAST_NAME"], "RS_STATUS_ID" => $arStatus["ID"], "RS_STATUS_NAME" => $arStatus["TITLE"]);
$dbRes = CEventMessage::GetList($by = "id", $order = "asc", array('ID' => implode('|', $arTemplates), "ACTIVE" => "Y", "EVENT_NAME" => $arStatus["MAIL_EVENT_TYPE"]));
while ($arTemplate = $dbRes->Fetch()) {
CEvent::Send($arTemplate["EVENT_NAME"], $arTemplate["SITE_ID"], $arEventFields, "Y", $arTemplate["ID"]);
}
}
示例2: installEvents
/**
* Creates events for sending e-mail.
* @return bool
*/
public static function installEvents()
{
$dbEvent = \CEventMessage::GetList($b = "ID", $order = "ASC", array("EVENT_NAME" => "SALE_EBAY_ERROR"));
if (!$dbEvent->Fetch()) {
$langs = \CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
$obEventType = new \CEventType();
$obEventType->Add(array("EVENT_NAME" => "SALE_EBAY_ERROR", "NAME" => Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR"), "LID" => $lid, "DESCRIPTION" => "\n\t\t\t\t\t#ERROR_TYPE# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_TYPE") . "\n\t\t\t\t\t#ERROR_DETAILS# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_DETAIL") . "\n\t\t\t\t\t#EMAIL_FROM# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_FROM") . "\n\t\t\t\t\t#EMAIL_TO# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_TO") . "\n\t\t\t\t\t#BCC# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_BCC")));
$arSites = array();
$sites = \CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$arr = array();
$arr["ACTIVE"] = "Y";
$arr["EVENT_NAME"] = "SALE_EBAY_ERROR";
$arr["LID"] = $arSites;
$arr["EMAIL_FROM"] = "#DEFAULT_EMAIL_FROM#";
$arr["EMAIL_TO"] = "#EMAIL_TO#";
$arr["BCC"] = "#BCC#";
$arr["SUBJECT"] = "#SITE_NAME# " . Loc::getMessage("SALE_EBAY_EVNT_MSG_SBUJ']") . ".";
$arr["BODY_TYPE"] = "text";
$arr["MESSAGE"] = Loc::getMessage("SALE_EBAY_EVNT_MSG_INFO_SITE") . " #SITE_NAME#.\n\n" . Loc::getMessage("SALE_EBAY_EVNT_MSG") . ":\n\n" . "#ERROR_TYPE#\n\n" . "#ERROR_DETAILS#";
$obTemplate = new \CEventMessage();
$obTemplate->Add($arr);
}
}
}
return true;
}
示例3: InstallDB
function InstallDB($arParams = array())
{
RegisterModuleDependences('main', 'OnBuildGlobalMenu', self::MODULE_ID, 'CIpdesignK', 'OnBuildGlobalMenu');
$arsites = array();
$rsSites = CSite::GetList($by="sort", $order="desc", false);
while ($arSite = $rsSites->Fetch()){
$arsites[] = $arSite['ID'];
}
$arFilter = array(
"TYPE_ID" => "SENDWISHLIST",
);
$rsET = CEventType::GetList($arFilter);
$arET = $rsET->Fetch();
if(empty($arET)){
$et = new CEventType;
$arMessageFields = array("USER_ID" => $UserProduct['USER']['ID'],
"USER_NAME" => $UserProduct['USER']["NAME"].' '.$UserProduct['USER']["LAST_NAME"],
"USER_EMAIL" => $UserProduct['USER']["EMAIL"],
"PRODUCTS_LIST" => $strListProduct);
$DESCRIPTION = '#USER_ID# - '.GetMessage("IT_BASKET_SENDER_USER_ID");
$DESCRIPTION .= '\n#USER_NAME# - '.GetMessage("IT_BASKET_SENDER_USER_NAME");
$DESCRIPTION .= '\n#USER_EMAIL# - '.GetMessage("IT_BASKET_SENDER_USER_EMAIL");
$DESCRIPTION .= '\n#PRODUCTS_LIST# - '.GetMessage("IT_BASKET_SENDER_PRODUCTS_LIST");
$sendType = $et->Add(array(
"LID" => 'ru',
"EVENT_NAME" => "SENDWISHLIST",
"NAME" => GetMessage("IT_SENDER_TYPE_NAME"),
"DESCRIPTION" => $DESCRIPTION
));
}else{
$sendType = $arET['ID'];
}
$rsMess = CEventMessage::GetList($by="site_id", $order="desc", array('TYPE' => 'SENDWISHLIST'));
$arMess = $rsMess->Fetch();
if(empty($arMess)){
$message = '';
$message .= '<h2>'.GetMessage("IT_BASKET_SENDER_TEMPLATE_HELLO").',#USER_NAME#</h2>';
$message .= '<p>'.GetMessage("IT_BASKET_SENDER_TEMPLATE_WHISHLIST").'</p>';
$message .= '<hr />';
$message .= '#PRODUCTS_LIST#';
$arFields = array("ACTIVE" => 'Y',
"EVENT_NAME" => "SENDWISHLIST",
"LID" => $arsites,
"EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#",
"EMAIL_TO" => "#USER_EMAIL#",
"BCC" => "",
"MESSAGE" => $message,
"BODY_TYPE" => "html",
"SUBJECT" => GetMessage("IT_SENDER_MESSAGE_SUBJECT"). " #SERVER_NAME# ",
);
$emess = new CEventMessage;
if($emess->Add($arFields)){
}
};
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", self::MODULE_ID, "CSaleActionCtrlBasketMain", "GetControlDescr");
RegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", 110, '/modules/ipdesign.k1785/itdiscount.php');
return true;
}
示例4: CEventMessage
function __construct()
{
$eventMessage = new CEventMessage();
$getList = $eventMessage->GetList($by, $order);
while ($data = $getList->Fetch()) {
$this->items[] = $data;
}
}
示例5: GetAdditionalFields
function GetAdditionalFields($id = 0){
$arFieldList = array(
"ID" => "SEND_MAIL",
"SIZE" => 5,
"TYPE" => "SELECT",
"CTYPE" => "SINGLE",
"VALUES" => array()
);
$curEventMessage = array();
$arFilter = array(
"ACTIVE" => "Y"
);
if($id > 0){
$arFilter["ID"] = $id;
}
//echo "<pre>";print_r($arFilter);echo "</pre>";
$rsEmailTemplates = CEventMessage::GetList($by, $order, $arFilter);
if($arEmailTemplate = $rsEmailTemplates->GetNext()){
//echo "<pre>";print_r($arEmailTemplate);echo "</pre>";
$arFieldList["VALUES"][] = array(
"ID" => $arEmailTemplate["ID"],
"NAME" => $arEmailTemplate["EVENT_TYPE"]
);
$curEventMessage = array(
"ID" => $arEmailTemplate["ID"],
"TYPE_ID" => $arEmailTemplate["EVENT_NAME"]
);
}
if($id > 0 && !empty($curEventMessage)){
$rsEmailEventType = CEventType::GetList(
array(
"TYPE_ID" => $curEventMessage["TYPE_ID"],
"LID" => "ru"
)
);
if($arEmailEventType = $rsEmailEventType->Fetch()){
//echo "<pre>";print_r($arEmailEventType);echo "</pre>";
preg_match_all('/#([A-Za-z_]+)#/iu', $arEmailEventType["DESCRIPTION"], $out);
//echo "<pre>";print_r($out);echo "</pre>";die;
if(!empty($out[0])){
return implode(",",$out[0]);
}
}else{
return "";
}
//return ($arEmailEventType = $rsEmailEventType->Fetch() ? $arEmailEventType["DESCRIPTION"] : "");
}else{
return "";
}
}
示例6: 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;
}
示例7: UnInstallEvent
function UnInstallEvent()
{
global $DB;
//Удаляем тип почтового события
$et = new CEventType();
$et->Delete($this->EVENT_NAME);
//Находим все почтовые шаблоные которые были привязаны к нашему типу
$DB->StartTransaction();
$emessage = new CEventMessage();
$rsMess = CEventMessage::GetList($by = "site_id", $order = "desc", array("TYPE_ID" => $this->EVENT_NAME));
//рекурсивно по одному удаляем найденные шаблоны
while ($events = $rsMess->GetNext()) {
$emessage->Delete(intval($events["ID"]));
$DB->Commit();
}
}
示例8: array
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CEventType::GetListEx(array($by => $order), $arFilter, array("type" => "none"));
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['EVENT_NAME'];
}
}
foreach ($arID as $ID) {
if (strLen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
case "clean":
$DB->StartTransaction();
$ID = array("EVENT_NAME" => $ID);
$db_res = CEventMessage::GetList($by, $order, $ID);
if ($db_res && ($res = $db_res->Fetch())) {
do {
if (!CEventMessage::Delete($res["ID"])) {
$error = true;
break;
}
} while ($res = $db_res->Fetch());
}
if ($error || !CEventType::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
} else {
$DB->Commit();
}
break;
示例9: array
<?php
/*
* This file is part of the Studio Fact package.
*
* (c) Kulichkin Denis (onEXHovia) <onexhovia@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
die;
}
use Bitrix\Main\Localization\Loc;
Loc::loadMessages(__FILE__);
$eventTypeList = array();
$eventType = CEventType::GetList(array('LID' => SITE_ID));
while ($item = $eventType->GetNext()) {
$eventTypeList[$item['EVENT_NAME']] = sprintf('[%s] %s', $item['EVENT_NAME'], $item['NAME']);
}
$eventTemplateList = array();
if (strlen($arCurrentValues['EVENT_NAME']) > 0) {
$eventTemplate = CEventMessage::GetList($o = '', $b = '', array('EVENT_NAME' => $arCurrentValues['EVENT_NAME']));
while ($item = $eventTemplate->GetNext()) {
$eventTemplateList[$item['ID']] = sprintf('[%d] %s', $item['ID'], $item['SUBJECT']);
}
}
$arComponentParameters = array('PARAMETERS' => array('ID' => array('PARENT' => 'BASE', 'NAME' => Loc::getMessage('ID'), 'TYPE' => 'STRING'), 'TYPE' => array('PARENT' => 'BASE', 'NAME' => Loc::getMessage('TYPE'), 'TYPE' => 'LIST', 'VALUES' => array('IBLOCK' => Loc::getMessage('TYPE_IBLOCK'), 'HLBLOCK' => Loc::getMessage('TYPE_HLBLOCK'), 'CUSTOM' => Loc::getMessage('TYPE_CUSTOM'))), 'ALIAS_FIELDS' => array('NAME' => Loc::getMessage('ALIAS_FIELDS'), 'TYPE' => 'CUSTOM', 'ADDITIONAL_VALUES' => 'Y', 'MULTIPLE' => 'Y', 'VALUES' => array()), 'DISPLAY_FIELDS' => array('NAME' => Loc::getMessage('DISPLAY_FIELDS'), 'TYPE' => 'STRING', 'ADDITIONAL_VALUES' => 'Y', 'MULTIPLE' => 'Y', 'VALUES' => array()), 'ATTACH_FIELDS' => array('NAME' => Loc::getMessage('ATTACH_FIELDS'), 'TYPE' => 'STRING', 'ADDITIONAL_VALUES' => 'Y', 'MULTIPLE' => 'Y', 'VALUES' => array()), 'EVENT_NAME' => array('NAME' => Loc::getMessage('EVENT_NAME'), 'TYPE' => 'LIST', 'ADDITIONAL_VALUES' => 'Y', 'VALUES' => $eventTypeList, 'REFRESH' => 'Y', 'DEFAULT' => ''), 'EVENT_TEMPLATE' => array('NAME' => Loc::getMessage('EVENT_TEMPLATE'), 'TYPE' => 'LIST', 'VALUES' => $eventTemplateList, 'ADDITIONAL_VALUES' => 'Y', 'DEFAULT' => ''), 'EVENT_TYPE' => array('NAME' => Loc::getMessage('EVENT_TYPE'), 'TYPE' => 'STRING', 'DEFAULT' => ''), 'BUILDER' => array('NAME' => Loc::getMessage('BUILDER'), 'TYPE' => 'STRING', 'DEFAULT' => ''), 'STORAGE' => array('NAME' => Loc::getMessage('STORAGE'), 'TYPE' => 'STRING', 'DEFAULT' => ''), 'VALIDATOR' => array('NAME' => Loc::getMessage('VALIDATOR'), 'TYPE' => 'STRING', 'DEFAULT' => ''), 'AJAX' => array('NAME' => Loc::getMessage('AJAX'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => ''), 'USE_CAPTCHA' => array('NAME' => Loc::getMessage('USE_CAPTCHA'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'Y'), 'USE_CSRF' => array('NAME' => Loc::getMessage('USE_CSRF'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'Y'), 'REDIRECT_PATH' => array('NAME' => Loc::getMessage('REDIRECT_PATH'), 'TYPE' => 'STRING', 'DEFAULT' => ''), 'CACHE_TIME' => array('DEFAULT' => 36000000), 'CACHE_GROUPS' => array('PARENT' => 'CACHE_SETTINGS', 'NAME' => Loc::getMessage('CACHE_GROUPS'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'Y')));
示例10: UnInstallEvents
function UnInstallEvents()
{
$dbEvent = CEventMessage::GetList($by, $order, array("EVENT_NAME" => "LDAP_USER_CONFIRM"));
while ($arEvent = $dbEvent->Fetch()) {
CEventMessage::Delete($arEvent["ID"]);
}
$eventType = new CEventType();
$eventType->Delete("LDAP_USER_CONFIRM");
return true;
}
示例11: GetMessage
$arStatusLang = CSaleStatus::GetLangByID($ID, $lid);
$template = str_replace("#SITE_CHARSET#", $lang["CHARSET"], $templateGeneral);
$dbEventType = $eventType->GetList(array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $lid));
if (!($arEventType = $dbEventType->Fetch())) {
$str = "";
$str .= "#ORDER_ID# - " . GetMessage("SKGS_ORDER_ID") . "\n";
$str .= "#ORDER_DATE# - " . GetMessage("SKGS_ORDER_DATE") . "\n";
$str .= "#ORDER_STATUS# - " . GetMessage("SKGS_ORDER_STATUS") . "\n";
$str .= "#EMAIL# - " . GetMessage("SKGS_ORDER_EMAIL") . "\n";
$str .= "#ORDER_DESCRIPTION# - " . GetMessage("SKGS_STATUS_DESCR") . "\n";
$str .= "#TEXT# - " . GetMessage("SKGS_STATUS_TEXT") . "\n";
$str .= "#SALE_EMAIL# - " . GetMessage("SKGS_SALE_EMAIL") . "\n";
$eventTypeID = $eventType->Add(array("LID" => $lid, "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "NAME" => GetMessage("SKGS_CHANGING_STATUS_TO") . " \"" . $arStatusLang["NAME"] . "\"", "DESCRIPTION" => $str));
}
if (count($arSites) > 0) {
$dbEventMessage = $eventMessage->GetList($b = "", $o = "", array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "SITE_ID" => $arSites));
if (!($arEventMessage = $dbEventMessage->Fetch())) {
$message = GetMessage("SKGS_STATUS_MAIL_BODY1");
$message .= "------------------------------------------\n\n";
$message .= GetMessage("SKGS_STATUS_MAIL_BODY2");
$message .= GetMessage("SKGS_STATUS_MAIL_BODY3");
$message .= "#ORDER_STATUS#\n";
$message .= "#ORDER_DESCRIPTION#\n";
$message .= "#TEXT#\n\n";
$message .= GetMessage("SKGS_STATUS_MAIL_BODY4");
$message .= "#SITE_NAME#\n";
$message = str_replace(array("#TITLE#", "#SUB_TITLE#", "#TEXT#", "#FOOTER_BR#", "#FOOTER_SHOP#"), array(GetMessage("SKGS_STATUS_MAIL_HTML_TITLE"), GetMessage("SKGS_STATUS_MAIL_HTML_SUB_TITLE"), str_replace("\n", "<br />\n", $message), GetMessage("SMAIL_FOOTER_BR"), GetMessage("SMAIL_FOOTER_SHOP")), $template);
$arFields = array("ACTIVE" => "Y", "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $arSites, "EMAIL_FROM" => "#SALE_EMAIL#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("SKGS_STATUS_MAIL_SUBJ"), "MESSAGE" => $message, "BODY_TYPE" => "html");
$eventMessageID = $eventMessage->Add($arFields);
}
}
示例12: GetTemplateList
public static function GetTemplateList($STATUS_ID)
{
$err_mess = (CAllForm::err_mess())."<br>Function: GetTemplateList<br>Line: ";
global $DB, $strError;
$STATUS_ID = intval($STATUS_ID);
if ($STATUS_ID > 0)
{
$arrSITE = array();
$strSql = "
SELECT
F.MAIL_EVENT_TYPE,
FS.SITE_ID
FROM b_form_status F
INNER JOIN b_form_2_site FS ON (FS.FORM_ID = F.FORM_ID)
WHERE
F.ID='".$STATUS_ID."'
";
//echo '<pre>',$strSql,'</pre>';
$z = $DB->Query($strSql,false,$err_mess.__LINE__);
while ($zr = $z->Fetch())
{
$MAIL_EVENT_TYPE = $zr["MAIL_EVENT_TYPE"];
$arrSITE[] = $zr["SITE_ID"];
}
if (strlen($MAIL_EVENT_TYPE) <= 0)
return false;
$arReferenceId = array();
$arReference = array();
$arFilter = Array(
"ACTIVE" => "Y",
"SITE_ID" => $arrSITE,
"EVENT_NAME" => $MAIL_EVENT_TYPE
);
$e = CEventMessage::GetList($by="id", $order="asc", $arFilter);
while ($er=$e->Fetch())
{
if (!in_array($er["ID"], $arReferenceId))
{
$arReferenceId[] = $er["ID"];
$arReference[] = "(".$er["LID"].") ".TruncateText($er["SUBJECT"],50);
}
}
$arr = array("reference"=>$arReference,"reference_id"=>$arReferenceId);
return $arr;
}
return false;
}
示例13: Mail
/**
* <p>Создает почтовое событие для отсылки данных <a href="http://dev.1c-bitrix.ru/api_help/form/terms.php#result">результата</a> по e-mail. Возвращает "true" в случае успеха, в противном случае - "false".</p>
*
*
*
*
* @param int $result_id ID <a href="http://dev.1c-bitrix.ru/api_help/form/terms.php#result">результата</a>.
*
*
*
* @param mixed $template_id = false ID почтового шаблона.<br><br> Параметр необязательный. По умолчанию -
* "false" (будут использованы почтовые шаблоны из настроек
* соответствующей веб-формы).
*
*
*
* @return bool
*
*
* <h4>Example</h4>
* <pre>
* <?
* $RESULT_ID = 189; // ID результата
*
* // создадим почтовое событие для отсылки по EMail данных результата
* if (<b>CFormResult::Mail</b>($RESULT_ID))
* {
* echo "Почтовое событие успешно создано.";
* }
* else // ошибка
* {
* global $strError;
* echo $strError;
* }
* ?>
* </pre>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/form/classes/cformresult/mail.php
* @author Bitrix
*/
public static function Mail($RESULT_ID, $TEMPLATE_ID = false)
{
global $APPLICATION, $DB, $MESS, $strError;
$err_mess = (CAllFormResult::err_mess())."<br>Function: Mail<br>Line: ";
$RESULT_ID = intval($RESULT_ID);
CTimeZone::Disable();
$arrResult = CFormResult::GetDataByID($RESULT_ID, array(), $arrRES, $arrANSWER);
CTimeZone::Enable();
if ($arrResult)
{
$z = CForm::GetByID($arrRES["FORM_ID"]);
if ($arrFORM = $z->Fetch())
{
$TEMPLATE_ID = intval($TEMPLATE_ID);
$arrFormSites = CForm::GetSiteArray($arrRES["FORM_ID"]);
$arrFormSites = (is_array($arrFormSites)) ? $arrFormSites : array();
if (!defined('SITE_ID') || !in_array(SITE_ID, $arrFormSites))
return true;
$rs = CSite::GetList(($by="sort"), ($order="asc"), array('ID' => implode('|', $arrFormSites)));
$arrSites = array();
while ($ar = $rs->Fetch())
{
if ($ar["DEF"]=="Y") $def_site_id = $ar["ID"];
$arrSites[$ar["ID"]] = $ar;
}
$arrFormTemplates = CForm::GetMailTemplateArray($arrRES["FORM_ID"]);
$arrFormTemplates = (is_array($arrFormTemplates)) ? $arrFormTemplates : array();
$arrTemplates = array();
$rs = CEventMessage::GetList($by="id", $order="asc", array(
"ACTIVE" => "Y",
"SITE_ID" => SITE_ID,
"EVENT_NAME" => $arrFORM["MAIL_EVENT_TYPE"]
));
while ($ar = $rs->Fetch())
{
if ($TEMPLATE_ID>0)
{
if ($TEMPLATE_ID == $ar["ID"])
{
$arrTemplates[$ar["ID"]] = $ar;
break;
}
}
elseif (in_array($ar["ID"],$arrFormTemplates)) $arrTemplates[$ar["ID"]] = $ar;
}
foreach($arrTemplates as $arrTemplate)
{
$OLD_MESS = $MESS;
//.........这里部分代码省略.........
示例14: GetMessage
echo GetMessage("SUPPORT_MAIL_SUBJECT_TEMPLATE");
?>
<br>
<?php
echo GetMessage("SUPPORT_MAIL_SUBJECT_TEMPLATE_NOTES");
?>
</td>
</tr>
<tr valign="top">
<td colspan="2" align="center">
<?php
if (!isset($W_SUPPORT_SUBJECT)) {
$w_subject = "";
$arrTemplate = array();
$db_res = CEventMessage::GetList($o, $b, array("ACTIVE" => "Y", "EVENT_NAME" => "TICKET_NEW_FOR_AUTHOR || TICKET_NEW_FOR_TECHSUPPORT || TICKET_CHANGE_FOR_TECHSUPPORT || TICKET_CHANGE_BY_AUTHOR_FOR_AUTHOR || TICKET_CHANGE_BY_SUPPORT_FOR_AUTHOR", "LID" => $MAILBOX_LID));
while ($ar_res = $db_res->Fetch()) {
$arrTemplate[] = $ar_res["SUBJECT"];
}
$arrTemplate = array_unique($arrTemplate);
if (is_array($arrTemplate) && count($arrTemplate) > 0) {
foreach ($arrTemplate as $subject) {
$subject = preg_quote($subject, "/");
$subject = str_replace("#ID#", "([0-9]+)", $subject);
$subject = preg_replace("/#[-A-Z_0-9]+#/i" . BX_UTF_PCRE_MODIFIER, ".*?", $subject);
$w_subject .= $subject . "\r\n";
}
$W_SUPPORT_SUBJECT = $w_subject;
}
}
?>
示例15: array
$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();
$rsType = CEventType::GetListEx(array(), array(), array("LID" => LANG, "type" => "type"));
while ($arType = $rsType->Fetch()) {
$arEventTypes[$arType["EVENT_NAME"]] = $arType["NAME"];
}
// Body
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes, "message_edit.php?lang=" . LANGUAGE_ID . "&ID=" . $f_ID, GetMessage("MAIN_ADMIN_MENU_EDIT_TITLE"));