- 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.
136 lines
4.8 KiB
PHP
136 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.
|
|
************************************************************************************/
|
|
|
|
require_once("include/utils/CommonUtils.php");
|
|
require_once("include/events/SqlResultIterator.inc");
|
|
require_once("include/events/VTWSEntityType.inc");
|
|
|
|
require_once("VTWorkflowApplication.inc");
|
|
require_once("VTTaskManager.inc");
|
|
require_once("VTWorkflowManager.inc");
|
|
require_once("VTWorkflowUtils.php");
|
|
function vtTaskEdit($adb, $request, $current_language, $app_strings){
|
|
global $theme;
|
|
$util = new VTWorkflowUtils();
|
|
$image_path = "themes/$theme/images/";
|
|
|
|
$module = new VTWorkflowApplication('edittask');
|
|
|
|
$mod = return_module_language($current_language, $module->name);
|
|
|
|
if(!$util->checkAdminAccess()){
|
|
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
|
|
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
|
|
return;
|
|
}
|
|
|
|
$smarty = new vtigerCRM_Smarty();
|
|
$tm = new VTTaskManager($adb);
|
|
$smarty->assign('edit',isset($request["task_id"]));
|
|
if(isset($request["task_id"])){
|
|
$task = $tm->retrieveTask($request["task_id"]);
|
|
$taskClass = get_class($task);
|
|
$workflowId=$task->workflowId;
|
|
}else{
|
|
$workflowId = $request["workflow_id"];
|
|
$taskClass = vtlib_purifyForSql($request["task_type"]);
|
|
$task = $tm->createTask($taskClass, $workflowId);
|
|
}
|
|
|
|
if($task==null){
|
|
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_TASK']);
|
|
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_TASK']);
|
|
return;
|
|
}
|
|
|
|
$wm = new VTWorkflowManager($adb);
|
|
$workflow = $wm->retrieve($workflowId);
|
|
if($workflow==null){
|
|
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_WORKFLOW']);
|
|
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_WORKFLOW']);
|
|
return;
|
|
}
|
|
|
|
|
|
$smarty->assign("workflow", $workflow);
|
|
$smarty->assign("returnUrl", vtlib_purify($request["return_url"]));
|
|
$smarty->assign("task", $task);
|
|
$smarty->assign("taskType", $taskClass);
|
|
$smarty->assign("saveType", vtlib_purify($request['save_type']));
|
|
|
|
$taskTypeInstance = VTTaskType::getInstanceFromTaskType($taskClass);
|
|
$taskTemplateClass = $tm->retrieveTemplatePath($module->name, $taskTypeInstance);
|
|
$smarty->assign("taskTemplate", $taskTemplateClass);
|
|
|
|
$et = VTWSEntityType::usingGlobalCurrentUser($workflow->moduleName);
|
|
$smarty->assign("entityType", $et);
|
|
$smarty->assign('entityName', $workflow->moduleName);
|
|
$smarty->assign("fieldNames", $et->getFieldNames());
|
|
$repeat_date = $task->calendar_repeat_limit_date;
|
|
if(!empty ($repeat_date)){
|
|
$repeat_date = DateTimeField::convertToUserFormat($repeat_date);
|
|
}
|
|
$smarty->assign('REPEAT_DATE',$repeat_date);
|
|
$dateFields = array();
|
|
$fieldTypes = $et->getFieldTypes();
|
|
$fieldLabels = $et->getFieldLabels();
|
|
foreach($fieldTypes as $name => $type){
|
|
if($type->type=='Date' || $type->type=='DateTime'){
|
|
$dateFields[$name] = $fieldLabels[$name];
|
|
}
|
|
}
|
|
|
|
$smarty->assign('dateFields', $dateFields);
|
|
|
|
|
|
if($task->trigger!=null){
|
|
$trigger = $task->trigger;
|
|
$days = $trigger['days'];
|
|
if ($days < 0){
|
|
$days*=-1;
|
|
$direction = 'before';
|
|
}else{
|
|
$direction = 'after';
|
|
}
|
|
$smarty->assign('trigger', array('days'=>$days, 'direction'=>$direction,
|
|
'field'=>$trigger['field']));
|
|
}
|
|
$metaVariables = $task->getMetaVariables();
|
|
|
|
$date = new DateTimeField(null);
|
|
$time = substr($date->getDisplayTime(), 0, 5);
|
|
$smarty->assign("META_VARIABLES",$metaVariables);
|
|
$smarty->assign("SYSTEM_TIMEZONE",$db_timezone);
|
|
$smarty->assign("USER_TIME",$task->formatTimeForTimePicker($time));
|
|
$smarty->assign("USER_DATE", $date->getDisplayDate());
|
|
$smarty->assign("MOD", array_merge(
|
|
return_module_language($current_language,'Settings'),
|
|
return_module_language($current_language, 'Calendar'),
|
|
return_module_language($current_language, $module->name)));
|
|
$smarty->assign("APP", $app_strings);
|
|
$smarty->assign("dateFormat", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
|
|
$smarty->assign("IMAGE_PATH",$image_path);
|
|
$smarty->assign("THEME", $theme);
|
|
$smarty->assign("MODULE_NAME", $module->label);
|
|
$smarty->assign("PAGE_NAME", $mod['LBL_EDIT_TASK']);
|
|
$smarty->assign("PAGE_TITLE", $mod['LBL_EDIT_TASK_TITLE']);
|
|
|
|
$users = $group = array();
|
|
$users = get_user_array();
|
|
$group = get_group_array();
|
|
foreach($group as $id => $name) {
|
|
$users[$id] = $name;
|
|
}
|
|
$smarty->assign('ASSIGNED_TO', $users);
|
|
$smarty->assign("module", $module);
|
|
$smarty->display("{$module->name}/EditTask.tpl");
|
|
}
|
|
vtTaskEdit($adb, $_REQUEST, $current_language, $app_strings);
|
|
?>
|