Files
crm.clientright.ru/modules/Settings/Workflow2/views/resources/FrontendWorkflows.js
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

107 lines
4.4 KiB
JavaScript

/**
* Created by Stefan on 13.11.2016.
*/
var workflowID = 1;
(function($) {
$(function() {
function backupToggleable() {
var panelids = [];
jQuery('.Toggleable.Visible', '.contentsDiv').each(function(index, ele) {
panelids.push($(ele).data('panelid'));
});
window._serializedOpenToggleables = panelids;
}
function restoreToggleable() {
if(typeof window._serializedOpenToggleables == 'undefined') return;
jQuery.each(window._serializedOpenToggleables, function(index, panelid) {
$('.Toggleable[data-panelid="' + panelid + '"]', '.contentsDiv' ).toggleClass('Visible Invisible');
});
}
var FrontendConfig = {
addEvents:function() {
$('#addWorkflowButton').on('click', function(e) {
var wfId = $('#addWorkflow').val();
if(wfId == '') return;
RedooAjax('Workflow2').postAction('FrontendWorkflowAdd', {
wfid:wfId
}, true).then(FrontendConfig.refresh);
});
$('.ActivateToggle').on('change', function(e) {
var entry = $($(e.currentTarget).closest('.WorkflowFrontendContentIntern'));
RedooAjax('Workflow2').postAction('FrontendWorkflowActivate', {
'id': entry.data('id'),
'status': $(e.currentTarget).prop('checked') ? 1 : 0
}, true);
});
$('.ToggleHandler').on('click', function(e) {
$(e.currentTarget).closest('.Toggleable').toggleClass('Visible Invisible');
});
$('.editConfig').on('click', function(e) {
var triggerID = jQuery(e.currentTarget).closest('.ToggleContent').data('id');
workflowID = jQuery(e.currentTarget).closest('.ToggleContent').data('workflowid');
FrontendConfig.openEditor(triggerID);
e.preventDefault();
e.stopPropagation();
});
$('.deleteConfig').on('click', function(e) {
var triggerID = jQuery(e.currentTarget).closest('.ToggleContent').data('id');
bootbox.confirm(app.vtranslate('Please confirm'), function(response) {
if(response === false) return;
RedooAjax('Workflow2').postAction('RemoveFrontendTrigger', {triggerID: triggerID}, true).then(function() {
console.log(jQuery('.WorkflowFrontendContainerIntern[data-panelid="wf_' + triggerID + '"]'));
jQuery('.WorkflowFrontendContainerIntern[data-panelid="wf_' + triggerID + '"]').remove();
});
});
e.preventDefault();
e.stopPropagation();
});
},
openEditor:function(triggerID) {
RedooAjax('Workflow2').postView('FrontendWorkflowEditor', { id:triggerID }, true).then(function(html) {
RedooUtils('Workflow2').showModalBox(html).then(function(data) {
var data = $(data);
var quickCreateForm = data.find('form[name="FrontendWorkflowEditor"]');
jQuery(quickCreateForm).submit(function(e) {
e.preventDefault();
var options = {
success: function(data) {
FrontendConfig.refresh();
},
dataType: 'json' // 'xml', 'script', or 'json' (expected server response type)
};
jQuery(this).ajaxSubmit(options);
return false;
});
});
});
},
refresh:function() {
backupToggleable();
RedooUtils('Workflow2').refreshContent('FrontendWorkflowConfig', true).then(function() {
FrontendConfig.addEvents();
restoreToggleable();
});
},
}
FrontendConfig.addEvents();
});
})(jQuery);