PMCORE-4144

This commit is contained in:
Julio Cesar Laura Avendaño
2023-01-30 16:35:39 +00:00
parent fe4f7b22cc
commit bf2d0a2f37
3 changed files with 33 additions and 0 deletions

View File

@@ -6166,6 +6166,7 @@ class G
define('PM_SCHEDULER_CREATE_CASE_BEFORE', 1019); define('PM_SCHEDULER_CREATE_CASE_BEFORE', 1019);
define('PM_SCHEDULER_CREATE_CASE_AFTER', 1020); define('PM_SCHEDULER_CREATE_CASE_AFTER', 1020);
define('PM_SWAP_TEMPORARY_APP_NUMBER', 1021); define('PM_SWAP_TEMPORARY_APP_NUMBER', 1021);
define('PM_REDIRECT', 1022);
} }
/** /**

View File

@@ -22,6 +22,7 @@ use ProcessMaker\Plugins\PluginRegistry;
use ProcessMaker\Validation\ValidationUploadedFiles; use ProcessMaker\Validation\ValidationUploadedFiles;
use ProcessUserPeer; use ProcessUserPeer;
use ResultSet; use ResultSet;
use stdClass;
use StepPeer; use StepPeer;
use StepSupervisorPeer; use StepSupervisorPeer;
use Users; use Users;
@@ -541,6 +542,21 @@ class InputDocument
$iDocVersion = $oAppDocument->getDocVersion(); $iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename()); $info = pathinfo($oAppDocument->getAppDocFilename());
// Plugin Hook PM_REDIRECT to redirect to a custom page
$pluginRegistry = PluginRegistry::loadSingleton();
// If the hook exists try to execute
if ($pluginRegistry->existsTrigger(PM_REDIRECT)) {
// Build the object to send
$data = new stdClass();
$data->sApplicationUid = $oAppDocument->getAppUid();
$data->appDocUid = $oAppDocument->getAppDocUid();
$data->docType = '';
// Execute hook
$pluginRegistry->executeTriggers(PM_REDIRECT, $data);
}
$app_uid = G::getPathFromUID($oAppDocument->Fields['APP_UID']); $app_uid = G::getPathFromUID($oAppDocument->Fields['APP_UID']);
$file = G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid); $file = G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid);

View File

@@ -3,6 +3,7 @@ namespace ProcessMaker\BusinessModel\Cases;
use ProcessMaker\Core\System; use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry; use ProcessMaker\Plugins\PluginRegistry;
use stdClass;
class OutputDocument class OutputDocument
{ {
@@ -372,6 +373,21 @@ class OutputDocument
$pathInfo = pathinfo($appDocument->getAppDocFilename()); $pathInfo = pathinfo($appDocument->getAppDocFilename());
// Plugin Hook PM_REDIRECT to redirect to a custom page
$pluginRegistry = PluginRegistry::loadSingleton();
// If the hook exists try to execute
if ($pluginRegistry->existsTrigger(PM_REDIRECT)) {
// Build the object to send
$data = new stdClass();
$data->sApplicationUid = $appDocument->getAppUid();
$data->appDocUid = $appDocument->getAppDocUid();
$data->docType = $ext;
// Execute hook
$pluginRegistry->executeTriggers(PM_REDIRECT, $data);
}
$extensionDoc = $ext; $extensionDoc = $ext;
$versionDoc = '_' . $arrayAppDocumentData['DOC_VERSION']; $versionDoc = '_' . $arrayAppDocumentData['DOC_VERSION'];