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

141 lines
4.7 KiB
PHP

<?php
/* +********************************************************************************
* The content of this file is subject to the Reports 4 You license.
* ("License"); You may not use this file except in compliance with the License
* The Initial Developer of the Original Code is IT-Solutions4You s.r.o.
* Portions created by IT-Solutions4You s.r.o. are Copyright(C) IT-Solutions4You s.r.o.
* All Rights Reserved.
* ****************************************************************************** */
require_once('modules/ITS4YouReports/ITS4YouReports.php');
class ITS4YouReports_BingMaps_View extends Vtiger_Index_View {
private static $apiKey = '';
public static $mapParameterColumns = [
'zoom',
];
public static $addressColumns = [
'street',
'city',
'state',
'zip',
'country',
];
protected static $defaultMapZoom = 10;
protected $mapColumns = [];
/**
* @param Vtiger_Request $request
* @param bool $display
*
* @return bool|void
*/
public function preProcess(Vtiger_Request $request, $display = true) {
echo '<head>
<script data-pace-options=\'{ajax: false,document: false,eventLag: false,elements: {selectors: ["#R4YouMap"]}}\' src="modules/ITS4YouReports/lib/pace/pace.min.js"></script>
<link href="modules/ITS4YouReports/lib/pace/pace-theme.css" rel="stylesheet" />
</head>';
return false;
}
/**
* @param Vtiger_Request $request
*
* @return bool|void
* @throws AppException
*/
function checkPermission(Vtiger_Request $request) {
$moduleName = $request->getModule();
$moduleModel = ITS4YouReports_Module_Model::getInstance($moduleName);
$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) {
throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}
}
/**
* @param Vtiger_Request $request
*
* @return bool|void
*/
function postProcess(Vtiger_Request $request) {
return false;
}
/**
* @param Vtiger_request $request
*
* @throws SmartyException
*/
function process(Vtiger_request $request) {
$reportId = $request->get('record');
self::$apiKey = ITS4YouReports_Bing_Map::getApiKeyForJs();
if (!empty(self::$apiKey)) {
if (!empty($reportId)) {
$ITS4YouReports = new ITS4YouReports(true, $reportId);
$this->setMapColumns($ITS4YouReports->reportinformations['maps']);
$generateObj = new GenerateObj($ITS4YouReports);
$reportMapData = $generateObj->generateBingMapsData($reportId);
try {
self::displayMap($reportMapData['found']);
ITS4YouReports_Bing_Map::resultsToTitle($reportMapData);
} catch (AppException $e) {
throw new Exception('map can not be displayed!');
}
} else {
throw new Exception('record can not be empty!');
}
} else {
throw new Exception('apiKey can not be empty!');
}
}
/**
* @param $foundData
*
* @throws AppException
* @throws SmartyException
*/
private function displayMap($foundData) {
$request = new Vtiger_Request($_REQUEST, $_REQUEST);
if (!empty($foundData)) {
if (!empty($foundData)) {
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$viewer->assign('MODULE', $moduleName);
$record = $request->get('record');
$viewer->assign('RECORD_ID', $record);
$viewer->assign('API_KEY', self::$apiKey);
$viewer->assign('MAP_ZOOM', (int) $this->getMapZoom());
$viewer->assign('FOUND_DATA', $foundData);
$viewer->assign('DEV_MODE', '0'); // 1 / 0
$viewer->view('BingView.tpl', $moduleName);
} else {
throw new AppException('No data to display');
}
}
}
/**
* @param array $mapColumns
*/
public function setMapColumns($mapColumns) {
$this->mapColumns = $mapColumns;
}
/**
* @return int
*/
public function getMapZoom() {
return ($this->mapColumns['zoom'] ? : self::$defaultMapZoom);
}
}