function OnProductCatalogHandler($ID, $arFields)
{
    Bitrix\Main\Loader::includeModule('iblock');
    Bitrix\Main\Loader::includeModule('catalog');
    define('IBLOCK_ID_PRODUCTS', 2);
    define('IBLOCK_ID_OFFERS', 3);
    $query = new \Bitrix\Main\Entity\Query(Bitrix\Iblock\ElementTable::getEntity());
    $query->setSelect(array("ID", "IBLOCK_ID"))->setFilter(array("ID" => $ID))->setOrder(array("ID" => "ASC"));
    $resElement = $query->exec()->fetch();
    if ($resElement['IBLOCK_ID'] == IBLOCK_ID_PRODUCTS) {
        CIBlockElement::SetPropertyValuesEx($ID, $resElement['IBLOCK_ID'], array("AVAILABLE_QUANTITY_CATALOG" => $arFields['QUANTITY']));
    } elseif ($resElement['IBLOCK_ID'] == IBLOCK_ID_OFFERS) {
        //1
        $rsElementOffer = CIBlockElement::GetList(array(), array("ID" => $ID), false, false, array("ID", "IBLOCK_ID", 'NAME', "PROPERTY_CML2_LINK"))->fetch();
        $resElemOfferProduct = (int) $rsElementOffer['PROPERTY_CML2_LINK_VALUE'];
        //2
        $resOffersCML2 = CIBlockElement::GetList(array(), array("PROPERTY_CML2_LINK" => $resElemOfferProduct, 'IBLOCK_ID' => IBLOCK_ID_OFFERS), false, false, array("ID", "IBLOCK_ID", 'NAME'));
        //3
        $arrOffersIDs = array();
        while ($res = $resOffersCML2->fetch()) {
            $arrOffersIDs[] = $res['ID'];
        }
        //4
        $availQuant = array();
        foreach ($arrOffersIDs as $k => $v) {
            $ar_res_cat = CCatalogProduct::GetList(array("ID" => "DESC"), array("ID" => (int) $v), false, false, array("ID", "QUANTITY", 'ELEMENT_IBLOCK_ID', 'ELEMENT_NAME'))->fetch();
            $availQuant[] = $ar_res_cat['QUANTITY'];
        }
        //5
        $minAvailQuant = (int) min($availQuant);
        //6
        $resUpdateSCU = CIBlockElement::SetPropertyValuesEx($resElemOfferProduct, IBLOCK_ID_PRODUCTS, array("AVAILABLE_QUANTITY_CATALOG" => $minAvailQuant));
    }
}
Beispiel #2
0
 function InstallDB($params = array())
 {
     global $DB;
     if (!$DB->Query("SELECT 'x' FROM b_conv_context", true)) {
         Option::set('conversion', 'START_DATE_TIME', date('Y-m-d H:i:s'));
         if (ModuleManager::isModuleInstalled('sale') && ($currency = Option::get('sale', 'default_currency'))) {
             Option::set('conversion', 'BASE_CURRENCY', $currency);
         } elseif (Bitrix\Main\Loader::includeModule('currency')) {
             Option::set('conversion', 'BASE_CURRENCY', Bitrix\Currency\CurrencyManager::getBaseCurrency());
         }
         if ($params['GENERATE_INITIAL_DATA'] !== 'Y') {
             Option::set('conversion', 'GENERATE_INITIAL_DATA', 'generated');
         }
         $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/conversion/install/db/' . strtolower($DB->type) . '/install.sql');
     }
     ModuleManager::registerModule('conversion');
     RegisterModuleDependences('conversion', 'OnGetCounterTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetCounterTypes');
     RegisterModuleDependences('conversion', 'OnGetAttributeTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeTypes');
     RegisterModuleDependences('conversion', 'OnGetAttributeGroupTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeGroupTypes');
     RegisterModuleDependences('conversion', 'OnSetDayContextAttributes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onSetDayContextAttributes');
     RegisterModuleDependences('main', 'OnProlog', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onProlog');
     return true;
 }
Beispiel #3
0
        echo $key;
        ?>
"></a>
										<a class="bx_ui_slider_handle right" style="right:0;" href="javascript:void(0)" id="right_slider_<?php 
        echo $key;
        ?>
"></a>
									</div>
								</div>
								<div style="opacity: 0;height: 1px;"></div>
							</div>
						</div>
					</div>
					<?php 
        $precision = 2;
        if (Bitrix\Main\Loader::includeModule("currency")) {
            $res = CCurrencyLang::GetFormatDescription($arItem["VALUES"]["MIN"]["CURRENCY"]);
            $precision = $res['DECIMALS'];
        }
        $arJsParams = array("leftSlider" => 'left_slider_' . $key, "rightSlider" => 'right_slider_' . $key, "tracker" => "drag_tracker_" . $key, "trackerWrap" => "drag_track_" . $key, "minInputId" => $arItem["VALUES"]["MIN"]["CONTROL_ID"], "maxInputId" => $arItem["VALUES"]["MAX"]["CONTROL_ID"], "minPrice" => $arItem["VALUES"]["MIN"]["VALUE"], "maxPrice" => $arItem["VALUES"]["MAX"]["VALUE"], "curMinPrice" => $arItem["VALUES"]["MIN"]["HTML_VALUE"], "curMaxPrice" => $arItem["VALUES"]["MAX"]["HTML_VALUE"], "fltMinPrice" => intval($arItem["VALUES"]["MIN"]["FILTERED_VALUE"]) ? $arItem["VALUES"]["MIN"]["FILTERED_VALUE"] : $arItem["VALUES"]["MIN"]["VALUE"], "fltMaxPrice" => intval($arItem["VALUES"]["MAX"]["FILTERED_VALUE"]) ? $arItem["VALUES"]["MAX"]["FILTERED_VALUE"] : $arItem["VALUES"]["MAX"]["VALUE"], "precision" => $precision, "colorUnavailableActive" => 'colorUnavailableActive_' . $key, "colorAvailableActive" => 'colorAvailableActive_' . $key, "colorAvailableInactive" => 'colorAvailableInactive_' . $key);
        ?>
					<script type="text/javascript">
						BX.ready(function(){
							window['trackBar<?php 
        echo $key;
        ?>
'] = new BX.Iblock.SmartFilter(<?php 
        echo CUtil::PhpToJSObject($arJsParams);
        ?>
);
						});
/*
##############################################
# Bitrix: SiteManager                        #
# Copyright (c) 2002-2004 Bitrix             #
# http://www.bitrixsoft.com                  #
# mailto:admin@bitrixsoft.com                #
##############################################
*/
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/mail/prolog.php";
$MOD_RIGHT = $APPLICATION->GetGroupRight("mail");
if ($MOD_RIGHT < "R") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
Bitrix\Main\Loader::includeModule('mail');
$err_mess = "File: " . __FILE__ . "<br>Line: ";
$sTableID = "t_mailbox_admin";
$oSort = new CAdminSorting($sTableID, "timestamp_x", "desc");
// инициализация сортировки
$lAdmin = new CAdminList($sTableID, $oSort);
// инициализация списка
$filter = new CAdminFilter($sTableID . "_filter_id", array(GetMessage("MAIL_MBOX_ADM_TYPE"), GetMessage("MAIL_MBOX_ADR"), "ID", GetMessage("MAIL_MBOX_ADM_USER_TYPE"), GetMessage("MAIL_MBOX_ADM_FILT_ACT"), GetMessage("MAIL_MBOX_ADM_FILT_LANG")));
$arFilterFields = array("find_name", "find_id", "find_user_type", "find_server", "find_server_type", "find_active", "find_lid");
if ($lAdmin->IsDefaultFilter()) {
    $find_user_type = 'admin';
    $set_filter = 'Y';
}
$lAdmin->InitFilter($arFilterFields);
//инициализация фильтра
$arFilter = array("ID" => $find_id, "NAME" => $find_name, "LID" => $find_lid, "SERVER_TYPE" => $find_server_type, "SERVER" => $find_server, "ACTIVE" => $find_active);
Beispiel #5
0
 public static function AgentCountDayOrders()
 {
     global $DB;
     if (Bitrix\Main\Loader::includeModule("sale")) {
         //count orders
         $arFilter = array("STATUS_ID" => array("F", "P"), "PAYED" => "Y");
         $dateFromTs = MakeTimeStamp(date("d", time() - 3600 * 24 * 2) . "." . date("m", time() - 3600 * 24 * 2) . "." . date("Y", time() - 3600 * 24 * 2) . " 23:59:59", "DD.MM.YYYY HH:MI:SS");
         $dateToTs = MakeTimeStamp(date("d") . "." . date("m") . "." . date("Y") . " 00:00:00", "DD.MM.YYYY HH:MI:SS");
         $arFilter[">DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateFromTs);
         $arFilter["<DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateToTs);
         $dbOrders = CSaleOrder::GetList(array(), $arFilter);
         $numOrders = $dbOrders->SelectedRowsCount();
         $newNumOrders = array("newDay" => $numOrders);
         $curNumOrders = Bitrix\Main\Config\Option::get("storeassist", "num_orders", "");
         if ($curNumOrders) {
             $curNumOrders = unserialize($curNumOrders);
         }
         $newNumOrders["prevDay"] = isset($curNumOrders["newDay"]) ? $curNumOrders["newDay"] : 0;
         Bitrix\Main\Config\Option::set("storeassist", "num_orders", serialize($newNumOrders), "");
         //count progress
         $progress = Bitrix\Main\Config\Option::get("storeassist", "progress_percent", 0);
         $newProgress = 0;
         if ($newNumOrders["newDay"] >= $newNumOrders["prevDay"] && $newNumOrders["newDay"] > 0) {
             $newProgress = ++$progress > 10 ? 10 : $progress;
         } else {
             $newProgress = --$progress > 0 ? $progress : 0;
         }
         Bitrix\Main\Config\Option::set("storeassist", "progress_percent", $newProgress, "");
     }
     return "CStoreAssist::AgentCountDayOrders();";
 }
Beispiel #6
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!Bitrix\Main\Loader::includeModule("disk")) {
    return;
}
if (WIZARD_B24_TO_CP) {
    $commonStorage = \Bitrix\Disk\Driver::getInstance()->getStorageByCommonId('shared_files_' . WIZARD_SITE_ID);
    if ($commonStorage) {
        $commonStorage->changeBaseUrl(WIZARD_SITE_DIR . 'docs/shared/');
        $commonStorageId = $commonStorage->getId();
    }
}
$driver = \Bitrix\Disk\Driver::getInstance();
$rightsManager = $driver->getRightsManager();
$taskIdEdit = $rightsManager->getTaskIdByName($rightsManager::TASK_EDIT);
$taskIdFull = $rightsManager->getTaskIdByName($rightsManager::TASK_FULL);
$employeeCode = 'G' . WIZARD_EMPLOYEES_GROUP;
if (CModule::IncludeModule("iblock")) {
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "departments"));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $dbUpdepartment = CIBlockSection::GetList(array(), array("SECTION_ID" => 0, "IBLOCK_ID" => $arIBlock["ID"]));
        if ($upDepartment = $dbUpdepartment->Fetch()) {
            $employeeCode = "DR" . $upDepartment['ID'];
        }
    }
}
//Common storage
$dbDisk = Bitrix\Disk\Storage::getList(array("filter" => array("ENTITY_ID" => "shared_files_" . WIZARD_SITE_ID)));
Beispiel #7
0
<?php

