/** * @param $id * @param null $dbVersion * @return array|mixed */ public function getSnapshot($id, $dbVersion = null) { if (!$id) { return false; } $dbVersion && ($id = $this->getCurrentVersionId($id, $dbVersion)); !$dbVersion && !$this->hasCurrentReference($id) && $this->registerCurrentVersionId($id); $iblock = \CIBlock::GetArrayByID($id); if (!$iblock) { return false; } $iblock['~reference'] = $this->getReferenceValue($id); $type = \CIBlockType::GetByID($iblock['IBLOCK_TYPE_ID'])->Fetch(); $rsTypeLangs = TypeLanguageTable::getList(array('filter' => array('IBLOCK_TYPE_ID' => $iblock['IBLOCK_TYPE_ID']))); while ($lang = $rsTypeLangs->fetch()) { $type['LANG'][$lang['LANGUAGE_ID']] = $lang; } return array('iblock' => $iblock, 'type' => $type); }
$iblockElement->SetPropertyValuesEx($elementId, $idIBlock, array($idProperty => $elementValues)); } return true; }; if ($_POST['apply'] == 'Применить') { $iblockID = intval($_POST['selectIblocks']); $propertyID = intval($_POST['selectProperties']); $newTypeIBlock = $_POST['new-type-property-info-block']; $conversionResult = $conversionProperty($propertyID, $iblockID, $newTypeIBlock); $conversionResult && CAdminNotify::Add(array('MESSAGE' => 'Конвертация прошла успешно', 'TAG' => 'save_property_notify', 'MODULE_ID' => 'ws.tools', 'ENABLE_CLOSE' => 'Y')); !$conversionResult && CAdminNotify::Error(array('MESSAGE' => 'Конвертация не прошла успешно', 'TAG' => 'save_property_notify_error', 'MODULE_ID' => 'ws.tools', 'ENABLE_CLOSE' => 'Y')); } require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php"; $jsParams = array(); $types = array(); $rsTypes = \Bitrix\Iblock\TypeLanguageTable::getList(array('filter' => array('LANGUAGE_ID' => LANG))); while ($type = $rsTypes->fetch()) { $types[$type['IBLOCK_TYPE_ID']] = $type['NAME']; } $jsParams['types'] = array('name' => 'selectTypes', 'list' => $types); $iblocks = array(); $rsIblocks = \Bitrix\Iblock\IblockTable::getList(); while ($iblock = $rsIblocks->fetch()) { $iblocks[$iblock['ID']] = array('name' => $iblock['NAME'], 'type' => $iblock['IBLOCK_TYPE_ID']); } $jsParams['iblocks'] = array('name' => 'selectIblocks', 'list' => $iblocks); $properties = array(); $rsProperties = \Bitrix\Iblock\PropertyTable::getList(array('filter' => array('PROPERTY_TYPE' => \Bitrix\Iblock\PropertyTable::TYPE_STRING, 'USER_TYPE' => NULL))); while ($property = $rsProperties->fetch()) { $properties[$property['ID']] = array('name' => $property['NAME'], 'iblockId' => $property['IBLOCK_ID']); }