Files
crm.clientright.ru/modules/ModuleBuilder/actions/InitModuleBuilder.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

98 lines
3.3 KiB
PHP

<?php
/***********************************************************************************************
** The contents of this file are subject to the Vtiger Module-Builder License Version 1.3
* ( "License" ); You may not use this file except in compliance with the License
* The Original Code is: Technokrafts Labs Pvt Ltd
* The Initial Developer of the Original Code is Technokrafts Labs Pvt Ltd.
* Portions created by Technokrafts Labs Pvt Ltd are Copyright ( C ) Technokrafts Labs Pvt Ltd.
* All Rights Reserved.
**
*************************************************************************************************/
class ModuleBuilder_InitModuleBuilder_Action extends Settings_Vtiger_Index_Action
{
/**
* Class Constructor
*/
function __construct()
{
global $log;
$log->debug("Entering __construct() method....");
$this->exposeMethod('initMB');
$this->exposeMethod('setSession');
$log->debug("Exiting __construct() method....");
}
/**
* Function to check permission for the User
*/
function checkPermission(Vtiger_Request $request) {
global $log;
$log->debug("Entering checkPermission(request array()) method....");
$log->debug("Exiting checkPermission(request array()) method....");
return true;
}
/**
* Function to check permission for the User
*/
function setSession(Vtiger_Request $request) {
global $log;
$log->debug("Entering setSession(request array()) method....");
$temp_array = array();
$token = $request->get('token');
$response = new Vtiger_Response();
unset($_SESSION['tks_module_builder'][$token]['blocks']);
unset($_SESSION['tks_module_builder'][$token]['fields']);
$response->setResult(array('init' => true));
$log->debug("Exiting setSession(request array()) method....");
return true;
}
/**
* Function to initaliza Module Builder and clear old data
*/
public function initMB(Vtiger_Request $request)
{
global $log;
$log->debug("Entering initMB(request array()) method....");
$temp_array = array();
$token = $request->get('token');
//$token = $request->get('token');
if($token == '')
{
$response = new Vtiger_Response();
$response->setError('502', vtranslate('LBL_FAILED_MODULE_INIT', $request->getModule(false)));
$response->emit();
$log->debug("Exiting initMB(request array()) method.... INITIALIZAION SESSION ERROR");
return;
}
$_SESSION['tks_module_builder']["$token"] = array();
$temp_array['tks_modname'] = $request -> get('tks_modulename');
$temp_array['tks_label'] = $request -> get('tks_modulelabel');
$temp_array['tks_parent'] = $request -> get('tks_parent');
$_SESSION['tks_module_builder']["$token"] = $temp_array;
$response = new Vtiger_Response();
try
{
$log->debug("initMB(request array()) method.... Init Done");
$log->debug("Exiting initMB(request array()) method....");
$response->setResult(array('init' => true));
header('Location: index.php?module=ModuleBuilder&view=Index&parent=Tools&app=PROJECT&token='.$token);
}
catch(Exception $e)
{
$log->debug("initMB(request array()) method.... ERROR OCCURED");
$response->setError($e->getCode(),$e->getMessage());
}
$log->debug("Exiting initMB(request array()) method....");
$response->emit();
}
}