PMCORE-3104

This commit is contained in:
Paula Quispe
2021-08-19 15:23:25 -04:00
parent 7cbba5190c
commit f18e475196
17 changed files with 262 additions and 25 deletions

View File

@@ -1,27 +1,16 @@
<?php
use Illuminate\Support\Facades\DB;
use ProcessMaker\BusinessModel\Cases\CasesList;
use ProcessMaker\Model\Delegation;
// Get the self service query for the current user
$query = Delegation::getSelfServiceQuery($_SESSION['USER_LOGGED']);
// Mutate query and execute
if (!is_string($query)) {
$query->limit(1);
$items = $query->get();
$atLeastOne = $items->count() > 0;
} else {
$query .= " LIMIT 1";
$items = DB::select($query);
$atLeastOne = !empty($items);
}
// Initializing the response variable
// Get the user logged
$usrUid = $_SESSION['USER_LOGGED'];
// Instance the class
$casesList = new CasesList();
$response = [];
// The scope for the first version of this feature is only for unassigned list, so, this value is currently fixed
$response[] = ['item' => 'CASES_SELFSERVICE', 'highlight' => $atLeastOne];
// Get highlight for all task list
$response = $casesList->atLeastOne($usrUid);
// Print the response in JSON format
header('Content-Type: application/json');