Merged in bugfix/PMCORE-952-A (pull request #8174)

PMCORE-952-A

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Andrea Adamczyk
2021-09-24 19:58:11 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 30 additions and 2 deletions

View File

@@ -45,6 +45,18 @@ class Task extends Model
return $this->hasMany(Delegation::class, 'TAS_ID', 'TAS_ID');
}
/**
* Get the task by taskId
*
* @param int $tasId
* @return \ProcessMaker\Model\Task
*/
public static function getTask($tasId)
{
$query = Task::query()->select()->where('TAS_ID', $tasId);
return $query->first();
}
/**
* Scope a query to only include self-service
*
@@ -98,7 +110,7 @@ class Task extends Model
public function scopeExcludedTasks($query)
{
$query->whereNotIn('TAS_TYPE', Task::$typesRunAutomatically)
->whereNotIn('TAS_TYPE', Task::DUMMY_TASKS);
->whereNotIn('TAS_TYPE', Task::DUMMY_TASKS);
return $query;
}
@@ -256,7 +268,7 @@ class Task extends Model
});
$res = $query->first();
if(is_null($res)) {
if (is_null($res)) {
return "";
} else {
return $res->TAS_DEF_TITLE;