HOR-3214
WebEntry2 Execution Screen
This commit is contained in:
@@ -322,7 +322,7 @@ class WebEntry
|
||||
$projectUser = new \ProcessMaker\BusinessModel\ProjectUser();
|
||||
|
||||
if (!$projectUser->userIsAssignedToTask($arrayData["USR_UID"], $arrayDataMain["TAS_UID"])) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_USER_DOES_NOT_HAVE_ACTIVITY_ASSIGNED", array($arrayUserData["USR_USERNAME"], $arrayTaskData["TAS_TITLE"])));
|
||||
//throw new \Exception(\G::LoadTranslation("ID_USER_DOES_NOT_HAVE_ACTIVITY_ASSIGNED", array($arrayUserData["USR_USERNAME"], $arrayTaskData["TAS_TITLE"])));
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
@@ -402,6 +402,13 @@ class WebEntry
|
||||
|
||||
$fileContent = "<?php\n\n";
|
||||
$fileContent .= "global \$_DBArray;\n";
|
||||
$fileContent .= '$webEntry = new ' . WebEntry::class . ";\n";
|
||||
$fileContent .= "\$processUid = \"" . $processUid . "\";\n";
|
||||
$fileContent .= "\$weUid = \"" . $arrayWebEntryData['WE_UID'] . "\";\n";
|
||||
$fileContent .= "\$tasUid = \"" . $arrayWebEntryData['TAS_UID'] . "\";\n";
|
||||
$fileContent .= 'if (!$webEntry->isWebEntryOne($processUid, $weUid)) {'."\n";
|
||||
$fileContent .= " return require(PATH_METHODS . 'webentry/access.php');\n";
|
||||
$fileContent .= "}\n";
|
||||
$fileContent .= "if (!isset(\$_DBArray)) {\n";
|
||||
$fileContent .= " \$_DBArray = array();\n";
|
||||
$fileContent .= "}\n";
|
||||
@@ -1067,5 +1074,56 @@ class WebEntry
|
||||
. "\n";
|
||||
file_put_contents($pathFileName, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if web entry is a single dynaform without login required.
|
||||
*
|
||||
* @param type $processUid
|
||||
* @param type $weUid
|
||||
* @return boolean
|
||||
*/
|
||||
public function isWebEntryOne($processUid, $weUid)
|
||||
{
|
||||
$webEntry = \WebEntryPeer::retrieveByPK($weUid);
|
||||
return $webEntry->getWeType()==='SINGLE' && $webEntry->getWeAuthentication()==='ANONYMOUS';
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if a Task is and Web Entry auxiliar task.
|
||||
*
|
||||
* @param type $tasUid
|
||||
* @return type
|
||||
*/
|
||||
public function isTaskAWebEntry($tasUid)
|
||||
{
|
||||
return substr($tasUid, 0, 4) === 'wee-';
|
||||
}
|
||||
|
||||
public function getCallbackUrlByTask($tasUid)
|
||||
{
|
||||
$criteria = new \Criteria;
|
||||
$criteria->add(\WebEntryPeer::TAS_UID, $tasUid);
|
||||
$webEntry = \WebEntryPeer::doSelectOne($criteria);
|
||||
if ($webEntry->getWeCallback()==='CUSTOM' || $webEntry->getWeCallback()==='CUSTOM_CLEAR') {
|
||||
return $webEntry->getWeCallbackUrl();
|
||||
} else {
|
||||
return '../services/webentry/completed?message=@%_DELEGATION_MESSAGE';
|
||||
}
|
||||
}
|
||||
|
||||
public function getDelegationMessage($data)
|
||||
{
|
||||
$appNumber = $data['APP_NUMBER'];
|
||||
$appUid = $data['APPLICATION'];
|
||||
$message = "\nCase created in ProcessMaker".
|
||||
"\nCase Number: $appNumber".
|
||||
"\nCase Id: $appUid";
|
||||
foreach($data['_DELEGATION_DATA'] as $task) {
|
||||
$message.="\nCase routed to: ".
|
||||
$task['NEXT_TASK']['TAS_TITLE'].
|
||||
"(".htmlentities($task['NEXT_TASK']['USER_ASSIGNED']['USR_USERNAME']).")";
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user