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

100 lines
4.0 KiB
PHP

<?php
class FinReports_Detail_View extends Vtiger_Detail_View
{
function __construct() {
parent::__construct();
$this->exposeMethod('showRelatedRecords');
}
/**
* Function to get activities
* @param Vtiger_Request $request
* @return <List of activity models>
*/
public function getActivities(Vtiger_Request $request) {
$moduleName = 'Calendar';
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if($currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) {
$moduleName = $request->getModule();
$recordId = $request->get('record');
$pageNumber = $request->get('page');
if(empty ($pageNumber)) {
$pageNumber = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('limit', 10);
if(!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$moduleModel = $recordModel->getModule();
$relatedActivities = $moduleModel->getCalendarActivities('', $pagingModel, 'all', $recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('ACTIVITIES', $relatedActivities);
return $viewer->view('RelatedActivities.tpl', $moduleName, true);
}
}
/**
* Function sends all the comments for a parent(Accounts, Contacts etc)
* @param Vtiger_Request $request
* @return <type>
*/
function showAllComments(Vtiger_Request $request) {
$parentRecordId = $request->get('record');
$commentRecordId = $request->get('commentid');
$moduleName = $request->getModule();
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
$parentCommentModels = ModComments_Record_Model::getAllParentComments($parentRecordId,$moduleName);
if(!empty($commentRecordId)) {
$currentCommentModel = ModComments_Record_Model::getInstanceById($commentRecordId);
}
$viewer = $this->getViewer($request);
$recordModel = Vtiger_Record_Model::getInstanceById($parentRecordId);
$link = $recordModel->getDetailViewUrl();
$viewer->assign('LINKDETAILVIEW', $link);
$viewer->assign('CURRENTUSER', $currentUserModel);
$viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel);
$viewer->assign('PARENT_COMMENTS', $parentCommentModels);
$viewer->assign('CURRENT_COMMENT', $currentCommentModel);
return $viewer->view('ShowAllComments.tpl', $moduleName, 'true');
}
function showChildComments(Vtiger_Request $request) {
$parentCommentId = $request->get('commentid');
$parentCommentModel = ModComments_Record_Model::getInstanceById($parentCommentId);
$childComments = $parentCommentModel->getChildComments();
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
$viewer = $this->getViewer($request);
$recordModel = Vtiger_Record_Model::getInstanceById($request->get('record'));
$link = $recordModel->getDetailViewUrl();
$viewer->assign('LINKDETAILVIEW', $link);
$viewer->assign('PARENT_COMMENTS', $childComments);
$viewer->assign('CURRENTUSER', $currentUserModel);
$viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel);
$moduleName = $request->getModule();
return $viewer->view('CommentsList.tpl', $moduleName, 'true');
}
}