From 125407fcac99780da87a1d42b782882269aa9928 Mon Sep 17 00:00:00 2001 From: divyachaudhari <58217051+divyachaudhari@users.noreply.github.com> Date: Tue, 3 Aug 2021 21:43:07 +0530 Subject: [PATCH 1/2] =?UTF-8?q?Bug=20#173717=20Fix:Backend=20>=20Reports?= =?UTF-8?q?=20>=20Search=20and=20filters=20are=20not=20workin=E2=80=A6=20(?= =?UTF-8?q?#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bug #173717 Fix:Backend > Reports > Search and filters are not working and correct alignment of search fields * Bug #173717 Fix: Removing js from assets and added to media * Bug #173708 Fix: Adding script to delete files * Update script.tjreports.php Co-authored-by: Manoj L --- .../views/tjreport/view.html.php | 4 +- .../assets => media}/js/tjrContentService.js | 0 .../js/tjrContentService.min.js | 0 .../{site/assets => media}/js/tjrContentUI.js | 0 .../assets => media}/js/tjrContentUI.min.js | 0 tjreports/script.tjreports.php | 46 +++++++++++++++++++ tjreports/site/views/reports/view.html.php | 4 +- 7 files changed, 50 insertions(+), 4 deletions(-) rename tjreports/{site/assets => media}/js/tjrContentService.js (100%) mode change 100755 => 100644 rename tjreports/{site/assets => media}/js/tjrContentService.min.js (100%) rename tjreports/{site/assets => media}/js/tjrContentUI.js (100%) mode change 100755 => 100644 rename tjreports/{site/assets => media}/js/tjrContentUI.min.js (100%) diff --git a/tjreports/administrator/views/tjreport/view.html.php b/tjreports/administrator/views/tjreport/view.html.php index cd55d2e..c0a5fac 100644 --- a/tjreports/administrator/views/tjreport/view.html.php +++ b/tjreports/administrator/views/tjreport/view.html.php @@ -111,8 +111,8 @@ protected function addDocumentHeaderData() $document = Factory::getDocument(); - HTMLHelper::_('script', 'components/com_tjreports/assets/js/tjrContentService.min.js'); - HTMLHelper::_('script', 'components/com_tjreports/assets/js/tjrContentUI.min.js'); + HTMLHelper::_('script', 'com_tjreports/tjrContentService.min.js', array("relative" => true)); + HTMLHelper::_('script', 'com_tjreports/tjrContentUI.min.js', array("relative" => true)); HTMLHelper::_('stylesheet', 'components/com_tjreports/assets/css/tjreports.min.css'); $document->addScriptDeclaration('tjrContentUI.base_url = "' . Uri::base() . '"'); diff --git a/tjreports/site/assets/js/tjrContentService.js b/tjreports/media/js/tjrContentService.js old mode 100755 new mode 100644 similarity index 100% rename from tjreports/site/assets/js/tjrContentService.js rename to tjreports/media/js/tjrContentService.js diff --git a/tjreports/site/assets/js/tjrContentService.min.js b/tjreports/media/js/tjrContentService.min.js similarity index 100% rename from tjreports/site/assets/js/tjrContentService.min.js rename to tjreports/media/js/tjrContentService.min.js diff --git a/tjreports/site/assets/js/tjrContentUI.js b/tjreports/media/js/tjrContentUI.js old mode 100755 new mode 100644 similarity index 100% rename from tjreports/site/assets/js/tjrContentUI.js rename to tjreports/media/js/tjrContentUI.js diff --git a/tjreports/site/assets/js/tjrContentUI.min.js b/tjreports/media/js/tjrContentUI.min.js similarity index 100% rename from tjreports/site/assets/js/tjrContentUI.min.js rename to tjreports/media/js/tjrContentUI.min.js diff --git a/tjreports/script.tjreports.php b/tjreports/script.tjreports.php index 1585029..297161a 100755 --- a/tjreports/script.tjreports.php +++ b/tjreports/script.tjreports.php @@ -43,6 +43,17 @@ **/ class Com_TjreportsInstallerScript { + private $removeFilesAndFolders = array( + 'files' => array( + // Since v1.1.7 + 'components/com_tjreports/assets/js/tjrContentService.js', + 'components/com_tjreports/assets/js/tjrContentService.min.js', + 'components/com_tjreports/assets/js/tjrContentUI.js', + 'components/com_tjreports/assets/js/tjrContentUI.min.js', + ), + 'folders' => array() + ); + /** @var array The list of extra modules and plugins to install */ private $queue = array( @@ -238,6 +249,9 @@ public function postflight($type, $parent) } } + // Remove obsolete files and folders + $this->removeObsoleteFilesAndFolders($this->removeFilesAndFolders); + $this->migrateReportsOrdering(); } @@ -266,4 +280,36 @@ public function migrateReportsOrdering() $reportTable->save($data); } } + + /** + * Removes obsolete files and folders + * + * @param array $removeFilesAndFolders + */ + private function removeObsoleteFilesAndFolders($removeFilesAndFolders) + { + // Remove files + jimport('joomla.filesystem.file'); + if(!empty($removeFilesAndFolders['files'])) + { + foreach($removeFilesAndFolders['files'] as $file) + { + $f = JPATH_ROOT.'/'.$file; + if(!JFile::exists($f)) continue; + JFile::delete($f); + } + } + + // Remove folders + jimport('joomla.filesystem.file'); + if(!empty($removeFilesAndFolders['folders'])) + { + foreach($removeFilesAndFolders['folders'] as $folder) + { + $f = JPATH_ROOT.'/'.$folder; + if(!file_exists($f)) continue; + JFolder::delete($f); + } + } + } } diff --git a/tjreports/site/views/reports/view.html.php b/tjreports/site/views/reports/view.html.php index 3afd01a..de2dec5 100755 --- a/tjreports/site/views/reports/view.html.php +++ b/tjreports/site/views/reports/view.html.php @@ -159,8 +159,8 @@ protected function addDocumentHeaderData() HTMLHelper::stylesheet(Uri::root() . '/media/techjoomla_strapper/bs3/css/bootstrap.min.css'); } - HTMLHelper::_('script', 'components/com_tjreports/assets/js/tjrContentService.min.js', array("relative" => true)); - HTMLHelper::_('script', 'components/com_tjreports/assets/js/tjrContentUI.min.js', array("relative" => true)); + HTMLHelper::_('script', 'com_tjreports/tjrContentService.min.js', array("relative" => true)); + HTMLHelper::_('script', 'com_tjreports/tjrContentUI.min.js', array("relative" => true)); HTMLHelper::_('stylesheet', 'components/com_tjreports/assets/css/tjreports.min.css'); $document->addScriptDeclaration('tjrContentUI.base_url = "' . Uri::base() . '"'); From 955e593247a9617ecda01510a36a7ca57d35a791 Mon Sep 17 00:00:00 2001 From: divyachaudhari <58217051+divyachaudhari@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:25:06 +0530 Subject: [PATCH 2/2] Task #173544 Chore: Verion changes - 1.1.7 (#222) --- tjreports/plugins/actionlog/tjreports/tjreports.xml | 4 ++-- tjreports/plugins/content/tjreportsfields/tjreportsfields.xml | 4 ++-- tjreports/plugins/privacy/tjreports/tjreports.xml | 4 ++-- tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml | 4 ++-- tjreports/tjreports.xml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tjreports/plugins/actionlog/tjreports/tjreports.xml b/tjreports/plugins/actionlog/tjreports/tjreports.xml index b80d6a5..6e3501c 100644 --- a/tjreports/plugins/actionlog/tjreports/tjreports.xml +++ b/tjreports/plugins/actionlog/tjreports/tjreports.xml @@ -2,12 +2,12 @@ plg_actionlog_tjreports Techjoomla - 12th Jul 2021 + 17th Aug 2021 Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL extensions@techjoomla.com https://techjoomla.com - 1.1.6 + 1.1.7 PLG_ACTIONLOG_TJREPORTS_XML_DESCRIPTION tjreports.php diff --git a/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml b/tjreports/plugins/content/tjreportsfields/tjreportsfields.xml index e5c2f5f..477a456 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 - 12th Jul 2021 + 17th Aug 2021 Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 1.1.6 + 1.1.7 tjreportsfields.php diff --git a/tjreports/plugins/privacy/tjreports/tjreports.xml b/tjreports/plugins/privacy/tjreports/tjreports.xml index 171964d..4cd90e1 100644 --- a/tjreports/plugins/privacy/tjreports/tjreports.xml +++ b/tjreports/plugins/privacy/tjreports/tjreports.xml @@ -1,8 +1,8 @@ plg_privacy_tjreports - 1.1.6 - 12th Jul 2021 + 1.1.7 + 17th Aug 2021 Techjoomla extensions@techjoomla.com https://techjoomla.com diff --git a/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml b/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.xml index c5e820b..243393b 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 - 12th Jul 2021 + 17th Aug 2021 Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 1.1.6 + 1.1.7 sql/tjreportsindexer.install.sql diff --git a/tjreports/tjreports.xml b/tjreports/tjreports.xml index 2268b4d..ef6eea0 100644 --- a/tjreports/tjreports.xml +++ b/tjreports/tjreports.xml @@ -6,8 +6,8 @@ https://techjoomla.com Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 12th Jul 2021 - 1.1.6 + 17th Aug 2021 + 1.1.7 This component is used to access all the report at single place.