COnflicts
This commit is contained in:
@@ -7,6 +7,7 @@ use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\CaseList;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\Task;
|
||||
use ProcessMaker\Model\ProcessCategory;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
class Inbox extends AbstractCases
|
||||
@@ -16,6 +17,7 @@ class Inbox extends AbstractCases
|
||||
// Columns view in the cases list
|
||||
'APP_DELEGATION.APP_NUMBER', // Case #
|
||||
'APP_DELEGATION.DEL_TITLE', // Case Title
|
||||
'PROCESS.CATEGORY_ID', // Category
|
||||
'PROCESS.PRO_TITLE', // Process
|
||||
'TASK.TAS_TITLE', // Task
|
||||
'USERS.USR_USERNAME', // Current UserName
|
||||
@@ -70,6 +72,10 @@ class Inbox extends AbstractCases
|
||||
if (!empty($this->getCaseTitle())) {
|
||||
$query->title($this->getCaseTitle());
|
||||
}
|
||||
// Specific category
|
||||
if ($this->getCategoryId()) {
|
||||
$query->categoryId($this->getCategoryId());
|
||||
}
|
||||
// Specific process
|
||||
if ($this->getProcessId()) {
|
||||
$query->processId($this->getProcessId());
|
||||
@@ -131,6 +137,9 @@ class Inbox extends AbstractCases
|
||||
$results = $query->get();
|
||||
// Prepare the result
|
||||
$results->transform(function ($item, $key) {
|
||||
// Get the category
|
||||
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
|
||||
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
|
||||
// Get priority label
|
||||
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
|
||||
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
|
||||
@@ -216,6 +225,11 @@ class Inbox extends AbstractCases
|
||||
$query = Delegation::query()->select();
|
||||
// Scope that sets the queries for List Inbox
|
||||
$query->inbox($this->getUserId());
|
||||
// Check if the category was defined
|
||||
if ($this->getCategoryId()) {
|
||||
// Join with process if the filter with category exist
|
||||
$query->joinProcess();
|
||||
}
|
||||
// Apply filters
|
||||
$this->filters($query);
|
||||
// Return the number of rows
|
||||
|
||||
Reference in New Issue
Block a user