PMCORE-3104
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user