Files
crm.clientright.ru/modules/Settings/ITS4YouQuickReminder/models/Integration.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

104 lines
2.8 KiB
PHP

<?php
/* * *******************************************************************************
* The content of this file is subject to the ITS4YouQuickReminder 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.
* ****************************************************************************** */
class Settings_ITS4YouQuickReminder_Integration_Model extends Vtiger_Base_Model
{
/**
* @var string
*/
public $moduleName;
/**
* @var PearDatabase
*/
public $db;
/**
* @param string $module
* @return Settings_ITS4YouQuickReminder_Integration_Model
* @throws Exception
*/
public static function getInstance($module)
{
$self = new self();
$self->db = PearDatabase::getInstance();
$self->setModuleName($module);
$self->retrieveData();
return $self;
}
public static function isInstalled()
{
$adb = PearDatabase::getInstance();
$result = $adb->query('SELECT * FROM its4you_reminder_settings');
return $adb->num_rows($result);
}
/**
* @throws Exception
*/
public function retrieveData()
{
$result = $this->db->pquery('SELECT * FROM its4you_reminder_settings WHERE module_name=?', array($this->getModuleName()));
$row = $this->db->query_result_rowdata($result);
$this->setData($row);
$this->set('module_name', $this->getModuleName());
}
/**
* @return string
*/
public function getModuleName()
{
return $this->moduleName;
}
/**
* @param string $value
*/
public function setModuleName($value)
{
$this->moduleName = $value;
}
public function save()
{
$params = array($this->get('module_name'), $this->get('active'));
if (!$this->isEmpty('id')) {
array_push($params, $this->get('id'));
$this->db->pquery('UPDATE its4you_reminder_settings SET module_name=?,active=? WHERE id=?', $params);
} else {
$this->db->pquery('INSERT INTO its4you_reminder_settings (module_name, active) VALUES (?,?)', $params);
}
}
public static $activeModules = [];
public static function getActiveModules()
{
if (empty(self::$activeModules)) {
$adb = PearDatabase::getInstance();
$result = $adb->pquery('SELECT module_name FROM its4you_reminder_settings WHERE active=?',
array('1')
);
while ($row = $adb->fetchByAssoc($result)) {
self::$activeModules[] = $row['module_name'];
}
}
return self::$activeModules;
}
}