当前位置: 首页>>代码示例>>PHP>>正文


PHP CEventType::Add方法代码示例

本文整理汇总了PHP中CEventType::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventType::Add方法的具体用法?PHP CEventType::Add怎么用?PHP CEventType::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEventType的用法示例。


在下文中一共展示了CEventType::Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:36,代码来源:helper.php

示例2: 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

示例3: InstallEvent

 function InstallEvent()
 {
     //Создаем тип почтового события
     $fields = "\n#USER_NAME# имя отправителя\n#USER_PHONE# телефон отправителя\n#USER_COMMENT# комментарий отправителя";
     $et = new CEventType();
     $et->Add(array("LID" => "ru", "EVENT_NAME" => $this->EVENT_NAME, "NAME" => "Заказ звонка с сайта", "DESCRIPTION" => $fields));
     //формируем массив из идентификаторов сайтов
     $arSite = array();
     $dbSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
     while ($site = $dbSites->Fetch()) {
         $arSite[] = $site["LID"];
     }
     //создаем почтовый шаблон для всех сайтов
     $arr = array("ACTIVE" => "Y", "EVENT_NAME" => $this->EVENT_NAME, "LID" => $arSite, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#DEFAULT_EMAIL_FROM#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("EVENT_SUBJECT"), "BODY_TYPE" => "text", "MESSAGE" => Getmessage("EVENT_MESSAGE"));
     $emess = new CEventMessage();
     $emess->Add($arr);
 }
开发者ID:ASDAFF,项目名称:callback.form,代码行数:17,代码来源:index.php

示例4: addEventTypeIfNotExists

 /**
  * @param $eventName
  * @param $fields array(), key LID = language id
  * @return bool|int
  * @throws \Sprint\Migration\Exceptions\HelperException
  */
 public function addEventTypeIfNotExists($eventName, $fields)
 {
     $this->checkRequiredKeys(__METHOD__, $fields, array('LID'));
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     $aItem = \CEventType::GetList(array('TYPE_ID' => $eventName, 'LID' => $fields['LID']))->Fetch();
     if ($aItem) {
         return $aItem['ID'];
     }
     $default = array("LID" => $fields['LID'], "EVENT_NAME" => 'event_name', "NAME" => 'NAME', "DESCRIPTION" => 'description');
     $fields = array_replace_recursive($default, $fields);
     $fields['EVENT_NAME'] = $eventName;
     $event = new \CEventType();
     $id = $event->Add($fields);
     if ($id) {
         return $id;
     }
     $this->throwException(__METHOD__, 'Event type %s not added', $eventName);
 }
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:24,代码来源:EventHelper.php

示例5: IncludeModuleLangFile

<?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" => "STATISTIC_ACTIVITY_EXCEEDING", "NAME" => GetMessage("STATISTIC_ACTIVITY_EXCEEDING_NAME"), "DESCRIPTION" => GetMessage("STATISTIC_ACTIVITY_EXCEEDING_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "STATISTIC_DAILY_REPORT", "NAME" => GetMessage("STATISTIC_DAILY_REPORT_NAME"), "DESCRIPTION" => GetMessage("STATISTIC_DAILY_REPORT_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" => "STATISTIC_DAILY_REPORT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "BCC" => "", "SUBJECT" => GetMessage("STATISTIC_DAILY_REPORT_SUBJECT"), "MESSAGE" => GetMessage("STATISTIC_DAILY_REPORT_MESSAGE", array("#LANGUAGE_ID#" => $lid)), "BODY_TYPE" => "html"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "STATISTIC_ACTIVITY_EXCEEDING", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "BCC" => "", "SUBJECT" => GetMessage("STATISTIC_ACTIVITY_EXCEEDING_SUBJECT"), "MESSAGE" => GetMessage("STATISTIC_ACTIVITY_EXCEEDING_MESSAGE"), "BODY_TYPE" => "text"));
    }
}
开发者ID:Satariall,项目名称:izurit,代码行数:22,代码来源:set_events.php

示例6: CEventType

 $eventType = new CEventType();
 $eventMessage = new CEventMessage();
 IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/general/status.php", $lid);
 $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");
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:events.php

示例7: IncludeModuleLangFile

<?php

$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
    $lid = $lang["LID"];
    IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/tasks/install/events.php", $lid);
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "TASK_REMINDER", "NAME" => GetMessage("TASK_REMINDER_NAME"), "DESCRIPTION" => GetMessage("TASK_REMINDER_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" => "TASK_REMINDER", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("TASK_REMINDER_SUBJECT"), "MESSAGE" => GetMessage("TASK_REMINDER_MESSAGE"), "BODY_TYPE" => "text"));
    }
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:18,代码来源:set_events.php

