- 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.
154 lines
3.5 KiB
PHP
154 lines
3.5 KiB
PHP
<?php
|
|
/**
|
|
* @copyright 2016-2017 Redoo Networks GmbH
|
|
* @link https://redoo-networks.com/
|
|
* This file is part of a vTigerCRM module, implemented by Redoo Networks GmbH and must not used without permission.
|
|
*/
|
|
|
|
namespace Workflow\RequestValuesForm;
|
|
|
|
|
|
use Workflow\RequestValuesForm;
|
|
use Workflow\Task;
|
|
use Workflow\VTEntity;
|
|
|
|
class Field
|
|
{
|
|
/**
|
|
* @var null|Row
|
|
*/
|
|
private $_Row = null;
|
|
private $_ColIndex = 0;
|
|
|
|
private $_Type = null;
|
|
private $_Data = array();
|
|
private $_Config = array();
|
|
|
|
private $_FieldName = '';
|
|
|
|
private $_Label = '';
|
|
private $_Value = '';
|
|
|
|
private $_HTML = '';
|
|
private $_JS = '';
|
|
/**
|
|
* Field constructor.
|
|
* @param Row $row
|
|
*/
|
|
public function __construct(Row $row) {
|
|
$this->_Row = $row;
|
|
}
|
|
|
|
/**
|
|
* @param string $type
|
|
*/
|
|
public function setType($type) {
|
|
$this->_Type = $type;
|
|
}
|
|
public function getType() {
|
|
return $this->_Type;
|
|
}
|
|
|
|
public function setFieldname($fieldname) {
|
|
$this->_FieldName = $fieldname;
|
|
}
|
|
public function getFieldname() {
|
|
return $this->_FieldName;
|
|
}
|
|
public function getValue($value, $fieldName, $completeData, VTEntity $context, Task $task) {
|
|
|
|
$type = \Workflow\Fieldtype::getType($this->_Type);
|
|
return $type->getValue($value, $fieldName, $this->_Type, $context, $completeData, $this->_Data, $task);
|
|
|
|
}
|
|
|
|
/**
|
|
* @param $config
|
|
*/
|
|
public function setConfig($config) {
|
|
$this->_Config = $config;
|
|
}
|
|
|
|
public function setConfigValue($key, $value) {
|
|
$this->_Config[$key] = $value;
|
|
}
|
|
|
|
/**
|
|
* @param $label
|
|
*/
|
|
public function setLabel($label) {
|
|
$this->_Label = $label;
|
|
}
|
|
|
|
/**
|
|
* @param $value
|
|
*/
|
|
public function setValue($value) {
|
|
$this->_Value = $value;
|
|
}
|
|
|
|
/**
|
|
* @param array $data
|
|
*/
|
|
public function setData($data) {
|
|
$this->_Data = $data;
|
|
}
|
|
|
|
/**
|
|
* @param VTEntity $context
|
|
* @return string
|
|
*/
|
|
public function render(VTEntity $context) {
|
|
$this->_HTML = '';
|
|
|
|
if(!empty($this->_FieldName)) {
|
|
$this->_Data['name'] = $this->_FieldName;
|
|
}
|
|
$this->_Data['type'] = $this->_Type;
|
|
|
|
$this->_Data['label'] = $this->_Label;
|
|
$this->_Data['config'] = $this->_Config;
|
|
|
|
if(!empty($this->_Value)) {
|
|
$this->_Data['config']["default"] = $this->_Value;
|
|
}
|
|
|
|
$type = \Workflow\Fieldtype::getType($this->_Type, 2);
|
|
|
|
if($type === false) {
|
|
throw new \Exception('Type '.$this->_Type.' not found');
|
|
}
|
|
|
|
if($type->decorated($this->_Data) == true) {
|
|
$this->_HTML .= '<div class="group materialstyle">';
|
|
$result = $type->renderFrontendV2($this->_Data, $context);
|
|
|
|
$this->_HTML .= $result['html'];
|
|
$this->_JS = $result['js'];
|
|
|
|
$this->_HTML .= '<label>' . $this->_Label . '</label>';
|
|
$this->_HTML .= '</div>';
|
|
} else {
|
|
$result = $type->renderFrontendV2($this->_Data, $context);
|
|
|
|
$this->_HTML .= $result['html'];
|
|
$this->_JS = $result['js'];
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
* @throws \Exception
|
|
*/
|
|
public function getHTML() {
|
|
if(empty($this->_HTML)) throw new \Exception('Execute render Function before get HTML');
|
|
return $this->_HTML;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getJS() {
|
|
return $this->_JS;
|
|
}
|
|
} |