HOR-1110-C "Filter PM Table data..."

This commit is contained in:
Luis Fernando Saisa Lopez
2016-07-07 17:44:58 -04:00
parent 5e475952d3
commit 3dba7b3640
3 changed files with 9 additions and 5 deletions

View File

@@ -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) {

View File

@@ -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()));

View File

@@ -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()));