PMCORE-3832 Custom Case Counters does not provide the correct number nor information PMCORE_3.7.4

This commit is contained in:
Roly Gutierrez
2022-07-12 09:22:28 -04:00
parent 2db3a6807e
commit feecd6cda8
3 changed files with 6 additions and 6 deletions

View File

@@ -250,7 +250,7 @@ class Unassigned extends AbstractCases
{ {
$caseList = CaseList::getCaseList($id, $type); $caseList = CaseList::getCaseList($id, $type);
$query = Delegation::query()->select(); $query = Delegation::query()->select();
$query->selfService($this->getUserId()); $query->selfService($this->getUserUid());
$name = ''; $name = '';
$description = ''; $description = '';

View File

@@ -791,18 +791,18 @@ class Delegation extends Model
* Scope a self service cases * Scope a self service cases
* *
* @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $query
* @param string $user * @param string $usrUid
* *
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */
public function scopeSelfService($query, $user) public function scopeSelfService($query, string $usrUid)
{ {
// Add Join with task filtering only the type self-service // Add Join with task filtering only the type self-service
$query->taskAssignType('SELF_SERVICE'); $query->taskAssignType('SELF_SERVICE');
// Filtering the open threads and without users // Filtering the open threads and without users
$query->threadOpen()->withoutUserId(); $query->threadOpen()->withoutUserId();
// Filtering the cases unassigned that the user can view // Filtering the cases unassigned that the user can view
$this->casesUnassigned($query, $user); $this->casesUnassigned($query, $usrUid);
return $query; return $query;
} }
@@ -1135,7 +1135,7 @@ class Delegation extends Model
* *
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */
public function casesUnassigned(&$query, $usrUid) public function casesUnassigned(&$query, string $usrUid)
{ {
// Get the task self services related to the user // Get the task self services related to the user
$taskSelfService = TaskUser::getSelfServicePerUser($usrUid); $taskSelfService = TaskUser::getSelfServicePerUser($usrUid);

View File

@@ -62,7 +62,7 @@ class TaskUser extends Model
* *
* @return array * @return array
*/ */
public static function getSelfServicePerUser($usrUid) public static function getSelfServicePerUser(string $usrUid)
{ {
//Get the groups related to the user //Get the groups related to the user
$groups = GroupUser::getGroups($usrUid, 'GRP_UID'); $groups = GroupUser::getGroups($usrUid, 'GRP_UID');