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