fix: ПРАВИЛЬНАЯ миграция путей Nextcloud /crm2/ → /crm/crm2/
ИСПРАВЛЕНИЕ: На новом Nextcloud S3 примонтирован как /crm, но внутри папка crm2 Правильный путь: /crm/crm2/CRM_Active_Files/ Выполнено в БД (rollback_and_fix.sql): - Откат предыдущей неправильной миграции из backup - s3_key: crm2/ → crm/crm2/ (17386 записей) - nc_path: /crm2/crm2/ → /crm/crm2/ (72 записи) - nc_path: /crm2/ → /crm/crm2/ (все остальные) Обновлены файлы кода: - crm_extensions/file_storage/config.php: active_folder = /crm/crm2/CRM_Active_Files/ - crm_extensions/nextcloud_editor/js/nextcloud-editor.js (5 путей) - crm_extensions/file_storage/api/get_edit_urls.php (6 путей) - modules/Documents/actions/NcPrepareEdit.php (2 пути) - crm_extensions/file_storage/api/prepare_edit.php (1 путь) - crm_extensions/file_storage/NextcloudClient.php (1 путь) Документ 395695: - s3_key: crm/crm2/CRM_Active_Files/Documents/395695/zayavlenie_proekt.docx ✓ - nc_path: /crm/crm2/CRM_Active_Files/Documents/395695/zayavlenie_proekt.docx ✓
This commit is contained in:
@@ -78,17 +78,17 @@ function createEditUrls(baseEditUrl, recordId, fileName, fileId = 662) {
|
||||
// Извлекаем базовый URL из базовой ссылки
|
||||
const baseUrl = 'https://office.clientright.ru';
|
||||
const encodedFileName = encodeURIComponent(fileName);
|
||||
const filePath = `/crm/CRM_Active_Files/Documents/${recordId}/${encodedFileName}`;
|
||||
const filePath = `/crm/crm2/CRM_Active_Files/Documents/${recordId}/${encodedFileName}`;
|
||||
|
||||
const urls = {
|
||||
'correct_path': fileId ? `${baseUrl}/apps/files/files/${fileId}?dir=/crm/CRM_Active_Files/Documents/${recordId}&editing=false&openfile=true` : `${baseUrl}/apps/files/?dir=/crm/CRM_Active_Files/Documents/${recordId}&openfile=${encodedFileName}`,
|
||||
'correct_path': fileId ? `${baseUrl}/apps/files/files/${fileId}?dir=/crm/crm2/CRM_Active_Files/Documents/${recordId}&editing=false&openfile=true` : `${baseUrl}/apps/files/?dir=/crm/crm2/CRM_Active_Files/Documents/${recordId}&openfile=${encodedFileName}`,
|
||||
'collabora_path': `${baseUrl}/apps/richdocuments/open?path=${filePath}`,
|
||||
'onlyoffice_path': `${baseUrl}/apps/onlyoffice/open?path=${filePath}`,
|
||||
'files_manager': `${baseUrl}/apps/files/?dir=/crm/CRM_Active_Files/Documents/${recordId}&openfile=${encodedFileName}`,
|
||||
'files_manager': `${baseUrl}/apps/files/?dir=/crm/crm2/CRM_Active_Files/Documents/${recordId}&openfile=${encodedFileName}`,
|
||||
'collabora_id': fileId ? `${baseUrl}/apps/richdocuments/index?fileId=${fileId}` : null,
|
||||
'onlyoffice_id': fileId ? `${baseUrl}/apps/onlyoffice?fileId=${fileId}` : null,
|
||||
'files_app': `${baseUrl}/apps/files/?dir=/crm/CRM_Active_Files/Documents/${recordId}&openfile=${encodedFileName}&action=edit`,
|
||||
'simple_files': `${baseUrl}/apps/files/?dir=/crm/CRM_Active_Files/Documents/${recordId}`
|
||||
'files_app': `${baseUrl}/apps/files/?dir=/crm/crm2/CRM_Active_Files/Documents/${recordId}&openfile=${encodedFileName}&action=edit`,
|
||||
'simple_files': `${baseUrl}/apps/files/?dir=/crm/crm2/CRM_Active_Files/Documents/${recordId}`
|
||||
};
|
||||
|
||||
// Убираем null значения
|
||||
|
||||
Reference in New Issue
Block a user