本文整理汇总了PHP中CEventLog::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventLog::Add方法的具体用法?PHP CEventLog::Add怎么用?PHP CEventLog::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEventLog
的用法示例。
在下文中一共展示了CEventLog::Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addRecord
/**
* @param int $level Record level.
* @param string $type Record type.
* @param string $itemId Identifier of record object.
* @param string $description Record description.
* @return bool
* @throws \Bitrix\Main\SystemException
*/
public function addRecord($level, $type, $itemId, $description)
{
if ($this->logLevel < $level || $level == static::LOG_LEVEL_DISABLE) {
return false;
}
if (!array_key_exists($level, $this->severities)) {
throw new SystemException("Unknown type of severity: " . $level . ". " . __METHOD__);
}
$eventLog = new \CEventLog();
return $eventLog->Add(array("SEVERITY" => $this->severities[$level], "AUDIT_TYPE_ID" => $type, "MODULE_ID" => "sale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
}
示例2: dbg2EventLog
/**
* @param mixed $data
* @param bool | string | false $die
* @param string $msg
*
* @return null
*/
public static function dbg2EventLog($data, $die = false, $msg = 'DEBUG')
{
if (!is_bool($die)) {
$msg = $die;
$die = false;
}
$sDebug = self::_debugmessage($data);
$oEventLog = new \CEventLog();
$oEventLog->Add(array("SEVERITY" => "SECURITY", "AUDIT_TYPE_ID" => "DEBUG_MESSAGE", "MODULE_ID" => "DEBUG", "ITEM_ID" => $msg, "DESCRIPTION" => $sDebug));
if ($die && self::isValidIP()) {
die;
}
}
示例3: addRecord
/**
* @param $level
* @param $auditType
* @param $itemId
* @param $description
* @return bool
*/
public static function addRecord($level, $auditType, $itemId, $description)
{
if ($level == self::LOG_LEVEL_ERROR) {
$severity = "ERROR";
} elseif ($level == self::LOG_LEVEL_INFO) {
$severity = "INFO";
} elseif ($level == self::LOG_LEVEL_DEBUG) {
$severity = "DEBUG";
} else {
$severity = "UNKNOWN";
}
\CEventLog::Add(array("SEVERITY" => $severity, "AUDIT_TYPE_ID" => $auditType, "MODULE_ID" => "scale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
return true;
}
示例4: Request
function Request($server, $page, $port, $params, $uri = false)
{
if ($uri && strlen($uri) > 0) {
$strURI = $uri;
} else {
$strURI = "http://" . $server . (strlen($port) > 0 && intval($port) > 0 ? ":" . intval($port) : "") . (strlen($page) ? $page : "/") . (strlen($params) > 0 ? "?" . $params : "");
}
$http = new \Bitrix\Main\Web\HttpClient(array("version" => "1.0", "socketTimeout" => 30, "streamTimeout" => 30, "redirect" => true, "redirectMax" => 5));
$strData = $http->get($strURI);
$errors = $http->getError();
$arRSSResult = array();
if (!$strData && !empty($errors)) {
$strError = "";
foreach ($errors as $errorCode => $errMes) {
$strError .= $errorCode . ": " . $errMes;
}
\CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "XDIMPORT_HTTP", "MODULE_ID" => "xdimport", "ITEM_ID" => "RSS_REQUEST", "DESCRIPTION" => $strError));
}
if ($strData) {
$rss_charset = "windows-1251";
if (preg_match("/<" . "\\?XML[^>]{1,}encoding=[\"']([^>\"']{1,})[\"'][^>]{0,}\\?" . ">/i", $strData, $matches)) {
$rss_charset = Trim($matches[1]);
}
$strData = preg_replace("/<" . "\\?XML.*?\\?" . ">/i", "", $strData);
$strData = $GLOBALS["APPLICATION"]->ConvertCharset($strData, $rss_charset, SITE_CHARSET);
}
if (strlen($strData) > 0) {
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/xml.php";
$objXML = new CDataXML();
$res = $objXML->LoadString($strData);
if ($res !== false) {
$ar = $objXML->GetArray();
if (is_array($ar) && isset($ar["rss"]) && is_array($ar["rss"]) && isset($ar["rss"]["#"]) && is_array($ar["rss"]["#"]) && isset($ar["rss"]["#"]["channel"]) && is_array($ar["rss"]["#"]["channel"]) && isset($ar["rss"]["#"]["channel"][0]) && is_array($ar["rss"]["#"]["channel"][0]) && isset($ar["rss"]["#"]["channel"][0]["#"])) {
$arRSSResult = $ar["rss"]["#"]["channel"][0]["#"];
} else {
$arRSSResult = array();
}
$arRSSResult["rss_charset"] = strtolower(SITE_CHARSET);
}
}
if (is_array($arRSSResult) && !empty($arRSSResult)) {
$arRSSResult = CXDILFSchemeRSS::FormatArray($arRSSResult);
if (!empty($arRSSResult) && array_key_exists("item", $arRSSResult) && is_array($arRSSResult["item"]) && !empty($arRSSResult["item"])) {
$arRSSResult["item"] = array_reverse($arRSSResult["item"]);
}
}
return $arRSSResult;
}
示例5: RaiseErrorAndDie
function RaiseErrorAndDie($strError, $errCode = 0, $ITEM_ID = '')
{
global $DB;
if (CLI)
echo 'Error ['.$errCode.']: '.str_replace('<br>',"\n",$strError)."\n";
else
{
echo "ERROR_".$errCode."\n".htmlspecialcharsbx($strError)."\n";
}
if (is_object($DB))
{
$DB->DoConnect();
CEventLog::Add(array(
"SEVERITY" => "WARNING",
"AUDIT_TYPE_ID" => "BACKUP_ERROR",
"MODULE_ID" => "main",
"ITEM_ID" => $ITEM_ID,
"DESCRIPTION" => "[".$errCode."] ".$strError,
));
}
die();
}
示例6: eventLog
/**
*
* w+ event in bitrix log
*/
public static function eventLog($auditType, $itemId, $description)
{
CEventLog::Add(array("SEVERITY" => "SECURITY", "AUDIT_TYPE_ID" => $auditType, "MODULE_ID" => self::$MODULE_ID, "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
}
示例7: send
protected static function send($strParams)
{
$http = new \Bitrix\Main\Web\HttpClient(array("version" => "1.1", "socketTimeout" => 30, "streamTimeout" => 30, "redirect" => true, "redirectMax" => 5));
$jsnData = $http->post("http://www.pecom.ru/bitrix/components/pecom/calc/ajax.php", $strParams);
$errors = $http->getError();
if (!$jsnData && !empty($errors)) {
$strError = "";
foreach ($errors as $errorCode => $errMes) {
$strError .= $errorCode . ": " . $errMes;
}
\CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_DELIVERY", "MODULE_ID" => "sale", "ITEM_ID" => "PECOM_CALCULATOR_SEND", "DESCRIPTION" => $strError));
}
return $jsnData;
}
示例8: Get_StatGA
//.........这里部分代码省略.........
//количество городов
$cityRows = 10;
//csv-файл для отчета Посетители
$visitorsCSV = "visitors.csv";
//csv-файл для отчета Посетители за посл. 3 месяца
$visitors3CSV = "visitors_3.csv";
//csv-файл для отчета География по странам
$countryCSV = "country.csv";
//csv-файл для отчета География по городам
$cityCSV = "city.csv";
//полный пусть к директории со скриптом (слэш в конце обязателен!)
$path = dirname(__FILE__) . "/../../../cache/" . SITE_ID . "/statga/";
try {
$ga = new gapi($u, $p);
//получаем пользователи/просмотры за все время
$ga->requestReportData($id, array('month', 'year'), array('visitors', 'pageviews'), 'year', null, $datestart, $datefinish, 1, 1000);
//получаем и обрабатываем результаты
foreach ($ga->getResults() as $result) {
$m = $result;
//месяц год
$visitors = $result->getVisitors();
//посетители
$pageviews = $result->getPageviews();
//просмотры
//приводим дату к удобочитаемому виду ,мменяем пробелы на точки
$m = str_replace(" ", ".", $m);
//формируем строку
$output .= $m . ";" . $visitors . ";" . $pageviews . "\n";
}
//пишем в файл
self::writeToFile($path . $visitorsCSV, $output);
//получаем пользователи/просмотры/посещения за последние 3 месяца
$ga->requestReportData($id, array('day', 'month', 'year'), array('visitors', 'visits', 'pageviews'), array('year', 'month'), null, $date3MonthStart, $date3MonthFinish, 1, 1000);
//переменная для записи резалта
$output = "";
//получаем и обрабатываем результаты
foreach ($ga->getResults() as $result) {
$d = $result;
//день
$visitors = $result->getVisitors();
//посетители
$pageviews = $result->getPageviews();
//просмотры
$visits = $result->getVisits();
//посещения
//приводим дату к удобочитаемому виду ,мменяем пробелы на точки
$d = str_replace(" ", ".", $d);
//формируем строку
$output .= $d . ";" . $visitors . ";" . $pageviews . ";" . $visits . "\n";
}
//пишем в файл
self::writeToFile($path . $visitors3CSV, $output);
//получаем географию посещений за последний месяц
$ga->requestReportData($id, array('country'), array('visits'), '-visits', null, $date1MonthStart, $date1MonthFinish, 1, $countryRows);
//переменная для записи резалта
$output = "";
//получаем общее число посещений для всех стран
$total_visits = $ga->getVisits();
//получаем и обрабатываем результаты
foreach ($ga->getResults() as $result) {
$country = $result->getCountry();
//страна
$visits = $result->getVisits();
//кол-во посещений
//нот сет переводим на русский
$country = str_replace("(not set)", "не определено", $country);
//формируем строку
$output .= $country . ";" . $visits . "\n";
}
//пишем в файл
self::writeToFile($path . $countryCSV, $output);
//////получаем ГОРОДА за последний месяц
$ga->requestReportData($id, array('city'), array('visits'), '-visits', null, $date1MonthStart, $date1MonthFinish, 1, $cityRows);
//переменная для записи резалта
$output = "";
//получаем общее число посещений для всех стран
$total_visits = $ga->getVisits();
//получаем и обрабатываем результаты
foreach ($ga->getResults() as $result) {
$city = $result->getCity();
//страна
$visits = $result->getVisits();
//кол-во посещений
//нот сет переводим на русский
$city = str_replace("(not set)", "не определено", $city);
//формируем строку
$output .= $city . ";" . $visits . "\n";
}
//пишем в файл
self::writeToFile($path . $cityCSV, $output);
} catch (Exception $e) {
$SEVERITY = "WARNING";
$ERROR_TYPE = "STATGA_ERROR";
$MODULE_ID = "statga";
$ITEM_ID = "Get_StatGA";
$DESCRIPTION = $e->getMessage();
CEventLog::Add(array("SEVERITY" => $SEVERITY, "AUDIT_TYPE_ID" => $ERROR_TYPE, "MODULE_ID" => $MODULE_ID, "ITEM_ID" => $ITEM_ID, "DESCRIPTION" => $DESCRIPTION));
}
return "statga::Get_StatGA();";
}
示例9: IntVal
$logKPI::add(array('UF_USER' => IntVal($_REQUEST['UF_USER']), 'UF_AMPLIFIER' => $USER->GetID(), 'UF_EVENT' => $_REQUEST['UF_EVENT'] ? $_REQUEST['UF_EVENT'] : 0, 'UF_DATE_TIME' => date("Y-m-d H:i:s"), 'UF_ACTION_CODE' => 103, 'UF_ACTION_TEXT' => "change_status", 'UF_TYPE' => $arUserType[1][getUserType(IntVal($_REQUEST['UF_USER']))], 'UF_TYPE_2' => $arUserType[2][5]));
if ($res) {
getResultJSON(array("status" => "OK", "status_msg" => "put_photo_ok"));
} else {
getResultJSON(array("status" => "ERROR", "status_msg" => "put_photo_error"));
}
}
/**
Добавление события
*/
if ($_REQUEST["mode"] == "new_event") {
if (!$USER->IsAuthorized()) {
exit;
}
$json = json_decode(file_get_contents('php://input'), true);
CEventLog::Add(array("SEVERITY" => "WARNING", "AUDIT_TYPE_ID" => "SEND_EVENT", "MODULE_ID" => "iblock", "ITEM_ID" => "", "DESCRIPTION" => json_encode($json)));
if (!isValidJSON($json)) {
exit;
}
foreach ($json as $key => $val) {
$el = new CIBlockElement();
$PROP = array('CREATED_USER_ID' => $USER->GetID(), 'CLUB_NAME' => $val["CLUB_NAME"], 'OG_DESCRIPTION' => $val["OG_DESCRIPTION"], 'LINK' => $val["LINK"], 'PLACE_EVENT' => $val["PLACE_EVENT"], 'START_DATE' => ConvertTimeStamp(MakeTimeStamp($val["DATE_EVENT"], "DD.MM.YYYY HH:MI"), "FULL"));
$arEvent = array("IBLOCK_ID" => 2, "PROPERTY_VALUES" => $PROP, "NAME" => $val["NAME"], "DATE_ACTIVE_FROM" => ConvertTimeStamp(MakeTimeStamp($val["DATE_EVENT"], "DD.MM.YYYY HH:MI"), "FULL"));
$res = $el->Add($arEvent);
if ($res) {
getResultJSON(array("status" => "OK", "status_msg" => "new_event"));
} else {
getResultJSON(array("status" => "ERROR", "status_msg" => "new_event " . $el->LAST_ERROR));
}
}
}
示例10: convertToNew
/**
* @return \Bitrix\Sale\Result
* @throws Exception
* @throws \Bitrix\Main\SystemException
*/
public static function convertToNew($renameTable = false)
{
$result = new \Bitrix\Sale\Result();
$con = \Bitrix\Main\Application::getConnection();
if (!$con->isTableExists("b_sale_delivery_handler")) {
return $result;
}
$sqlHelper = $con->getSqlHelper();
$deliveryRes = $con->query('SELECT * FROM b_sale_delivery_handler WHERE CONVERTED != \'Y\'');
$tablesToUpdate = array('b_sale_order', 'b_sale_order_history');
\CSaleDeliveryHandler::Initialize();
$handlers = \CSaleDeliveryHandler::__getRegisteredHandlers();
while ($delivery = $deliveryRes->fetch()) {
if (strlen($delivery["HID"]) <= 0) {
$result->addError(new \Bitrix\Main\Entity\EntityError("Can't find delivery HID. ID: \"" . $delivery["ID"] . "\""));
continue;
}
if (!isset($handlers[$delivery["HID"]])) {
\CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_CONVERTER_ERROR", "MODULE_ID" => "sale", "ITEM_ID" => "CAllSaleDeliveryHandler::convertToNew()", "DESCRIPTION" => "Can't find delivery handler for registered HID: \"" . $delivery["HID"] . "\""));
//$result->addError( new \Bitrix\Main\Entity\EntityError("Can't find delivery handler for registered HID: \"".$delivery["HID"]."\""));
continue;
}
if (strlen($delivery["PROFILES"]) > 0) {
//get from base
$delivery["PROFILES"] = unserialize($delivery["PROFILES"]);
} else {
//or default.
$delivery["PROFILES"] = $handlers[$delivery["HID"]]["PROFILES"];
}
// Something strange it probably not used
if ($delivery["PROFILES"] == false || !is_array($delivery["PROFILES"]) || empty($delivery["PROFILES"])) {
$result->addError(new \Bitrix\Main\Entity\EntityError("Can't receive info about profiles. Delivery HID: \"" . $delivery["HID"] . "\""));
continue;
}
//Set profiles activity
foreach ($delivery["PROFILES"] as $id => $params) {
if (!isset($delivery["PROFILES"][$id]["ACTIVE"]) || $delivery["ACTIVE"] == "N") {
$delivery["PROFILES"][$id]["ACTIVE"] = $delivery["ACTIVE"];
}
}
unset($delivery["ID"]);
$delivery["CONFIG"] = array();
if (strlen($delivery["SETTINGS"]) > 0) {
if (isset($handlers[$delivery["HID"]]["DBGETSETTINGS"]) && is_callable($handlers[$delivery["HID"]]["DBGETSETTINGS"])) {
$delivery["CONFIG"] = call_user_func($handlers[$delivery["HID"]]["DBGETSETTINGS"], $delivery["SETTINGS"]);
} else {
$delivery["CONFIG"] = $delivery["SETTINGS"];
}
} elseif (isset($handlers[$delivery["HID"]]["GETCONFIG"]) && is_callable($handlers[$delivery["HID"]]["GETCONFIG"])) {
$config = call_user_func($handlers[$delivery["HID"]]["GETCONFIG"], strlen($delivery["LID"]) > 0 ? $delivery["LID"] : false);
foreach ($config["CONFIG"] as $key => $arConfig) {
if (!empty($arConfig["DEFAULT"])) {
$delivery["CONFIG"][$key] = $arConfig["DEFAULT"];
}
}
}
if (empty($delivery["NAME"])) {
if (!empty($handlers[$delivery["HID"]]["NAME"])) {
$delivery["NAME"] = $handlers[$delivery["HID"]]["NAME"];
} else {
$delivery["NAME"] = "-";
}
}
$delivery["SID"] = $handlers[$delivery["HID"]]["SID"];
$id = \CSaleDeliveryHandler::Set($delivery["HID"], $delivery, strlen($delivery["LID"]) > 0 ? $delivery["LID"] : false);
if (intval($id) <= 0) {
$result->addError(new \Bitrix\Main\Entity\EntityError("Can't convert delivery handler with hid: " . $delivery["HID"] . (strlen($delivery["LID"]) > 0 ? " for site: " . $delivery["LID"] : "")));
continue;
}
$con->queryExecute("UPDATE b_sale_delivery_handler SET CONVERTED='Y' WHERE HID LIKE '" . $sqlHelper->forSql($delivery["HID"]) . "'");
$ids = array($id);
foreach ($delivery["PROFILES"] as $profileName => $profileData) {
$fullSid = $delivery["HID"] . ":" . $profileName;
$profileId = \CSaleDelivery::getIdByCode($fullSid);
$ids[] = $profileId;
if (intval($profileId) > 0) {
foreach ($tablesToUpdate as $table) {
$con->queryExecute("UPDATE " . $table . " SET DELIVERY_ID='" . $sqlHelper->forSql($profileId) . "' WHERE DELIVERY_ID = '" . $sqlHelper->forSql($fullSid) . "'");
}
$con->queryExecute("UPDATE b_sale_delivery2paysystem SET DELIVERY_ID='" . $sqlHelper->forSql($profileId) . "', DELIVERY_PROFILE_ID='##CONVERTED##' WHERE DELIVERY_ID = '" . $sqlHelper->forSql($delivery["HID"]) . "' AND DELIVERY_PROFILE_ID='" . $profileName . "'");
} else {
$result->addError(new \Bitrix\Main\Entity\EntityError("Cant determine id for profile code: " . $fullSid));
}
}
$con->queryExecute("UPDATE b_sale_delivery2paysystem SET DELIVERY_ID='" . $sqlHelper->forSql($id) . "', DELIVERY_PROFILE_ID='##CONVERTED##' WHERE DELIVERY_ID = '" . $sqlHelper->forSql($delivery["HID"]) . "' AND (DELIVERY_PROFILE_ID='' OR DELIVERY_PROFILE_ID IS NULL)");
$d2pRes = \Bitrix\Sale\Internals\DeliveryPaySystemTable::getList(array('filter' => array('DELIVERY_ID' => $ids), 'select' => array("DELIVERY_ID"), 'group' => array("DELIVERY_ID")));
while ($d2p = $d2pRes->fetch()) {
$res = \Bitrix\Sale\Internals\ServiceRestrictionTable::add(array("SERVICE_ID" => $d2p["DELIVERY_ID"], "SERVICE_TYPE" => \Bitrix\Sale\Services\Base\RestrictionManager::SERVICE_TYPE_SHIPMENT, "CLASS_NAME" => '\\Bitrix\\Sale\\Delivery\\Restrictions\\ByPaySystem', "SORT" => 100));
if (!$res->isSuccess()) {
$result->addErrors($res->getErrors());
}
}
}
if ($renameTable && $result->isSuccess()) {
$con->renameTable('b_sale_delivery_handler', 'b_sale_delivery_handler_old');
//.........这里部分代码省略.........
示例11: file_put_contents
file_put_contents($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/sale_convert.txt', 'update b_sale_store_barcode = ' . ($end - $start) . "\n", FILE_APPEND);
if (empty($error)) {
$message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_ORDER_PAYMENT');
$result['NEXT_STEP'] = ++$ajax_step;
} else {
$message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_INSERT_SHIPMENT_BASKET_BARCODE');
$result['ERROR'] = true;
$message .= "<br>" . $error;
}
$result['DATA'] = $message;
break;
case 20:
$start = microtime(true);
if (!$DB->Query("\n\t\t\t\t\tUPDATE \n\t\t\t\t\t\tb_sale_order \n\t\t\t\t\tSET\n\t\t\t\t\t\tb_sale_order.SUM_PAID = b_sale_order.PRICE \n\t\t\t\t\tWHERE b_sale_order.PAYED = 'Y'", true)) {
$error .= "<br>" . $DB->GetErrorMessage();
\CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_CONVERTER_ERROR", "MODULE_ID" => "sale", "ITEM_ID" => "-", "DESCRIPTION" => $error));
}
$end = microtime(true);
file_put_contents($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/sale_convert.txt', 'update b_sale_order = ' . ($end - $start) . "\n", FILE_APPEND);
if (empty($error)) {
$result['NEXT_STEP'] = ++$ajax_step;
$message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_REPORT');
} else {
$message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_ORDER_PAYMENT');
$result['ERROR'] = true;
$message .= "<br>" . $error;
}
$result['DATA'] = $message;
break;
case 21:
if ($DB->TableExists('b_report')) {
示例12: FormationName
function FormationName(&$arFields) {
if ( $arFields['IBLOCK_ID'] == 24 ){
// if iBLOCK_ID SK_CONTRACT
try{
global $APPLICATION;
$include_file = __DIR__ .'/../templates/work_copy/class/class_contract.php';
include_once ( $include_file );
$no_errors = IBlockContractHandler::OnBeforeIBlockElementAddHandler( $arFields );
if( is_array( $no_errors ) != true && $no_errors === true ){
return true;
}else{
$APPLICATION->throwException( implode ("\n", $no_errors ));
return false;
}
}catch( Exception $e ){
ob_start();
echo "\n ". __FILE__ ."\n";
print_r ( $e->getMessage() );
echo "\n ";
$toLog = ob_get_contents();
ob_end_clean();
AddMessage2Log("$toLog", "my_module_id");
}
}elseif( $arFields['IBLOCK_ID'] == 23 ){
try{
global $APPLICATION;
$include_file = __DIR__ .'/../templates/work_copy/class/class_chassis.php';
include_once ( $include_file );
$no_errors = IBlockChassisHandler::OnBeforeIBlockElementAddHandler( $arFields );
if( is_array( $no_errors ) != true && $no_errors === true ){
return true;
}else{
$APPLICATION->throwException( implode ("\n", $no_errors ));
return false;
}
}catch( Exception $e ){
echo $e->getMessage();
}
}elseif( $arFields['IBLOCK_ID'] == 22 ){
try{
global $APPLICATION;
$include_file = __DIR__ .'/../templates/work_copy/class/class_client.php';
include_once ( $include_file );
$no_errors = IBlockClientHandler::OnBeforeIBlockElementAddHandler( $arFields );
if( is_array( $no_errors ) != true && $no_errors === true ){
return true;
}else{
$APPLICATION->throwException( implode ("\n", $no_errors ));
return false;
}
}catch( Exception $e ){
echo $e->getMessage();
}
}elseif( $arFields['IBLOCK_ID'] == 6 ){
try{
global $USER;
CModule::IncludeModule('iblock');
$dbEl = CIBlockElement::GetByID( $arFields["ID"] );
if( $obEl = $dbEl->GetNextElement() ){
$CurrentVal = $obEl->GetFields();
$CurrentVal["PROPERTIES"] = $obEl->GetProperties();
// ob_start();
// echo "\n ". __FILE__ ."\n";
// print_r ( $arFields );
// print_r ( $CurrentVal );
// echo "\n ";
// $toLog = ob_get_contents();
// ob_end_clean();
// AddMessage2Log("$toLog", __METHOD__ . __LINE__);
$log_mess = "";
$newService_code = $arFields["PROPERTY_VALUES"][106] [ $CurrentVal ["PROPERTIES"]["service_code"]["PROPERTY_VALUE_ID"] ]["VALUE"];
if( $CurrentVal ["PROPERTIES"]["service_code"]["VALUE"] !== $newService_code ){
$log_mess.= "Значение свойства «". $CurrentVal ["PROPERTIES"]["service_code"]["NAME"]."» изменено ".$CurrentVal["PROPERTIES"]["service_code"]["VALUE"]." => ".$newService_code." ;";
}
$newService_price = $arFields["PROPERTY_VALUES"][107] [ $CurrentVal ["PROPERTIES"]["service_price"]["PROPERTY_VALUE_ID"] ]["VALUE"];
if( $CurrentVal ["PROPERTIES"]["service_price"]["VALUE"] !== $newService_price ){
$log_mess.= "Значение свойства «". $CurrentVal ["PROPERTIES"]["service_price"]["NAME"]."» изменено ".$CurrentVal["PROPERTIES"]["service_price"]["VALUE"]." => ".$newService_price." ;";
}
if( $log_mess!="" ){
CEventLog::Add(array(
"SEVERITY"=>"SECURITY",
"AUDIT_TYPE_ID"=>"SERVICE_CALC_ITEM_PRICE_CHANGE",
"MODULE_ID"=>"IBLOCK",
"ITEM_ID"=>$arFields["ID"],
"USER_ID"=>$USER->GetID(),
"DESCRIPTION"=>"$log_mess",
//.........这里部分代码省略.........
示例13: log
protected function log($level, $type, $itemId, $description)
{
if ($this->logLevel < $level) {
return false;
}
CEventLog::Add(array("SEVERITY" => $level >= CSaleYMHandler::LOG_LEVEL_ERROR ? "WARNING" : "NOTICE", "AUDIT_TYPE_ID" => $type, "MODULE_ID" => "sale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
return true;
}
示例14: startRefreshingStatuses
/**
* Starts statuses refreshing
*/
public static function startRefreshingStatuses()
{
$manager = self::getInstance();
$result = $manager->updateStatuses();
if (!$result->isSuccess()) {
$eventLog = new \CEventLog();
$eventLog->Add(array("SEVERITY" => \CEventLog::SEVERITY_ERROR, "AUDIT_TYPE_ID" => 'SALE_DELIVERY_TRACKING_REFRESHING_STATUS_ERROR', "MODULE_ID" => "sale", "ITEM_ID" => time(), "DESCRIPTION" => implode('\\n', $result->getErrorMessages())));
} else {
$data = $result->getData();
if (!empty($data)) {
$manager->processStatusChange($data);
}
}
return '\\Bitrix\\Sale\\Delivery\\Tracking\\Manager::startRefreshingStatuses();';
}
示例15: Log
function Log($SEVERITY, $AUDIT_TYPE_ID, $MODULE_ID, $ITEM_ID, $DESCRIPTION = false, $SITE_ID = false)
{
return CEventLog::Add(array("SEVERITY" => $SEVERITY, "AUDIT_TYPE_ID" => $AUDIT_TYPE_ID, "MODULE_ID" => $MODULE_ID, "ITEM_ID" => $ITEM_ID, "DESCRIPTION" => $DESCRIPTION, "SITE_ID" => $SITE_ID));
}