if (!CWikiUtils::IsReadable()) { ShowError(GetMessage('WIKI_ACCESS_DENIED')); return; } $res = CIBlock::GetList(array(), array("ID" => $arParams['IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N')); $arIBLOCK = $res->GetNext(); if (empty($arIBLOCK['BIZPROC']) || $arIBLOCK['BIZPROC'] != 'Y') { ShowError(GetMessage('WIKI_NOT_CHANGE_BIZPROC')); return; } //converts the old type of document to a new if (COption::GetOptionString('wiki', 'convert_history_' . $arParams['IBLOCK_ID'], 'N') == 'N') { $arFilter = array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N', 'ACTIVE' => 'Y'); $rsElement = CIBlockElement::GetList(array(), $arFilter, false, false, array()); while ($arElement = $rsElement->GetNext()) { CBPHistoryService::MergeHistory(array('iblock', 'CWikiDocument', $arElement['ID']), array('iblock', 'CIBlockDocument', $arElement['ID'])); } COption::SetOptionString('wiki', 'convert_history_' . $arParams['IBLOCK_ID'], 'Y'); LocalRedirect(CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'history') : array())); return; } CUtil::InitJSCore(array("ajax", "tooltip")); //http://jabber.bx/view.php?id=30695 if ($this->StartResultCache(false, array($USER->GetGroups(), $arNavigation, $arCache), false)) { $arResult['USE_REVIEW'] = $arParams['USE_REVIEW']; $arResult['ELEMENT'] = array(); $arParams['ELEMENT_NAME'] = urldecode($arParams['ELEMENT_NAME']); $arFilter = array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N', 'ACTIVE' => 'Y'); if (empty($arParams['ELEMENT_NAME'])) { $arParams['ELEMENT_NAME'] = CWiki::GetDefaultPage($arParams['IBLOCK_ID']); }
public static function MergeDocuments($firstDocumentId, $secondDocumentId) { CBPStateService::MergeStates($firstDocumentId, $secondDocumentId); CBPHistoryService::MergeHistory($firstDocumentId, $secondDocumentId); }