1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sets_available.php
См. документацию.
1<?php
4const STOP_STATISTICS = true;
5const NO_AGENT_CHECK = true;
6const PUBLIC_AJAX_MODE = true;
7
11use Bitrix\Main;
14
15require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_before.php');
16
17Loc::loadMessages(__FILE__);
18
19if (
20 !Loader::includeModule('catalog')
21 || !AccessController::getCurrent()->check(ActionDictionary::ACTION_PRICE_EDIT)
22 || !Catalog\Config\Feature::isProductSetsEnabled()
23)
24{
25 ShowError(Loc::getMessage('CAT_SETS_AVAILABLE_ERRORS_FATAL'));
26 die();
27}
28if (
29 $_SERVER['REQUEST_METHOD'] == 'GET'
31 && (isset($_REQUEST['operation']) && !is_array($_REQUEST['operation']) && (string)$_REQUEST['operation'] == 'Y')
32)
33{
34 $params = array(
35 'sessID' => $_GET['ajaxSessionID'],
36 'maxExecutionTime' => $_GET['maxExecutionTime'],
37 'maxOperationCounter' => $_GET['maxOperationCounter'],
38 'counter' => $_GET['counter'],
39 'operationCounter' => $_GET['operationCounter'],
40 'lastID' => $_GET['lastID']
41 );
42
43 $setsAvailable = new CCatalogProductSetAvailable($params['sessID'], $params['maxExecutionTime'], $params['maxOperationCounter']);
44 $setsAvailable->initStep($params['counter'], $params['operationCounter'], $params['lastID']);
45 $setsAvailable->run();
46 $result = $setsAvailable->saveStep();
47
48 if ($result['finishOperation'])
49 {
50 $adminNotifyIterator = CAdminNotify::GetList(array(), array('MODULE_ID'=>'catalog', 'TAG' => 'CATALOG_SETS_AVAILABLE'));
51 if ($adminNotify = $adminNotifyIterator->Fetch())
52 {
53 CAdminNotify::DeleteByTag('CATALOG_SETS_AVAILABLE');
54 }
55 }
56 header('Content-Type: application/x-javascript; charset='.LANG_CHARSET);
57 echo CUtil::PhpToJSObject($result, false, true);
58 require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_admin_after.php');
59}
60else
61{
62 $APPLICATION->SetTitle(Loc::getMessage('CAT_SETS_AVAILABLE_PAGE_TITLE'));
63
66
67 require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_after.php');
68
70 array(
71 'DIV' => 'setTab01',
72 'TAB' => Loc::getMessage('CAT_SETS_AVAILABLE_TAB'),
73 'ICON' => 'catalog',
74 'TITLE' => Loc::getMessage('CAT_SETS_AVAILABLE_TAB_TITLE')
75 )
76 );
77 $tabControl = new CAdminTabControl('sets_available', $tabList, true, true);
78 Main\Page\Asset::getInstance()->addJs('/bitrix/js/catalog/step_operations.js');
79
80 ?><div id="sets_result_div" style="margin:0; display: none;"></div>
81 <div id="sets_error_div" style="margin:0; display: none;">
82 <div class="adm-info-message-wrap adm-info-message-red">
83 <div class="adm-info-message">
84 <div class="adm-info-message-title"><?= Loc::getMessage('CAT_SETS_AVAILABLE_ERRORS_TITLE') ?></div>
85 <div id="sets_error_cont"></div>
86 <div class="adm-info-message-icon"></div>
87 </div>
88 </div>
89 </div>
90 <form name="sets_available_form" action="<?= $APPLICATION->GetCurPage() ?>" method="POST"><?php
91 $tabControl->Begin();
92 $tabControl->BeginNextTab();
93 ?><tr>
94 <td width="40%"><?= Loc::getMessage('CAT_SETS_AVAILABLE_MAX_EXECUTION_TIME') ?></td>
95 <td><input type="text" name="max_execution_time" id="max_execution_time" size="3" value="<?= $oneStepTime ?>"></td>
96 </tr><?php
97 $tabControl->Buttons();
98 ?>
99 <input type="button" id="start_button" value="<?= Loc::getMessage('CAT_SETS_AVAILABLE_UPDATE_BTN') ?>"<?= ($setsCounter > 0 ? '' : ' disabled') ?>>
100 <input type="button" id="stop_button" value="<?= Loc::getMessage('CAT_SETS_AVAILABLE_STOP_BTN') ?>" disabled>
101 <?php
102 $tabControl->End();
103 ?></form><?php
105 'url' => $APPLICATION->GetCurPage(),
106 'options' => array(
107 'ajaxSessionID' => 'setsConv',
108 'maxExecutionTime' => $oneStepTime,
109 'maxOperationCounter' => 10,
110 'counter' => $setsCounter
111 ),
112 'visual' => array(
113 'startBtnID' => 'start_button',
114 'stopBtnID' => 'stop_button',
115 'resultContID' => 'sets_result_div',
116 'errorContID' => 'sets_error_cont',
117 'errorDivID' => 'sets_error_div',
118 'timeFieldID' => 'max_execution_time'
119 ),
120 'ajaxParams' => array(
121 'operation' => 'Y'
122 )
123 );
124 ?>
125<script>
126var jsStepOperations = new BX.Catalog.StepOperations(<?= CUtil::PhpToJSObject($jsParams, false, true) ?>);
127</script>
128 <?php
129 require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php');
130}
global $APPLICATION
Определения include.php:80
const PUBLIC_AJAX_MODE
Определения catalog_reindex.php:6
$jsParams
Определения catalog_reindex.php:168
$tabList
Определения catalog_reindex.php:107
$oneStepTime
Определения catalog_reindex.php:103
Определения loader.php:13
static GetList($arSort=[], $arFilter=[])
Определения admin_notify.php:207
static DeleteByTag($tagId)
Определения admin_notify.php:146
static getAllCounter()
Определения step_operations.php:281
static getDefaultExecutionTime()
Определения step_operations.php:162
static PhpToJSObject($arData, $bWS=false, $bSkipTilda=false, $bExtType=false)
Определения util.php:66
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Form FILTER_ACTION disabled
Определения options.php:358
const STOP_STATISTICS
Определения froogle_util.php:2
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$result
Определения get_property_values.php:14
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
const NO_AGENT_CHECK
Определения cron_frame.php:17
$tabControl
Определения csv_new_setup.php:244
const LANG_CHARSET
Определения include.php:65
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
ShowError($strError, $cls="errortext")
Определения tools.php:4499
die
Определения quickway.php:367
font style
Определения invoice.php:442
font size
Определения invoice.php:442
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$setsCounter
Определения sets_available.php:64