Files
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

92 lines
2.6 KiB
PHP

<?php
/**
* Created by JetBrains PhpStorm.
* User: Stefan Warnat <support@stefanwarnat.de>
* Date: 01.06.14 12:04
* You must not use this file without permission.
*/
namespace Workflow\Plugins\InterfaceFiles;
class PDFMaker extends \Workflow\InterfaceFiles {
protected $title = 'PDFMaker Templates';
protected $key = 'pdfmaker';
public function __construct() {
if(!$this->isModuleActive()) {
return;
}
require_once('modules/PDFMaker/PDFMaker.php');
}
protected function _getFile($id, $moduleName, $crmid) {
$current_user = \Users_Record_Model::getCurrentUserModel();
$useUser = \Users::getActiveAdminUser();
$oldUser = vglobal('current_user'); vglobal('current_user', $useUser);
$tmpFilename = $this->_getTmpFilename();
$mpdf = "";
$language = $current_user->language;
if(empty($language)) {
$language = \Vtiger_Language_Handler::getLanguage();
}
$Records = array($crmid);
// $request = $_REQUEST;
// $_REQUEST['search'] = true;
//$_REQUEST['submode'] = true;
\Vtiger_Loader::autoLoad('PDFMaker_PDFMaker_Model');
$PDFMaker = new \PDFMaker_PDFMaker_Model();
$name = $PDFMaker->GetPreparedMPDF($mpdf, $Records, array($id), $moduleName, $language);
$name = $PDFMaker->generate_cool_uri($name);
if ($name != "")
$name = $name . ".pdf";
$mpdf->Output($tmpFilename);
vglobal('current_user', $oldUser);
$filetype = "application/pdf";
//$_REQUEST = $request;
return array(
'path' => $tmpFilename,
'name' => $name,
'type' => $filetype
);
}
protected function _getAvailableFiles($moduleName) {
$return = array();
if(!$this->isModuleActive()) {
return $return;
}
/**
* @var $PDFMaker PDFMaker_PDFMaker_Model
*/
\Vtiger_Loader::autoLoad('PDFMaker_PDFMaker_Model');
$PDFMaker = new \PDFMaker_PDFMaker_Model();
if(method_exists($PDFMaker, "GetAvailableTemplates")) {
$templates = $PDFMaker->GetAvailableTemplates($moduleName);
foreach($templates as $index => $value) {
$return[$index] = 'PDFMaker - '.$value["templatename"];
}
}
return $return;
}
public function isModuleActive() {
return getTabid('PDFMaker') && vtlib_isModuleActive('PDFMaker');
}
}
\Workflow\InterfaceFiles::register('pdfmaker', '\Workflow\Plugins\InterfaceFiles\PDFMaker');