3define(
'STOP_STATISTICS',
true);
4define(
'NO_AGENT_CHECK',
true);
5define(
'PUBLIC_AJAX_MODE',
true);
11require_once(
$_SERVER[
'DOCUMENT_ROOT'].
'/bitrix/modules/main/include/prolog_admin_before.php');
13Loc::loadMessages(__FILE__);
18 ShowError(Loc::getMessage(
'SALE_BASKET_DISCOUNT_CONVERT_ERRORS_RIGHTS'));
24 ShowError(Loc::getMessage(
'SALE_BASKET_DISCOUNT_CONVERT_ERRORS_INCORRECT_SESSION'));
28if (!Loader::includeModule(
'sale'))
30 ShowError(Loc::getMessage(
'SALE_BASKET_DISCOUNT_CONVERT_ERRORS_MODULE_SALE_ABSENT'));
34if (!Loader::includeModule(
'catalog'))
36 ShowError(Loc::getMessage(
'SALE_BASKET_DISCOUNT_CONVERT_ERRORS_MODULE_CATALOG_ABSENT'));
41$request = Main\Context::getCurrent()->getRequest();
44 $request->getRequestMethod() ==
'GET'
55 'sessID' =>
$request[
'ajaxSessionID'],
56 'maxExecutionTime' =>
$request[
'maxExecutionTime'],
57 'maxOperationCounter' =>
$request[
'maxOperationCounter'],
59 'operationCounter' =>
$request[
'operationCounter'],
69 $basketDiscount->setFilter(
$filter);
70 $basketDiscount->run();
71 $result = $basketDiscount->saveStep();
84 if ($adminNotifyIterator)
86 if ($adminNotify = $adminNotifyIterator->Fetch())
90 unset($adminNotifyIterator);
92 header(
'Content-Type: application/x-javascript; charset='.
LANG_CHARSET);
93 echo CUtil::PhpToJSObject(
$result,
false,
true);
94 require(
$_SERVER[
'DOCUMENT_ROOT'].
'/bitrix/modules/main/include/epilog_admin_after.php');
98 $APPLICATION->SetTitle(Loc::getMessage(
'SALE_BASKET_DISCOUNT_CONVERT_PAGE_TITLE'));
106 if ($adminNotifyIterator)
108 if ($adminNotify = $adminNotifyIterator->Fetch())
112 unset($adminNotifyIterator);
115 require(
$_SERVER[
'DOCUMENT_ROOT'].
'/bitrix/modules/main/include/prolog_admin_after.php');
118 array(
'DIV' =>
'basketDiscountTab01',
'TAB' => Loc::getMessage(
'SALE_BASKET_DISCOUNT_TAB'),
'ICON' =>
'sale',
'TITLE' => Loc::getMessage(
'SALE_BASKET_DISCOUNT_TAB_TITLE'))
122 Main\Page\Asset::getInstance()->addJs(
'/bitrix/js/catalog/step_operations.js');
123 Main\Page\Asset::getInstance()->addJs(
'/bitrix/js/sale/admin/step_operations.js');
129 ?><div
id=
"basket_discount_empty_orders" style=
"display: <?=($ordersCounter == 0 ? 'block' : 'none'); ?>;"><?
130 ShowNote(Loc::getMessage(
'SALE_BASKET_DISCOUNT_MESS_ORDERS_ABSENT'));
132 <div
id=
"basket_discount_result_div" style=
"margin:0; display: none;"></div>
133 <div
id=
"basket_discount_error_div" style=
"margin:0; display: none;">
134 <div
class=
"adm-info-message-wrap adm-info-message-red">
135 <div
class=
"adm-info-message">
136 <div
class=
"adm-info-message-title"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_ERRORS_TITLE'); ?></div>
137 <div
id=
"basket_discount_error_cont"></div>
138 <div
class=
"adm-info-message-icon"></div>
142 <form name=
"basket_discount_form" action=
"<? echo $APPLICATION->GetCurPage(); ?>" method=
"GET"><?
146 <td
width=
"40%"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_MAX_EXECUTION_TIME')?></td>
147 <td><input type=
"text" name=
"max_execution_time" id=
"max_execution_time" size=
"3" value=
"<?echo $oneStepTime; ?>"></td>
150 <td colspan=
"2"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER'); ?></td>
153 <td
width=
"40%"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_TYPE') ?></td>
155 <
select name=
"filter_type" id=
"filter_type">
156 <option value=
"all" selected><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_TYPE_ALL'); ?></option>
157 <option value=
"id"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_TYPE_ID'); ?></option>
158 <option value=
"date" selected><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_TYPE_DATE'); ?></option>
162 <tr
id=
"tr_filter_id" style=
"display: none;">
163 <td
width=
"40%"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_ORDER_ID_RANGE') ?></td>
165 echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_RANGE_FROM');
166 ?>&
nbsp;<input type=
"text" name=
"order_id_from" id=
"order_id_from" size=
"5">&
nbsp;<?
167 echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_RANGE_TO');
168 ?>&
nbsp;<input type=
"text" name=
"order_id_to" id=
"order_id_to" size=
"5">
171 <tr
id=
"tr_filter_date" style=
"display: table-row;">
172 <td
width=
"40%"><? echo Loc::getMessage(
'SALE_BASKET_DISCOUNT_FILTER_DATE_RANGE') ?></td>
176 'order_date_from',
'order_date_to',
185 <input type=
"button" id=
"start_button" value=
"<? echo Loc::getMessage('SALE_BASKET_DISCOUNT_UPDATE_BTN')?>" disabled>
186 <input type=
"button" id=
"stop_button" value=
"<? echo Loc::getMessage('SALE_BASKET_DISCOUNT_STOP_BTN')?>" disabled>
193 'ajaxSessionID' =>
'basketDiscountConv',
195 'maxOperationCounter' => 10,
199 'startBtnID' =>
'start_button',
200 'stopBtnID' =>
'stop_button',
201 'resultContID' =>
'basket_discount_result_div',
202 'errorContID' =>
'basket_discount_error_cont',
203 'errorDivID' =>
'basket_discount_error_div',
204 'timeFieldID' =>
'max_execution_time',
205 'emptyOrdersId' =>
'basket_discount_empty_orders'
207 'ajaxParams' =>
array(
214 'order_date_from_calendar_from',
215 'order_date_to_calendar_to'
220 var jsBasketDiscountConverter =
new BX.Sale.Admin.StepOperations.StepOperationsFilter(<? echo CUtil::PhpToJSObject(
$jsParams,
false,
true); ?>);
222 var filterType = BX(
'filter_type'),
223 filterId = BX(
'tr_filter_id'),
224 filterDate = BX(
'tr_filter_date');
227 BX.bind(filterType,
'change',
function(){
228 BX.style(filterId,
'display', (filterType.value ==
'id' ?
'table-row' :
'none'));
229 BX.style(filterDate,
'display', (filterType.value ==
'date' ?
'table-row' :
'none'));
235 require(
$_SERVER[
'DOCUMENT_ROOT'].
'/bitrix/modules/main/include/epilog_admin.php');
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
static CalendarPeriodCustom($sFromName, $sToName, $sFromVal="", $sToVal="", $bSelectShow=false, $size=10, $bTime=false, $arPeriod=false, $periodValue='')
static GetList($arSort=[], $arFilter=[])
static getDefaultExecutionTime()
static Init($arExt=array(), $bReturn=false)
static getFilterCounter($filter)
static checkFilter(Main\HttpRequest $request)
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Form FILTER_ACTION disabled
$_SERVER["DOCUMENT_ROOT"]
check_bitrix_sessid($varname='sessid')
ShowError($strError, $cls="errortext")
ShowNote($strNote, $cls="notetext")
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']