示例8: IncludeModuleLangFile

<?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" => "WF_STATUS_CHANGE", "NAME" => GetMessage("WF_STATUS_CHANGE_NAME"), "DESCRIPTION" => GetMessage("WF_STATUS_CHANGE_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_NEW_DOCUMENT", "NAME" => GetMessage("WF_NEW_DOCUMENT_NAME"), "DESCRIPTION" => GetMessage("WF_NEW_DOCUMENT_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_IBLOCK_STATUS_CHANGE", "NAME" => GetMessage("WF_IBLOCK_STATUS_CHANGE_NAME"), "DESCRIPTION" => GetMessage("WF_IBLOCK_STATUS_CHANGE_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_NEW_IBLOCK_ELEMENT", "NAME" => GetMessage("WF_NEW_IBLOCK_ELEMENT_NAME"), "DESCRIPTION" => GetMessage("WF_NEW_IBLOCK_ELEMENT_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" => "WF_STATUS_CHANGE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#ENTERED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_STATUS_CHANGE_SUBJECT"), "MESSAGE" => GetMessage("WF_STATUS_CHANGE_MESSAGE"), "BODY_TYPE" => "text"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_NEW_DOCUMENT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#ENTERED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_NEW_DOCUMENT_SUBJECT"), "MESSAGE" => GetMessage("WF_NEW_DOCUMENT_MESSAGE"), "BODY_TYPE" => "text"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_IBLOCK_STATUS_CHANGE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#CREATED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_IBLOCK_STATUS_CHANGE_SUBJECT"), "MESSAGE" => GetMessage("WF_IBLOCK_STATUS_CHANGE_MESSAGE"), "BODY_TYPE" => "text"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_NEW_IBLOCK_ELEMENT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#CREATED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_NEW_IBLOCK_ELEMENT_SUBJECT"), "MESSAGE" => GetMessage("WF_NEW_IBLOCK_ELEMENT_MESSAGE"), "BODY_TYPE" => "text"));
    }
}
开发者ID:Satariall,项目名称:izurit,代码行数:30,代码来源:set_events.php

示例9: 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;

						}
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:form_callformstatus.php

示例10: while

    } while ($res = $db_res->GetNext());
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && ($_POST["save"] != '' || $_POST["apply"] != '') && $isAdmin && check_bitrix_sessid()) {
    $_POST["EVENT_NAME"] = trim($_POST["EVENT_NAME"]);
    $res = array();
    $DB->StartTransaction();
    if ($_POST["EVENT_NAME"] != '') {
        $db_res = CEventType::GetListEx(array(), array("EVENT_NAME" => $_POST["EVENT_NAME"]), array("type" => "full"));
        if (!$db_res || !($res = $db_res->Fetch())) {
            $res["EVENT_NAME"] = $_POST["EVENT_NAME"];
        }
    }
    foreach ($arParams["LANGUAGE"] as $idLang => $arLang) {
        $arType = array("ID" => $_POST["FIELDS"][$idLang]["ID"], "SORT" => $_POST["FIELDS"][$idLang]["SORT"], "NAME" => $_POST["FIELDS"][$idLang]["NAME"], "DESCRIPTION" => $_POST["FIELDS"][$idLang]["DESCRIPTION"], "LID" => $idLang, "EVENT_NAME" => $res["EVENT_NAME"]);
        if (CAdminList::IsUpdated($idLang) && $_REQUEST[$idLang] == "Y") {
            if (intval($arType["ID"]) > 0 && !CEventType::Update(array("ID" => $arType["ID"]), $arType) || intval($arType["ID"]) <= 0 && !CEventType::Add($arType)) {
                $bVarsFromForm = true;
            }
        }
        if ($_REQUEST[$idLang] != "Y") {
            unset($arLangs[$idLang]);
            if (intval($arType["ID"]) > 0) {
                if (!CEventType::Delete(array("ID" => $arType["ID"]))) {
                    $bVarsFromForm = true;
                }
            }
        }
        if ($bVarsFromForm) {
            break;
        }
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:type_edit.php

示例11: addMailEvType

 protected function addMailEvType()
 {
     foreach ($this->lang_ids as $lang) {
         $f = array("LID" => $lang, "EVENT_NAME" => $this->mail_event_name, "NAME" => Loc::getMessage("DEVTM_ERIP_MAIL_EVENT_NAME"), "DESCRIPTION" => Loc::getMessage("DEVTM_ERIP_MAIL_EVENT_DESC"));
         $et = new CEventType();
         if ($et->Add($f) === false) {
             return false;
         }
     }
     return true;
 }
开发者ID:dimabresky,项目名称:bitrix-Erip-module,代码行数:11,代码来源:index.php

示例12: UET

function UET($EVENT_NAME, $NAME, $LID, $DESCRIPTION)
{
    $et = new CEventType();
    $et->Add(array("LID" => $LID, "EVENT_NAME" => $EVENT_NAME, "NAME" => $NAME, "DESCRIPTION" => $DESCRIPTION));
}
开发者ID:Satariall,项目名称:izurit,代码行数:5,代码来源:events.php

示例13: CreatTypeMailEvent

	function CreatTypeMailEvent()
	{
		$oEventType = new CEventType();
		$oEventType->Add( array(
				"LID" => SITE_ID,
				"EVENT_NAME" => "ADD_MAILBOX_PDD",
				"NAME" => GetMessage("PDD_NAME_TYPE_MAIL_EVENT"),
				"DESCRIPTION"   => "#LOGIN_PDD# - ".GetMessage("PDD_LOGIN_PDD")."
							        #DOMAIN_PDD# - ".GetMessage("DOMAIN_PDD")."
							        #PASSWORD_PDD# - ".GetMessage("PASSWORD_PDD")."
							        #LINK_PDD# - ".GetMessage("LINK_PDD")."
									#EMAIL# - ".GetMessage("EMAIL")."
							        "
		) );
	}
开发者ID:ASDAFF,项目名称:bitrix-yandex-pdd,代码行数:15,代码来源:index.php

示例14: IncludeModuleLangFile

<?php

$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
    $db_events = CEventType::GetList(array("EVENT_NAME" => "VOTE_FOR", "LID" => $lang["LID"]));
    if (!$db_events->Fetch()) {
        IncludeModuleLangFile(__FILE__, $lang["LID"]);
        $et = new CEventType();
        $et->Add(array("LID" => $lang["LID"], "EVENT_NAME" => "VOTE_FOR", "NAME" => GetMessage("VOTE_FOR_NAME"), "DESCRIPTION" => GetMessage("VOTE_FOR_DESC")));
        $arSites = array();
        $sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lang["LID"]));
        while ($site = $sites->Fetch()) {
            $arSites[] = $site["LID"];
        }
        if (count($arSites) > 0) {
            $emess = new CEventMessage();
            $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "VOTE_FOR", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("VOTE_FOR_SUBJECT"), "MESSAGE" => GetMessage("VOTE_FOR_MESSAGE"), "BODY_TYPE" => "text"));
        }
    }
}
开发者ID:Satariall,项目名称:izurit,代码行数:20,代码来源:set_events.php

