diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Table.php b/workflow/engine/src/ProcessMaker/BusinessModel/Table.php index 71991aa45..105770ee1 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Table.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Table.php @@ -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) { diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php b/workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php index f95683eb9..ef58db850 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php @@ -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())); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php index 4b1a20fad..7d1894259 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php @@ -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()));