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/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/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() . '"'); 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.