diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index 2566e857..09c87545 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -212,7 +212,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) { //bitrix site list $siteListArr = []; - + foreach ($arResult['arSites'] as $arSites) { if (count($arResult['arSites']) > 1) { if ($_POST['sites-id-' . $arSites['LID']]) { @@ -414,8 +414,8 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) { function maskPrice($var){ return preg_match("/^shops-price/", $var); } - $bitrixPriceShopsArr = str_replace('shops-price-', '', array_filter(array_keys($_POST), 'maskPrice')); + $bitrixPriceShopsArr = array_values(array_filter($_POST, 'maskPrice', ARRAY_FILTER_USE_KEY)); $arResult['bitrixIblocksExportList'] = RCrmActions::IblocksExportList(); foreach($arResult['bitrixIblocksExportList'] as $bitrixIblocks){ if(htmlspecialchars(trim($_POST['iblocks-prices-' . $bitrixIblocks['ID']])) === 'Y'){ @@ -486,10 +486,12 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) { $cc = 'Y'; $bitrixCorpName = htmlspecialchars(trim($_POST['nickName-corporate'])); $bitrixCorpAdres = htmlspecialchars(trim($_POST['adres-corporate'])); + function maskCorp($var) { return preg_match("/^shops-corporate/", $var); } - $bitrixCorpShopsArr = str_replace('shops-corporate-', '', array_filter(array_keys($_POST), 'maskCorp')); + + $bitrixCorpShopsArr = array_values(array_filter($_POST, 'maskCorp', ARRAY_FILTER_USE_KEY)); RegisterModuleDependences("main", "OnBeforeProlog", $mid, "RetailCrmCc", "add"); } else { @@ -1394,7 +1396,10 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) { > - + @@ -1541,7 +1546,10 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) { - +