diff --git a/crm_extensions/file_storage/NextcloudClient.php b/crm_extensions/file_storage/NextcloudClient.php index 5e032437..981ab821 100644 --- a/crm_extensions/file_storage/NextcloudClient.php +++ b/crm_extensions/file_storage/NextcloudClient.php @@ -203,7 +203,7 @@ class NextcloudClient { if (substr($fileName, 0, 1) === '_') { $fileName = substr($fileName, 1); } - $editUrl = $this->baseUrl . '/apps/files/?dir=/crm/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName); + $editUrl = $this->baseUrl . '/apps/files/?dir=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName); return [ 'success' => true, diff --git a/crm_extensions/file_storage/api/get_edit_urls.php b/crm_extensions/file_storage/api/get_edit_urls.php index 3fec5d82..09cb2865 100644 --- a/crm_extensions/file_storage/api/get_edit_urls.php +++ b/crm_extensions/file_storage/api/get_edit_urls.php @@ -24,12 +24,12 @@ try { // Создаем различные варианты URL $urls = [ - 'direct_edit' => $baseUrl . '/apps/files/files/662?dir=/crm/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName) . '&action=edit', - 'openfile_only' => $baseUrl . '/apps/files/files/662?dir=/crm/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName), - 'edit_true' => $baseUrl . '/apps/files/files/662?dir=/crm/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName) . '&edit=true', - 'richdocuments' => $baseUrl . '/apps/richdocuments/open?path=/crm/CRM_Active_Files/Documents/' . $recordId . '/' . urlencode($fileName), - 'onlyoffice' => $baseUrl . '/apps/onlyoffice/open?path=/crm/CRM_Active_Files/Documents/' . $recordId . '/' . urlencode($fileName), - 'files_app' => $baseUrl . '/apps/files/?dir=/crm/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName) . '&action=edit' + 'direct_edit' => $baseUrl . '/apps/files/files/662?dir=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName) . '&action=edit', + 'openfile_only' => $baseUrl . '/apps/files/files/662?dir=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName), + 'edit_true' => $baseUrl . '/apps/files/files/662?dir=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName) . '&edit=true', + 'richdocuments' => $baseUrl . '/apps/richdocuments/open?path=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '/' . urlencode($fileName), + 'onlyoffice' => $baseUrl . '/apps/onlyoffice/open?path=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '/' . urlencode($fileName), + 'files_app' => $baseUrl . '/apps/files/?dir=/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '&openfile=' . urlencode($fileName) . '&action=edit' ]; echo json_encode([ diff --git a/crm_extensions/file_storage/api/prepare_edit.php b/crm_extensions/file_storage/api/prepare_edit.php index 40f9247a..915ffab6 100644 --- a/crm_extensions/file_storage/api/prepare_edit.php +++ b/crm_extensions/file_storage/api/prepare_edit.php @@ -72,7 +72,7 @@ try { if (substr($actualFileName, 0, 1) === '_') { $actualFileName = substr($actualFileName, 1); } - $nextcloudPath = '/crm/CRM_Active_Files/Documents/' . $recordId . '/' . $actualFileName; + $nextcloudPath = '/crm/crm2/CRM_Active_Files/Documents/' . $recordId . '/' . $actualFileName; // Проверяем, существует ли файл в Nextcloud $fileExists = $nextcloudClient->fileExists($nextcloudPath); diff --git a/crm_extensions/file_storage/config.php b/crm_extensions/file_storage/config.php index dace35e9..68f67004 100644 --- a/crm_extensions/file_storage/config.php +++ b/crm_extensions/file_storage/config.php @@ -30,7 +30,7 @@ return [ 'base_url' => EnvLoader::getRequired('NEXTCLOUD_URL'), 'username' => EnvLoader::getRequired('NEXTCLOUD_USERNAME'), 'password' => EnvLoader::getRequired('NEXTCLOUD_PASSWORD'), - 'active_folder' => '/crm/CRM_Active_Files/', + 'active_folder' => '/crm/crm2/CRM_Active_Files/', 'timeout' => 30, ], diff --git a/crm_extensions/nextcloud_editor/js/nextcloud-editor.js b/crm_extensions/nextcloud_editor/js/nextcloud-editor.js index 8f8936f3..8991abf8 100644 --- a/crm_extensions/nextcloud_editor/js/nextcloud-editor.js +++ b/crm_extensions/nextcloud_editor/js/nextcloud-editor.js @@ -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 значения diff --git a/modules/Documents/actions/NcPrepareEdit.php b/modules/Documents/actions/NcPrepareEdit.php index 4909eb61..31555a25 100644 --- a/modules/Documents/actions/NcPrepareEdit.php +++ b/modules/Documents/actions/NcPrepareEdit.php @@ -81,7 +81,7 @@ class Documents_NcPrepareEdit_Action extends Vtiger_Action_Controller { * Получение пути к директории */ private function getDirPath($recordId): string { - return '/crm/CRM_Active_Files/Documents/' . $recordId; + return '/crm/crm2/CRM_Active_Files/Documents/' . $recordId; } /** @@ -131,7 +131,7 @@ class Documents_NcPrepareEdit_Action extends Vtiger_Action_Controller { * Получение пути к файлу в Nextcloud */ private function getNcPath(int $recordId, string $fileName): string { - return "/crm/CRM_Active_Files/Documents/{$recordId}/" . rawurlencode($fileName); + return "/crm/crm2/CRM_Active_Files/Documents/{$recordId}/" . rawurlencode($fileName); } /**