if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    die;
}
if (isset($_POST['SITE_ID']) && is_string($_POST['SITE_ID']) && preg_match('/^[A-Za-z0-9_]{2}$/', $_POST['SITE_ID']) === 1) {
    define('SITE_ID', $_POST['SITE_ID']);
}
define('STOP_STATISTICS', true);
//define("NOT_CHECK_PERMISSIONS", true);
define('PUBLIC_AJAX_MODE', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!(check_bitrix_sessid() && Bitrix\Main\Loader::includeModule('conversion'))) {
    die;
}
if (($referer = $_POST['HTTP_REFERER']) && is_string($referer)) {
    $_SERVER['HTTP_REFERER'] = $referer;
}
$context = Bitrix\Conversion\DayContext::getInstance();
$context->saveInstance();
$context->addDayCounter('conversion_visit_day', 1);
echo 'OK';
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
Beispiel #8
0
# mailto:admin@bitrixsoft.com                #
##############################################
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/storeassist/include.php";
IncludeModuleLangFile(__FILE__);
\Bitrix\Main\Loader::includeModule('storeassist');
if (!($APPLICATION->GetGroupRight("storeassist") >= "R")) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/storeassist/prolog.php";
$APPLICATION->SetTitle(GetMessage("STOREAS_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$APPLICATION->SetAdditionalCSS('/bitrix/panel/storeassist/storeassist.css');
CUtil::InitJSCore(array("fx", "storeassist"));
$catalogIblockId = "";
if (Bitrix\Main\Loader::includeModule("catalog")) {
    $dbCatalog = CCatalog::getList(array(), array("IBLOCK_ACTIVE" => "Y", "IBLOCK_TYPE_ID" => "catalog"));
    if ($arCatalog = $dbCatalog->Fetch()) {
        $catalogIblockId = $arCatalog["IBLOCK_ID"];
    }
}
$partnerUrl = Bitrix\Main\Config\Option::get("storeassist", "partner_url", "");
$arAssistSteps = array("MAIN" => array("BLOCKS" => array("BLOCK_1" => array("MAIN_ITEMS" => array("currencies" => array("path" => "/bitrix/admin/currencies.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("currency")), "cat_group_admin" => array("path" => "/bitrix/admin/cat_group_admin.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("catalog")), "cat_measure_list" => array("path" => "/bitrix/admin/cat_measure_list.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("catalog")), "sale_report_edit" => array("path" => "/bitrix/admin/sale_report_edit.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("sale")), "sale_person_type" => array("path" => "/bitrix/admin/sale_person_type.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("sale")), "sale_buyers" => array("path" => "/bitrix/admin/sale_buyers.php?lang=" . LANGUAGE_ID . "&pageid=sale_buyers&back=main_block_1#showtask", "available" => IsModuleInstalled("sale")), "sale_status" => array("path" => "/bitrix/admin/sale_status.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("sale")), "cat_store_list" => array("path" => "/bitrix/admin/cat_store_list.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => IsModuleInstalled("catalog")), "storeassist_social" => array("path" => "/bitrix/admin/storeassist_social.php?lang=" . LANGUAGE_ID . "&back=main_block_1#showtask", "available" => true)), "ADDITIONAL_ITEMS" => array()), "BLOCK_2" => array("MAIN_ITEMS" => array("cat_product_list" => array("path" => intval($catalogIblockId) ? "/bitrix/admin/cat_product_list.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $catalogIblockId . "&type=catalog&find_section_section=-1" : "/bitrix/admin/storeassist_new_items.php?lang=" . LANGUAGE_ID . "&pageid=cat_product_list&back=main_block_2#showtask", "available" => IsModuleInstalled("catalog")), "quantity" => array("path" => "/bitrix/admin/settings.php?lang=" . LANGUAGE_ID . "&mid=catalog&pageid=quantity&back=main_block_2#showtask", "available" => IsModuleInstalled("catalog")), "cat_store_document_list" => array("path" => "/bitrix/admin/cat_store_document_list.php?lang=" . LANGUAGE_ID . "&back=main_block_2#showtask", "available" => IsModuleInstalled("catalog")), "order_setting" => array("path" => "/bitrix/admin/settings.php?lang=" . LANGUAGE_ID . "&mid=sale&pageid=order_setting&back=main_block_2#showtask", "available" => IsModuleInstalled("sale")), "reserve_setting" => array("path" => "/bitrix/admin/settings.php?lang=" . LANGUAGE_ID . "&mid=catalog&pageid=reserve_setting&back=main_block_2#showtask", "available" => IsModuleInstalled("catalog"))), "ADDITIONAL_ITEMS" => array(), "TYPE" => "ONE"), "BLOCK_3" => array("MAIN_ITEMS" => array("storeassist_1c_catalog_fill" => array("path" => "/bitrix/admin/storeassist_1c_catalog_fill.php?lang=" . LANGUAGE_ID . "&back=main_block_3#showtask", "available" => true), "1c_integration" => array("path" => "/bitrix/admin/1c_admin.php?lang=" . LANGUAGE_ID . "&pageid=1c_integration&back=main_block_3#showtask", "available" => IsModuleInstalled("sale")), "storeassist_1c_unloading" => array("path" => "/bitrix/admin/storeassist_1c_unloading.php?lang=" . LANGUAGE_ID . "&back=main_block_3#showtask", "available" => true), "1c_exchange" => array("path" => "/bitrix/admin/1c_admin.php?lang=" . LANGUAGE_ID . "&pageid=1c_exchange&back=main_block_3#showtask", "available" => IsModuleInstalled("sale")), "storeassist_1c_exchange_realtime" => array("path" => "/bitrix/admin/storeassist_1c_exchange_realtime.php?lang=" . LANGUAGE_ID . "&back=main_block_3#showtask", "available" => true), "storeassist_1c_small_firm" => array("path" => "/bitrix/admin/storeassist_1c_small_firm.php?lang=" . LANGUAGE_ID . "&back=main_block_3#showtask", "available" => true)), "ADDITIONAL_ITEMS" => array(), "TYPE" => "TWO"), "BLOCK_4" => array("MAIN_ITEMS" => array("sale_pay_system" => array("path" => "/bitrix/admin/sale_pay_system.php?lang=" . LANGUAGE_ID . "&back=main_block_4#showtask", "available" => IsModuleInstalled("sale")), COption::GetOptionString("main", "~sale_converted_15", "") == "Y" ? "sale_delivery_service_list" : "sale_delivery" => array("path" => "/bitrix/admin/" . (COption::GetOptionString("main", "~sale_converted_15", "") == "Y" ? "sale_delivery_service_list" : "sale_delivery") . ".php?lang=" . LANGUAGE_ID . "&back=main_block_4#showtask", "available" => IsModuleInstalled("sale"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_5" => array("MAIN_ITEMS" => array("storeassist_seo_settings" => array("path" => "/bitrix/admin/storeassist_seo_settings.php?lang=" . LANGUAGE_ID . "&back=main_block_5#showtask", "available" => true), "seo_robots" => array("path" => "/bitrix/admin/seo_robots.php?lang=" . LANGUAGE_ID . "&back=main_block_5#showtask", "available" => IsModuleInstalled("seo")), "seo_sitemap" => array("path" => "/bitrix/admin/seo_sitemap.php?lang=" . LANGUAGE_ID . "&back=main_block_5#showtask", "available" => IsModuleInstalled("seo")), "seo_search_yandex" => array("path" => "/bitrix/admin/seo_search_yandex.php?lang=" . LANGUAGE_ID . "&back=main_block_5#showtask", "available" => IsModuleInstalled("seo")), "seo_search_google" => array("path" => "/bitrix/admin/seo_search_google.php?lang=" . LANGUAGE_ID . "&back=main_block_5#showtask", "available" => IsModuleInstalled("seo")), "search_reindex" => array("path" => "/bitrix/admin/search_reindex.php?lang=" . LANGUAGE_ID . "&back=main_block_5#showtask", "available" => IsModuleInstalled("search"))), "ADDITIONAL_ITEMS" => array()))), "WORK" => array("BLOCKS" => array("BLOCK_1" => array("MAIN_ITEMS" => array("storeassist_adaptive" => array("path" => "/bitrix/admin/storeassist_adaptive.php?lang=" . LANGUAGE_ID . "&back=work_block_1#showtask", "available" => true), "opening" => array("path" => "/bitrix/admin/settings.php?lang=" . LANGUAGE_ID . "&mid=main&pageid=opening&back=work_block_1#showtask", "available" => IsModuleInstalled("main")), "checklist" => array("path" => "/bitrix/admin/checklist.php?lang=" . LANGUAGE_ID . "&back=work_block_1#showtask", "available" => IsModuleInstalled("main"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_2" => array("MAIN_ITEMS" => array("cat_discount_admin" => array("path" => "/bitrix/admin/cat_discount_admin.php?lang=" . LANGUAGE_ID . "&back=work_block_2#showtask", "available" => IsModuleInstalled("catalog")), "posting_admin" => array("path" => "/bitrix/admin/posting_admin.php?lang=" . LANGUAGE_ID . "&back=work_block_2#showtask", "available" => IsModuleInstalled("subscribe"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_3" => array("MAIN_ITEMS" => array("cat_export_setup" => array("path" => "/bitrix/admin/cat_export_setup.php?lang=" . LANGUAGE_ID . "&back=work_block_3#showtask", "available" => IsModuleInstalled("catalog")), "sale_ymarket" => array("path" => "/bitrix/admin/sale_ymarket.php?lang=" . LANGUAGE_ID . "&back=work_block_3#showtask", "available" => IsModuleInstalled("sale"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_4" => array("MAIN_ITEMS" => array("sale_order" => array("path" => "/bitrix/admin/sale_order.php?lang=" . LANGUAGE_ID . "&back=work_block_4#showtask", "available" => IsModuleInstalled("sale")), "sale_report" => array("path" => "/bitrix/admin/sale_report.php?lang=" . LANGUAGE_ID . "&back=work_block_4#showtask", "available" => IsModuleInstalled("sale")), "client" => array("path" => "/bitrix/admin/sale_buyers.php?lang=" . LANGUAGE_ID . "&pageid=client&back=work_block_4", "available" => IsModuleInstalled("sale")), "sale_account_admin" => array("path" => "/bitrix/admin/sale_account_admin.php?lang=" . LANGUAGE_ID . "&back=work_block_4#showtask", "available" => IsModuleInstalled("sale")), "sale_basket" => array("path" => "/bitrix/admin/sale_basket.php?lang=" . LANGUAGE_ID . "&back=work_block_4#showtask", "available" => IsModuleInstalled("sale"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_5" => array("MAIN_ITEMS" => array("sale_personalization" => array("path" => "/bitrix/admin/sale_personalization.php?lang=" . LANGUAGE_ID . "&back=work_block_5#showtask", "available" => IsModuleInstalled("sale"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_6" => array("MAIN_ITEMS" => array("blog_comment" => array("path" => "/bitrix/admin/blog_comment.php?lang=" . LANGUAGE_ID . "&back=work_block_6#showtask", "available" => IsModuleInstalled("blog")), "ticket_desktop" => array("path" => "/bitrix/admin/ticket_desktop.php?lang=" . LANGUAGE_ID . "&back=work_block_6#showtask", "available" => IsModuleInstalled("support"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_7" => array("MAIN_ITEMS" => array("sale_crm" => array("path" => "/bitrix/admin/sale_crm.php?lang=" . LANGUAGE_ID . "&back=work_block_6#showtask", "available" => IsModuleInstalled("sale")), "storeassist_crm_client" => array("path" => "/bitrix/admin/storeassist_crm_client.php?lang=" . LANGUAGE_ID . "&back=work_block_7#showtask", "available" => true), "storeassist_crm_calls" => array("path" => "/bitrix/admin/storeassist_crm_calls.php?lang=" . LANGUAGE_ID . "&back=work_block_7#showtask", "available" => true)), "ADDITIONAL_ITEMS" => array()))), "HEALTH" => array("BLOCKS" => array("BLOCK_1" => array("MAIN_ITEMS" => array("site_speed" => array("path" => "/bitrix/admin/site_speed.php?lang=" . LANGUAGE_ID . "&back=health_block_1#showtask", "available" => IsModuleInstalled("main")), "composite" => array("path" => "/bitrix/admin/composite.php?lang=" . LANGUAGE_ID . "&back=health_block_1#showtask", "available" => IsModuleInstalled("main")), "bitrixcloud_cdn" => array("path" => "/bitrix/admin/bitrixcloud_cdn.php?lang=" . LANGUAGE_ID . "&back=health_block_1#showtask", "available" => IsModuleInstalled("bitrixcloud")), "perfmon_panel" => array("path" => "/bitrix/admin/perfmon_panel.php?lang=" . LANGUAGE_ID . "&back=health_block_1#showtask", "available" => IsModuleInstalled("perfmon"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_2" => array("MAIN_ITEMS" => array("security_filter" => array("path" => "/bitrix/admin/security_filter.php?lang=" . LANGUAGE_ID . "&back=health_block_2#showtask", "available" => IsModuleInstalled("security")), "dump_auto" => array("path" => "/bitrix/admin/dump_auto.php?lang=" . LANGUAGE_ID . "&back=health_block_2#showtask", "available" => IsModuleInstalled("main")), "security_scanner" => array("path" => "/bitrix/admin/security_scanner.php?lang=" . LANGUAGE_ID . "&back=health_block_2#showtask", "available" => IsModuleInstalled("security")), "bitrixcloud_monitoring_admin" => array("path" => "/bitrix/admin/bitrixcloud_monitoring_admin.php?lang=" . LANGUAGE_ID . "&back=health_block_2#showtask", "available" => IsModuleInstalled("bitrixcloud")), "security_otp" => array("path" => "/bitrix/admin/security_otp.php?lang=" . LANGUAGE_ID . "&back=health_block_2#showtask", "available" => IsModuleInstalled("security"))), "ADDITIONAL_ITEMS" => array()), "BLOCK_3" => array("MAIN_ITEMS" => array("scale_graph" => array("path" => "/bitrix/admin/scale_graph.php?lang=" . LANGUAGE_ID . "&back=health_block_3#showtask", "available" => IsModuleInstalled("scale")), "cluster_index" => array("path" => "/bitrix/admin/cluster_index.php?lang=" . LANGUAGE_ID . "&back=health_block_3#showtask", "available" => IsModuleInstalled("cluster")), "storeassist_virtual" => array("path" => "/bitrix/admin/storeassist_virtual.php?lang=" . LANGUAGE_ID . "&back=health_block_3#showtask", "available" => true)), "ADDITIONAL_ITEMS" => array()), "BLOCK_4" => array("MAIN_ITEMS" => array("site_checker" => array("path" => "/bitrix/admin/site_checker.php?lang=" . LANGUAGE_ID . "&back=health_block_4#showtask", "available" => IsModuleInstalled("main")), "info_vk" => array("path" => "https://vk.com/topic-23581648_24910930", "available" => true), "info_blog" => array("path" => "https://dev.1c-bitrix.ru/community/blogs/product_features/", "available" => true), "info_forum_guest" => array("path" => "https://dev.1c-bitrix.ru/community/forums/forum6/", "available" => true), "info_forum_client" => array("path" => "https://dev.1c-bitrix.ru/community/forums/forum7/", "available" => true), "info_idea" => array("path" => "https://idea.1c-bitrix.ru/category/bitrix/", "available" => true), "info_user_doc" => array("path" => "https://dev.1c-bitrix.ru/user_help/", "available" => true), "info_api_doc" => array("path" => "https://dev.1c-bitrix.ru/api_help/", "available" => true), "support_bitrix" => array("path" => "https://www.1c-bitrix.ru/support/", "available" => true), "info_courses" => array("path" => "http://dev.1c-bitrix.ru/learning/index.php", "available" => true), "support_developer" => array("path" => htmlspecialcharsbx($partnerUrl), "available" => $partnerUrl ? true : false)), "ADDITIONAL_ITEMS" => array()))));
//option of checked items
$arStoreAssistOption = CStoreAssist::getSettingOption();
//check Opening item
if (!in_array("opening", $arStoreAssistOption)) {
    if (Bitrix\Main\Config\Option::get("main", "site_stopped", "N") == "N") {
        CStoreAssist::setSettingOption("opening", "Y");
        $arStoreAssistOption[] = "opening";
    }
Beispiel #9
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
IncludeModuleLangFile(__FILE__);
Bitrix\Main\Loader::includeModule('abtest');
$conversionAvailable = Bitrix\Main\Loader::includeModule('conversion');
$arLang = $APPLICATION->getLang();
if (!$USER->canDoOperation('view_other_settings')) {
    $APPLICATION->authForm(getMessage('ACCESS_DENIED'));
}
$isAdmin = $USER->canDoOperation('edit_php');
$ID = intval($ID);
$abtest = Bitrix\ABTest\ABTestTable::getList(array('filter' => array('=ID' => $ID), 'select' => array('*', 'USER_NAME' => 'USER.NAME', 'USER_LAST_NAME' => 'USER.LAST_NAME', 'USER_SECOND_NAME' => 'USER.SECOND_NAME', 'USER_TITLE' => 'USER.TITLE', 'USER_LOGIN' => 'USER.LOGIN')))->fetch();
if (empty($abtest) || $abtest['ENABLED'] != 'Y') {
    $APPLICATION->setTitle(empty($abtest['NAME']) ? str_replace('#ID#', $ID, getMessage('ABTEST_REPORT_TITLE1')) : str_replace('#NAME#', $abtest['NAME'], getMessage('ABTEST_REPORT_TITLE2')));
    $message = new CAdminMessage(array('MESSAGE' => getMessage('ABTEST_REPORT_NOTFOUND'), 'DETAILS' => getMessage('ABTEST_REPORT_DISABLED')));
    require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_after.php';
    echo $message->Show();
    require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php';
    return;
}
if ($abtest['ACTIVE'] == 'Y') {
    $active_test = $abtest;
} else {
    $active_test = Bitrix\ABTest\ABTestTable::getList(array('order' => array('SORT' => 'ASC'), 'filter' => array('SITE_ID' => $abtest['SITE_ID'], 'ACTIVE' => 'Y')))->fetch();
}
$arGraphData = array();
if ($conversionAvailable) {
    $conversionRates = Bitrix\Conversion\RateManager::getTypes(array('ACTIVE' => true));
}
if (!empty($conversionRates)) {
<?php

IncludeModuleLangFile(__FILE__);
Bitrix\Main\Loader::includeModule("iblock");
require_once "lib/mymanag.php";
require_once "lib/myzyavki.php";
require_once "lib/mystrzai.php";
Beispiel #11
0
<?php

if (!Defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
/**
 * @var $APPLICATION CAllMain
 * @var $USER CAllUser
 */
Bitrix\Main\Loader::includeModule("mobileapp");
Bitrix\Main\Loader::includeModule("mobile");
Bitrix\MobileApp\Mobile::Init();
include dirname(__FILE__) . "/functions.php";
defineApiVersion();
$isSessidValid = true;
if (array_key_exists("sessid", $_REQUEST) && strlen($_REQUEST["sessid"]) > 0) {
    $isSessidValid = check_bitrix_sessid();
}
if ($_REQUEST["mobile_action"]) {
    $APPLICATION->RestartBuffer();
    $action = $_REQUEST["mobile_action"];
    $actionList = new Bitrix\Mobile\Action();
    $actionList->executeAction($action, $arParams);
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
    die;
} elseif ($_REQUEST["captcha_sid"]) {
    $APPLICATION->RestartBuffer();
    $actionList = new Bitrix\Mobile\Action();
    $actionList->executeAction("get_captcha", $arParams);
    die;
} elseif ($_REQUEST["manifest_id"]) {
Beispiel #12
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_before.php';
IncludeModuleLangFile(__FILE__);
Bitrix\Main\Loader::includeModule('abtest');
$error = getMessage('ACCESS_DENIED');
if ($USER->canDoOperation('edit_php')) {
    $error = false;
    $arSites = array();
    $dbSites = Bitrix\Main\SiteTable::getList(array('select' => array('LID')));
    while ($arSite = $dbSites->fetch()) {
        $arSites[] = $arSite['LID'];
    }
    switch ($_REQUEST['action']) {
        case 'copy':
            $site = isset($_REQUEST['site']) ? $_REQUEST['site'] : null;
            $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
            $source = isset($_REQUEST['source']) ? $_REQUEST['source'] : null;
            if (!check_bitrix_sessid()) {
                $error = getMessage('ABTEST_CSRF_ERROR');
            }
            if (empty($site) || empty($type) || empty($source)) {
                $error = getMessage('ABTEST_AJAX_ERROR');
            }
            if (!in_array($type, array('page'))) {
                $error = getMessage('ABTEST_AJAX_ERROR');
            }
            if (!in_array($site, $arSites)) {
                $error = getMessage('ABTEST_AJAX_ERROR');
            }
            if ($error === false) {
				'GLOBAL_ACTIVE' => 'Y',
			);
			if (0 < intval($arResult['VARIABLES']['SECTION_ID'])) {
				$arFilter['ID'] = $arResult['VARIABLES']['SECTION_ID'];
			}
			elseif ('' != $arResult['VARIABLES']['SECTION_CODE']) {
				$arFilter['=CODE'] = $arResult['VARIABLES']['SECTION_CODE'];
			}

			$obCache = new CPHPCache();
			if ($obCache->InitCache(36000, serialize($arFilter), '/iblock/catalog')) {
				$arCurSection = $obCache->GetVars();
			}
			elseif ($obCache->StartDataCache()) {
				$arCurSection = array();
				if (Bitrix\Main\Loader::includeModule('iblock')) {
					$dbRes = CIBlockSection::GetList(array(), $arFilter, false, array('ID'));
					if(defined('BX_COMP_MANAGED_CACHE')) {
						global $CACHE_MANAGER;
						$CACHE_MANAGER->StartTagCache('/iblock/catalog');

						if ($arCurSection = $dbRes->Fetch()) {
							$CACHE_MANAGER->RegisterTag('iblock_id_'.$arParams['IBLOCK_ID']);
						}
						$CACHE_MANAGER->EndTagCache();
					}
					else {
						if(!$arCurSection = $dbRes->Fetch()) {
							$arCurSection = array();
						}
					}
Beispiel #14
0
<?php

/**
 * @var  CUser $USER
 * @var  CMain $APPLICATION
 */
use Bitrix\Main\Localization\Loc;
use Bitrix\Sale\Helpers\Admin;
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
$saleOrder = null;
$moduleId = "sale";
$errorMsgs = array();
Loc::loadMessages(__FILE__);
Bitrix\Main\Loader::includeModule('sale');
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
$arUserGroups = $USER->GetUserGroupArray();
if ($saleModulePermissions == "D") {
    $APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/lib/helpers/admin/orderedit.php";
$allowedStatusesView = array();
//load order
if (!empty($_REQUEST["ID"]) && intval($_REQUEST["ID"]) > 0) {
    $saleOrder = Bitrix\Sale\Order::load($_REQUEST["ID"]);
}
if ($saleOrder) {
    $allowedStatusesView = \Bitrix\Sale\OrderStatus::getStatusesUserCanDoOperations($USER->GetID(), array('view'));
}
if (!$saleOrder || !in_array($saleOrder->getField("STATUS_ID"), $allowedStatusesView)) {
    LocalRedirect("/bitrix/admin/sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_", false));
Beispiel #15
0
    $arSubIBlock = CIBlock::GetArrayByID($intSubIBlockID);
    $arSubIBlock["SITE_ID"] = array();
    $rsSites = CIBlock::GetSite($intSubIBlockID);
    while ($arSite = $rsSites->Fetch()) {
        $arSubIBlock["SITE_ID"][] = $arSite["LID"];
    }
    $strSubIBlockType = $arSubIBlock['IBLOCK_TYPE_ID'];
    $arSubIBlockType = CIBlockType::GetByIDLang($strSubIBlockType, LANGUAGE_ID);
    $boolIncludeOffers = CIBlockRights::UserHasRightTo($intSubIBlockID, $intSubIBlockID, "iblock_admin_display");
    $arSubCatalog = CCatalogSKU::GetInfoByOfferIBlock($arMainCatalog['IBLOCK_ID']);
    $boolSubCatalog = !empty($arSubCatalog) && is_array($arSubCatalog);
    if (!$boolCatalogRead && !$boolCatalogPrice) {
        $boolSubCatalog = false;
    }
    $boolSubWorkFlow = Bitrix\Main\Loader::includeModule("workflow") && $arSubIBlock["WORKFLOW"] != "N";
    $boolSubBizproc = Bitrix\Main\Loader::includeModule("bizproc") && $arSubIBlock["BIZPROC"] != "N";
    $intSubPropValue = 0 == $ID || $bCopy ? '-' . $TMP_ID : $ID;
    $strSubTMP_ID = $TMP_ID;
    $strSubElementAjaxPath = '/bitrix/admin/iblock_subelement_admin.php?WF=Y&IBLOCK_ID=' . $intSubIBlockID . '&type=' . urlencode($strSubIBlockType) . '&lang=' . LANGUAGE_ID . '&find_section_section=0&find_el_property_' . $arSubCatalog['SKU_PROPERTY_ID'] . '=' . (0 == $ID || $bCopy ? '-' . $TMP_ID : $ID) . '&TMP_ID=' . urlencode($strSubTMP_ID);
    if ($boolIncludeOffers && file_exists($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/iblock/admin/templates/iblock_subelement_list.php')) {
        require $_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/iblock/admin/templates/iblock_subelement_list.php';
    } else {
        ShowError(GetMessage('IBLOCK_EL_OFFERS_ACCESS_DENIED'));
    }
    ?>
</td></tr><?php 
    $tabControl->EndCustomField('OFFERS', '');
}
if ($arShowTabs['product_set']) {
    $tabControl->BeginNextFormTab();
    $tabControl->BeginCustomField('PRODUCT_SET', GetMessage('IBLOCK_EL_PRODUCT_SET') . ':', false);
<?if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED!==true) die();

if(!Bitrix\Main\Loader::includeModule('iblock')
	|| !Bitrix\Main\Loader::includeModule('catalog')){
	return;
}

$arIBlock = array();
$rsIBlock = CIBlock::GetList(array('SORT' => 'ASC'), array('ACTIVE' => 'Y'));
while ($arr = $rsIBlock->Fetch()){
	$arIBlock[$arr['ID']] = '['.$arr['ID'].'] '.$arr['NAME'];
}

$arPopupDetailVariable = array(
	'ON_IMAGE' => getMessage('POPUP_DETAIL_VARIABLE_IMAGE'),
	'ON_LUPA' => getMessage('POPUP_DETAIL_VARIABLE_LUPA'),
	'ON_NONE' => getMessage('POPUP_DETAIL_VARIABLE_NONE'),
);
$arSectionDescrValues = array(
	'-' => getMessage('RS_SLINE.UNDEFINED'),
	'top' => getMessage('RS_SLINE.SHOW_SECTION_DESCRIPTION_TOP'),
	'bottom' => getMessage('RS_SLINE.SHOW_SECTION_DESCRIPTION_BOTTOM'),
);

$arPriceFor = array(
	'products' => getMessage('FILTER_PRICE_GROUPED_FOR_PRIDUCTS'),
	'sku' => getMessage('FILTER_PRICE_GROUPED_FOR_SKU'),
);

$defaultListValues = array('-' => getMessage('RS_SLINE.UNDEFINED'));
Beispiel #17
0
 function Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     Bitrix\Main\Loader::includeModule('mail');
     $db_msg = Bitrix\Mail\MailMessageTable::getList(array('select' => array('ID'), 'filter' => array('MAILBOX_ID' => $ID)));
     while ($msg = $db_msg->Fetch()) {
         if (!CMailMessage::Delete($msg["ID"])) {
             return false;
         }
     }
     $db_flt = CMailFilter::GetList(array(), array("MAILBOX_ID" => $ID));
     while ($flt = $db_flt->Fetch()) {
         if (!CMailFilter::Delete($flt["ID"])) {
             return false;
         }
     }
     $db_mbox = CMailbox::GetList(array('ID' => $ID, 'ACTIVE' => 'Y', '!USER_ID' => 0));
     if ($mbox = $db_mbox->fetch()) {
         CUserCounter::Clear($mbox['USER_ID'], 'mail_unseen', $mbox['LID']);
         CUserOptions::DeleteOption('global', 'last_mail_check_' . $mbox['LID'], false, $mbox['USER_ID']);
         CUserOptions::DeleteOption('global', 'last_mail_check_success_' . $mbox['LID'], false, $mbox['USER_ID']);
     }
     CAgent::RemoveAgent("CMailbox::CheckMailAgent(" . $ID . ");", "mail");
     $strSql = "DELETE FROM b_mail_log WHERE MAILBOX_ID=" . $ID;
     if (!$DB->Query($strSql, true)) {
         return false;
     }
     $strSql = "DELETE FROM b_mail_message_uid WHERE MAILBOX_ID=" . $ID;
     if (!$DB->Query($strSql, true)) {
         return false;
     }
     CMailbox::SMTPReload();
     $strSql = "DELETE FROM b_mail_mailbox WHERE ID=" . $ID;
     return $DB->Query($strSql, true);
 }