Esempio n. 1
0
 public static function GetCountItemsWithParent($parentID)
 {
     global $DB;
     if (!isset($this) || !is_object($this) || strlen($this->_table_name) <= 0) {
         $ob = new CIBlockXMLFile();
         return $ob->GetCountItemsWithParent($parentID);
     } else {
         $parentID = (int) $parentID;
         $rs = $DB->Query("select count(*) C from " . $this->_table_name . " where PARENT_ID = " . $parentID);
         $ar = $rs->Fetch();
         return $ar['C'];
     }
 }
Esempio n. 2
0
         $strMessage = GetMessage("CC_BSC1_SECTIONS_IMPORTED");
         $NS["STEP"] = 6;
     } else {
         $strError = GetMessage("CC_BSC1_METADATA_ERROR") . $result;
     }
 } elseif ($NS["STEP"] == 6) {
     $obCatalog = new CIBlockCMLImport();
     $obCatalog->InitEx($NS, array("files_dir" => $WORK_DIR_NAME, "use_crc" => $arParams["USE_CRC"], "preview" => $preview, "detail" => $detail, "use_offers" => $arParams["USE_OFFERS"], "force_offers" => $arParams["FORCE_OFFERS"], "use_iblock_type_id" => $arParams["USE_IBLOCK_TYPE_ID"], "translit_on_add" => $arParams["TRANSLIT_ON_ADD"], "translit_on_update" => $arParams["TRANSLIT_ON_UPDATE"], "translit_params" => $arTranslitParams, "skip_root_section" => $arParams["SKIP_ROOT_SECTION"], "disable_change_price_name" => $arParams["DISABLE_CHANGE_PRICE_NAME"]));
     $obCatalog->DeactivateSections($arParams["SECTION_ACTION"]);
     $obCatalog->SectionsResort();
     $strMessage = GetMessage("CC_BSC1_SECTION_DEA_DONE");
     $NS["STEP"] = 7;
 } elseif ($NS["STEP"] == 7) {
     if ($NS["DONE"]["ALL"] <= 0 && $NS["XML_ELEMENTS_PARENT"]) {
         if (CIBlockXMLFile::IsExistTemporaryTable()) {
             $NS["DONE"]["ALL"] = CIBlockXMLFile::GetCountItemsWithParent($NS["XML_ELEMENTS_PARENT"]);
         } else {
             $strError = GetMessage("CC_BCT1_TABLE_EXIST_ERROR");
         }
     }
     if ($strError == "") {
         $obCatalog = new CIBlockCMLImport();
         $obCatalog->InitEx($NS, array("files_dir" => $WORK_DIR_NAME, "use_crc" => $arParams["USE_CRC"], "preview" => $preview, "detail" => $detail, "use_offers" => $arParams["USE_OFFERS"], "force_offers" => $arParams["FORCE_OFFERS"], "use_iblock_type_id" => $arParams["USE_IBLOCK_TYPE_ID"], "translit_on_add" => $arParams["TRANSLIT_ON_ADD"], "translit_on_update" => $arParams["TRANSLIT_ON_UPDATE"], "translit_params" => $arTranslitParams, "skip_root_section" => $arParams["SKIP_ROOT_SECTION"], "disable_change_price_name" => $arParams["DISABLE_CHANGE_PRICE_NAME"]));
         $obCatalog->ReadCatalogData($_SESSION["BX_CML2_IMPORT"]["SECTION_MAP"], $_SESSION["BX_CML2_IMPORT"]["PRICES_MAP"]);
         $result = $obCatalog->ImportElements($start_time, $arParams["INTERVAL"]);
         $counter = 0;
         foreach ($result as $key => $value) {
             $NS["DONE"][$key] += $value;
             $counter += $value;
         }
         if (!$counter) {