" OnClick="RestoreDefaults();" value="<?php echo GetMessage("MAIN_RESTORE_DEFAULTS"); ?> "> <?php $tabControl->End(); ?> </form> <h2><?php echo GetMessage("SALE_SYSTEM_PROCEDURES"); ?> </h2> <?php $showbasketDiscountConvert = (string) Main\Config\Option::get('sale', 'basket_discount_converted') != 'Y' && Main\ModuleManager::isModuleInstalled('catalog'); if ($showbasketDiscountConvert) { if (CSaleBasketDiscountConvert::getAllCounter() == 0) { $adminNotifyIterator = CAdminNotify::GetList(array(), array('MODULE_ID' => 'sale', 'TAG' => 'BASKET_DISCOUNT_CONVERTED')); if ($adminNotifyIterator) { if ($adminNotify = $adminNotifyIterator->Fetch()) { CAdminNotify::Delete($adminNotify['ID']); } unset($adminNotify); } unset($adminNotifyIterator); $showbasketDiscountConvert = false; } } $systemTabs[] = array('DIV' => 'saleSysTabReindex', 'TAB' => GetMessage('SALE_SYSTEM_TAB_REINDEX'), 'ICON' => 'sale_settings', 'TITLE' => GetMessage('SALE_SYSTEM_TAB_REINDEX_TITLE')); if ($showbasketDiscountConvert) { $systemTabs[] = array('DIV' => 'saleSysTabConvert', 'TAB' => GetMessage('SALE_SYSTEM_TAB_CONVERT'), 'ICON' => 'sale_settings', 'TITLE' => GetMessage('SALE_SYSTEM_TAB_CONVERT_TITLE')); }
if (!Loader::includeModule('catalog')) { require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_after.php'; ShowError(Loc::getMessage('SALE_BASKET_DISCOUNT_CONVERT_ERRORS_MODULE_CATALOG_ABSENT')); require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php'; die; } /** @var $request Main\HttpRequest */ $request = Main\Context::getCurrent()->getRequest(); if ($request->getRequestMethod() == 'GET' && ($request['operation'] == 'Y' || $request['getCount'] == 'Y')) { CUtil::JSPostUnescape(); $filter = array(); $filter = CSaleBasketDiscountConvert::checkFilter($request); $result = array(); if ($request['operation'] == 'Y') { $params = array('sessID' => $request['ajaxSessionID'], 'maxExecutionTime' => $request['maxExecutionTime'], 'maxOperationCounter' => $request['maxOperationCounter'], 'counter' => $request['counter'], 'operationCounter' => $request['operationCounter'], 'lastID' => $request['lastID']); $basketDiscount = new CSaleBasketDiscountConvert($params['sessID'], $params['maxExecutionTime'], $params['maxOperationCounter']); $basketDiscount->initStep($params['counter'], $params['operationCounter'], $params['lastID']); $basketDiscount->setFilter($filter); $basketDiscount->run(); $result = $basketDiscount->saveStep(); } if ($request['getCount'] == 'Y') { $result = array('counter' => CSaleBasketDiscountConvert::getFilterCounter($filter)); } header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET); echo CUtil::PhpToJSObject($result, false, true); require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin_after.php'; } else { $APPLICATION->SetTitle(Loc::getMessage('SALE_BASKET_DISCOUNT_CONVERT_PAGE_TITLE')); $ordersCounter = CSaleBasketDiscountConvert::getAllCounter(); $oneStepTime = CSaleBasketDiscountConvert::getDefaultExecutionTime();