diff --git a/tjreports/plugins/actionlog/tjreports/tjreports.xml b/tjreports/plugins/actionlog/tjreports/tjreports.xml index 8c4dd2b..58e7c09 100644 --- a/tjreports/plugins/actionlog/tjreports/tjreports.xml +++ b/tjreports/plugins/actionlog/tjreports/tjreports.xml @@ -2,12 +2,12 @@ plg_actionlog_tjreports Techjoomla - 24th Oct 2019 + 11th Nov 2019 Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL extensions@techjoomla.com https://techjoomla.com - 1.1.3 + 1.1.4 PLG_ACTIONLOG_TJREPORTS_XML_DESCRIPTION tjreports.php diff --git a/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml b/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml index 08dee73..90250ec 100644 --- a/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml +++ b/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml @@ -5,10 +5,10 @@ Techjoomla extensions@techjoomla.com https://techjoomla.com - 24th Oct 2019 + 11th Nov 2019 Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 1.1.3 + 1.1.4 tjreportsfields.php diff --git a/tjreports/plugins/privacy/tjreports/tjreports.xml b/tjreports/plugins/privacy/tjreports/tjreports.xml index 870ecbc..db63cec 100644 --- a/tjreports/plugins/privacy/tjreports/tjreports.xml +++ b/tjreports/plugins/privacy/tjreports/tjreports.xml @@ -1,8 +1,8 @@ plg_privacy_tjreports - 1.1.3 - 24th Oct 2019 + 1.1.4 + 11th Nov 2019 Techjoomla extensions@techjoomla.com https://techjoomla.com diff --git a/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml b/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml index 20007a9..4b2e249 100644 --- a/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml +++ b/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml @@ -5,10 +5,10 @@ Techjoomla extensions@techjoomla.com https://techjoomla.com - 24th Oct 2019 + 11th Nov 2019 Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 1.1.3 + 1.1.4 sql/tjreportsindexer.install.sql diff --git a/tjreports/site/assets/js/tjrContentUI.js b/tjreports/site/assets/js/tjrContentUI.js index 9927292..a76c1af 100755 --- a/tjreports/site/assets/js/tjrContentUI.js +++ b/tjreports/site/assets/js/tjrContentUI.js @@ -49,7 +49,7 @@ jQuery.extend(tjrContentUI.report, { // If sendEmail plug is enabled then try to add a column of checkboxes if ( - typeof window.tjSendEmail.UI != 'undefined' && + typeof window.tjSendEmail != 'undefined' && jQuery('body').find('.td-sendemail').length > 0 ) { diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php index 35c566c..2472f24 100755 --- a/tjreports/site/models/reports.php +++ b/tjreports/site/models/reports.php @@ -48,7 +48,7 @@ class TjreportsModelReports extends JModelList public $showhideCols = array(); // Columns which will be displayed by default - private $defaultColToShow = array(); + public $defaultColToShow = array(); // Columns which will be hide by default private $defaultColToHide = array(); @@ -85,7 +85,10 @@ class TjreportsModelReports extends JModelList private $filterPiiColumns = array(); - private $filterParamColToshow = array(); + public $filterParamColToshow = array(); + + // Used to get the columns which are hide by default in load params + public $filterDefaultColToHide = array(); /** * Constructor. @@ -1140,7 +1143,7 @@ private function filterReportColumns($queryId, &$selColToshow) } $query = $this->_db->getQuery(true); - $this->filterShowhideCols = $this->filterPiiColumns = $this->filterParamColToshow = array(); + $this->filterDefaultColToHide = $this->filterShowhideCols = $this->filterPiiColumns = $this->filterParamColToshow = array(); // $this->filterSelColToshow = $selColToshow; @@ -1168,6 +1171,12 @@ private function filterReportColumns($queryId, &$selColToshow) } } + // Used to get the columns which are hide by default in load params + if (!empty($this->filterDefaultColToHide)) + { + $this->defaultColToHide = $this->filterDefaultColToHide; + } + if (!empty($this->filterShowhideCols)) { $this->showhideCols = $this->filterShowhideCols; @@ -1240,6 +1249,11 @@ private function processSavedReportColumns($queryId, &$selColToshow) { $this->filterParamColToshow[$cols] = $cols; } + else + { + // Used to get the columns which are hide (false) by default in load params + $this->filterDefaultColToHide[$cols] = $cols; + } if (!empty($param['showHideColumns']) && !in_array($cols, $param['showHideColumns']) && !empty($selColToshow)) { @@ -1253,6 +1267,10 @@ private function processSavedReportColumns($queryId, &$selColToshow) // Check PII permission if (!empty($param['piiColumns']) && !$this->piiPermission) { + /* Checked the columns which are hide(false) in load params & if set them as piiColumns + * then it only returns the columns which are not available in piiColumns. */ + $this->filterDefaultColToHide = array_diff($this->filterDefaultColToHide, $param['piiColumns']); + $this->filterParamColToshow = array_diff($this->filterParamColToshow, $param['piiColumns']); $this->filterShowhideCols = array_diff($this->filterShowhideCols, $param['piiColumns']); } diff --git a/tjreports/site/views/reports/view.base.php b/tjreports/site/views/reports/view.base.php index bb25a18..9e14e42 100644 --- a/tjreports/site/views/reports/view.base.php +++ b/tjreports/site/views/reports/view.base.php @@ -169,17 +169,26 @@ public function processData($type = 'html') */ $this->showHideColumns = $this->model->showhideCols; + /* To get the columns from loadparams*/ + $this->defaultColToshow = $this->model->filterParamColToshow; + + /* Check the columns in loadparams are available or not & show plugin level columns & custom field columns + * in case if load params are not available*/ + if (empty($this->defaultColToshow)) + { + $this->defaultColToshow = $this->model->defaultColToShow; + } + if (!empty($this->defaultColToHide)) { - $this->showHideColumns = array_intersect($this->model->showhideCols, array_merge($this->model->getState('colToshow'), $this->defaultColToHide)); + $this->showHideColumns = array_intersect($this->model->showhideCols, array_merge($this->defaultColToshow, $this->defaultColToHide)); } $this->sortable = $this->model->sortableColumns; $this->emailColumn = $this->model->getState('emailColumn'); $this->srButton = $this->model->showSearchResetButton; - // Array_intersect - if column present in colToshow as true/false but not in showHideColumns then remove it - $this->colToshow = array_intersect($this->model->getState('colToshow'), $this->model->showhideCols); + $this->colToshow = $this->model->getState('colToshow'); $this->filterValues = $this->model->getState('filters'); diff --git a/tjreports/tjreports.xml b/tjreports/tjreports.xml index a464ec7..ae12368 100644 --- a/tjreports/tjreports.xml +++ b/tjreports/tjreports.xml @@ -6,8 +6,8 @@ https://techjoomla.com Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 24th Oct 2019 - 1.1.3 + 11th Nov 2019 + 1.1.4 This component is used to access all the report at single place.