Files
crm.clientright.ru/crm_extensions/file_storage/check_project_structure.php
Fedor 9245768987 🚀 CRM Files Migration & Real-time Features
 Features:
- Migrated ALL files to new S3 structure (Projects, Contacts, Accounts, HelpDesk, Invoice, etc.)
- Added Nextcloud folder buttons to ALL modules
- Fixed Nextcloud editor integration
- WebSocket server for real-time updates
- Redis Pub/Sub integration
- File path manager for organized storage
- Redis caching for performance (Functions.php)

📁 New Structure:
Documents/Project/ProjectName_ID/file_docID.ext
Documents/Contacts/FirstName_LastName_ID/file_docID.ext
Documents/Accounts/AccountName_ID/file_docID.ext

🔧 Technical:
- FilePathManager for standardized paths
- S3StorageService integration
- WebSocket server (Node.js + Docker)
- Redis cache for getBasicModuleInfo()
- Predis library for Redis connectivity

📝 Scripts:
- Migration scripts for all modules
- Test pages for WebSocket/SSE/Polling
- Documentation (MIGRATION_*.md, REDIS_*.md)

🎯 Result: 15,000+ files migrated successfully!
2025-10-24 19:59:28 +03:00

62 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Тестовая проверка перед миграцией
*/
require_once(__DIR__ . '/../../config.inc.php');
global $adb;
echo "🔍 ПРОВЕРКА ДАННЫХ PROJECT\n";
echo "==========================================\n\n";
try {
// Проверяем файлы в старой структуре (без Project/)
$sql = "SELECT n.notesid, n.filename
FROM vtiger_notes n
INNER JOIN vtiger_senotesrel sr ON n.notesid = sr.notesid
INNER JOIN vtiger_project p ON sr.crmid = p.projectid
WHERE n.deleted = 0
AND n.filelocationtype = 'S'
AND n.filename LIKE '%/%'
AND n.filename NOT LIKE 'Project/%'
LIMIT 10";
$result = $adb->query($sql);
$count = $adb->num_rows($result);
echo "📊 Файлов в старой структуре (без Project/): $count\n\n";
if ($count > 0) {
echo "📁 Примеры:\n";
while ($row = $adb->fetch_array($result)) {
echo " ID: {$row['notesid']}, Path: {$row['filename']}\n";
}
}
echo "\n";
// Проверяем файлы в новой структуре (с Project/)
$sql2 = "SELECT COUNT(*) as cnt
FROM vtiger_notes n
WHERE n.deleted = 0
AND n.filelocationtype = 'S'
AND n.filename LIKE 'Project/%'";
$result2 = $adb->query($sql2);
$newCount = $adb->query_result($result2, 0, 'cnt');
echo "📊 Файлов в новой структуре (с Project/): $newCount\n\n";
echo "✅ Проверка завершена!\n";
} catch (Exception $e) {
echo "❌ Ошибка: " . $e->getMessage() . "\n";
echo $e->getTraceAsString() . "\n";
}
?>