本文整理汇总了PHP中CEventMessage类的典型用法代码示例。如果您正苦于以下问题:PHP CEventMessage类的具体用法?PHP CEventMessage怎么用?PHP CEventMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEventMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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;
}
开发者ID:Kulkow,项目名称:ipdesign.k1785,代码行数:59,代码来源:index.php
示例2: appendMessage
function appendMessage($ID)
{
$LID = $this->getSitesByMessage($ID);
$LID[] = WIZARD_SITE_ID;
$em = new CEventMessage();
$arFields = array("LID" => $LID);
return $em->Update($ID, $arFields);
}
开发者ID:ASDAFF,项目名称:bitrix_marketplace_module,代码行数:8,代码来源:import.class.php
示例3: 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;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:51,代码来源:functions.php
示例4: 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;
}
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:14,代码来源:EventHelper.php
示例5: 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"]);
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:34,代码来源:events.php
示例6: 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();
}
}
开发者ID:ASDAFF,项目名称:callback.form,代码行数:16,代码来源:index.php
示例7: 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 "";
}
}
开发者ID:ASDAFF,项目名称:trigger-module,代码行数:50,代码来源:action_type_fields.php
示例8: 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;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:85,代码来源:form_callform.php
示例9: while
<?php
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
IncludeModuleLangFile(__FILE__, $lid);
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "VIRUS_DETECTED", "NAME" => GetMessage("VIRUS_DETECTED_NAME"), "DESCRIPTION" => GetMessage("VIRUS_DETECTED_DESC")));
$arSites = array();
$sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "VIRUS_DETECTED", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "BCC" => "", "SUBJECT" => GetMessage("VIRUS_DETECTED_SUBJECT"), "MESSAGE" => GetMessage("VIRUS_DETECTED_MESSAGE"), "BODY_TYPE" => "text"));
}
}
开发者ID:Satariall,项目名称:izurit,代码行数:18,代码来源:events.php
示例10: deleteMailTemplate
protected function deleteMailTemplate()
{
$mail_template_id = (int) \Bitrix\Main\Config\Option::get($this->MODULE_ID, "mail_template_id");
CEventMessage::Delete($mail_template_id);
return true;
}
开发者ID:dimabresky,项目名称:bitrix-Erip-module,代码行数:6,代码来源:index.php
示例11: elseif
$ANS_ID = $arAnswer["ANS_NEW"] == "Y" ? false : $arAnswer["ID"];
CFormAnswer::Set($arAnswerFields, $ANS_ID);
}
}
}
}
}
if ($bSimple) {
// mail template
$arr = CForm::GetTemplateList("MAIL", "xxx", $res);
if ($_REQUEST['USE_MAIL_TEMPLATE'] && count($arr['reference_id']) == 0) {
CForm::SetMailTemplate($res, "Y");
} elseif (!$_REQUEST['USE_MAIL_TEMPLATE'] && count($arr['reference_id']) > 0) {
reset($arr['reference_id']);
while (list($num, $tmp_id) = each($arr['reference_id'])) {
CEventMessage::Delete($tmp_id);
}
}
$arr = CForm::GetTemplateList("MAIL", "xxx", $res);
$arFields['SID'] = "SIMPLE_FORM_{$res}";
$arFields['arMAIL_TEMPLATE'] = $arr['reference_id'];
CForm::Set($arFields, $res);
// create default status
if ($ID == 0) {
$arFields_status = array("FORM_ID" => $res, "C_SORT" => 100, "ACTIVE" => "Y", "TITLE" => "DEFAULT", "DESCRIPTION" => "DEFAULT", "CSS" => "statusgreen", "DEFAULT_VALUE" => "Y", "arPERMISSION_VIEW" => array(0), "arPERMISSION_MOVE" => array(0), "arPERMISSION_EDIT" => array(0), "arPERMISSION_DELETE" => array(0));
CFormStatus::Set($arFields_status, 0);
}
}
if (strlen($strError) <= 0 && $ID > 0) {
$arCrmParams = array('CRM_ID' => $_REQUEST['CRM_ID'], 'LINK_TYPE' => $_REQUEST['CRM_LINK_TYPE'], 'CRM_FIELDS' => $_REQUEST['CRM_FIELD'], 'FORM_FIELDS' => $_REQUEST['CRM_FORM_FIELD']);
CFormCrm::SetForm($ID, $arCrmParams);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:form_edit.php
示例12: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("iblock")) {
return;
}
$site = $_REQUEST["site"] != '' ? $_REQUEST["site"] : ($_REQUEST["src_site"] != '' ? $_REQUEST["src_site"] : false);
$arFilter = array("ACTIVE" => "Y");
if ($site !== false) {
$arFilter["LID"] = $site;
}
$arEvent = array();
$dbType = CEventMessage::GetList($by = "ID", $order = "DESC", $arFilter);
while ($arType = $dbType->GetNext()) {
$arEvent[$arType["ID"]] = "[" . $arType["ID"] . "] " . $arType["SUBJECT"];
}
$arIBlockType = CIBlockParameters::GetIBlockTypes();
$arIBlock = array();
$rsIBlock = CIBlock::GetList(array("sort" => "asc"), array("TYPE" => $arCurrentValues["IBLOCK_TYPE"], "ACTIVE" => "Y"));
while ($arr = $rsIBlock->Fetch()) {
$arIBlock[$arr["ID"]] = "[" . $arr["ID"] . "] " . $arr["NAME"];
}
$arComponentParameters = array("PARAMETERS" => array("OK_TEXT" => array("NAME" => GetMessage("WF_OK_MESSAGE"), "TYPE" => "STRING", "DEFAULT" => GetMessage("WF_OK_TEXT"), "PARENT" => "BASE"), "EMAIL_TO" => array("NAME" => GetMessage("WF_EMAIL_TO"), "TYPE" => "STRING", "DEFAULT" => htmlspecialcharsbx(COption::GetOptionString("main", "email_from")), "PARENT" => "BASE"), "IBLOCK_TYPE" => array("PARENT" => "BASE", "NAME" => GetMessage("WF_IBLOCK_TYPE"), "TYPE" => "LIST", "VALUES" => $arIBlockType, "REFRESH" => "Y"), "IBLOCK_ID" => array("PARENT" => "BASE", "NAME" => GetMessage("WF_IBLOCK"), "TYPE" => "LIST", "VALUES" => $arIBlock, "REFRESH" => "Y"), "EVENT_MESSAGE_ID" => array("NAME" => GetMessage("WF_EMAIL_TEMPLATES"), "TYPE" => "LIST", "VALUES" => $arEvent, "DEFAULT" => "", "MULTIPLE" => "Y", "COLS" => 25, "PARENT" => "BASE"), "SET_TITLE" => array(), "CACHE_TIME" => array("DEFAULT" => 36000000)));
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:25,代码来源:.parameters.php
示例13: while
<?php
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
IncludeModuleLangFile(__FILE__, $lid);
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "EXTRANET_WG_TO_ARCHIVE", "NAME" => GetMessage("EXTRANET_WG_TO_ARCHIVE_NAME"), "DESCRIPTION" => GetMessage("EXTRANET_WG_TO_ARCHIVE_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "EXTRANET_WG_FROM_ARCHIVE", "NAME" => GetMessage("EXTRANET_WG_FROM_ARCHIVE_NAME"), "DESCRIPTION" => GetMessage("EXTRANET_WG_FROM_ARCHIVE_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "EXTRANET_INVITATION", "NAME" => GetMessage("EXTRANET_INVITATION_NAME"), "DESCRIPTION" => GetMessage("EXTRANET_INVITATION_DESC")));
$arSites = array();
$sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "EXTRANET_WG_TO_ARCHIVE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#MEMBER_EMAIL#", "BCC" => "", "SUBJECT" => GetMessage("EXTRANET_WG_TO_ARCHIVE_SUBJECT"), "MESSAGE" => GetMessage("EXTRANET_WG_TO_ARCHIVE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "EXTRANET_WG_FROM_ARCHIVE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#MEMBER_EMAIL#", "BCC" => "", "SUBJECT" => GetMessage("EXTRANET_WG_FROM_ARCHIVE_SUBJECT"), "MESSAGE" => GetMessage("EXTRANET_WG_FROM_ARCHIVE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "EXTRANET_INVITATION", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "BCC" => "", "SUBJECT" => GetMessage("EXTRANET_INVITATION_SUBJECT"), "MESSAGE" => GetMessage("EXTRANET_INVITATION_MESSAGE"), "BODY_TYPE" => "text"));
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:set_events.php
示例14: 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;
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:52,代码来源:form_callformstatus.php
示例15: while
}
}
// Actions
if (($arID = $lAdmin->GroupAction()) && $isAdmin) {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CEventMessage::GetList($by, $order, $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$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);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:message_admin.php
示例16: InstallEvents
function InstallEvents()
{
$arEventTypes = array();
$langs = CLanguage::GetList($b = "", $o = "");
while ($language = $langs->Fetch()) {
$lid = $language["LID"];
IncludeModuleLangFile(__FILE__, $lid);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "NEW_USER", "NAME" => GetMessage("MAIN_NEW_USER_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_NEW_USER_TYPE_DESC"), "SORT" => 1);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_INFO", "NAME" => GetMessage("MAIN_USER_INFO_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INFO_TYPE_DESC"), "SORT" => 2);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "NEW_USER_CONFIRM", "NAME" => GetMessage("MAIN_NEW_USER_CONFIRM_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_NEW_USER_CONFIRM_TYPE_DESC"), "SORT" => 3);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_PASS_REQUEST", "NAME" => GetMessage("MAIN_USER_PASS_REQUEST_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INFO_TYPE_DESC"), "SORT" => 4);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_PASS_CHANGED", "NAME" => GetMessage("MAIN_USER_PASS_CHANGED_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INFO_TYPE_DESC"), "SORT" => 5);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_INVITE", "NAME" => GetMessage("MAIN_USER_INVITE_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INVITE_TYPE_DESC"), "SORT" => 6);
$arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "FEEDBACK_FORM", "NAME" => GetMessage("MF_EVENT_NAME"), "DESCRIPTION" => GetMessage("MF_EVENT_DESCRIPTION"), "SORT" => 7);
}
$type = new CEventType();
foreach ($arEventTypes as $arEventType) {
$type->Add($arEventType);
}
IncludeModuleLangFile(__FILE__);
$arMessages = array();
$arMessages[] = array("EVENT_NAME" => "NEW_USER", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#DEFAULT_EMAIL_FROM#", "SUBJECT" => GetMessage("MAIN_NEW_USER_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_NEW_USER_EVENT_DESC"));
$arMessages[] = array("EVENT_NAME" => "USER_INFO", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_INFO_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_INFO_EVENT_DESC"));
$arMessages[] = array("EVENT_NAME" => "USER_PASS_REQUEST", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_PASS_REQUEST_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_PASS_REQUEST_EVENT_DESC"));
$arMessages[] = array("EVENT_NAME" => "USER_PASS_CHANGED", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_PASS_CHANGED_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_PASS_CHANGED_EVENT_DESC"));
$arMessages[] = array("EVENT_NAME" => "NEW_USER_CONFIRM", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_NEW_USER_CONFIRM_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_NEW_USER_CONFIRM_EVENT_DESC"));
$arMessages[] = array("EVENT_NAME" => "USER_INVITE", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_INVITE_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_INVITE_EVENT_DESC"));
$arMessages[] = array("EVENT_NAME" => "FEEDBACK_FORM", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("MF_EVENT_SUBJECT"), "MESSAGE" => GetMessage("MF_EVENT_MESSAGE"));
$message = new CEventMessage();
foreach ($arMessages as $arMessage) {
$message->Add($arMessage);
}
return true;
}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:34,代码来源:index.php
示例17: StatusOrder
function StatusOrder($ID, $val)
{
global $DB, $USER;
$ID = IntVal($ID);
$val = trim($val);
foreach (GetModuleEvents("sale", "OnSaleBeforeStatusOrder", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, $val)) === false) {
return false;
}
}
$arFields = array("STATUS_ID" => $val, "=DATE_STATUS" => $DB->GetNowFunction(), "EMP_STATUS_ID" => IntVal($USER->GetID()) > 0 ? IntVal($USER->GetID()) : false);
$res = CSaleOrder::Update($ID, $arFields);
unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
foreach (GetModuleEvents("sale", "OnSaleStatusOrder", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $val));
}
CTimeZone::Disable();
$arOrder = CSaleOrder::GetByID($ID);
CTimeZone::Enable();
$userEmail = "";
$dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ID, "PROP_IS_EMAIL" => "Y"));
if ($arOrderProp = $dbOrderProp->Fetch()) {
$userEmail = $arOrderProp["VALUE"];
}
if (strlen($userEmail) <= 0) {
$dbUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $dbUser->Fetch()) {
$userEmail = $arUser["EMAIL"];
}
}
$dbSite = CSite::GetByID($arOrder["LID"]);
$arSite = $dbSite->Fetch();
$arStatus = CSaleStatus::GetByID($arOrder["STATUS_ID"], $arSite["LANGUAGE_ID"]);
$arFields = array("ORDER_ID" => $ID, "ORDER_DATE" => $arOrder["DATE_INSERT_FORMAT"], "ORDER_STATUS" => $arStatus["NAME"], "EMAIL" => $userEmail, "ORDER_DESCRIPTION" => $arStatus["DESCRIPTION"], "TEXT" => "", "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]));
foreach (GetModuleEvents("sale", "OnSaleStatusEMail", true) as $arEvent) {
$arFields["TEXT"] = ExecuteModuleEventEx($arEvent, array($ID, $arStatus["ID"]));
}
$eventName = "SALE_STATUS_CHANGED_" . $arOrder["STATUS_ID"];
$bSend = true;
foreach (GetModuleEvents("sale", "OnOrderStatusSendEmail", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$eventName, &$arFields, $arOrder["STATUS_ID"])) === false) {
$bSend = false;
}
}
if ($bSend) {
$eventMessage = new CEventMessage();
$dbEventMessage = $eventMessage->GetList($b = "", $o = "", array("EVENT_NAME" => $eventName, "SITE_ID" => $arOrder["LID"]));
if (!($arEventMessage = $dbEventMessage->Fetch())) {
$eventName = "SALE_STATUS_CHANGED";
}
$event = new CEvent();
$event->Send($eventName, $arOrder["LID"], $arFields, "N");
}
return $res;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new, |
请发表评论