Files
crm.clientright.ru/modules/Workflow2/extends/provider/GoogleCalendar.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

112 lines
3.1 KiB
PHP

<?php
/**
* Created by JetBrains PhpStorm.
* User: Stefan Warnat <support@stefanwarnat.de>
* Date: 20.09.14 23:15
* You must not use this file without permission.
*/
namespace Workflow\Plugins\ConnectionProvider;
use Workflow\CommunicationPlugin;
use Workflow\OAuth;
use Workflow\VtUtils;
/**
* Class WfTaskCommunicateSMS
*
* @method int SMS() SMS(array $data)
* @method int SMS_check() SMS_check(array $data)
* @method array filterDataField(string $method, array $config)
* @method int FAX() FAX(array $data)
* @method int FAX_check() FAX_check(array $data)
*/
class GoogleCalendar extends \Workflow\ConnectionProvider {
protected $_title = 'Google Calendar';
protected $OAuthEnabled = true;
protected $OAuthTutorial = '';
protected $service = null;
/**
* @param $oauthObj \Workflow\OAuth
* @param $method
* @param $params
*/
public static function OAuthCallback($oauthObj, $method, $params = array()) {
switch($method) {
case 'get_authorization_url':
return $oauthObj->getCallbackUrl('vtiger-googlecalendar');
/*
return $provider->getAuthorizationUrl(array(
'scope' => array('channels:read', 'channels:write', 'chat:write:bot'), //, 'files:write:user'),
));*/
break;
case 'callback':
error_log('Callback: '.$_POST['refresh_token']);
$oauthObj->done(VtUtils::json_encode(array('access_token' => $_POST['access_token'])), $_POST['refresh_token'], $_POST['expire']);
break;
}
}
/*
protected $configFields = array (
'provider' => array (
'label' => 'Provider',
'type' => 'picklist',
'readonly' => true,
'options' => array(),
'description' => 'Which Communication provider do you use?'
),
);
*/
/**
* @throws \Exception
*/
public function renderExtraBackend($data) {
}
public function test() {
$service = $this->getCalendarService();
$listFeed = $service->calendarList->listCalendarList();
return true;
}
public function applyConfiguration(CommunicationPlugin $provider) {
}
public function getConfigFields() {
}
public function getClient() {
$additionalDir = VtUtils::getAdditionalPath('googleapi');
if(!function_exists('google_api_php_client_autoload')) {
require_once($additionalDir."/google-api-php-client/autoload.php");
}
$client = new \Google_Client();
$client->setAccessToken($this->getAccessToken());
return $client;
}
/**
* @return \Google_Service_Calendar
*/
public function getCalendarService() {
if($this->service === null) {
$client = $this->getClient();
$this->service = new \Google_Service_Calendar($client);
}
return $this->service;
}
}
\Workflow\ConnectionProvider::register('googlecalendar', '\Workflow\Plugins\ConnectionProvider\GoogleCalendar');