PMCORE-3100
This commit is contained in:
@@ -34,6 +34,8 @@ class AbstractCases implements CasesInterface
|
|||||||
const STATUS_TODO = 2;
|
const STATUS_TODO = 2;
|
||||||
const STATUS_COMPLETED = 3;
|
const STATUS_COMPLETED = 3;
|
||||||
const STATUS_CANCELED = 4;
|
const STATUS_CANCELED = 4;
|
||||||
|
// Order by column allowed
|
||||||
|
const ORDER_BY_COLUMN_ALLOWED = ['APP_NUMBER', 'DEL_TITLE', 'PRO_TITLE'];
|
||||||
|
|
||||||
// Filter by category from a process, know as "$category" in the old lists classes
|
// Filter by category from a process, know as "$category" in the old lists classes
|
||||||
private $categoryUid = '';
|
private $categoryUid = '';
|
||||||
@@ -957,6 +959,11 @@ class AbstractCases implements CasesInterface
|
|||||||
// Convert the value to upper case
|
// Convert the value to upper case
|
||||||
$orderByColumn = strtoupper($orderByColumn);
|
$orderByColumn = strtoupper($orderByColumn);
|
||||||
|
|
||||||
|
// Validate the order by column
|
||||||
|
if (!in_array($orderByColumn, self::ORDER_BY_COLUMN_ALLOWED)) {
|
||||||
|
throw new Exception("Order by column '{$orderByColumn}' is not valid.");
|
||||||
|
}
|
||||||
|
|
||||||
$this->orderByColumn = $orderByColumn;
|
$this->orderByColumn = $orderByColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ class Home extends Api
|
|||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
$paged = explode(',', $paged);
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = $paged[0];
|
$properties['start'] = (int)$paged[0];
|
||||||
$properties['limit'] = $paged[1];
|
$properties['limit'] = (int)$paged[1];
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -137,8 +137,8 @@ class Home extends Api
|
|||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
$paged = explode(',', $paged);
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = $paged[0];
|
$properties['start'] = (int)$paged[0];
|
||||||
$properties['limit'] = $paged[1];
|
$properties['limit'] = (int)$paged[1];
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -192,8 +192,8 @@ class Home extends Api
|
|||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
$paged = explode(',', $paged);
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = $paged[0];
|
$properties['start'] = (int)$paged[0];
|
||||||
$properties['limit'] = $paged[1];
|
$properties['limit'] = (int)$paged[1];
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
// todo: some queries related to the unassigned are using the USR_UID
|
// todo: some queries related to the unassigned are using the USR_UID
|
||||||
@@ -249,8 +249,8 @@ class Home extends Api
|
|||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
$paged = explode(',', $paged);
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = $paged[0];
|
$properties['start'] = (int)$paged[0];
|
||||||
$properties['limit'] = $paged[1];
|
$properties['limit'] = (int)$paged[1];
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -320,8 +320,8 @@ class Home extends Api
|
|||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
$paged = explode(',', $paged);
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = $paged[0];
|
$properties['start'] = (int)$paged[0];
|
||||||
$properties['limit'] = $paged[1];
|
$properties['limit'] = (int)$paged[1];
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$result = [];
|
$result = [];
|
||||||
@@ -479,8 +479,8 @@ class Home extends Api
|
|||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
$paged = explode(',', $paged);
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = $paged[0];
|
$properties['start'] = (int)$paged[0];
|
||||||
$properties['limit'] = $paged[1];
|
$properties['limit'] = (int)$paged[1];
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
|
|||||||
Reference in New Issue
Block a user