- 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.
106 lines
3.0 KiB
PHP
106 lines
3.0 KiB
PHP
<?php
|
|
/*+**********************************************************************************
|
|
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
|
|
* ("License"); You may not use this file except in compliance with the License
|
|
* The Original Code is: vtiger CRM Open Source
|
|
* The Initial Developer of the Original Code is vtiger.
|
|
* Portions created by vtiger are Copyright (C) vtiger.
|
|
* All Rights Reserved.
|
|
************************************************************************************/
|
|
// SalesPlatform.ru begin
|
|
require_once 'libraries/tcpdf/config/lang/rus.php';
|
|
//require_once 'libraries/tcpdf/config/lang/eng.php';
|
|
// SalesPlatform.ru end
|
|
require_once 'libraries/tcpdf/tcpdf.php';
|
|
|
|
class Vtiger_PDF_TCPDF extends TCPDF {
|
|
|
|
protected $FontFamily;
|
|
//SalesPlatform.ru begin
|
|
protected $footerModel;
|
|
protected $footerFrame;
|
|
//SalesPlatform.ru beginend
|
|
|
|
public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8') {
|
|
parent::__construct($orientation, $unit, $format, $unicode, $encoding);
|
|
$this->SetFont('','',10);
|
|
// SalesPlatform.ru begin
|
|
//$this->setFontFamily('times');
|
|
$this->setFontFamily('helvetica');
|
|
// SalesPlatform.ru end
|
|
}
|
|
|
|
function getFontSize() {
|
|
return $this->FontSizePt;
|
|
}
|
|
|
|
function setFontFamily($family) {
|
|
$this->FontFamily = $family;
|
|
}
|
|
|
|
function GetStringHeight($sa,$w) {
|
|
if(empty($sa)) return 0;
|
|
|
|
$sa = str_replace("\r","",$sa);
|
|
// remove the last newline
|
|
if (substr($sa,-1) == "\n")
|
|
$sa = substr($sa,0,-1);
|
|
|
|
$blocks = explode("\n",$sa);
|
|
$wmax = $w - (2 * $this->cMargin);
|
|
|
|
$lines = 0;
|
|
$spacesize = $this->GetCharWidth(32);
|
|
foreach ($blocks as $block) {
|
|
if (!empty($block)) {
|
|
$words = explode(" ",$block);
|
|
|
|
$cw = 0;
|
|
for ($i = 0;$i < count($words);$i++) {
|
|
if ($i != 0) $cw += $spacesize;
|
|
|
|
$wordwidth = $this->GetStringWidth($words[$i]);
|
|
$cw += $wordwidth;
|
|
|
|
if ($cw > $wmax) { // linebreak
|
|
$cw = $wordwidth;
|
|
$lines++;
|
|
}
|
|
}
|
|
}
|
|
|
|
$lines++;
|
|
}
|
|
|
|
return ($lines * ($this->FontSize * $this->cell_height_ratio)) + 2;
|
|
}
|
|
|
|
function SetFont($family, $style='', $size='') {
|
|
if($family == '') {
|
|
$family = $this->FontFamily;
|
|
}
|
|
//Select a font; size given in points
|
|
if ($size == 0) {
|
|
$size = $this->FontSizePt;
|
|
}
|
|
// try to add font (if not already added)
|
|
$fontdata = $this->AddFont($family, $style);
|
|
$this->FontFamily = $fontdata['family'];
|
|
$this->FontStyle = $fontdata['style'];
|
|
$this->CurrentFont = &$this->fonts[$fontdata['fontkey']];
|
|
$this->SetFontSize($size);
|
|
}
|
|
//SalesPlatform.ru begin
|
|
public function setFooterModel($footerModel, $footerFrame) {
|
|
$this->footerModel = $footerModel;
|
|
$this->footerFrame = $footerFrame;
|
|
}
|
|
public function Footer() {
|
|
$this->SetFont('','', 8);
|
|
if ($this->footerFrame->h > 0) {
|
|
$this->writeHTMLCell($this->footerFrame->w,$this->footerFrame->h, $this->footerFrame->x, $this->footerFrame->y+20, $this->footerModel->getContent());
|
|
}
|
|
}
|
|
//SalesPlatform.ru end
|
|
}
|
|
?>
|