- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
61 lines
2.6 KiB
JavaScript
61 lines
2.6 KiB
JavaScript
/**
|
||
* Nextcloud Editor Integration
|
||
* Функция для редактирования документов в Nextcloud
|
||
*/
|
||
|
||
function editInNextcloud(recordId, fileName) {
|
||
console.log('Opening file in Nextcloud:', recordId, fileName);
|
||
|
||
// Проверяем расширение
|
||
const ext = fileName.split('.').pop().toLowerCase();
|
||
if (!['docx', 'xlsx', 'pptx'].includes(ext)) {
|
||
alert('Файл ' + fileName + ' не поддерживается для редактирования. Поддерживаются: docx, xlsx, pptx');
|
||
return;
|
||
}
|
||
|
||
// Отправляем запрос к нашему API
|
||
const apiUrl = `crm_extensions/nextcloud_api.php?record=${encodeURIComponent(recordId)}&fileName=${encodeURIComponent(fileName)}`;
|
||
fetch(apiUrl, {
|
||
method: 'GET'
|
||
})
|
||
.then(response => {
|
||
console.log('Response status:', response.status);
|
||
return response.json();
|
||
})
|
||
.then(json => {
|
||
console.log('JSON response:', json);
|
||
if (json.success && json.data && json.data.urls) {
|
||
// Сначала пробуем файловый менеджер, потом прямой редактор
|
||
const filesManagerUrl = json.data.urls.files_manager;
|
||
const collaboraUrl = json.data.urls.collabora_id;
|
||
const onlyofficeUrl = json.data.urls.onlyoffice_id;
|
||
|
||
if (filesManagerUrl) {
|
||
console.log('Opening files manager:', filesManagerUrl);
|
||
window.open(filesManagerUrl, '_blank');
|
||
} else if (collaboraUrl) {
|
||
console.log('Opening Collabora:', collaboraUrl);
|
||
window.open(collaboraUrl, '_blank');
|
||
} else if (onlyofficeUrl) {
|
||
console.log('Opening OnlyOffice:', onlyofficeUrl);
|
||
window.open(onlyofficeUrl, '_blank');
|
||
} else {
|
||
console.error('No valid URLs found');
|
||
alert('Ошибка: Не удалось получить URL для редактирования');
|
||
}
|
||
} else {
|
||
console.error('Invalid response structure:', json);
|
||
alert('Ошибка: ' + (json.error || 'Не удалось получить URL для редактирования. Проверьте консоль для деталей.'));
|
||
}
|
||
})
|
||
.catch(error => {
|
||
console.error('Error:', error);
|
||
alert('Ошибка: ' + error.message);
|
||
});
|
||
}
|
||
|
||
// Делаем функцию глобальной для доступа из шаблонов
|
||
window.editInNextcloud = editInNextcloud;
|
||
|
||
|