Files
crm.clientright.ru/modules/Workflow2/extends/inventoryloader/ProductCollection.inc.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

71 lines
2.3 KiB
PHP

<?php
/**
* Created by Stefan Warnat
* User: Stefan
* Date: 28.09.2016
* Time: 18:59
*/
namespace Workflow\Plugin\InventoryLoader;
use Workflow\InventoryLoader;
use Workflow\VTEntity;
class ProductCollection implements \Workflow\Interfaces\IInventoryLoader {
public function getAvailableLoader()
{
return array(
'productcollection' => array( // LOADERKEY
'label' => 'Add Products from Product Collection', // LOADERLABEL
'config' => array( // LOADERCONFIG
'collectionid' => array(
'type' => 'template',
'label' => 'Product Collection ID:',
'description' => 'Collect Products/Services in Product Collection to work with multiple Items at once.'
)
)
),
);
}
public function getItems($config, VTEntity $context)
{
$collectionid = $config['collectionid'];
$envKey = '__prodcol_'.$collectionid;;
$itemIds = $context->getEnvironment($envKey);
if(empty($itemIds)) array();
$sql = 'SELECT * FROM vtiger_inventoryproductrel WHERE lineitem_id IN ('.implode(',', $itemIds).')';
$result = \Workflow\VtUtils::query($sql);
$availableTaxes = getAllTaxes();
$products = array();
while($row = \Workflow\VtUtils::fetchByAssoc($result)) {
$tmp = array(
'module' => \Vtiger_Functions::getCRMRecordType($row['productid']),
'productlabel' => \Vtiger_Functions::getCRMRecordLabel($row['productid']),
'productid' => $row['productid'],
'comment' => $row['comment'],
'quantity' => $row['quantity'],
'listprice' => $row['listprice'],
'discount_amount' => $row['discount_amount'],
'discount_percent' => $row['discount_percent'],
'taxes' => array()
);
foreach($availableTaxes as $tax) {
if(!empty($row[$tax['taxname']])) {
$tmp['taxes'][$tax['taxid']] = $row[$tax['taxname']];
}
}
$products[] = $row;
}
return $products;
}
}
InventoryLoader::register(__NAMESPACE__.'\\ProductCollection');