HOR-1110-C "Filter PM Table data..."
This commit is contained in:
@@ -150,8 +150,12 @@ class Table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTableData($tab_uid, $pro_uid = '', $reportFlag = false)
|
||||
public function getTableData($tab_uid, $pro_uid = '', $filter = null, $reportFlag = false)
|
||||
{
|
||||
//Validation
|
||||
$inputFilter = new \InputFilter();
|
||||
$filter = $inputFilter->sanitizeInputValue($filter, 'nosql');
|
||||
|
||||
//VALIDATION
|
||||
if ($reportFlag) {
|
||||
$pro_uid = $this->validateProUid($pro_uid);
|
||||
@@ -160,7 +164,7 @@ class Table
|
||||
|
||||
$additionalTables = new AdditionalTables();
|
||||
$table = $additionalTables->load($tab_uid, true);
|
||||
$result = $additionalTables->getAllData($tab_uid);
|
||||
$result = $additionalTables->getAllData($tab_uid, null, null, null, $filter);
|
||||
$primaryKeys = $additionalTables->getPrimaryKeys();
|
||||
if (is_array($result['rows'])) {
|
||||
foreach ($result['rows'] as $i => $row) {
|
||||
|
||||
@@ -79,11 +79,11 @@ class Pmtable extends Api
|
||||
*
|
||||
* @url GET /:pmt_uid/data
|
||||
*/
|
||||
public function doGetPmTableData($pmt_uid)
|
||||
public function doGetPmTableData($pmt_uid, $filter = null)
|
||||
{
|
||||
try {
|
||||
$oPmTable = new \ProcessMaker\BusinessModel\Table();
|
||||
$response = $oPmTable->getTableData($pmt_uid);
|
||||
$response = $oPmTable->getTableData($pmt_uid, null, $filter);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
|
||||
@@ -87,7 +87,7 @@ class ReportTable extends Api
|
||||
{
|
||||
try {
|
||||
$oReportTable = new \ProcessMaker\BusinessModel\Table();
|
||||
$response = $oReportTable->getTableData($rep_uid, $prj_uid, true);
|
||||
$response = $oReportTable->getTableData($rep_uid, $prj_uid, null, true);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
|
||||
Reference in New Issue
Block a user