Merged in luisfernandosl/processmaker/HOR-1110-C-31 (pull request #4547)

HOR-1110-C
This commit is contained in:
Julio Cesar Laura Avendaño
2016-07-08 15:18:14 -04:00
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()));