Skip to content

Commit

Permalink
Merge Release 1.1.1 into master (#148)
Browse files Browse the repository at this point in the history
Merge `Release 1.1.1` into `master`
  • Loading branch information
manojLondhe authored Sep 25, 2019
2 parents d780671 + 6d78322 commit d567a78
Show file tree
Hide file tree
Showing 30 changed files with 95 additions and 49 deletions.
8 changes: 4 additions & 4 deletions build/bump.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ function usage($command)
// This file will vary from component to component
$coreXmlFiles = array(
'/tjreports/tjreports.xml',
'/plugins/actionlog/tjreports/tjreports.xml',
'/plugins/content/tjreportsfields/tjreportsfields.xml',
'/plugins/privacy/tjreports/tjreports.xml',
'/plugins/user/tjreportsindexer/tjreportsindexer.xml'
'/tjreports/plugins/actionlog/tjreports/tjreports.xml',
'/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml',
'/tjreports/plugins/privacy/tjreports/tjreports.xml',
'/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml'
);

$antJobFile = '/build.xml';
Expand Down
1 change: 1 addition & 0 deletions tjreports/administrator/models/tjreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function getReportPluginData($pluginId, $pluginName = null)
$params['filter_order'] = $plgModel->getState('list.ordering');
$params['filter_order_Dir'] = $plgModel->getState('list.direction');
$params['limit'] = $plgModel->getState('list.limit');
$params['emailColumn'] = $plgModel->getState('emailColumn');
$params['colToshow'] = $plgModel->getState('colToshow');
$params['colToshow'] = array_combine($params['colToshow'], array_fill(0, count($params['colToshow']), true));
$params['showHideColumns'] = $plgModel->showhideCols;
Expand Down
File renamed without changes.
File renamed without changes.
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 Jun 2019</creationDate>
<creationDate>12th Jul 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.0</version>
<version>1.1.1</version>
<description>PLG_ACTIONLOG_TJREPORTS_XML_DESCRIPTION</description>
<files>
<filename plugin="tjreports">tjreports.php</filename>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<name>plg_content_tjreportsfields</name>
<description>PLG_CONTENT_TJREPORTSFIELDS_XML_DESCRIPTION</description>
<author>Techjoomla</author>
<authorEmail>contact@techjoomla.com</authorEmail>
<authorEmail>extensions@techjoomla.com</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<creationDate>24th May 2019</creationDate>
<copyright>Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.</copyright>
<creationDate>12th Jul 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.0.0</version>
<version>1.1.1</version>

<files>
<filename plugin="tjreportsfields">tjreportsfields.php</filename>
Expand Down
File renamed without changes.
File renamed without changes.
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.0</version>
<creationDate>24th Jun 2019</creationDate>
<version>1.1.1</version>
<creationDate>12th Jul 2019</creationDate>
<author>Techjoomla</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE IF NOT EXISTS `#__tjreports_com_users_user` (
`record_id` int(11) NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE IF NOT EXISTS `#__tjreports_com_users_user` (
`record_id` int(11) NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@
<name>plg_user_tjreportsindexer</name>
<description>PLG_USER_TJREPORTSINDEXER_XML_DESCRIPTION</description>
<author>Techjoomla</author>
<authorEmail>contact@techjoomla.com</authorEmail>
<authorEmail>extensions@techjoomla.com</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<creationDate>24th May 2019</creationDate>
<copyright>Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.</copyright>
<creationDate>12th Jul 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.0.0</version>

<version>1.1.1</version>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/tjreportsindexer.install.sql</file>
</sql>
</install>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<files>
<filename plugin="tjreportsindexer">tjreportsindexer.php</filename>
<filename>index.html</filename>
<folder>sql</folder>
</files>

<languages folder="language">
Expand Down
11 changes: 11 additions & 0 deletions tjreports/site/assets/js/tjrContentUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tjrContentUI.root_url = (typeof root_url == 'undefined') ? '' : root_url;
tjrContentUI.base_url = (typeof root_url == 'undefined') ? '' : root_url;
tjrContentUI.report = tjrContentUI.report ? tjrContentUI.report : {};


jQuery.extend(tjrContentUI.report, {
searchToggle: true,
$form: null,
Expand All @@ -28,6 +29,7 @@ jQuery.extend(tjrContentUI.report, {
}
jQuery(".hasPopover").popover('destroy')
var promise = tjrContentService.postData(this.url, this.$form.serialize());//, {'datatype':'html'}

promise.fail(
function(response) {
console.log('Something went wrong.');
Expand All @@ -45,6 +47,15 @@ jQuery.extend(tjrContentUI.report, {
var responseHTML = jQuery(response['html']).find(containerSel).html();
jQuery(containerSel).html(responseHTML);

// If sendEmail plug is enabled then try to add a column of checkboxes
if (
typeof tjutilitysendemail != 'undefined' &&
jQuery('body').find('.td-sendemail').length > 0
)
{
tjutilitysendemail.addColumn('report-table');
}

// Reinitialze some js like for calandar, tooltip, chosen
jQuery(".hasPopover").popover({"html": true,"trigger": "hover focus","container": "body"});

Expand Down
39 changes: 18 additions & 21 deletions tjreports/site/controllers/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public function csvexport()
$columns = $model->columns;
$colToshow = $model->getState('colToshow');

$csvData = null;
$csvData_arr = $colTitleArray = array();
$colTitleArray = array();

foreach ($colToshow as $index => $detail)
{
Expand Down Expand Up @@ -111,19 +110,23 @@ public function csvexport()
}
}

$csvData .= implode(',', $colTitleArray);
$csvData .= "\n";
echo $csvData;

$csvData = '';
$pluginTitle = $reportData->title;
$filename = strtolower($pluginTitle) . "_report_" . date("Y-m-d_H-i", time());

// Create a file pointer connected to the output stream
$output = fopen('php://output', 'w');

// Put CSV headings first
fputcsv($output, $colTitleArray);

// Set CSV headers
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=" . $filename . ".csv");
header("Pragma: no-cache");
header("Expires: 0");
header('Pragma: no-cache');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Description: File Transfer');
header('Content-Type: text/csv;');
header('Content-Disposition: attachment; filename=' . $filename . '.csv');
header('Content-Transfer-Encoding: binary');

// Loop through items
foreach ((array) $items as $itemKey => $item)
Expand All @@ -136,25 +139,19 @@ public function csvexport()
{
foreach ($key as $subkey => $subVal)
{
$final_text_value = $this->filterValue($item[$arrayKey][$subkey]);

// Add data in the Quotes and asign it in the csv array
$itemCSV[] = '"' . $final_text_value . '"';
$itemCSV[] = $this->filterValue($item[$arrayKey][$subkey]);
}
}
else
{
$final_text_value = $this->filterValue($item[$key]);

// Add data in the Quotes and asign it in the csv array
$itemCSV[] = '"' . $final_text_value . '"';
$itemCSV[] = $this->filterValue($item[$key]);
}
}

// TRIGGER After csv body add extra fields
echo implode(',', $itemCSV) . "\n";
fputcsv($output, $itemCSV);
}

fclose($output);
jexit();
}

Expand Down
31 changes: 24 additions & 7 deletions tjreports/site/models/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class TjreportsModelReports extends JModelList
// Columns array contain columns data
public $columns = array();

// Columns array contain email columns
private $emailColumn = '';

// Columns that a user can select to display
public $showhideCols = array();

Expand Down Expand Up @@ -91,6 +94,9 @@ public function __construct($config = array())
$this->setCustomFieldsColumns();
}

// Get email column
$this->emailColumn = array_search(1, array_map(function ($ar) {return $ar['emailColumn'];}, $this->columns));

$this->initData();

parent::__construct($config);
Expand Down Expand Up @@ -366,6 +372,7 @@ private function initData()
$this->sortableColumns = array_values($this->sortableColumns);
$this->sortableWoQuery = array_values($this->sortableWoQuery);
$this->defaultColToShow = array_values($this->defaultColToShow);

}

/**
Expand Down Expand Up @@ -525,6 +532,11 @@ protected function populateState($ordering = '', $direction = 'ASC')
$value = $input->get('limitstart', 0, 'uint');
$this->setState('list.start', $value);

if ($this->emailColumn)
{
$this->setState('emailColumn', $this->emailColumn);
}

// Ordering
$this->default_order = $input->get('filter_order', $this->default_order, 'STRING');

Expand Down Expand Up @@ -1073,7 +1085,7 @@ private function filterReportColumns($queryId, &$selColToshow)
// Process if user has saved query is for a plugin
if (!empty($parentId))
{
$this->processSavedReportColumns($parentId, $showhideCols, $paramColToshow, $selColToshow);
$this->processSavedReportColumns($parentId, $showhideCols, $paramColToshow, $selColToshow);
}

// If plugin has save any column assign that otherwise default plugin param will be applied
Expand All @@ -1095,15 +1107,20 @@ private function filterReportColumns($queryId, &$selColToshow)
{
$this->showhideCols = $showhideCols;
}

if (!empty($emailColumn))
{
$this->emailColumn = $emailColumn;
}
}

/**
* Method to Process parent Report columns
*
* @param INT $queryId Query Id
* @param ARRAY &$showhideCols Show Hide columns
* @param ARRAY &$colToshow Columns to show
* @param ARRAY &$selColToshow Selected Cols
* @param INT $queryId Query Id
* @param ARRAY &$showhideCols Show Hide columns
* @param ARRAY &$colToshow Columns to show
* @param ARRAY &$selColToshow Selected Cols
*
* @return Void
*
Expand Down Expand Up @@ -1216,7 +1233,7 @@ public function getReportLink($reportToLink, $filters)
/**
* Method to get id of the report having default set as 1
*
* @param STRING $pluginName Plugin Name
* @param STRING $reportId Report id
*
* @return Integer
*
Expand All @@ -1228,7 +1245,7 @@ public function getReportParams($reportId)
JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables');
$reportTable = JTable::getInstance('Tjreport', 'TjreportsTable', array('dbo', $db));
$reportTable->load($reportId);

return new JRegistry($reportTable->param);
}

Expand Down
7 changes: 5 additions & 2 deletions tjreports/site/views/reports/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

$emailColmClass = 'td-sendemail';

$app = JFactory::getApplication();
$headerLevel = $this->headerLevel;
$this->listOrder = $this->state->get('list.ordering');
Expand Down Expand Up @@ -289,7 +291,7 @@

for($i = $headerLevel; $i > 0 ; $i--)
{
echo '<tr>';
echo '<tr class="report-row">';

foreach($this->colToshow as $index=>$detail)
{
Expand Down Expand Up @@ -431,7 +433,8 @@
}
else
{
echo '<td class="' . $key . '">'. $item[$key] .'</td>';
$isSendEmailClass = ($key == $this->emailColumn) ? $emailColmClass : '';
echo "<td class=\"{$key} {$isSendEmailClass} \">{$item[$key]}</td>";
}
}

Expand Down
1 change: 1 addition & 0 deletions tjreports/site/views/reports/view.base.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public function processData($type = 'html')
$this->columns = $this->model->columns;
$this->showHideColumns = $this->model->showhideCols;
$this->sortable = $this->model->sortableColumns;
$this->emailColumn = $this->model->getState('emailColumn');
$this->srButton = $this->model->showSearchResetButton;

$this->colToshow = $this->model->getState('colToshow');
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 Jun 2019</creationDate>
<version>1.1.0</version>
<creationDate>12th Jul 2019</creationDate>
<version>1.1.1</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 d567a78

Please sign in to comment.