From 8fd115d2278dea0146e16a5cd6a080a44017f1c8 Mon Sep 17 00:00:00 2001 From: Vijay Khollam Date: Mon, 13 Jan 2020 20:05:42 +0530 Subject: [PATCH 1/3] Feature #155875 feat: Support Custom Params --- tjreports/administrator/models/tjreport.php | 5 ++++- tjreports/site/models/reports.php | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tjreports/administrator/models/tjreport.php b/tjreports/administrator/models/tjreport.php index 5ed7eeb..8222d1c 100644 --- a/tjreports/administrator/models/tjreport.php +++ b/tjreports/administrator/models/tjreport.php @@ -175,7 +175,9 @@ public function getReportPluginData($pluginId, $pluginName = null) $defaultColToHide = $plgModel->getState('defaultColToHide'); - $params = array(); + $params = array(); + $customParam = new stdClass; + $params['filter_order'] = $plgModel->getState('list.ordering'); $params['filter_order_Dir'] = $plgModel->getState('list.direction'); $params['limit'] = $plgModel->getState('list.limit'); @@ -192,6 +194,7 @@ public function getReportPluginData($pluginId, $pluginName = null) $params['showHideColumns'] = $plgModel->showhideCols; $params['piiColumns'] = $plgModel->getState('piiColumns'); + $params['customParam'] = $customParam; $report->param = json_encode($params); } diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php index 70728a6..c3ccd32 100755 --- a/tjreports/site/models/reports.php +++ b/tjreports/site/models/reports.php @@ -1292,6 +1292,18 @@ private function processSavedReportColumns($queryId, &$selColToshow) $this->filterShowhideCols = array_diff($this->filterShowhideCols, $param['piiColumns']); } + if (isset($param['customParam'])) + { + if (empty($this->customParam)) + { + $this->customParam = (array) $param['customParam']; + } + else + { + $this->customParam = (array) $param['customParam']; + } + } + $parent = $queryData->parent; } else From 9019db543f3f105c314eed5c319dabdd7e566624 Mon Sep 17 00:00:00 2001 From: Vijay Khollam Date: Tue, 14 Jan 2020 12:37:02 +0530 Subject: [PATCH 2/3] Feature #155875 feat: scrutinizer fixes --- tjreports/site/models/reports.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php index c3ccd32..f966cd7 100755 --- a/tjreports/site/models/reports.php +++ b/tjreports/site/models/reports.php @@ -49,6 +49,9 @@ class TjreportsModelReports extends ListModel // Columns array contain PII columns private $piiColumns = array(); + // Columns array contain Custom Param + public $customParam = array(); + // Columns array contain email columns private $emailColumn = ''; @@ -1161,7 +1164,7 @@ private function filterReportColumns($queryId, &$selColToshow) } $query = $this->_db->getQuery(true); - $this->filterDefaultColToHide = $this->filterShowhideCols = $this->filterPiiColumns = $this->filterParamColToshow = array(); + $this->filterDefaultColToHide = $this->filterShowhideCols = $this->filterPiiColumns = $this->filterParamColToshow = $this->customParam = array(); // $this->filterSelColToshow = $selColToshow; @@ -1205,6 +1208,11 @@ private function filterReportColumns($queryId, &$selColToshow) $this->emailColumn = $emailColumn; } + if (!empty($customParam)) + { + $this->customParam = $customParam; + } + if (!empty($this->filterPiiColumns)) { $this->piiColumns = $this->filterPiiColumns; @@ -1294,14 +1302,7 @@ private function processSavedReportColumns($queryId, &$selColToshow) if (isset($param['customParam'])) { - if (empty($this->customParam)) - { - $this->customParam = (array) $param['customParam']; - } - else - { - $this->customParam = (array) $param['customParam']; - } + $this->customParam = (array) $param['customParam']; } $parent = $queryData->parent; From c45263254ef91fde6d42ee7978b2004062a7bed1 Mon Sep 17 00:00:00 2001 From: Vijay Khollam Date: Tue, 14 Jan 2020 13:05:24 +0530 Subject: [PATCH 3/3] Feature #155875 feat: scrutinizer fixes --- tjreports/site/models/reports.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php index f966cd7..578897d 100755 --- a/tjreports/site/models/reports.php +++ b/tjreports/site/models/reports.php @@ -1164,7 +1164,7 @@ private function filterReportColumns($queryId, &$selColToshow) } $query = $this->_db->getQuery(true); - $this->filterDefaultColToHide = $this->filterShowhideCols = $this->filterPiiColumns = $this->filterParamColToshow = $this->customParam = array(); + $this->filterDefaultColToHide = $this->filterShowhideCols = $this->filterPiiColumns = $this->filterParamColToshow = array(); // $this->filterSelColToshow = $selColToshow; @@ -1208,11 +1208,6 @@ private function filterReportColumns($queryId, &$selColToshow) $this->emailColumn = $emailColumn; } - if (!empty($customParam)) - { - $this->customParam = $customParam; - } - if (!empty($this->filterPiiColumns)) { $this->piiColumns = $this->filterPiiColumns;