Merged in gproly/processmaker/HOR-1421 (pull request #4594)

HOR-1421
This commit is contained in:
Julio Cesar Laura Avendaño
2016-07-21 12:23:08 -04:00
3 changed files with 49 additions and 6 deletions

View File

@@ -150,7 +150,7 @@ class Table
*
* @return array
*/
public function getTableData($tab_uid, $pro_uid = '', $filter = null, $reportFlag = false)
public function getTableData($tab_uid, $pro_uid = '', $filter = null, $reportFlag = false, $search = '')
{
//Validation
$inputFilter = new \InputFilter();
@@ -164,7 +164,7 @@ class Table
$additionalTables = new AdditionalTables();
$table = $additionalTables->load($tab_uid, true);
$result = $additionalTables->getAllData($tab_uid, null, null, null, $filter);
$result = $additionalTables->getAllData($tab_uid, null, null, null, $filter, false, $search);
$primaryKeys = $additionalTables->getPrimaryKeys();
if (is_array($result['rows'])) {
foreach ($result['rows'] as $i => $row) {

View File

@@ -72,6 +72,8 @@ class Pmtable extends Api
/**
* @param string $pmt_uid {@min 1} {@max 32}
* @param string $filter
* @param string $q
* @return array
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
@@ -79,11 +81,11 @@ class Pmtable extends Api
*
* @url GET /:pmt_uid/data
*/
public function doGetPmTableData($pmt_uid, $filter = null)
public function doGetPmTableData($pmt_uid, $filter = null, $q = "")
{
try {
$oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->getTableData($pmt_uid, null, $filter);
$response = $oPmTable->getTableData($pmt_uid, null, $filter, false, $q);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));