if ($arIBlock = $rsIBlock->Fetch()) { $iblockID = $arIBlock["ID"]; } if ($iblockID == false && WIZARD_SITE_ID == "s1") { $rsIBlock = CIBlock::GetList(array(), array("CODE" => "meeting_rooms", "TYPE" => $iblockType)); if ($arIBlock = $rsIBlock->Fetch()) { $iblockID = $arIBlock["ID"]; } } if ($iblockID == false) { $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "meeting_rooms_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "W", WIZARD_DIRECTION_GROUP => "W")); if ($iblockID < 1) { return; } WizardServices::CreateSectionProperty($iblockID, "UF__CAL_COL", $arFieldColorName); WizardServices::CreateSectionProperty($iblockID, "UF__CAL_EXP", $arFieldExportName); $ibSection = new CIBlockSection(); $arColor = array("#DDBFEB", "#CEE669", "#98AEF6"); $dbSection = CIBlockSection::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID)); $i = 0; while ($arSection = $dbSection->Fetch()) { $color = isset($arColor[$i]) ? $arColor[$i] : $arColor[0]; $ibSection->Update($arSection["ID"], array("ACTIVE" => "Y", "UF__CAL_COL" => $color, "UF__CAL_EXP" => "all")); $i++; } $arAF = array("UF_FLOOR" => array("NAME" => GetMessage("INAF_F_FLOOR"), "TYPE" => "integer"), "UF_PLACE" => array("NAME" => GetMessage("INAF_F_PLACE"), "TYPE" => "integer"), "UF_PHONE" => array("NAME" => GetMessage("INAF_F_PHONE"), "TYPE" => "string")); $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $iblockID . "_SECTION", 0, LANGUAGE_ID); $arKeys = Array_Keys($arAF); foreach ($arKeys as $key) { if (!Array_Key_Exists($key, $arUserFields)) { $arFields = array("ENTITY_ID" => "IBLOCK_" . $iblockID . "_SECTION", "FIELD_NAME" => $key, "USER_TYPE_ID" => $arAF[$key]["TYPE"]);