Skip to content

Commit

Permalink
Merge pull request #168 from techjoomla/release-1.1.4
Browse files Browse the repository at this point in the history
Release 1.1.4
  • Loading branch information
vaivk369 authored Nov 11, 2019
2 parents 474b6e7 + 85cd165 commit b55d986
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tjreports/plugins/actionlog/tjreports/tjreports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="3.9" type="plugin" group="actionlog" method="upgrade">
<name>plg_actionlog_tjreports</name>
<author>Techjoomla</author>
<creationDate>24th Oct 2019</creationDate>
<creationDate>11th Nov 2019</creationDate>
<copyright>Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<version>1.1.3</version>
<version>1.1.4</version>
<description>PLG_ACTIONLOG_TJREPORTS_XML_DESCRIPTION</description>
<files>
<filename plugin="tjreports">tjreports.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions tjreports/plugins/content/tjreportsfields/tjreportsfields.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<author>Techjoomla</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<creationDate>24th Oct 2019</creationDate>
<creationDate>11th Nov 2019</creationDate>
<copyright>Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<version>1.1.3</version>
<version>1.1.4</version>

<files>
<filename plugin="tjreportsfields">tjreportsfields.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions tjreports/plugins/privacy/tjreports/tjreports.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.4" type="plugin" group="privacy" method="upgrade">
<name>plg_privacy_tjreports</name>
<version>1.1.3</version>
<creationDate>24th Oct 2019</creationDate>
<version>1.1.4</version>
<creationDate>11th Nov 2019</creationDate>
<author>Techjoomla</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<author>Techjoomla</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<creationDate>24th Oct 2019</creationDate>
<creationDate>11th Nov 2019</creationDate>
<copyright>Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<version>1.1.3</version>
<version>1.1.4</version>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/tjreportsindexer.install.sql</file>
Expand Down
2 changes: 1 addition & 1 deletion tjreports/site/assets/js/tjrContentUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
{
Expand Down
24 changes: 21 additions & 3 deletions tjreports/site/models/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))
{
Expand All @@ -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']);
}
Expand Down
15 changes: 12 additions & 3 deletions tjreports/site/views/reports/view.base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
4 changes: 2 additions & 2 deletions tjreports/tjreports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorUrl>https://techjoomla.com</authorUrl>
<copyright>Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<creationDate>24th Oct 2019</creationDate>
<version>1.1.3</version>
<creationDate>11th Nov 2019</creationDate>
<version>1.1.4</version>
<description>This component is used to access all the report at single place.</description>
<install>
<!-- Runs on install -->
Expand Down

0 comments on commit b55d986

Please sign in to comment.