PMCORE-2736

This commit is contained in:
Julio Cesar Laura Avendaño
2021-01-19 19:54:07 +00:00
parent c48d7a6c16
commit 40e9c679bd
5 changed files with 62 additions and 11 deletions

View File

@@ -63,6 +63,9 @@ $_SESSION['__SYSTEM_UTC_TIME_ZONE__'] = (int) (env('MAIN_SYSTEM_UTC_TIME_ZONE',
ini_set('date.timezone', $_SESSION['__SYSTEM_UTC_TIME_ZONE__'] ? 'UTC' : env('MAIN_TIME_ZONE', 'America/New_York'));
define('TIME_ZONE', ini_get('date.timezone'));
// Only test async routing
define('DISABLE_TASK_MANAGER_ROUTING_ASYNC', false);
//This path includes PM tables model classes
set_include_path(get_include_path() . PATH_SEPARATOR . PATH_DB . SYS_SYS . "/");

View File

@@ -106,11 +106,17 @@ try {
$cases = new Cases();
$cases->routeCase($processUid, $application, $postForm, $sStatus, $flagGmail, $tasUid, $index, $userLogged);
};
if (!DISABLE_TASK_MANAGER_ROUTING_ASYNC) {
// Routing the case asynchronically
JobsManager::getSingleton()->dispatch(RouteCase::class, $closure);
//We close the related threads.
// We close the related threads.
$cases = new Cases();
$cases->CloseCurrentDelegation($application, $index);
} else {
// Routing the case synchronically
$closure();
}
$debuggerAvailable = true;
$casesRedirector = 'casesListExtJsRedirector';
@@ -126,13 +132,42 @@ try {
}
}
$loc = $nextStep['PAGE'];
//Triggers After
// Triggers After
$isIE = Bootstrap::isIE();
unset($_SESSION['TRIGGER_DEBUG']);
//close tab only if IE11 add a validation was added if the current skin is uxs
// If the routing of cases asynchronically is disabled, use the old behaviour for debug option
if (DISABLE_TASK_MANAGER_ROUTING_ASYNC) {
// Determine the landing page
if (isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $nextStep['PAGE'];
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
} else {
$loc = $nextStep['PAGE'];
}
// If debug option is enabled for the process, load the debug template
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && !$isIE) {
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
$templatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$templatePower->prepare();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('template', '', '', '', $templatePower);
$_POST['NextStep'] = $loc;
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
G::RenderPage('publish', 'blank');
exit();
} else {
unset($_SESSION['TRIGGER_DEBUG']);
}
}
} else {
// If the case is routed synchronically, always redirect to the next step
$loc = $nextStep['PAGE'];
unset($_SESSION['TRIGGER_DEBUG']);
}
// Close tab only if IE11 add a validation was added if the current skin is uxs
if ($isIE && !isset($_SESSION['__OUTLOOK_CONNECTOR__']) && SYS_SKIN !== "uxs") {
$script = "
<script type='text/javascript'>

View File

@@ -61,7 +61,13 @@ if ($featureEnable) {
$cases = new Cases();
$cases->routeCaseActionByEmail($appUid, $delIndex, $aber, $dynUid, $forms, $remoteAddr, $files);
};
if (!DISABLE_TASK_MANAGER_ROUTING_ASYNC) {
// Routing the case asynchronically
JobsManager::getSingleton()->dispatch(ActionByEmail::class, $closure);
} else {
// Routing the case synchronically
$closure();
}
$message = [];
$message['MESSAGE'] = '<strong>' . G::loadTranslation('ID_ABE_INFORMATION_SUBMITTED') . '</strong>';

View File

@@ -82,7 +82,8 @@ class System
'report_table_batch_regeneration' => 1000,
'report_table_floating_number' => 4,
'report_table_double_number' => 4,
'ext_ajax_timeout' => 600000
'ext_ajax_timeout' => 600000,
'disable_task_manager_routing_async' => '0'
];
/**
@@ -1239,6 +1240,11 @@ class System
$config['highlight_home_folder_scope'] = self::$defaultConfig['highlight_home_folder_scope'];
}
$value = $config['disable_task_manager_routing_async'];
if (!is_numeric($value) || !in_array($value, [0, 1])) {
$config['disable_task_manager_routing_async'] = self::$defaultConfig['disable_task_manager_routing_async'];
}
return $config;
}

View File

@@ -342,6 +342,7 @@ define('HIGHLIGHT_HOME_FOLDER_ENABLE', $config['highlight_home_folder_enable'] =
define('HIGHLIGHT_HOME_FOLDER_REFRESH_TIME', $config['highlight_home_folder_refresh_time']);
define('HIGHLIGHT_HOME_FOLDER_SCOPE', $config['highlight_home_folder_scope']);
/*----------------------------------********---------------------------------*/
define('DISABLE_TASK_MANAGER_ROUTING_ASYNC', $config['disable_task_manager_routing_async'] === "1");
// IIS Compatibility, SERVER_ADDR doesn't exist on that env, so we need to define it.
$_SERVER['SERVER_ADDR'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['SERVER_NAME'];