- 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.
113 lines
4.8 KiB
PHP
113 lines
4.8 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.
|
|
*************************************************************************************/
|
|
|
|
vimport('~~/include/Webservices/Query.php');
|
|
|
|
class Calendar_FetchAgendaEvents_Action extends Vtiger_BasicAjax_Action {
|
|
|
|
public function process(Vtiger_Request $request) {
|
|
$result = array();
|
|
$start = $request->get('startDate');
|
|
$noOfDays = $request->get('numOfDays');
|
|
$dbStartDateOject = DateTimeField::convertToDBTimeZone($start);
|
|
$dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');
|
|
|
|
$dbEndDateTime = $this->addDays($dbStartDateTime, $noOfDays);
|
|
|
|
$currentUser = Users_Record_Model::getCurrentUserModel();
|
|
$db = PearDatabase::getInstance();
|
|
|
|
$query = 'SELECT vtiger_activity.subject, vtiger_activity.eventstatus, vtiger_activity.priority ,vtiger_activity.visibility,
|
|
vtiger_activity.date_start, vtiger_activity.time_start, vtiger_activity.due_date, vtiger_activity.time_end,
|
|
vtiger_crmentity.smownerid, vtiger_activity.activityid, vtiger_activity.activitytype, vtiger_activity.recurringtype,
|
|
vtiger_activity.location FROM vtiger_activity
|
|
INNER JOIN vtiger_crmentity ON vtiger_activity.activityid = vtiger_crmentity.crmid
|
|
LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id
|
|
LEFT JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid
|
|
WHERE vtiger_crmentity.deleted=0 AND vtiger_activity.activityid > 0 AND vtiger_activity.activitytype NOT IN ("Emails","Task") AND ';
|
|
|
|
$hideCompleted = $currentUser->get('hidecompletedevents');
|
|
if ($hideCompleted) {
|
|
$query.= "vtiger_activity.eventstatus != 'HELD' AND ";
|
|
}
|
|
$query.= " (concat(date_start,'',time_start)) >= ? AND (concat(date_start,'',time_start)) < ?";
|
|
|
|
$params = array($dbStartDateTime, $dbEndDateTime);
|
|
|
|
$eventUserId = $currentUser->getId();
|
|
$userIds = array_merge(array($eventUserId), $this->getGroupsIdsForUsers($eventUserId));
|
|
$query.= " AND vtiger_crmentity.smownerid IN (".generateQuestionMarks($userIds).")";
|
|
$query.= ' ORDER BY time_start';
|
|
|
|
$params = array_merge($params, $userIds);
|
|
$queryResult = $db->pquery($query, $params);
|
|
//SalesPlatform.ru begin
|
|
$moduleName = $request->getModule();
|
|
//SalesPlatform.ru end
|
|
while ($record = $db->fetchByAssoc($queryResult)) {
|
|
$item = array();
|
|
$item['id'] = $record['activityid'];
|
|
$item['visibility'] = $record['visibility'];
|
|
$item['activitytype'] = $record['activitytype'];
|
|
$item['status'] = vtranslate($record['eventstatus'], $moduleName);
|
|
$item['priority'] = $record['priority'];
|
|
$item['userfullname'] = getUserFullName($record['smownerid']);
|
|
$item['title'] = decode_html($record['subject']);
|
|
|
|
$dateTimeFieldInstance = new DateTimeField($record['date_start'].' '.$record['time_start']);
|
|
$userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
|
|
$startDateComponents = explode(' ', $userDateTimeString);
|
|
|
|
$item['start'] = $userDateTimeString;
|
|
$item['startDate'] = $startDateComponents[0];
|
|
$item['startTime'] = $startDateComponents[1];
|
|
|
|
$dateTimeFieldInstance = new DateTimeField($record['due_date'].' '.$record['time_end']);
|
|
$userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
|
|
$endDateComponents = explode(' ', $userDateTimeString);
|
|
|
|
$item['end'] = $userDateTimeString;
|
|
$item['endDate'] = $endDateComponents[0];
|
|
$item['endTime'] = $endDateComponents[1];
|
|
|
|
if ($currentUser->get('hour_format') == '12') {
|
|
$item['startTime'] = Vtiger_Time_UIType::getTimeValueInAMorPM($item['startTime']);
|
|
$item['endTime'] = Vtiger_Time_UIType::getTimeValueInAMorPM($item['endTime']);
|
|
}
|
|
$recurringCheck = false;
|
|
if($record['recurringtype'] != '' && $record['recurringtype'] != '--None--') {
|
|
$recurringCheck = true;
|
|
}
|
|
$item['recurringcheck'] = $recurringCheck;
|
|
$result[$startDateComponents[0]][] = $item;
|
|
}
|
|
|
|
$response = new Vtiger_Response();
|
|
$response->setResult($result);
|
|
$response->emit();
|
|
}
|
|
|
|
public function addDays($datetime, $daysToAdd) {
|
|
$datetime = strtotime($datetime);
|
|
$secondsDelta = 24 * 60 * 60 * $daysToAdd;
|
|
$futureDate = $datetime + $secondsDelta;
|
|
return date("Y-m-d H:i:s", $futureDate);
|
|
}
|
|
|
|
protected function getGroupsIdsForUsers($userId) {
|
|
vimport('~~/include/utils/GetUserGroups.php');
|
|
|
|
$userGroupInstance = new GetUserGroups();
|
|
$userGroupInstance->getAllUserGroups($userId);
|
|
return $userGroupInstance->user_groups;
|
|
}
|
|
|
|
}
|