Files
crm.clientright.ru/crm_extensions/file_storage/create_templates.php
Fedor 7e3f0dcede Исправление путей к папкам проектов в Nextcloud + создание файлов из CRM
🔧 Исправления:
- Исправлены пути к папкам проектов: теперь /Documents/Project/{Name}_{Id}
- Исправлена функция openProjectFolder() во всех JS файлах
- Добавлены кнопки создания Word/Excel/PowerPoint из CRM (10 модулей)
- Создание файлов напрямую в S3 с автоиндексацией через Redis
- Исправлена ошибка 'Class Redis not found' (использован Predis)

📁 Изменённые файлы:
- layouts/v7/lib/nextcloud-editor.js
- crm_extensions/nextcloud_editor/js/nextcloud-editor.js
- layouts/v7/lib/nextcloud-editor-v3.js
- crm_extensions/file_storage/api/create_nextcloud_file.php
- layouts/v7/modules/*/DetailViewHeaderTitle.tpl (10 модулей)
- layouts/v7/modules/Documents/*.tpl (кнопки редактирования)

🎯 Результат:
- Кнопка 'Папка в Nextcloud' открывает правильную папку
- Создание файлов работает молниеносно (прямо в S3)
- Redis события публикуются корректно
- OnlyOffice открывается для редактирования

Проект 391552 теперь открывается по правильному пути!
2025-11-01 12:22:12 +03:00

40 lines
1.3 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
/**
* Создание минимальных пустых шаблонов Office файлов
*/
require_once '/var/www/fastuser/data/www/crm.clientright.ru/vendor/autoload.php';
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpPresentation\PhpPresentation;
$templatesDir = __DIR__ . '/templates/';
// Создаём Word документ
$phpWord = new PhpWord();
$section = $phpWord->addSection();
$section->addText('');
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save($templatesDir . 'empty.docx');
echo "✅ Created empty.docx\n";
// Создаём Excel таблицу
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', '');
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
$writer->save($templatesDir . 'empty.xlsx');
echo "✅ Created empty.xlsx\n";
// Создаём PowerPoint презентацию
$presentation = new PhpPresentation();
$slide = $presentation->getActiveSlide();
$writer = \PhpOffice\PhpPresentation\IOFactory::createWriter($presentation, 'PowerPoint2007');
$writer->save($templatesDir . 'empty.pptx');
echo "✅ Created empty.pptx\n";
echo "\nВсе шаблоны созданы!\n";
?>