Files
crm.clientright.ru/modules/VDNotifierPro/helpers/GenerateSetting.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

101 lines
3.6 KiB
PHP

<?php
/* * *******************************************************************************
* The content of this file is subject to the Notificator Pro license.
* ("License"); You may not use this file except in compliance with the License
* The Initial Developer of the Original Code is http://www.vordoom.net
* Portions created by Vordoom.net are Copyright(C) Vordoom.net
* All Rights Reserved.
* ****************************************************************************** */
class VDNotifierProGenerateSetting {
public function DefaultModuleSetting($Modules){
$params = array ("status"=>"1","creator"=>"1","owner"=>"1","modif"=>"1","newentity"=>"1","updateentity"=>"1");
$ModulesSettings = array();
foreach ($Modules as $module){
if ($module->get('isentitytype') == '1' && $module->getName() != 'Webmails'){
$ModulesSettings[$module->getName()] = array();
foreach ($params as $name => $value){
$ModulesSettings[$module->getName()][$name] = $value;
}
}
}
return $this->SetSetting('ModuleSetting', $ModulesSettings);
}
public function DefaultUsersSetting(){
global $current_user;
$ClassName = "UsersSetting_".$current_user->id;
$UserSettings = array();
$UserSettings['Setting'] = array ("sound"=>"1","message"=>"1");
return $this->SetSetting($ClassName, $UserSettings);
}
public function DefaultGeneralSetting(){
$GeneralSetting = array();
$GeneralSetting['Setting'] = array ("a"=>"1","t"=>"5000","k"=>"");
return $this->SetSetting("GeneralSetting", $GeneralSetting);
}
public function SetValue($NameObject,$NameSetting,$array){
global $current_user;
$config = new VDNotifierProConfig();
$data = $config->$NameObject;
$_data = array();
if ($NameObject == 'ModuleSetting'){
foreach ($data as $key=>$_val){
$_data[$key] = Zend_Json::decode($_val);
}
}
else {
$_data[$NameSetting] = $data;
}
foreach ($array as $key=>$value){
$_data[$NameSetting][$key] = $value;
}
if ($NameObject == 'UsersSetting'){
$NameObject = "UsersSetting_".$current_user->id;
}
//print_r ($data);die;
return $this->SetSetting($NameObject, $_data);
}
public function ChangeModuleValue($module,$value){
$config = new VDNotifierProConfig();
$data = $config->ModuleSetting;
// var_dump($data);die;
foreach ($data as $key=>$_val){
$data[$key] = Zend_Json::decode($_val);
if ($key == $module){
foreach ($data[$module] as $_key => $val){
$data[$module][$_key] = $value;
}
}
}
return $this->SetSetting('ModuleSetting', $data);
}
public function GenerateClass($ClassName, $array){
$text = "<?php \n";
$text .= "class VDNotifierPro$ClassName { \n";
foreach ($array as $key=> $value){
$text .= "\tpublic $".$key." = '".Zend_Json::encode($value)."';\n";
}
$text .= '}';
return $text;
}
public function SetSetting($ClassName, $array){
$text = $this->GenerateClass($ClassName, $array);
$fp = fopen('modules/VDNotifierPro/Settings/'.$ClassName.'.php', 'w');
$result = fwrite($fp, $text);
fclose($fp);
return $result;
}
}