- 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.
81 lines
2.7 KiB
PHP
81 lines
2.7 KiB
PHP
<?php
|
|
|
|
class Settings_FinReports_Settings_Model extends Vtiger_Base_Model
|
|
{
|
|
public $user = NULL;
|
|
public $db = NULL;
|
|
public $dataFields = array('api', 'org_field', 'del_field');
|
|
public function __construct()
|
|
{
|
|
global $current_user;
|
|
$this->user = $current_user;
|
|
$this->db = PearDatabase::getInstance();
|
|
}
|
|
public function getData()
|
|
{
|
|
$settings = array();
|
|
$query = "SELECT * FROM vtiger_finreports_settings";
|
|
$result = $this->db->pquery($query, array());
|
|
if (0 < $this->db->num_rows($result)) {
|
|
while ($row = $this->db->fetchByAssoc($result)) {
|
|
$settings[$row['name']] = $row['value'];
|
|
}
|
|
}
|
|
return $settings;
|
|
}
|
|
public function getModuleFields($moduleName)
|
|
{
|
|
$moduleHandler = vtws_getModuleHandlerFromName($moduleName, $this->user);
|
|
$moduleMeta = $moduleHandler->getMeta();
|
|
return $moduleMeta->getModuleFields();
|
|
}
|
|
public function deleteRecord($request)
|
|
{
|
|
$recordId = $request->get("record", 0);
|
|
if ($recordId == 0) {
|
|
return false;
|
|
}
|
|
$this->db->pquery("DELETE FROM vtiger_finreports_settings WHERE vtiger_finreports_settings.id=?", array($recordId));
|
|
return true;
|
|
}
|
|
public function saveSetting($request)
|
|
{
|
|
$entities = $request->get("entities", 0);
|
|
if (0 < $entities) {
|
|
$this->updateSetting($request);
|
|
} else {
|
|
$this->addSetting($request);
|
|
}
|
|
return true;
|
|
}
|
|
public function updateSetting($request)
|
|
{
|
|
$modulename = $request->get("modulename");
|
|
foreach ($this->dataFields as $dataField) {
|
|
$curData = $request->get($dataField);
|
|
$query = "SELECT * FROM vtiger_finreports_settings WHERE `name` = ?";
|
|
$result = $this->db->pquery($query, array($dataField));
|
|
if (0 < $this->db->num_rows($result)) {
|
|
$this->db->pquery("UPDATE vtiger_finreports_settings SET `name` = ?, `value` = ?\n WHERE `name` = ?", array($dataField, $curData, $dataField));
|
|
} else {
|
|
$this->db->pquery("INSERT INTO vtiger_finreports_settings(`name`, `value`)\n VALUES(?, ?)", array($dataField, $curData));
|
|
}
|
|
}
|
|
|
|
|
|
return true;
|
|
}
|
|
public function addSetting($request)
|
|
{
|
|
$modulename = $request->get("modulename");
|
|
foreach ($this->dataFields as $dataField) {
|
|
$curData = $request->get($dataField);
|
|
$this->db->pquery("INSERT INTO vtiger_finreports_settings(`name`, `value`)\n VALUES(?, ?)", array($dataField, $curData));
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
?>
|