本文整理汇总了PHP中CEvent类的典型用法代码示例。如果您正苦于以下问题:PHP CEvent类的具体用法?PHP CEvent怎么用?PHP CEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@set_time_limit(0);
@ignore_user_abort(true);
define('CHK_EVENT', true);
$agentManager = new \CAgent();
$agentManager->CheckAgents();
define('BX_CRONTAB_SUPPORT', true);
define('BX_CRONTAB', true);
$eventManager = new \CEvent();
$eventManager->CheckEvents();
}
示例2: _OnUserAdd
function _OnUserAdd(&$arFields, &$userID)
{
$GLOBALS["cntUsersImport"]++;
unset($arFields["GROUP_ID"]);
$arFields["ID"] = $arFields["USER_ID"] = $userID;
$arFields["URL_LOGIN"] = urlencode($arFields["LOGIN"]);
if (isset($arFields["EXTERNAL_AUTH_ID"]) && strlen($arFields["EXTERNAL_AUTH_ID"]) > 0 && strlen($GLOBALS["eventLdapLangID"]) > 0) {
$arFields["BACK_URL"] = "/";
$event = new CEvent();
$event->Send("LDAP_USER_CONFIRM", $GLOBALS["eventLdapLangID"], $arFields);
} elseif ($GLOBALS["sendEmail"] == "Y" && $arFields["EMAIL"] != $GLOBALS["defaultUserEmail"] && strlen($GLOBALS["eventLangID"]) > 0) {
$event = new CEvent();
$event->Send("USER_INVITE", $GLOBALS["eventLangID"], $arFields);
}
}
示例3: registerUser
function registerUser($userInfo)
{
$errors = array();
$result = '';
if (empty($userInfo['name'])) {
$errors[] = 'Вы не ввели имя';
}
if (empty($userInfo['email'])) {
$errors[] = 'Вы не ввели email';
}
if (empty($userInfo['phone'])) {
$errors[] = 'Вы не ввели телефон';
}
if (empty($errors)) {
$user = new CUser();
$password = make_password(8);
$arFields = array("NAME" => $userInfo['name'], "EMAIL" => $userInfo['email'], "LOGIN" => $userInfo['email'], "ACTIVE" => "Y", "GROUP_ID" => array(6), "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "PERSONAL_PHONE" => $userInfo['phone']);
$ID = $user->Add($arFields);
if (intval($ID) > 0) {
$result = "Вы успешно зарегистрированы.";
$arEventField = array("NAME" => $userInfo['name'], "EMAIL" => $userInfo['email'], "PASSWORD" => $password);
CEvent::SendImmediate("NEW_REG", "s1", $arEventField);
unset($_POST['user']);
global $USER;
global $APPLICATION;
$USER->Authorize($ID);
LocalRedirect($APPLICATION->GetCurPageParam('', array('user[name]', 'user[email]', 'ELEMENT_CODE', 'code')));
} else {
$errors[] = $user->LAST_ERROR;
}
}
return $errors;
}
示例4: Delivery
function Delivery(&$arFields){
CModule::IncludeModule("iblock");
$arSelect = Array("ID","PROPERTY_iblock","PROPERTY_send","NAME");
$arFilter = Array("IBLOCK_ID"=>38, "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement())
{
$arFields1 = $ob->GetFields();
$delivery[$arFields1["PROPERTY_IBLOCK_VALUE"]]=$arFields1;
$id_ac[]=$arFields1["PROPERTY_IBLOCK_VALUE"];
}
if (in_array($arFields['IBLOCK_ID'],$id_ac))
{
$arSelect = Array("ID","PROPERTY_email","NAME");
$arFilter = Array("IBLOCK_ID"=>34, "ACTIVE"=>"Y","PROPERTY_delivery"=>$arFields['IBLOCK_ID']);
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50000), $arSelect);
while($ob = $res->GetNextElement())
{
$arFields1 = $ob->GetFields();
$receivers[]=$arFields1;
}
foreach ($receivers as $receiver){
$arEventFields = array(
"ID" => $arFields["ID"],
"EMAIL_TO" => $receiver["PROPERTY_EMAIL_VALUE"],
"TITLE" => $arFields["NAME"],
);
$ev_id[]=CEvent::Send('DELIVERY', 's1', $arEventFields,"N",$delivery[$arFields['IBLOCK_ID']]["PROPERTY_SEND_VALUE"]);
}
}
}
示例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"]);
}
}
示例6: getEventLinks
/**
* Sub-function to collect events within a period
* @param Date the starting date of the period
* @param Date the ending date of the period
* @param array by-ref an array of links to append new items to
* @param int the length to truncate entries by
* @author Andrew Eddie <eddieajau@users.sourceforge.net>
*/
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen)
{
global $AppUI, $event_filter;
$events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
// assemble the links for the events
foreach ($events as $row) {
$start = new CDate($row['event_start_date']);
$end = new CDate($row['event_end_date']);
$date = $start;
$date->setTime(0, 0, 0);
$cwd = explode(',', $GLOBALS['dPconfig']['cal_working_days']);
for ($i = 0, $x = $end->dateDiff($start); $i <= $x; $i++) {
// the link
// optionally do not show events on non-working days
if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
$link['href'] = '?m=calendar&a=view&event_id=' . $row['event_id'];
$link['alt'] = $row['event_description'];
$link['text'] = dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16) . htmlspecialchars($row['event_title']);
if ($i == 0) {
$link['alt'] .= ' [' . $AppUI->_('START') . ']';
}
if ($i == $x) {
$link['alt'] .= ' [' . $AppUI->_('END') . ']';
}
$links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
}
$date = $date->getNextDay();
}
}
}
示例7: Send
public function Send()
{
if(!$this->IsAvailable())
return false;
$arNotification = $this->Notify->getNotification();
//No need to send about updates;
if($arNotification["ACTION"] == "UPDATE")
return 0;
$arEmailSubscribe = array();
$arAllSubscribe = $this->GetList(array(), array("ID" => array(self::SUBSCRIBE_ALL, self::SUBSCRIBE_IDEA_COMMENT.$arNotification["POST_ID"])), false, false, array("USER_ID", "USER_EMAIL"));
while($r = $arAllSubscribe->Fetch())
if(check_email($r["USER_EMAIL"]))
$arEmailSubscribe[$r["USER_ID"]] = $r["USER_EMAIL"];
foreach($arEmailSubscribe as $UserId => $Email)
{
//Avoid to send notification to author
if($UserId == $arNotification["AUTHOR_ID"])
continue;
$arNotification["EMIAL_TO"] = $Email;
//ADD_IDEA_COMMENT, ADD_IDEA
CEvent::Send($arNotification["ACTION"].'_'.$arNotification["TYPE"], SITE_ID, $arNotification);
}
return count($arEmailSubscribe)>0;
}
示例8: my_OnAfterIBlockElementAdd
function my_OnAfterIBlockElementAdd(&$arFields)
{
$elem = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 12, "ID" => $arFields["ID"]), false, false, array("NAME", "PROPERTY_email", "PROPERTY_phone", "PROPERTY_message"));
while ($elem_info = $elem->Fetch()) {
$mailFields = array("EMAIL_TO" => "raulschokino@yandex.ru", "AUTHOR" => $elem_info["NAME"], "AUTHOR_EMAIL" => $elem_info["PROPERTY_EMAIL_VALUE"], "AUTHOR_PHONE" => $elem_info["PROPERTY_PHONE_VALUE"], "TEXT" => $elem_info["PROPERTY_MESSAGE_VALUE"]);
}
CEvent::Send("FEEDBACK_FORM", "s1", $mailFields, "N");
//получим сообщение
}
示例9: CheckEvents
function CheckEvents()
{
if((defined("DisableEventsCheck") && DisableEventsCheck===true) || (defined("FX_CRONTAB_SUPPORT") && FX_CRONTAB_SUPPORT===true && FX_CRONTAB!==true))
return;
global $DB;
return CEvent::ExecuteEvents();
}
示例10: send
/**
* @param MailPackage $package
* @param bool $duplicate
* @return int
*/
public function send(MailPackage $package, $duplicate = false)
{
$rsSites = \CSite::GetList($by = "sort", $order = "desc", array());
$siteIds = array();
while ($arSite = $rsSites->Fetch()) {
$siteIds[] = $arSite['ID'];
}
return \CEvent::Send($package->getEventName(), $siteIds, $package->getFields(), $duplicate ? 'Y' : 'N', $package->getMessageId());
}
示例11: json_request
protected function json_request()
{
if($_REQUEST["json_request_callback_form"] && $_REQUEST["json_request_callback_form"] == "Y"){
global $APPLICATION;
$APPLICATION->restartBuffer();
$this->arResult = array();
$this->arResult["error"] = array();
if(!empty($_REQUEST["form"])){
foreach($_REQUEST["form"] as $val){
$this->arResult["form"][$val["name"]]=$val["value"];
if(($val["name"] == "USER_NAME" && strlen($val["value"]) < 2) || ($val["name"] == "USER_PHONE" && strlen($val["value"] < 6))){
$this->arResult["error"][] = array(
"name" => $val["name"],
"message" => GetMessage("ERROR_".$val["name"])
);
}else{
$this->arResult["field"][$val["name"]] = $val["value"];
}
}
}
if(count($this->arResult["error"]) == 0){
CEvent::Send("SB_CALLBACK_FORM",SITE_ID,$this->arResult["form"]);
\Bitrix\Main\Loader::includeModule("softbalance.callback");
$data = array(
"CREATED" => new \Bitrix\Main\Type\DateTime(),
"NAME" => $this->arResult["field"]["USER_NAME"],
"STATUS" => "new",
"PHONE" => $this->arResult["field"]["USER_PHONE"],
"USER_COMMENT"=> $this->arResult["field"]["USER_COMMENT"],
"ADMIN_COMMENT" => "",
"SITE_ID" => SITE_ID
);
$result = \Softbalance\Callback\CallbackTable::add($data);
if($result){
$this->arResult["complete"]=true;
$this->arResult["ok"]=GetMessage("ok");
}
}
echo json_encode($this->arResult);
die();
}
}
示例12: execute
public function execute(Form $form)
{
$sendData = $form->getData();
if ($this->fieldsUppercase) {
$submitArray = array_change_key_case($sendData, CASE_UPPER);
}
$result = \CEvent::Send($this->emailEvent, SITE_ID, $submitArray);
if (!$result && $this->isCritical) {
throw new \Exception('CEvent::Send false');
} elseif (!$result && !$this->isCritical) {
$form->setErrors(array($this->getErrorMessage('ошибка отправки почты (CEvent::Send)')));
}
}
示例13: afterRecord
/**
* После окончания записи передачи уведомление пользователю
*
* @param array $arParams
* @return boolean
*/
public static function afterRecord($arParams)
{
if (!empty($arParams["USER_EMAIL"])) {
$arEventFields = array("RECORD_ID" => $arParams["RECORD_ID"], "RECORD_TITLE" => $arParams["RECORD_NAME"], "EMAIL" => $arParams["USER_EMAIL"], "USER_ID" => $arParams["USER_ID"], "USER_NAME" => $arParams["USER_NAME"], "URL" => $arParams["URL"], "PICTURE" => $arParams["PICTURE"]);
if (CEvent::Send("RECORD_AFTER", array(SITE_ID), $arEventFields)) {
return true;
} else {
return false;
}
} else {
return true;
}
}
示例14: send
/**
* Created by JetBrains PhpStorm.
* User: professor
* Date: 28.10.12
* Time: 15:45
* To change this template use File | Settings | File Templates.
*/
function send()
{
die;
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule("iblock");
$ob = CIBlockElement::GetList(array("SORT" => "ASC"), array("!PROPERTY_EMAIL_MANAGER" => fale, "IBLOCK_ID" => IB_CLUB_ID), FALSE, FALSE, array("ID", "NAME", "PROPERTY_EMAIL_MANAGER"));
while ($row = $ob->Fetch()) {
if (trim($row['PROPERTY_EMAIL_MANAGER_VALUE'] != "")) {
$arEventFields = array("EMAIL" => $row['PROPERTY_EMAIL_MANAGER_VALUE']);
CEvent::Send("RASSYLKA", "s1", $arEventFields);
}
}
return true;
}
示例15: __construct
public function __construct($sender, $model, $objectParameter, $status = ViewController::ENTITY_STATUS_AVAILABLE)
{
parent::__construct($sender);
$this->model = $model;
$this->objectParameter = $objectParameter;
$this->status = $status;
}