Files
crm.clientright.ru/crm_extensions/file_storage/check_recent_pdfmaker_issues.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

145 lines
6.1 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
/**
* Check for recent PDFmaker issues in CRM
*/
$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 "=== Проверка недавних проблем с PDFmaker ===\n\n";
// 1. Ищем файлы с нулевым размером (возможная проблема PDFmaker)
echo "1. Файлы с нулевым размером (возможная проблема PDFmaker)...\n";
$zero_size_query = "SELECT notesid, title, filename, filesize, s3_key, s3_bucket
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND filesize = 0
AND notesid >= 394400
ORDER BY notesid DESC
LIMIT 20";
$zero_size_result = $mysqli->query($zero_size_query);
if ($zero_size_result && $zero_size_result->num_rows > 0) {
echo "Найдено файлов с нулевым размером: " . $zero_size_result->num_rows . "\n";
while ($row = $zero_size_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";
}
// 2. Ищем файлы с проблемными символами в URL
echo "\n2. Файлы с проблемными символами в URL...\n";
$problematic_query = "SELECT notesid, title, filename, filesize, s3_key, s3_bucket
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND notesid >= 394400
AND (filename LIKE '%#%' OR filename LIKE '% %' OR filename LIKE '%[%' OR filename LIKE '%]%')
ORDER BY notesid DESC
LIMIT 20";
$problematic_result = $mysqli->query($problematic_query);
if ($problematic_result && $problematic_result->num_rows > 0) {
echo "Найдено файлов с проблемными символами: " . $problematic_result->num_rows . "\n";
while ($row = $problematic_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. Ищем файлы без S3 ключей
echo "\n3. Файлы без S3 ключей...\n";
$no_s3_query = "SELECT notesid, title, filename, filesize, s3_key, s3_bucket
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND notesid >= 394400
AND (s3_key IS NULL OR s3_key = '')
ORDER BY notesid DESC
LIMIT 20";
$no_s3_result = $mysqli->query($no_s3_query);
if ($no_s3_result && $no_s3_result->num_rows > 0) {
echo "Найдено файлов без S3 ключей: " . $no_s3_result->num_rows . "\n";
while ($row = $no_s3_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 "Файлов без S3 ключей не найдено\n";
}
// 4. Ищем файлы с русскими символами без кодировки
echo "\n4. Файлы с русскими символами без кодировки...\n";
$russian_query = "SELECT notesid, title, filename, filesize, s3_key, s3_bucket
FROM vtiger_notes
WHERE filelocationtype = 'E'
AND notesid >= 394400
AND (filename REGEXP '[А-Яа-я]')
AND filename NOT LIKE '%#realfile%'
ORDER BY notesid DESC
LIMIT 20";
$russian_result = $mysqli->query($russian_query);
if ($russian_result && $russian_result->num_rows > 0) {
echo "Найдено файлов с русскими символами: " . $russian_result->num_rows . "\n";
while ($row = $russian_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";
}
$mysqli->close();
echo "\n=== Проверка завершена ===\n";
?>