Files
crm.clientright.ru/modules/Vtiger/views/ListViewQuickPreview.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

139 lines
4.9 KiB
PHP

<?php
/* +***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
* *********************************************************************************** */
class Vtiger_ListViewQuickPreview_View extends Vtiger_Index_View {
protected $record = false;
function __construct() {
parent::__construct();
}
public function requiresPermission(\Vtiger_Request $request) {
$permissions = parent::requiresPermission($request);
$permissions[] = array('module_parameter' => 'module', 'action' => 'DetailView', 'record_parameter' => 'record');
return $permissions;
}
function checkPermission(Vtiger_Request $request) {
$moduleName = $request->getModule();
$recordId = $request->get('record');
parent::checkPermission($request);
$nonEntityModules = array('Users', 'Events', 'Calendar', 'Portal', 'Reports', 'Rss', 'EmailTemplates');
if ($recordId && !in_array($moduleName, $nonEntityModules)) {
$recordEntityName = getSalesEntityType($recordId);
if ($recordEntityName !== $moduleName) {
throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}
}
return true;
}
function process(Vtiger_Request $request) {
$moduleName = $request->getModule();
$viewer = $this->getViewer($request);
$recordId = $request->get('record');
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
if ($request->get('navigation') == 'true') {
$this->assignNavigationRecordIds($viewer, $recordId);
}
$recordModel = $this->record->getRecord();
$recordStrucure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_SUMMARY);
$moduleModel = $recordModel->getModule();
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('SUMMARY_RECORD_STRUCTURE', $recordStrucure->getStructure());
$viewer->assign('$SOCIAL_ENABLED', false);
$viewer->assign('SELECTED_MENU_CATEGORY', 'MARKETING');
$viewer->assign('LIST_PREVIEW', true);
$pageNumber = 1;
$limit = 5;
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('limit', $limit);
if ($moduleModel->isCommentEnabled()) {
//Show Top 5
$recentComments = ModComments_Record_Model::getRecentComments($recordId, $pagingModel);
$viewer->assign('COMMENTS', $recentComments);
$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
$viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel);
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$viewer->assign('CURRENTUSER', $currentUserModel);
}
$viewer->assign('SHOW_ENGAGEMENTS', 'false');
$recentActivities = ModTracker_Record_Model::getUpdates($recordId, $pagingModel, $moduleName);
//To show more button for updates if there are more than 5 records
if (count($recentActivities) >= 5) {
$pagingModel->set('nextPageExists', true);
} else {
$pagingModel->set('nextPageExists', false);
}
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('RECENT_ACTIVITIES', $recentActivities);
$viewer->view('ListViewQuickPreview.tpl', $moduleName);
}
public function assignNavigationRecordIds($viewer, $recordId){
//Navigation to next and previous records.
$navigationInfo = ListViewSession::getListViewNavigation($recordId);
//Intially make the prev and next records as null
$prevRecordId = null;
$nextRecordId = null;
$found = false;
if ($navigationInfo) {
foreach ($navigationInfo as $page => $pageInfo) {
foreach ($pageInfo as $index => $record) {
//If record found then next record in the interation
//will be next record
if ($found) {
$nextRecordId = $record;
break;
}
if ($record == $recordId) {
$found = true;
}
//If record not found then we are assiging previousRecordId
//assuming next record will get matched
if (!$found) {
$prevRecordId = $record;
}
}
//if record is found and next record is not calculated we need to perform iteration
if ($found && !empty($nextRecordId)) {
break;
}
}
}
$viewer->assign('PREVIOUS_RECORD_ID', $prevRecordId);
$viewer->assign('NEXT_RECORD_ID', $nextRecordId);
$viewer->assign('NAVIGATION', true);
}
public function validateRequest(Vtiger_Request $request) {
$request->validateReadAccess();
}
}