Merged in bugfix/PMCORE-3899 (pull request #8500)
PMCORE-3899 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
namespace ProcessMaker\BusinessModel\Light;
|
namespace ProcessMaker\BusinessModel\Light;
|
||||||
|
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
use \ProcessMaker\Services\Api;
|
use ProcessMaker\Services\Api;
|
||||||
use G;
|
use G;
|
||||||
|
|
||||||
class NotificationDevice
|
class NotificationDevice
|
||||||
@@ -247,17 +247,27 @@ class NotificationDevice
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTaskUserSelfService($tas_uid, $appFields)
|
/**
|
||||||
|
* Get the users related to the task
|
||||||
|
*
|
||||||
|
* @param string $tasUid
|
||||||
|
* @param array $appFields
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTaskUserSelfService($tasUid, $appFields)
|
||||||
{
|
{
|
||||||
$oTask = new \Tasks();
|
$oTask = new \Tasks();
|
||||||
$oGroup = new \Groups();
|
$oGroup = new \Groups();
|
||||||
$taskNextDel = \TaskPeer::retrieveByPK($tas_uid);
|
$taskNextDel = \TaskPeer::retrieveByPK($tasUid);
|
||||||
$arrayTaskUser = array();
|
$arrayTaskUser = [];
|
||||||
|
|
||||||
if ($taskNextDel->getTasAssignType() == "SELF_SERVICE" && trim($taskNextDel->getTasGroupVariable()) != "") {
|
if ($taskNextDel->getTasAssignType() == "SELF_SERVICE" && trim($taskNextDel->getTasGroupVariable()) != "") {
|
||||||
// Self Service Value Based Assignment
|
// Self Service Value Based Assignment
|
||||||
$nextTaskGroupVariable = trim($taskNextDel->getTasGroupVariable(), " @#");
|
$nextTaskGroupVariable = trim($taskNextDel->getTasGroupVariable(), " @#");
|
||||||
if (isset($appFields["APP_DATA"][$nextTaskGroupVariable])) {
|
$dataGroupVariable = isset($appFields["APP_DATA"][$nextTaskGroupVariable]) ? $appFields["APP_DATA"][$nextTaskGroupVariable]
|
||||||
|
: (isset($appFields[$nextTaskGroupVariable]) ? $appFields[$nextTaskGroupVariable] : '');
|
||||||
|
if (!empty($dataGroupVariable)) {
|
||||||
$dataGroupVariable = $appFields["APP_DATA"][$nextTaskGroupVariable];
|
$dataGroupVariable = $appFields["APP_DATA"][$nextTaskGroupVariable];
|
||||||
$dataGroupVariable = (is_array($dataGroupVariable))? $dataGroupVariable : trim($dataGroupVariable);
|
$dataGroupVariable = (is_array($dataGroupVariable))? $dataGroupVariable : trim($dataGroupVariable);
|
||||||
if (!empty($dataGroupVariable) && is_array($dataGroupVariable)){
|
if (!empty($dataGroupVariable) && is_array($dataGroupVariable)){
|
||||||
@@ -270,14 +280,14 @@ class NotificationDevice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // Self Service
|
} else { // Self Service
|
||||||
$arrayGroupsOfTask = $oTask->getGroupsOfTask($tas_uid, 1);
|
$arrayGroupsOfTask = $oTask->getGroupsOfTask($tasUid, 1);
|
||||||
foreach ($arrayGroupsOfTask as $arrayGroup) {
|
foreach ($arrayGroupsOfTask as $arrayGroup) {
|
||||||
$arrayUsersOfGroup = $oGroup->getUsersOfGroup($arrayGroup["GRP_UID"]);
|
$arrayUsersOfGroup = $oGroup->getUsersOfGroup($arrayGroup["GRP_UID"]);
|
||||||
foreach ($arrayUsersOfGroup as $arrayUser) {
|
foreach ($arrayUsersOfGroup as $arrayUser) {
|
||||||
$arrayTaskUser[] = $arrayUser["USR_UID"];
|
$arrayTaskUser[] = $arrayUser["USR_UID"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$arrayUsersOfTask = $oTask->getUsersOfTask($tas_uid, 1);
|
$arrayUsersOfTask = $oTask->getUsersOfTask($tasUid, 1);
|
||||||
foreach ($arrayUsersOfTask as $arrayUser) {
|
foreach ($arrayUsersOfTask as $arrayUser) {
|
||||||
$arrayTaskUser[] = $arrayUser["USR_UID"];
|
$arrayTaskUser[] = $arrayUser["USR_UID"];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user