} $historyId = intval($history_id); if ($historyId > 0 && $bBizproc) { $view = "Y"; } else { $historyId = 0; } $error = false; $WF = $WF == "Y" ? "Y" : "N"; //workflow mode $view = $view == "Y" ? "Y" : "N"; //view mode $return_url = ''; CCatalogAdminTools::setSkuFormParams(); $arSubCatalogEx = array(); $arSubCatalogTabs = CCatalogAdminTools::getShowTabs($IBLOCK_ID, $copyID > 0 && ID == 0 ? $copyID : $ID, $arSubCatalogEx); if (!empty($arSubCatalogTabs)) { $arShowTabs['product_group'] = $arSubCatalogTabs[CCatalogAdminTools::TAB_GROUP]; } do { //one iteration loop if ($historyId > 0) { $arErrorsTmp = array(); $arResult = CBPDocument::GetDocumentFromHistory($historyId, $arErrorsTmp); if (!empty($arErrorsTmp)) { foreach ($arErrorsTmp as $e) { $error = new _CIBlockError(1, $e["code"], $e["message"]); break; } } $canWrite = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $USER->GetID(), $arResult["DOCUMENT_ID"], array("UserGroups" => $USER->GetUserGroupArray()));
$arCatalogTabs = false; $bOffers = false; $boolCatalogRead = false; $boolCatalogPrice = false; if ($bCatalog) { $boolCatalogRead = $USER->CanDoOperation('catalog_read'); $boolCatalogPrice = $USER->CanDoOperation('catalog_price'); $arMainCatalog = CCatalogSKU::GetInfoByIBlock($IBLOCK_ID); if (!empty($arMainCatalog)) { if (CCatalogSKU::TYPE_PRODUCT == $arMainCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_FULL == $arMainCatalog['CATALOG_TYPE']) $bOffers = true; CCatalogAdminTools::setProductFormParams(); $arCatalogTabs = CCatalogAdminTools::getShowTabs($IBLOCK_ID, ($copyID > 0 && ID == 0 ? $copyID : $ID), $arMainCatalog); if (!empty($arCatalogTabs)) { $arShowTabs['catalog'] = $arCatalogTabs[CCatalogAdminTools::TAB_CATALOG]; $arShowTabs['sku'] = $arCatalogTabs[CCatalogAdminTools::TAB_SKU]; $arShowTabs['product_set'] = $arCatalogTabs[CCatalogAdminTools::TAB_SET]; $arShowTabs['product_group'] = $arCatalogTabs[CCatalogAdminTools::TAB_GROUP]; } } } $str_TMP_ID = 0; if ($bOffers && (0 == $ID || $bCopy)) { if ('GET' == $_SERVER['REQUEST_METHOD'] && 0 >= $ID) { $str_TMP_ID = CIBlockOffersTmp::Add($IBLOCK_ID, $arMainCatalog['IBLOCK_ID']);
$bCatalog = CModule::IncludeModule('catalog'); $arMainCatalog = false; $arCatalogTabs = false; $bOffers = false; $boolCatalogRead = false; $boolCatalogPrice = false; if ($bCatalog) { $boolCatalogRead = $USER->CanDoOperation('catalog_read'); $boolCatalogPrice = $USER->CanDoOperation('catalog_price'); $arMainCatalog = CCatalogSKU::GetInfoByIBlock($IBLOCK_ID); if (!empty($arMainCatalog)) { if (CCatalogSKU::TYPE_PRODUCT == $arMainCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_FULL == $arMainCatalog['CATALOG_TYPE']) { $bOffers = true; } CCatalogAdminTools::setProductFormParams(); $arCatalogTabs = CCatalogAdminTools::getShowTabs($IBLOCK_ID, $ID, $arMainCatalog); if (!empty($arCatalogTabs)) { $arShowTabs['catalog'] = $arCatalogTabs[CCatalogAdminTools::TAB_CATALOG]; $arShowTabs['sku'] = $arCatalogTabs[CCatalogAdminTools::TAB_SKU]; $arShowTabs['product_set'] = $arCatalogTabs[CCatalogAdminTools::TAB_SET]; $arShowTabs['product_group'] = $arCatalogTabs[CCatalogAdminTools::TAB_GROUP]; } } } $str_TMP_ID = 0; if ($bOffers && (0 == $ID || $bCopy)) { if ('GET' == $_SERVER['REQUEST_METHOD'] && 0 >= $ID) { $str_TMP_ID = CIBlockOffersTmp::Add($IBLOCK_ID, $arMainCatalog['IBLOCK_ID']); } else { if (isset($_REQUEST['TMP_ID'])) { $str_TMP_ID = intval($_REQUEST['TMP_ID']);