Files
crm.clientright.ru/modules/Workflow2/lib/Workflow/ConditionPlugin.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
2.8 KiB
PHP

<?php
/**
* Created by JetBrains PhpStorm.
* User: Stefan Warnat <support@stefanwarnat.de>
* Date: 04.06.14 15:48
* You must not use this file without permission.
*/
namespace Workflow;
abstract class ConditionPlugin extends Extendable {
private $records = array();
/**
* @var \SWSearchPlusEventHandler
*/
public static $tableHander = false;
public static function init() {
self::_init(dirname(__FILE__).'/../../extends/conditions/');
}
public static function getSQLCondition($key, $moduleName, $columnName, $config, $not = false) {
$types = self::getAvailableOperators($moduleName);
if(strpos($key, '/') === false) {
$group = 'core';
} else {
$parts = explode('/', $key);
$key = $parts[1];
$group = $parts[0];
}
/**
* @var $item ConditionPlugin
*/
$item = self::getItem($group);
return $item->generateSQLCondition($key, $columnName, $config, $not);
}
public static function checkCondition(VTEntity $context, $moduleName, $key, $fieldValue, $config, $checkConfig) {
$void = self::getAvailableOperators($moduleName);
if(strpos($key, '/') === false) {
$group = 'core';
} else {
$parts = explode('/', $key);
$key = $parts[1];
$group = $parts[0];
}
/**
* @var $item ConditionPlugin
*/
$item = self::getItem($group);
return $item->checkValue($context, $key, $fieldValue, $config, $checkConfig);
}
public static function addJoinTable() {
}
public static function getAvailableOperators($moduleName, $mode = 'field') {
$items = self::getItems();
$return = array();
foreach($items as $item) {
$configs = $item->getOperators($moduleName);
foreach($configs as $key => $file) {
if($mode == 'mysql' && isset($file['mysqlmode']) && $file['mysqlmode'] === false) {
continue;
}
if($mode == 'field' && isset($file['fieldmode']) && $file['fieldmode'] === false) {
continue;
}
$file['label'] = vtranslate($file['label'], 'Settings:Workflow2');
$return[$item->getExtendableKey().'/'.$key] = $file;
}
}
return $return;
}
/**
* return array(array('<html>','<script>'), array('<html>','<script>'))
* @param $moduleName
* @return mixed
*/
abstract public function getOperators($moduleName);
abstract public function generateSQLCondition($key, $columnName, $value, $not);
abstract public function checkValue($context, $key, $fieldValue, $config, $checkConfig);
public function isAvailable($moduleName) {
return true;
}
}
?>