HOR-3929
This commit is contained in:
committed by
davidcallizaya
parent
69f26c6eee
commit
8ef2eb692d
@@ -110,6 +110,8 @@ class User
|
|||||||
'PREF_DEFAULT_CASES_MENUSELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
|
'PREF_DEFAULT_CASES_MENUSELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private $guestUser = '00000000000000000000000000000002';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor of the class
|
* Constructor of the class
|
||||||
*/
|
*/
|
||||||
@@ -124,6 +126,16 @@ class User
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function get the guest user defined
|
||||||
|
*
|
||||||
|
* @return string guestUser, uid related to this user
|
||||||
|
*/
|
||||||
|
public function getGuestUser()
|
||||||
|
{
|
||||||
|
return $this->guestUser;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,6 +9,23 @@ use WebEntryPeer;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use G;
|
use G;
|
||||||
use BpmnFlowPeer;
|
use BpmnFlowPeer;
|
||||||
|
use ProcessMaker\BusinessModel\Process as BusinessModelProcess;
|
||||||
|
use ProcessMaker\BusinessModel\Validator as BusinessModelValidator;
|
||||||
|
use ProcessMaker\Project\Workflow;
|
||||||
|
use WebEntryEvent as ModelWebEntryEvent;
|
||||||
|
use ProcessMaker\Util\Common;
|
||||||
|
use Task as ModelTask;
|
||||||
|
use Propel;
|
||||||
|
use BasePeer;
|
||||||
|
use Content;
|
||||||
|
use Tasks;
|
||||||
|
use Step;
|
||||||
|
use TaskPeer;
|
||||||
|
use StepPeer;
|
||||||
|
use ResultSet;
|
||||||
|
use TaskUser;
|
||||||
|
use TaskUserPeer;
|
||||||
|
|
||||||
|
|
||||||
class WebEntryEvent
|
class WebEntryEvent
|
||||||
{
|
{
|
||||||
@@ -358,13 +375,7 @@ class WebEntryEvent
|
|||||||
|
|
||||||
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
|
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
|
||||||
|
|
||||||
//Verify data - Field definition
|
//Define the required dependent fields:
|
||||||
$process = new \ProcessMaker\BusinessModel\Process();
|
|
||||||
//Dependent fields:
|
|
||||||
if (!isset($arrayData['WE_AUTHENTICATION']) || $arrayData['WE_AUTHENTICATION']
|
|
||||||
== 'ANONYMOUS') {
|
|
||||||
$this->arrayFieldDefinition['USR_UID']['required'] = true;
|
|
||||||
}
|
|
||||||
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE']
|
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE']
|
||||||
== 'SINGLE') {
|
== 'SINGLE') {
|
||||||
$this->arrayFieldDefinition['DYN_UID']['required'] = true;
|
$this->arrayFieldDefinition['DYN_UID']['required'] = true;
|
||||||
@@ -391,6 +402,7 @@ class WebEntryEvent
|
|||||||
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages;
|
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$process = new BusinessModelProcess();
|
||||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition,
|
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition,
|
||||||
$this->arrayFieldNameForException, $flagInsert);
|
$this->arrayFieldNameForException, $flagInsert);
|
||||||
|
|
||||||
@@ -513,11 +525,11 @@ class WebEntryEvent
|
|||||||
$arrayEventData = $bpmn->getEvent($eventUid);
|
$arrayEventData = $bpmn->getEvent($eventUid);
|
||||||
|
|
||||||
//Task
|
//Task
|
||||||
$task = new \Task();
|
$task = new ModelTask();
|
||||||
|
|
||||||
$tasUid = static::getTaskUidFromEvnUid($eventUid);
|
$tasUid = static::getTaskUidFromEvnUid($eventUid);
|
||||||
|
|
||||||
if (\TaskPeer::retrieveByPK($tasUid)) {
|
if (TaskPeer::retrieveByPK($tasUid)) {
|
||||||
$this->webEntryEventWebEntryTaskUid = $tasUid;
|
$this->webEntryEventWebEntryTaskUid = $tasUid;
|
||||||
} else {
|
} else {
|
||||||
$this->webEntryEventWebEntryTaskUid = $task->create(
|
$this->webEntryEventWebEntryTaskUid = $task->create(
|
||||||
@@ -535,7 +547,7 @@ class WebEntryEvent
|
|||||||
|
|
||||||
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE'] === 'SINGLE') {
|
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE'] === 'SINGLE') {
|
||||||
//Task - Step
|
//Task - Step
|
||||||
$step = new \Step();
|
$step = new Step();
|
||||||
|
|
||||||
$stepUid = $step->create(array(
|
$stepUid = $step->create(array(
|
||||||
"PRO_UID" => $projectUid,
|
"PRO_UID" => $projectUid,
|
||||||
@@ -553,13 +565,13 @@ class WebEntryEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Task - User
|
//Task - User
|
||||||
$task = new \Tasks();
|
$task = new Tasks();
|
||||||
if (!(isset($arrayData['WE_AUTHENTICATION']) && $arrayData['WE_AUTHENTICATION'] === 'LOGIN_REQUIRED')) {
|
if (!(isset($arrayData['WE_AUTHENTICATION']) && $arrayData['WE_AUTHENTICATION'] === 'LOGIN_REQUIRED')) {
|
||||||
$task->assignUser($this->webEntryEventWebEntryTaskUid, $userUid, 1);
|
$task->assignUser($this->webEntryEventWebEntryTaskUid, $userUid, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Route
|
//Route
|
||||||
$workflow = \ProcessMaker\Project\Workflow::load($projectUid);
|
$workflow = Workflow::load($projectUid);
|
||||||
|
|
||||||
$result = $workflow->addRoute($this->webEntryEventWebEntryTaskUid, $activityUid, "SEQUENTIAL");
|
$result = $workflow->addRoute($this->webEntryEventWebEntryTaskUid, $activityUid, "SEQUENTIAL");
|
||||||
|
|
||||||
@@ -622,10 +634,10 @@ class WebEntryEvent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if ($webEntryTaskUid != "") {
|
if ($webEntryTaskUid != "") {
|
||||||
$obj = \TaskPeer::retrieveByPK($webEntryTaskUid);
|
$obj = TaskPeer::retrieveByPK($webEntryTaskUid);
|
||||||
|
|
||||||
if (!is_null($obj)) {
|
if (!is_null($obj)) {
|
||||||
$task = new \Tasks();
|
$task = new Tasks();
|
||||||
|
|
||||||
$task->deleteTask($webEntryTaskUid);
|
$task->deleteTask($webEntryTaskUid);
|
||||||
}
|
}
|
||||||
@@ -657,8 +669,8 @@ class WebEntryEvent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//Verify data
|
//Verify data
|
||||||
$process = new \ProcessMaker\BusinessModel\Process();
|
$process = new BusinessModelProcess();
|
||||||
$validator = new \ProcessMaker\BusinessModel\Validator();
|
$validator = new BusinessModelValidator();
|
||||||
|
|
||||||
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
||||||
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||||
@@ -693,17 +705,18 @@ class WebEntryEvent
|
|||||||
$arrayData["WEE_TITLE"] = null;
|
$arrayData["WEE_TITLE"] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Verify data
|
//Verify data related to the process
|
||||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||||
|
//Define if the webEntry need to use the guest user
|
||||||
|
$weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : '';
|
||||||
|
$arrayData["USR_UID"] = $this->getWebEntryUser($arrayData["WE_AUTHENTICATION"], $weUserUid);
|
||||||
|
//Verify data with the required fields
|
||||||
$this->throwExceptionIfDataIsInvalid("", $projectUid, $arrayData);
|
$this->throwExceptionIfDataIsInvalid("", $projectUid, $arrayData);
|
||||||
|
|
||||||
//Create
|
|
||||||
$cnn = \Propel::getConnection("workflow");
|
|
||||||
|
|
||||||
$this->webEntryEventWebEntryUid = "";
|
$this->webEntryEventWebEntryUid = "";
|
||||||
$this->webEntryEventWebEntryTaskUid = "";
|
$this->webEntryEventWebEntryTaskUid = "";
|
||||||
|
//Create the connection
|
||||||
|
$cnn = Propel::getConnection("workflow");
|
||||||
try {
|
try {
|
||||||
//WebEntry
|
//WebEntry
|
||||||
$this->createWebEntry(
|
$this->createWebEntry(
|
||||||
@@ -719,11 +732,11 @@ class WebEntryEvent
|
|||||||
);
|
);
|
||||||
|
|
||||||
//WebEntry-Event
|
//WebEntry-Event
|
||||||
$webEntryEvent = new \WebEntryEvent();
|
$webEntryEvent = new ModelWebEntryEvent();
|
||||||
|
|
||||||
$webEntryEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
$webEntryEvent->fromArray($arrayData, BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
$webEntryEventUid = \ProcessMaker\Util\Common::generateUID();
|
$webEntryEventUid = Common::generateUID();
|
||||||
|
|
||||||
$webEntryEvent->setWeeUid($webEntryEventUid);
|
$webEntryEvent->setWeeUid($webEntryEventUid);
|
||||||
$webEntryEvent->setPrjUid($projectUid);
|
$webEntryEvent->setPrjUid($projectUid);
|
||||||
@@ -739,13 +752,13 @@ class WebEntryEvent
|
|||||||
|
|
||||||
//Set WEE_TITLE
|
//Set WEE_TITLE
|
||||||
if (isset($arrayData["WEE_TITLE"])) {
|
if (isset($arrayData["WEE_TITLE"])) {
|
||||||
$result = \Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
$result = Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
||||||
$arrayData["WEE_TITLE"]);
|
$arrayData["WEE_TITLE"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set WEE_DESCRIPTION
|
//Set WEE_DESCRIPTION
|
||||||
if (isset($arrayData["WEE_DESCRIPTION"])) {
|
if (isset($arrayData["WEE_DESCRIPTION"])) {
|
||||||
$result = \Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
$result = Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
||||||
$arrayData["WEE_DESCRIPTION"]);
|
$arrayData["WEE_DESCRIPTION"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -786,8 +799,8 @@ class WebEntryEvent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//Verify data
|
//Verify data
|
||||||
$process = new \ProcessMaker\BusinessModel\Process();
|
$process = new BusinessModelProcess();
|
||||||
$validator = new \ProcessMaker\BusinessModel\Validator();
|
$validator = new BusinessModelValidator();
|
||||||
|
|
||||||
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
||||||
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||||
@@ -806,14 +819,17 @@ class WebEntryEvent
|
|||||||
|
|
||||||
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
|
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
|
||||||
|
|
||||||
//Verify data
|
//Verify data related to the process
|
||||||
$this->throwExceptionIfNotExistsWebEntryEvent($webEntryEventUid,
|
$this->throwExceptionIfNotExistsWebEntryEvent($webEntryEventUid,
|
||||||
$this->arrayFieldNameForException["webEntryEventUid"]);
|
$this->arrayFieldNameForException["webEntryEventUid"]);
|
||||||
|
//Define if the webEntry need to use the guest user
|
||||||
|
$weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : '';
|
||||||
|
$arrayData["USR_UID"] = $this->getWebEntryUser($arrayData["WE_AUTHENTICATION"], $weUserUid);
|
||||||
|
//Verify data with the required fields
|
||||||
$this->throwExceptionIfDataIsInvalid($webEntryEventUid, $arrayWebEntryEventData["PRJ_UID"], $arrayData);
|
$this->throwExceptionIfDataIsInvalid($webEntryEventUid, $arrayWebEntryEventData["PRJ_UID"], $arrayData);
|
||||||
|
|
||||||
//Update
|
//Update
|
||||||
$cnn = \Propel::getConnection("workflow");
|
$cnn = Propel::getConnection("workflow");
|
||||||
|
|
||||||
$this->webEntryEventWebEntryUid = "";
|
$this->webEntryEventWebEntryUid = "";
|
||||||
$this->webEntryEventWebEntryTaskUid = "";
|
$this->webEntryEventWebEntryTaskUid = "";
|
||||||
@@ -821,20 +837,20 @@ class WebEntryEvent
|
|||||||
try {
|
try {
|
||||||
//WebEntry
|
//WebEntry
|
||||||
if ($arrayWebEntryEventData["WEE_WE_UID"] != "") {
|
if ($arrayWebEntryEventData["WEE_WE_UID"] != "") {
|
||||||
$task = new \Tasks();
|
$task = new Tasks();
|
||||||
|
|
||||||
//Task - Step for WE_TYPE=SINGLE
|
//Task - Step for WE_TYPE=SINGLE
|
||||||
$weType = !empty($arrayData["WE_TYPE"]) ? $arrayData["WE_TYPE"] : $arrayWebEntryEventData["WE_TYPE"];
|
$weType = !empty($arrayData["WE_TYPE"]) ? $arrayData["WE_TYPE"] : $arrayWebEntryEventData["WE_TYPE"];
|
||||||
if (isset($arrayData["DYN_UID"]) && $arrayData["DYN_UID"] !== $arrayWebEntryEventData["DYN_UID"] && $weType === 'SINGLE') {
|
if (isset($arrayData["DYN_UID"]) && $arrayData["DYN_UID"] !== $arrayWebEntryEventData["DYN_UID"] && $weType === 'SINGLE') {
|
||||||
//Delete
|
//Delete
|
||||||
$step = new \Step();
|
$step = new Step();
|
||||||
|
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
|
|
||||||
$criteria->add(\StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
$criteria->add(StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||||
|
|
||||||
$rsCriteria = \StepPeer::doSelectRS($criteria);
|
$rsCriteria = StepPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
while ($rsCriteria->next()) {
|
while ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
@@ -843,7 +859,7 @@ class WebEntryEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add
|
//Add
|
||||||
$step = new \Step();
|
$step = new Step();
|
||||||
|
|
||||||
$stepUid = $step->create(array(
|
$stepUid = $step->create(array(
|
||||||
"PRO_UID" => $arrayWebEntryEventData["PRJ_UID"],
|
"PRO_UID" => $arrayWebEntryEventData["PRJ_UID"],
|
||||||
@@ -861,14 +877,14 @@ class WebEntryEvent
|
|||||||
//Task - User
|
//Task - User
|
||||||
if (!empty($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
|
if (!empty($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
|
||||||
//Unassign
|
//Unassign
|
||||||
$taskUser = new \TaskUser();
|
$taskUser = new TaskUser();
|
||||||
|
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
|
|
||||||
$criteria->add(\TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
$criteria->add(TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||||
|
|
||||||
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
|
$rsCriteria = TaskUserPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
while ($rsCriteria->next()) {
|
while ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
@@ -878,8 +894,11 @@ class WebEntryEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Assign
|
//Assign
|
||||||
$result = $task->assignUser($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["USR_UID"],
|
$result = $task->assignUser(
|
||||||
1);
|
$arrayWebEntryEventData["WEE_WE_TAS_UID"],
|
||||||
|
$arrayData["USR_UID"],
|
||||||
|
1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Route
|
//Route
|
||||||
@@ -892,7 +911,7 @@ class WebEntryEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add
|
//Add
|
||||||
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
|
$workflow = Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
|
||||||
|
|
||||||
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"],
|
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"],
|
||||||
"SEQUENTIAL");
|
"SEQUENTIAL");
|
||||||
@@ -925,15 +944,18 @@ class WebEntryEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($arrayDataAux) > 0) {
|
if (count($arrayDataAux) > 0) {
|
||||||
$arrayDataAux = $this->webEntry->update($arrayWebEntryEventData["WEE_WE_UID"], $userUidUpdater,
|
$arrayDataAux = $this->webEntry->update(
|
||||||
$arrayDataAux);
|
$arrayWebEntryEventData["WEE_WE_UID"],
|
||||||
|
$userUidUpdater,
|
||||||
|
$arrayDataAux
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//WebEntry-Event
|
//WebEntry-Event
|
||||||
$webEntryEvent = WebEntryEventPeer::retrieveByPK($webEntryEventUid);
|
$webEntryEvent = WebEntryEventPeer::retrieveByPK($webEntryEventUid);
|
||||||
|
|
||||||
$webEntryEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
$webEntryEvent->fromArray($arrayData, BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
if ($webEntryEvent->validate()) {
|
if ($webEntryEvent->validate()) {
|
||||||
$cnn->begin();
|
$cnn->begin();
|
||||||
@@ -944,13 +966,13 @@ class WebEntryEvent
|
|||||||
|
|
||||||
//Set WEE_TITLE
|
//Set WEE_TITLE
|
||||||
if (isset($arrayData["WEE_TITLE"])) {
|
if (isset($arrayData["WEE_TITLE"])) {
|
||||||
$result = \Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
$result = Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
||||||
$arrayData["WEE_TITLE"]);
|
$arrayData["WEE_TITLE"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set WEE_DESCRIPTION
|
//Set WEE_DESCRIPTION
|
||||||
if (isset($arrayData["WEE_DESCRIPTION"])) {
|
if (isset($arrayData["WEE_DESCRIPTION"])) {
|
||||||
$result = \Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
$result = Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
||||||
$arrayData["WEE_DESCRIPTION"]);
|
$arrayData["WEE_DESCRIPTION"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1123,7 +1145,7 @@ class WebEntryEvent
|
|||||||
$arrayWebEntryEvent = array();
|
$arrayWebEntryEvent = array();
|
||||||
|
|
||||||
//Verify data
|
//Verify data
|
||||||
$process = new \ProcessMaker\BusinessModel\Process();
|
$process = new BusinessModelProcess();
|
||||||
|
|
||||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||||
|
|
||||||
@@ -1133,7 +1155,7 @@ class WebEntryEvent
|
|||||||
$criteria->add(WebEntryEventPeer::PRJ_UID, $projectUid, Criteria::EQUAL);
|
$criteria->add(WebEntryEventPeer::PRJ_UID, $projectUid, Criteria::EQUAL);
|
||||||
|
|
||||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
while ($rsCriteria->next()) {
|
while ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
@@ -1174,7 +1196,7 @@ class WebEntryEvent
|
|||||||
}
|
}
|
||||||
$criteria->add(ProcessPeer::PRO_STATUS, 'ACTIVE', Criteria::EQUAL);
|
$criteria->add(ProcessPeer::PRO_STATUS, 'ACTIVE', Criteria::EQUAL);
|
||||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
while ($rsCriteria->next()) {
|
while ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
$result[] = $this->getWebEntryEventDataFromRecord($row);
|
$result[] = $this->getWebEntryEventDataFromRecord($row);
|
||||||
@@ -1208,7 +1230,7 @@ class WebEntryEvent
|
|||||||
$criteria->add(WebEntryEventPeer::WEE_UID, $webEntryEventUid, Criteria::EQUAL);
|
$criteria->add(WebEntryEventPeer::WEE_UID, $webEntryEventUid, Criteria::EQUAL);
|
||||||
|
|
||||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
$rsCriteria->next();
|
$rsCriteria->next();
|
||||||
|
|
||||||
@@ -1235,7 +1257,7 @@ class WebEntryEvent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//Verify data
|
//Verify data
|
||||||
$process = new \ProcessMaker\BusinessModel\Process();
|
$process = new BusinessModelProcess();
|
||||||
|
|
||||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||||
|
|
||||||
@@ -1251,7 +1273,7 @@ class WebEntryEvent
|
|||||||
$criteria->add(WebEntryEventPeer::EVN_UID, $eventUid, Criteria::EQUAL);
|
$criteria->add(WebEntryEventPeer::EVN_UID, $eventUid, Criteria::EQUAL);
|
||||||
|
|
||||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
$rsCriteria->next();
|
$rsCriteria->next();
|
||||||
|
|
||||||
@@ -1361,4 +1383,20 @@ class WebEntryEvent
|
|||||||
return $url . "/" . $weData;
|
return $url . "/" . $weData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function return the uid of user related to the webEntry
|
||||||
|
* @param string $authentication, can be ANONYMOUS, LOGIN_REQUIRED
|
||||||
|
* @param string $usrUid
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getWebEntryUser($authentication = 'ANONYMOUS', $usrUid = '')
|
||||||
|
{
|
||||||
|
if ($authentication === 'ANONYMOUS') {
|
||||||
|
$user = new User();
|
||||||
|
return $user->getGuestUser();
|
||||||
|
} else {
|
||||||
|
return $usrUid;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user