Files
crm.clientright.ru/crm_extensions/file_storage/detailed_check_394492.php
Fedor ac7467f0b4 Major CRM updates: AI Assistant, Court Status API, S3 integration improvements, and extensive file storage system
- 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.
2025-10-16 11:17:21 +03:00

153 lines
6.2 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
/**
* Detailed check for Project 394492 files
*/
$ROOT = '/var/www/fastuser/data/www/crm.clientright.ru/';
require_once $ROOT . 'config.inc.php';
// Database connection
$mysqli = new mysqli($dbconfig['db_server'], $dbconfig['db_username'], $dbconfig['db_password'], $dbconfig['db_name']);
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
$mysqli->set_charset("utf8");
echo "=== Детальная проверка проекта 394492 ===\n\n";
// 1. Проверяем существование проекта
echo "1. Проверка существования проекта 394492...\n";
$project_query = "SELECT crmid, label, createdtime FROM vtiger_crmentity WHERE crmid = 394492";
$project_result = $mysqli->query($project_query);
if ($project_result && $project_result->num_rows > 0) {
$project = $project_result->fetch_assoc();
echo "✅ Проект найден: " . $project['label'] . "\n";
echo "Создан: " . $project['createdtime'] . "\n\n";
} else {
echo "❌ Проект 394492 не найден\n\n";
}
// 2. Ищем файлы через разные методы
echo "2. Поиск файлов проекта разными способами...\n\n";
// Способ 1: Через vtiger_senotesrel
echo "Способ 1: Через vtiger_senotesrel\n";
$method1_query = "SELECT n.notesid, n.title, n.filename, n.filesize, n.s3_key
FROM vtiger_notes n
INNER JOIN vtiger_senotesrel snr ON n.notesid = snr.notesid
WHERE snr.crmid = 394492 AND n.filelocationtype = 'E'";
$method1_result = $mysqli->query($method1_query);
if ($method1_result && $method1_result->num_rows > 0) {
echo "Найдено файлов: " . $method1_result->num_rows . "\n";
while ($row = $method1_result->fetch_assoc()) {
echo "ID: " . $row['notesid'] . " - " . $row['title'] . "\n";
echo "URL: " . substr($row['filename'], 0, 80) . "...\n";
echo "S3 Key: " . ($row['s3_key'] ?: 'NULL') . "\n";
// Проверяем доступность
if (!empty($row['filename'])) {
$headers = @get_headers($row['filename'], 1);
if ($headers && strpos($headers[0], '200') !== false) {
echo "✅ Доступен\n";
} else {
echo "❌ Недоступен\n";
}
}
echo "---\n";
}
} else {
echo "Файлов через vtiger_senotesrel не найдено\n";
}
// Способ 2: По названию или содержимому
echo "\nСпособ 2: По названию или содержимому\n";
$method2_query = "SELECT notesid, title, filename, filesize, s3_key
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND (title LIKE '%Шор%' OR title LIKE '%ХЕЛПЕР%' OR filename LIKE '%394492%')
ORDER BY notesid DESC";
$method2_result = $mysqli->query($method2_query);
if ($method2_result && $method2_result->num_rows > 0) {
echo "Найдено файлов: " . $method2_result->num_rows . "\n";
while ($row = $method2_result->fetch_assoc()) {
echo "ID: " . $row['notesid'] . " - " . $row['title'] . "\n";
echo "URL: " . substr($row['filename'], 0, 80) . "...\n";
echo "S3 Key: " . ($row['s3_key'] ?: 'NULL') . "\n";
// Проверяем доступность
if (!empty($row['filename'])) {
$headers = @get_headers($row['filename'], 1);
if ($headers && strpos($headers[0], '200') !== false) {
echo "✅ Доступен\n";
} else {
echo "❌ Недоступен\n";
}
}
echo "---\n";
}
} else {
echo "Файлов по названию не найдено\n";
}
// Способ 3: Недавние файлы (последние 50)
echo "\nСпособ 3: Недавние файлы (последние 50)\n";
$method3_query = "SELECT notesid, title, filename, filesize, s3_key
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND notesid >= 394490
ORDER BY notesid DESC
LIMIT 20";
$method3_result = $mysqli->query($method3_query);
if ($method3_result && $method3_result->num_rows > 0) {
echo "Найдено файлов: " . $method3_result->num_rows . "\n";
while ($row = $method3_result->fetch_assoc()) {
echo "ID: " . $row['notesid'] . " - " . $row['title'] . "\n";
echo "URL: " . substr($row['filename'], 0, 80) . "...\n";
echo "S3 Key: " . ($row['s3_key'] ?: 'NULL') . "\n";
// Проверяем доступность
if (!empty($row['filename'])) {
$headers = @get_headers($row['filename'], 1);
if ($headers && strpos($headers[0], '200') !== false) {
echo "✅ Доступен\n";
} else {
echo "❌ Недоступен\n";
}
}
echo "---\n";
}
} else {
echo "Недавних файлов не найдено\n";
}
// 4. Ищем файлы с потенциальными проблемами PDFmaker
echo "\n4. Поиск файлов с проблемами PDFmaker...\n";
$pdfmaker_query = "SELECT notesid, title, filename, filesize, s3_key
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND (title LIKE '%PDFmaker%' OR filename LIKE '%PDFmaker%' OR title LIKE '%PDF%maker%')
ORDER BY notesid DESC
LIMIT 10";
$pdfmaker_result = $mysqli->query($pdfmaker_query);
if ($pdfmaker_result && $pdfmaker_result->num_rows > 0) {
echo "Найдено файлов с PDFmaker: " . $pdfmaker_result->num_rows . "\n";
while ($row = $pdfmaker_result->fetch_assoc()) {
echo "ID: " . $row['notesid'] . " - " . $row['title'] . "\n";
echo "URL: " . substr($row['filename'], 0, 80) . "...\n";
echo "S3 Key: " . ($row['s3_key'] ?: 'NULL') . "\n";
echo "---\n";
}
} else {
echo "Файлов с PDFmaker не найдено\n";
}
$mysqli->close();
echo "\n=== Проверка завершена ===\n";
?>