Merged in bugfix/PMCORE-3369 (pull request #8172)
PMCORE-3366 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -410,10 +410,11 @@ class Process extends Model
|
||||
* @param string $category
|
||||
* @param int $offset
|
||||
* @param int $limit
|
||||
* @param bool $paged
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getProcessesForHome($text = null, $category = null, $offset = null, $limit = null)
|
||||
public static function getProcessesForHome($text = null, $category = null, $offset = null, $limit = null, $paged = true)
|
||||
{
|
||||
// Get base query
|
||||
$query = Process::query()->select(['PRO_ID', 'PRO_TITLE']);
|
||||
@@ -431,12 +432,15 @@ class Process extends Model
|
||||
// Set "PRO_STATUS" condition
|
||||
$query->status('ACTIVE');
|
||||
|
||||
// Set pagination if offset and limit are sent
|
||||
if (!is_null($offset) && !is_null($limit)) {
|
||||
$query->offset($offset);
|
||||
$query->limit($limit);
|
||||
if ($paged) {
|
||||
// Set pagination if offset and limit are sent
|
||||
if (!is_null($offset) && !is_null($limit)) {
|
||||
$query->offset($offset);
|
||||
$query->limit($limit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Order by "PRO_TITLE"
|
||||
$query->orderBy('PRO_TITLE');
|
||||
|
||||
|
||||
@@ -861,6 +861,7 @@ class Home extends Api
|
||||
* @param string $category
|
||||
* @param int $offset
|
||||
* @param int $limit
|
||||
* @param bool $paged
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -869,7 +870,7 @@ class Home extends Api
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function getProcesses($text = null, $category = null, int $offset = 0, int $limit = 15)
|
||||
public function getProcesses($text = null, $category = null, int $offset = 0, int $limit = 15, $paged = true)
|
||||
{
|
||||
try {
|
||||
return Process::getProcessesForHome($text, $category, $offset, $limit);
|
||||
|
||||
Reference in New Issue
Block a user