"article", "manufacturer" => "manufacturer", "color" =>"color", "weight" => "weight", "size" => "size", ); if(!check_bitrix_sessid()) return; __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/lang/", "/icml_export_setup.php")); if (($ACTION == 'EXPORT' || $ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY') && $STEP == 1) { if (isset($arOldSetupVars['SETUP_FILE_NAME'])) $SETUP_FILE_NAME = $arOldSetupVars['SETUP_FILE_NAME']; if (isset($arOldSetupVars['SETUP_PROFILE_NAME'])) $SETUP_PROFILE_NAME = $arOldSetupVars['SETUP_PROFILE_NAME']; if (isset($arOldSetupVars['IBLOCK_EXPORT'])) $IBLOCK_EXPORT = $arOldSetupVars['IBLOCK_EXPORT']; $IBLOCK_PROPERTY_SKU = array(); foreach ($iblockProperties as $prop) { foreach ($arOldSetupVars['IBLOCK_PROPERTY_SKU'. '_' . $prop] as $iblock => $val) { $IBLOCK_PROPERTY_SKU[$iblock][$prop] = $val; } } $IBLOCK_PROPERTY_PRODUCT = array(); foreach ($iblockProperties as $prop) { foreach ($arOldSetupVars['IBLOCK_PROPERTY_PRODUCT'. '_' . $prop] as $iblock => $val) { $IBLOCK_PROPERTY_PRODUCT[$iblock][$prop] = $val; } } } if ($STEP>1) { if (strlen($SETUP_FILE_NAME)<=0) { $arSetupErrors[] = GetMessage("CET_ERROR_NO_FILENAME"); } elseif ($APPLICATION->GetFileAccessPermission($SETUP_FILE_NAME) < "W") { $arSetupErrors[] = str_replace("#FILE#", $SETUP_FILE_NAME, GetMessage('CET_YAND_RUN_ERR_SETUP_FILE_ACCESS_DENIED')); } if (($ACTION=="EXPORT_SETUP" || $ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY') && strlen($SETUP_PROFILE_NAME)<=0) { $arSetupErrors[] = GetMessage("CET_ERROR_NO_PROFILE_NAME"); } if (!empty($arSetupErrors)) { $STEP = 1; } } if (!empty($arSetupErrors)) echo ShowError(implode('
', $arSetupErrors)); if ($STEP==1) { ?>



GetMessage("PROPERTY_ARTICLE_HEADER_NAME"), "manufacturer" => GetMessage("PROPERTY_MANUFACTURER_HEADER_NAME"), "color" => GetMessage("PROPERTY_COLOR_HEADER_NAME"), "weight" => GetMessage("PROPERTY_WEIGHT_HEADER_NAME"), "size" => GetMessage("PROPERTY_SIZE_HEADER_NAME"), ); $iblockPropertiesHint = Array( "article" => Array("ARTICLE", "ART", "ARTNUMBER", "ARTICUL", "ARTIKUL"), "manufacturer" => Array("MANUFACTURER", "PROISVODITEL", "PROISVOD", "PROISV"), "color" => Array("COLOR", "CVET"), "weight" => Array("WEIGHT", "VES", "VEC"), "size" => Array("SIZE", "RAZMER"), ); $boolAll = false; $intCountChecked = 0; $intCountAvailIBlock = 0; $arIBlockList = array(); $db_res = CIBlock::GetList(Array("IBLOCK_TYPE"=>"ASC", "NAME"=>"ASC"),array('CHECK_PERMISSIONS' => 'Y','MIN_PERMISSION' => 'W')); while ($iblock = $db_res->Fetch()) { if ($arCatalog = CCatalog::GetByIDExt($iblock["ID"])) { if($arCatalog['CATALOG_TYPE'] == "D" || $arCatalog['CATALOG_TYPE'] == "X" || $arCatalog['CATALOG_TYPE'] == "P") { $propertiesSKU = null; if ($arCatalog['CATALOG_TYPE'] == "X" || $arCatalog['CATALOG_TYPE'] == "P") { $iblockOffer = CCatalogSKU::GetInfoByProductIBlock($iblock["ID"]); $db_properties = CIBlock::GetProperties($iblockOffer['IBLOCK_ID'], Array()); while($prop = $db_properties->Fetch()) $propertiesSKU[] = $prop; $oldPropertySKU = null; if (isset($IBLOCK_PROPERTY_SKU[$iblock['ID']])) { foreach ($iblockPropertiesName as $key => $prop) { $oldPropertySKU[$key] = $IBLOCK_PROPERTY_SKU[$iblock['ID']][$key]; } } } $propertiesProduct = null; $db_properties = CIBlock::GetProperties($iblock['ID'], Array()); while($prop = $db_properties->Fetch()) $propertiesProduct[] = $prop; $oldPropertyProduct = null; if (isset($IBLOCK_PROPERTY_PRODUCT[$iblock['ID']])) { foreach ($iblockPropertiesName as $key => $prop) { $oldPropertyProduct[$key] = $IBLOCK_PROPERTY_PRODUCT[$iblock['ID']][$key]; } } $arSiteList = array(); $rsSites = CIBlock::GetSite($iblock["ID"]); while ($arSite = $rsSites->Fetch()) { $arSiteList[] = $arSite["SITE_ID"]; } if (count($IBLOCK_EXPORT) != 0) $boolExport = (in_array($iblock['ID'], $IBLOCK_EXPORT)); else $boolExport = true; $arIBlockList[] = array( 'ID' => $iblock['ID'], 'NAME' => $iblock['NAME'], 'IBLOCK_TYPE_ID' => $iblock['IBLOCK_TYPE_ID'], 'IBLOCK_EXPORT' => $boolExport, 'PROPERTIES_SKU' => $propertiesSKU, 'PROPERTIES_PRODUCT' => $propertiesProduct, 'OLD_PROPERTY_SKU_SELECT' => $oldPropertySKU, 'OLD_PROPERTY_PRODUCT_SELECT' => $oldPropertyProduct, 'SITE_LIST' => '('.implode(' ',$arSiteList).')', ); if ($boolExport) $intCountChecked++; $intCountAvailIBlock++; } } } if (count($IBLOCK_EXPORT) != 0) { if ($intCountChecked == $intCountAvailIBlock) $boolAll = true; } else { $intCountChecked = $intCountAvailIBlock; $boolAll = true; } ?> >

$arIBlock):?>
]" id="IBLOCK_EXPORT" value="" onclick="checkOne(this,);" >

> $property): ?>













"> ">