示例15: CEventType

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$ET = new CEventType();
$oEventType = $ET->GetList(array("EVENT_NAME" => "ADD_IDEA_COMMENT"));
if (!$oEventType->Fetch()) {
    $oLang = CLanguage::GetList($b = "", $o = "");
    while ($arLang = $oLang->Fetch()) {
        IncludeModuleLangFile(__FILE__, $arLang["LID"]);
        //Event Type
        $ET->Add(array("LID" => $arLang["LID"], "EVENT_NAME" => "ADD_IDEA_COMMENT", "NAME" => GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT"), "DESCRIPTION" => '#FULL_PATH# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT_PARAM_FULL_PATH") . "\n" . '#IDEA_TITLE# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT_PARAM_IDEA_TITLE") . "\n" . '#AUTHOR# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT_PARAM_AUTHOR") . "\n" . '#IDEA_COMMENT_TEXT# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT_PARAM_IDEA_COMMENT_TEXT") . "\n" . '#DATE_CREATE# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT_PARAM_DATE_CREATE") . "\n" . '#EMAIL_TO# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT_PARAM_EMAIL_TO")));
        $arSites = array();
        $oSite = CLang::GetList($by = "", $order = "", array("LANGUAGE_ID" => $arLang["LID"]));
        while ($arSite = $oSite->Fetch()) {
            $arSites[] = $arSite["LID"];
        }
        //Template for Event Type
        if (!empty($arSites)) {
            $EM = new CEventMessage();
            $EM->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "ADD_IDEA_COMMENT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => "#SITE_NAME#: " . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT") . ": #IDEA_TITLE#", "MESSAGE" => GetMessage("ADD_IDEA_COMMENT_TEMPLATE"), "BODY_TYPE" => "text"));
        }
    }
}
$oEventType = $ET->GetList(array("EVENT_NAME" => "ADD_IDEA"));
if (!$oEventType->Fetch()) {
    $oLang = CLanguage::GetList($b = "", $o = "");
    while ($arLang = $oLang->Fetch()) {
        IncludeModuleLangFile(__FILE__, $arLang["LID"]);
        //Event Type
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:events.php


注:本文中的CEventType::Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。