Merged in bugfix/PMCORE-3490 (pull request #8254)
PMCORE-3490 Custom Case List is displaying other Processes cases than the one belong to the Report Table of a Process PMCORE_3.7.0-5474 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -278,6 +278,7 @@ class Home
|
|||||||
->first();
|
->first();
|
||||||
if (!empty($caseList)) {
|
if (!empty($caseList)) {
|
||||||
$tableName = $caseList->ADD_TAB_NAME;
|
$tableName = $caseList->ADD_TAB_NAME;
|
||||||
|
$proUid = $caseList->PRO_UID;
|
||||||
|
|
||||||
//this gets the configured columns
|
//this gets the configured columns
|
||||||
$columns = json_decode($caseList->CAL_COLUMNS);
|
$columns = json_decode($caseList->CAL_COLUMNS);
|
||||||
@@ -300,13 +301,18 @@ class Home
|
|||||||
}
|
}
|
||||||
|
|
||||||
//this modifies the query
|
//this modifies the query
|
||||||
if (!empty($tableName) && !empty($fields)) {
|
if (!empty($tableName)) {
|
||||||
$arguments[] = function ($query) use ($tableName, $fields, $customFilters, $types) {
|
$arguments[] = function ($query) use ($tableName, $fields, $customFilters, $types, $proUid) {
|
||||||
|
//setting the related process
|
||||||
|
$query->where('PROCESS.PRO_UID', '=', $proUid);
|
||||||
|
|
||||||
|
//setting columns data from report table
|
||||||
$query->leftJoin($tableName, "{$tableName}.APP_UID", "=", "APP_DELEGATION.APP_UID");
|
$query->leftJoin($tableName, "{$tableName}.APP_UID", "=", "APP_DELEGATION.APP_UID");
|
||||||
foreach ($fields as $value) {
|
foreach ($fields as $value) {
|
||||||
$query->addSelect($value);
|
$query->addSelect($value);
|
||||||
}
|
}
|
||||||
//filters for custom case list
|
|
||||||
|
//setting filters for custom case list
|
||||||
foreach ($customFilters as $key => $filter) {
|
foreach ($customFilters as $key => $filter) {
|
||||||
if (in_array($key, $fields)) {
|
if (in_array($key, $fields)) {
|
||||||
//special case for date range
|
//special case for date range
|
||||||
|
|||||||
Reference in New Issue
Block a user