@@ -99,8 +104,8 @@
{
$reportId = $row->id;
}
- $link = JRoute::_('index.php?option=com_tjreports&task=tjreport.edit&id=' . $row->id.'&client='.$input->get('client','','STRING'));
- $report_link = JRoute::_('index.php?option=com_tjreports&view=reports&client=' . $row->client . '&reportToBuild='. $row->plugin . '&reportId=' . $reportId);
+ $link = Route::_('index.php?option=com_tjreports&task=tjreport.edit&id=' . $row->id.'&client='.$input->get('client','','STRING'));
+ $report_link = Route::_('index.php?option=com_tjreports&view=reports&client=' . $row->client . '&reportToBuild='. $row->plugin . '&reportId=' . $reportId);
?>
@@ -109,7 +114,7 @@
-
+
@@ -119,14 +124,14 @@
|
- id); ?>
+ id); ?>
|
-
+
title, ENT_COMPAT, 'UTF-8'); ?>
savedquery; ?>
|
-
+
|
@@ -158,7 +163,7 @@
-
+
@@ -166,5 +171,5 @@
-
+
diff --git a/tjreports/administrator/views/tjreports/view.html.php b/tjreports/administrator/views/tjreports/view.html.php
index a1c3ba3..845596d 100644
--- a/tjreports/administrator/views/tjreports/view.html.php
+++ b/tjreports/administrator/views/tjreports/view.html.php
@@ -8,13 +8,18 @@
*/
// No direct access to this file
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\View\HtmlView;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Toolbar\ToolbarHelper;
require_once JPATH_COMPONENT . '/helpers/tjreports.php';
/**
* HelloWorlds View
*
* @since 0.0.1
*/
-class TjreportsViewTjreports extends JViewLegacy
+class TjreportsViewTjreports extends HtmlView
{
/**
* Display the Tjreports view
@@ -29,7 +34,7 @@ public function display($tpl = null)
if (!$this->canDo->get('core.view'))
{
- JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
+ JError::raiseError(403, Text::_('JERROR_ALERTNOAUTHOR'));
return false;
}
@@ -42,10 +47,10 @@ public function display($tpl = null)
$this->filterForm = $this->get('FilterForm');
// Initialise variables.
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
// Get extension name
- $client = JFactory::getApplication()->input->get('client', '', 'word');
+ $client = Factory::getApplication()->input->get('client', '', 'word');
if ($client)
{
@@ -69,33 +74,33 @@ public function display($tpl = null)
*/
protected function addToolBar()
{
- $name = JText::_('COM_TJREPORTS');
+ $name = Text::_('COM_TJREPORTS');
- JToolBarHelper::title($name, 'list');
+ ToolbarHelper::title($name, 'list');
if ($this->canDo->get('core.create'))
{
- JToolBarHelper::addNew('tjreport.add');
+ ToolbarHelper::addNew('tjreport.add');
}
if ($this->canDo->get('core.edit'))
{
- JToolBarHelper::editList('tjreport.edit');
+ ToolbarHelper::editList('tjreport.edit');
}
if ($this->canDo->get('core.delete'))
{
- JToolBarHelper::deleteList('', 'tjreports.delete');
+ ToolbarHelper::deleteList('', 'tjreports.delete');
}
if ($this->canDo->get('core.admin'))
{
- JToolBarHelper::preferences('com_tjreports');
+ ToolbarHelper::preferences('com_tjreports');
}
if ($this->canDo->get('core.create'))
{
- JToolBarHelper::custom('tjreports.discover', 'refresh', 'refresh', 'JLIB_INSTALLER_DISCOVER', false);
+ ToolbarHelper::custom('tjreports.discover', 'refresh', 'refresh', 'JLIB_INSTALLER_DISCOVER', false);
}
}
}
diff --git a/tjreports/plugins/actionlog/tjreports/tjreports.php b/tjreports/plugins/actionlog/tjreports/tjreports.php
index c47aa13..dec27ba 100644
--- a/tjreports/plugins/actionlog/tjreports/tjreports.php
+++ b/tjreports/plugins/actionlog/tjreports/tjreports.php
@@ -10,11 +10,12 @@
// No direct access.
defined('_JEXEC') or die();
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php');
use Joomla\CMS\Plugin\CMSPlugin;
-use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
/**
@@ -92,9 +93,9 @@ public function tjReportsOnAfterReportSave($context, $table, $isNew)
return;
}
- $context = JFactory::getApplication()->input->get('option');
+ $context = Factory::getApplication()->input->get('option');
- $user = JFactory::getUser();
+ $user = Factory::getUser();
if ($isNew && !empty($table->client))
{
@@ -114,7 +115,7 @@ public function tjReportsOnAfterReportSave($context, $table, $isNew)
if ($table->client)
{
- $language = JFactory::getLanguage();
+ $language = Factory::getLanguage();
$language->load($table->client);
}
@@ -123,7 +124,7 @@ public function tjReportsOnAfterReportSave($context, $table, $isNew)
'id' => $table->id,
'title' => $table->title,
'plugin' => $table->plugin,
- 'client' => JText::_(strtoupper($table->client)),
+ 'client' => Text::_(strtoupper($table->client)),
'itemlink' => 'index.php?option=com_tjreports&task=tjreport.edit&id=' . $table->id,
'userid' => $user->id,
'username' => $user->username,
@@ -153,12 +154,12 @@ public function tjReportsOnAfterReportDelete($context, $table)
return;
}
- $context = JFactory::getApplication()->input->get('option');
- $user = JFactory::getUser();
+ $context = Factory::getApplication()->input->get('option');
+ $user = Factory::getUser();
if (!empty($table->client))
{
- $language = JFactory::getLanguage();
+ $language = Factory::getLanguage();
$language->load($table->client);
$messageLanguageKey = 'PLG_ACTIONLOG_TJREPORTS_REPORT_DELETED_WITH_CLIENT';
@@ -173,7 +174,7 @@ public function tjReportsOnAfterReportDelete($context, $table)
'id' => $table->id,
'title' => $table->title,
'plugin' => $table->plugin,
- 'client' => JText::_(strtoupper($table->client)),
+ 'client' => Text::_(strtoupper($table->client)),
'userid' => $user->id,
'username' => $user->username,
'accountlink' => 'index.php?option=com_users&task=user.edit&id=' . $user->id,
diff --git a/tjreports/plugins/api/reports/reports.php b/tjreports/plugins/api/reports/reports.php
index 5d4a54b..b29380d 100644
--- a/tjreports/plugins/api/reports/reports.php
+++ b/tjreports/plugins/api/reports/reports.php
@@ -10,6 +10,7 @@
// No direct access.
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
jimport('joomla.plugin.plugin');
JLoader::import('components.com_tjreports.models.report', JPATH_SITE);
@@ -37,7 +38,7 @@ public function __construct(&$subject, $config = array())
ApiResource::addIncludePath(dirname(__FILE__) . '/reports');
// Load language files
- $lang = JFactory::getLanguage();
+ $lang = Factory::getLanguage();
$lang->load('plg_api_reports', JPATH_SITE . "/plugins/api/reports/", 'en-GB', true);
}
}
diff --git a/tjreports/plugins/content/tjreportsfields/tjreportsfields.php b/tjreports/plugins/content/tjreportsfields/tjreportsfields.php
index cebcf68..e7cfb80 100644
--- a/tjreports/plugins/content/tjreportsfields/tjreportsfields.php
+++ b/tjreports/plugins/content/tjreportsfields/tjreportsfields.php
@@ -8,6 +8,9 @@
*/
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Plugin\CMSPlugin;
+use Joomla\CMS\Table\Table;
+use Joomla\CMS\Factory;
// Load TJReports db helper
JLoader::import('database', JPATH_SITE . '/components/com_tjreports/helpers');
@@ -17,7 +20,7 @@
*
* @since 1.1.0
*/
-class PlgContentTjreportsfields extends JPlugin
+class PlgContentTjreportsfields extends CMSPlugin
{
/**
* Load the language file on instantiation.
@@ -89,8 +92,8 @@ public function onContentBeforeSave($context, $row, $isNew)
// $context = com_fields.field
- JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables');
- $fieldsTable = JTable::getInstance('Field', 'FieldsTable');
+ Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables');
+ $fieldsTable = Table::getInstance('Field', 'FieldsTable');
$fieldsTable->load(array('id' => $row->id));
// Set an array with field id, field name, so it can be used in onContentAfterSave trigger
@@ -149,7 +152,7 @@ public function onContentAfterSave($context, $field, $isNew)
}
// Get column name, type for custom fields index table
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$columnsDetails = $db->getTableColumns($this->customFieldsTable);
// Extract column names from $columnDetails
@@ -235,7 +238,7 @@ protected function setCustomFieldsTableName($context)
*/
protected function addColumn($newColumn)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// ALTER TABLE tableName ADD newColumn dataType
// eg. ALTER TABLE `#__tjreports_com_users_user` ADD `dob` datetime
@@ -258,7 +261,7 @@ protected function addColumn($newColumn)
*/
protected function updateColumn($oldColumn, $newColumn)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// ALTER TABLE tableName CHANGE oldColumn newColumn dataType
$query = 'ALTER TABLE ' . $db->quoteName($this->customFieldsTable) . '
@@ -280,7 +283,7 @@ protected function updateColumn($oldColumn, $newColumn)
*/
protected function deleteColumn($column)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// ALTER TABLE tableName CHANGE oldColumn newColumn dataType
$query = 'ALTER TABLE ' . $db->quoteName($this->customFieldsTable) . '
diff --git a/tjreports/plugins/privacy/tjreports/tjreports.php b/tjreports/plugins/privacy/tjreports/tjreports.php
index b2ba275..b7fcc53 100644
--- a/tjreports/plugins/privacy/tjreports/tjreports.php
+++ b/tjreports/plugins/privacy/tjreports/tjreports.php
@@ -10,11 +10,12 @@
// No direct access.
defined('_JEXEC') or die();
+use Joomla\CMS\User\User;
+use Joomla\CMS\Table\User;
JLoader::register('PrivacyPlugin', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/plugin.php');
JLoader::register('PrivacyRemovalStatus', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/removal/status.php');
-use Joomla\CMS\User\User;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
@@ -75,7 +76,7 @@ public function onPrivacyCollectAdminCapabilities()
*
* @since 1.0.3
*/
- public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user = null)
+ public function onPrivacyExportRequest(PrivacyTableRequest $request, User $user = null)
{
if (!$user)
{
@@ -101,7 +102,7 @@ public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user
*
* @since 1.0.3
*/
- private function createTJReportsUserReports(JTableUser $user)
+ private function createTJReportsUserReports(User $user)
{
$domain = $this->createDomain('User Reports', 'Reports of user in TJReports');
@@ -135,7 +136,7 @@ private function createTJReportsUserReports(JTableUser $user)
*
* @since 1.0.3
*/
- public function onPrivacyRemoveData(PrivacyTableRequest $request, JUser $user = null)
+ public function onPrivacyRemoveData(PrivacyTableRequest $request, User $user = null)
{
// This plugin only processes data for registered user accounts
if (!$user)
diff --git a/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.php b/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.php
index 2a93064..d346163 100644
--- a/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.php
+++ b/tjreports/plugins/user/tjreportsindexer/tjreportsindexer.php
@@ -9,13 +9,17 @@
// No direct access
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Plugin\CMSPlugin;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Table\Table;
+use Joomla\Data\DataObject;
/**
* Class for Tjreportsindexer User Plugin
*
* @since 1.1.0
*/
-class PlgUserTjreportsindexer extends JPlugin
+class PlgUserTjreportsindexer extends CMSPlugin
{
/**
* Load the language file on instantiation.
@@ -96,7 +100,7 @@ public function onUserAfterDelete($user, $success, $msg)
*/
protected function addIndexerEntry($user)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// Get column name, type for custom fields index table
$columnsDetails = $db->getTableColumns($this->customFieldsTable);
@@ -107,7 +111,7 @@ protected function addIndexerEntry($user)
// For all fields get type, fieldparams
// Register FieldsHelper, Get fields data from current entry
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
- $userTableObj = JTable::getInstance('User');
+ $userTableObj = Table::getInstance('User');
$userTableObj->load((int) $user['id']);
$fields = FieldsHelper::getFields('com_users.user', $userTableObj, true);
@@ -176,7 +180,7 @@ protected function addIndexerEntry($user)
*/
protected function deleteIndexerEntry($userId)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// Here record_id = user_id
$query = $db->getQuery(true)
@@ -187,7 +191,7 @@ protected function deleteIndexerEntry($userId)
{
$db->setQuery($query)->execute();
}
- catch (JDatabaseExceptionExecuting $e)
+ catch (DataObjectbaseExceptionExecuting $e)
{
return false;
}
diff --git a/tjreports/script.tjreports.php b/tjreports/script.tjreports.php
index 297161a..b01e4d2 100755
--- a/tjreports/script.tjreports.php
+++ b/tjreports/script.tjreports.php
@@ -29,11 +29,16 @@
*/
defined('_JEXEC') or die( ';)' );
+use Joomla\CMS\Factory;
+use Joomla\CMS\Object\CMSObject;
+use Joomla\CMS\Installer\Installer;
+use Joomla\CMS\Table\Table;
+use Joomla\CMS\Filesystem\File;
+use Joomla\CMS\Filesystem\Folder;
jimport('joomla.installer.installer');
jimport('joomla.filesystem.file');
jimport('joomla.application.component.helper');
-Use Joomla\CMS\Table\Table;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
/**
@@ -99,9 +104,9 @@ public function uninstall($parent)
{
jimport('joomla.installer.installer');
- $db = JFactory::getDBO();
+ $db = Factory::getDBO();
- $status = new JObject;
+ $status = new CMSObject;
$status->plugins = array();
$src = $parent->getParent()->getPath('source');
@@ -126,7 +131,7 @@ public function uninstall($parent)
if ($id)
{
- $installer = new JInstaller;
+ $installer = new Installer;
$result = $installer->uninstall('plugin', $id);
$status->plugins[] = array(
'name' => 'plg_' . $plugin,
@@ -184,9 +189,9 @@ public function postflight($type, $parent)
{
$src = $parent->getParent()->getPath('source');
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
- $status = new JObject;
+ $status = new CMSObject;
$status->plugins = array();
// Plugins installation
@@ -229,7 +234,7 @@ public function postflight($type, $parent)
$db->setQuery($query);
$count = $db->loadResult();
- $installer = new JInstaller;
+ $installer = new Installer;
$result = $installer->install($path);
$status->plugins[] = array('name' => 'plg_' . $plugin, 'group' => $folder, 'result' => $result);
@@ -269,7 +274,7 @@ public function migrateReportsOrdering()
$tjreportsModel->setState('list.ordering', 'id');
$reportList = $tjreportsModel->getItems();
- JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables');
+ Table::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables');
$reportTable = Table::getInstance('Tjreport', 'TjreportsTable');
foreach ($reportList as $key => $report)
@@ -295,8 +300,8 @@ private function removeObsoleteFilesAndFolders($removeFilesAndFolders)
foreach($removeFilesAndFolders['files'] as $file)
{
$f = JPATH_ROOT.'/'.$file;
- if(!JFile::exists($f)) continue;
- JFile::delete($f);
+ if(!File::exists($f)) continue;
+ File::delete($f);
}
}
@@ -308,7 +313,7 @@ private function removeObsoleteFilesAndFolders($removeFilesAndFolders)
{
$f = JPATH_ROOT.'/'.$folder;
if(!file_exists($f)) continue;
- JFolder::delete($f);
+ Folder::delete($f);
}
}
}
diff --git a/tjreports/site/controller.php b/tjreports/site/controller.php
index 943235e..f6f1776 100755
--- a/tjreports/site/controller.php
+++ b/tjreports/site/controller.php
@@ -9,6 +9,7 @@
*/
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\Controller\BaseController;
jimport('joomla.application.component.controller');
@@ -17,7 +18,7 @@
*
* @since 1.6
*/
-class TjreportsController extends JControllerLegacy
+class TjreportsController extends BaseController
{
/**
* Method to display a view.
diff --git a/tjreports/site/controllers/reports.json.php b/tjreports/site/controllers/reports.json.php
index 2dfa861..d241595 100644
--- a/tjreports/site/controllers/reports.json.php
+++ b/tjreports/site/controllers/reports.json.php
@@ -12,6 +12,12 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\Controller\AdminController;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Filter\OutputFilter;
+use Joomla\CMS\Response\JsonResponse;
+use Joomla\CMS\Plugin\PluginHelper;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
jimport('joomla.application.component.controlleradmin');
@@ -20,7 +26,7 @@
*
* @since 1.0.0
*/
-class TjreportsControllerReports extends JControllerAdmin
+class TjreportsControllerReports extends AdminController
{
/**
* Save a query for report engine
@@ -33,11 +39,11 @@ public function saveQuery()
{
try
{
- $app = JFactory::getApplication();
- $db = JFactory::getDBO();
+ $app = Factory::getApplication();
+ $db = Factory::getDBO();
$input = $app->input;
$post = $input->post->getArray();
- $current_user = JFactory::getUser()->id;
+ $current_user = Factory::getUser()->id;
if (empty($post))
{
@@ -51,13 +57,13 @@ public function saveQuery()
if ($alias)
{
- if (JFactory::getConfig()->get('unicodeslugs') == 1)
+ if (Factory::getConfig()->get('unicodeslugs') == 1)
{
- $alias = JFilterOutput::stringURLUnicodeSlug($alias);
+ $alias = OutputFilter::stringURLUnicodeSlug($alias);
}
else
{
- $alias = JFilterOutput::stringURLSafe($alias);
+ $alias = OutputFilter::stringURLSafe($alias);
}
}
@@ -81,25 +87,24 @@ public function saveQuery()
{
$app->enqueueMessage($db->stderr());
- echo new JResponseJson(null, 'Could not insert data.', true);
+ echo new JsonResponse(null, 'Could not insert data.', true);
}
else
{
$id = $db->insertid();
$insert_object->id = $id;
- $dispatcher = JEventDispatcher::getInstance();
- $extension = JFactory::getApplication()->input->get('option');
- JPluginHelper::importPlugin('tjreports');
- $dispatcher->trigger('tjReportsOnAfterReportSave', array($extension, $insert_object, true));
+ $extension = Factory::getApplication()->input->get('option');
+ PluginHelper::importPlugin('tjreports');
+ Factory::getApplication()->triggerEvent('tjReportsOnAfterReportSave', array($extension, $insert_object, true));
$app->enqueueMessage('Data save successfully.');
- echo new JResponseJson('Done');
+ echo new JsonResponse('Done');
}
}
catch (Exception $e)
{
- echo new JResponseJson($e);
+ echo new JsonResponse($e);
}
}
@@ -114,21 +119,21 @@ public function deleteQuery()
{
try
{
- $app = JFactory::getApplication();
- $db = JFactory::getDBO();
+ $app = Factory::getApplication();
+ $db = Factory::getDBO();
$input = $app->input;
$queryId = $input->get('queryId', 0, 'INT');
- JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_tjreports/models');
- $model = JModelLegacy::getInstance('Report', 'TjreportsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_SITE . '/components/com_tjreports/models');
+ $model = BaseDatabaseModel::getInstance('Report', 'TjreportsModel');
$result = $model->delete($queryId);
- echo new JResponseJson($result);
+ echo new JsonResponse($result);
}
catch (Exception $e)
{
- echo new JResponseJson($e);
+ echo new JsonResponse($e);
}
}
}
diff --git a/tjreports/site/controllers/reports.php b/tjreports/site/controllers/reports.php
index 5cd560b..899e7f4 100644
--- a/tjreports/site/controllers/reports.php
+++ b/tjreports/site/controllers/reports.php
@@ -12,6 +12,12 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\Controller\AdminController;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Uri\Uri;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
jimport('joomla.application.component.controlleradmin');
@@ -20,7 +26,7 @@
*
* @since 1.0.0
*/
-class TjreportsControllerReports extends JControllerAdmin
+class TjreportsControllerReports extends AdminController
{
/**
* Function used to export data in csv format
@@ -31,23 +37,23 @@ class TjreportsControllerReports extends JControllerAdmin
*/
public function csvexport()
{
- $app = JFactory::getApplication();
- $user = JFactory::getUser();
- $input = JFactory::getApplication()->input;
+ $app = Factory::getApplication();
+ $user = Factory::getUser();
+ $input = Factory::getApplication()->input;
$reportId = $input->post->get('reportId');
if (!$user->authorise('core.export', 'com_tjreports.tjreport.' . $reportId))
{
if ($user->guest)
{
- $return = base64_encode(JUri::getInstance());
- $login_url_with_return = JRoute::_('index.php?option=com_users&view=login&return=' . $return);
- $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'notice');
+ $return = base64_encode(Uri::getInstance());
+ $login_url_with_return = Route::_('index.php?option=com_users&view=login&return=' . $return);
+ $app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'notice');
$app->redirect($login_url_with_return, 403);
}
else
{
- $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
+ $app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
$app->setHeader('status', 403, true);
return;
@@ -58,8 +64,8 @@ public function csvexport()
$reportData = $this->model->getReportNameById($reportId);
$pluginName = $reportData->plugin;
- JModelLegacy::addIncludePath(JPATH_SITE . '/plugins/tjreports/' . $pluginName);
- $model = JModelLegacy::getInstance($pluginName, 'TjreportsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_SITE . '/plugins/tjreports/' . $pluginName);
+ $model = BaseDatabaseModel::getInstance($pluginName, 'TjreportsModel');
$model->loadLanguage($pluginName);
$input->set('limit', 0);
@@ -90,7 +96,7 @@ public function csvexport()
$subTextTitle = $columns[$subKey]['title'];
}
- $colTitleArray[] = $contentTitle . ' ' . JText::sprintf($subTextTitle, $contentTitle, $contentId);
+ $colTitleArray[] = $contentTitle . ' ' . Text::sprintf($subTextTitle, $contentTitle, $contentId);
}
}
else
@@ -106,7 +112,7 @@ public function csvexport()
$colTitle = $columns[$colKey]['title'];
}
- $colTitleArray[] = JText::_($colTitle);
+ $colTitleArray[] = Text::_($colTitle);
}
}
@@ -165,11 +171,11 @@ public function csvexport()
public function pdfExport()
{
require_once JPATH_SITE . '/components/com_tjlms/models/review.php';
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
- $jinput = JFactory::getApplication()->input;
+ $jinput = Factory::getApplication()->input;
- $user = JFactory::getUser();
+ $user = Factory::getUser();
$track_id = $jinput->get('track_id', '0', 'INT');
$curriculam_id = $jinput->get('curId', '0', 'INT');
$user_id = $user->id;
@@ -181,7 +187,7 @@ public function pdfExport()
}
else
{
- return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ return JError::raiseWarning(404, Text::_('JERROR_ALERTNOAUTHOR'));
}
jexit();
@@ -225,12 +231,12 @@ private function filterValue($data)
*/
public function defaultReport()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
$model = $this->getModel('reports');
$reports = $model->getenableReportPlugins();
- $this->setRedirect(JRoute::_('index.php?option=com_tjreports&view=reports&client=' . $client . '&reportId=' . $reports[0]['reportId'], false));
+ $this->setRedirect(Route::_('index.php?option=com_tjreports&view=reports&client=' . $client . '&reportId=' . $reports[0]['reportId'], false));
}
}
diff --git a/tjreports/site/helpers/database.php b/tjreports/site/helpers/database.php
index b2fc4d6..b8fc885 100644
--- a/tjreports/site/helpers/database.php
+++ b/tjreports/site/helpers/database.php
@@ -9,6 +9,7 @@
// No direct access
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
/**
* Databse helper class for com_tjreports
@@ -31,7 +32,7 @@ class TjreportsfieldsHelperDatabase
*/
public function tableExists($tableName)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$dbPrefix = $db->getPrefix();
$allTables = $db->getTableList();
diff --git a/tjreports/site/layouts/joomla/pagination/link.php b/tjreports/site/layouts/joomla/pagination/link.php
index b21bf12..b49bff4 100644
--- a/tjreports/site/layouts/joomla/pagination/link.php
+++ b/tjreports/site/layouts/joomla/pagination/link.php
@@ -8,6 +8,8 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\HTML\HTMLHelper;
/** @var JPaginationObject $item */
$item = $displayData['data'];
@@ -28,33 +30,33 @@
switch ((string) $item->text)
{
// Check for "Start" item
- case JText::_('JLIB_HTML_START') :
+ case Text::_('JLIB_HTML_START') :
$icon = 'icon-backward icon-first fa fa-step-backward';
- $aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
+ $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
break;
// Check for "Prev" item
- case JText::_('JPREV') :
- $item->text = JText::_('JPREVIOUS');
+ case Text::_('JPREV') :
+ $item->text = Text::_('JPREVIOUS');
$icon = 'icon-step-backward icon-previous fa fa-backward';
- $aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
+ $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
break;
// Check for "Next" item
- case JText::_('JNEXT') :
+ case Text::_('JNEXT') :
$icon = 'icon-step-forward icon-next fa fa-forward';
- $aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
+ $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
break;
// Check for "End" item
- case JText::_('JLIB_HTML_END') :
+ case Text::_('JLIB_HTML_END') :
$icon = 'icon-forward icon-last fa fa-step-forward';
- $aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
+ $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
break;
default:
$icon = null;
- $aria = JText::sprintf('JLIB_HTML_GOTO_PAGE', $item->text);
+ $aria = Text::sprintf('JLIB_HTML_GOTO_PAGE', $item->text);
break;
}
@@ -82,7 +84,7 @@
if (!is_numeric($item->text))
{
- JHtml::_('bootstrap.tooltip');
+ HTMLHelper::_('bootstrap.tooltip');
$cssClasses[] = 'hasTooltip';
$title = ' title="' . $item->text . '" ';
}
@@ -106,7 +108,7 @@
- >
+ >
diff --git a/tjreports/site/layouts/joomla/pagination/links.php b/tjreports/site/layouts/joomla/pagination/links.php
index b699a02..b415a7d 100644
--- a/tjreports/site/layouts/joomla/pagination/links.php
+++ b/tjreports/site/layouts/joomla/pagination/links.php
@@ -8,6 +8,7 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Layout\LayoutHelper;
use Joomla\Registry\Registry;
@@ -60,11 +61,11 @@
diff --git a/tjreports/site/models/fields/createdby.php b/tjreports/site/models/fields/createdby.php
index 24c7199..c73b702 100755
--- a/tjreports/site/models/fields/createdby.php
+++ b/tjreports/site/models/fields/createdby.php
@@ -8,6 +8,8 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Factory;
jimport('joomla.form.formfield');
@@ -16,7 +18,7 @@
*
* @since 1.6
*/
-class JFormFieldCreatedby extends JFormField
+class FormFieldCreatedby extends FormField
{
/**
* The form field type.
@@ -43,11 +45,11 @@ protected function getInput()
if ($user_id)
{
- $user = JFactory::getUser($user_id);
+ $user = Factory::getUser($user_id);
}
else
{
- $user = JFactory::getUser();
+ $user = Factory::getUser();
$html[] = '';
}
diff --git a/tjreports/site/models/fields/filemultiple.php b/tjreports/site/models/fields/filemultiple.php
index 6cfd9d4..dcd4836 100755
--- a/tjreports/site/models/fields/filemultiple.php
+++ b/tjreports/site/models/fields/filemultiple.php
@@ -8,6 +8,7 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Form\FormField;
jimport('joomla.form.formfield');
@@ -16,7 +17,7 @@
*
* @since 1.6
*/
-class JFormFieldFileMultiple extends JFormField
+class FormFieldFileMultiple extends FormField
{
/**
* The form field type.
diff --git a/tjreports/site/models/fields/foreignkey.php b/tjreports/site/models/fields/foreignkey.php
index 4bd0f37..56b9c93 100755
--- a/tjreports/site/models/fields/foreignkey.php
+++ b/tjreports/site/models/fields/foreignkey.php
@@ -8,6 +8,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
jimport('joomla.form.formfield');
@@ -16,7 +19,7 @@
*
* @since 1.6
*/
-class JFormFieldForeignKey extends JFormField
+class FormFieldForeignKey extends FormField
{
/**
* The form field type.
@@ -64,7 +67,7 @@ protected function getInput()
$fk_value = '';
// Load all the field options
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
// Support for multiple fields on fk_values
@@ -113,7 +116,7 @@ protected function getInput()
// Iterate through all the results
foreach ($results as $result)
{
- $options[] = JHtml::_('select.option', $result->{$this->key_field}, $result->{$this->value_field});
+ $options[] = HTMLHelper::_('select.option', $result->{$this->key_field}, $result->{$this->value_field});
}
$value = $this->value;
@@ -136,10 +139,10 @@ protected function getInput()
}
else
{
- array_unshift($options, JHtml::_('select.option', '', ''));
+ array_unshift($options, HTMLHelper::_('select.option', '', ''));
}
- $html = JHtml::_('select.genericlist', $options, $this->name, $input_options, 'value', 'text', $value, $this->id);
+ $html = HTMLHelper::_('select.genericlist', $options, $this->name, $input_options, 'value', 'text', $value, $this->id);
break;
}
diff --git a/tjreports/site/models/fields/modifiedby.php b/tjreports/site/models/fields/modifiedby.php
index a5e85c6..aae9f56 100755
--- a/tjreports/site/models/fields/modifiedby.php
+++ b/tjreports/site/models/fields/modifiedby.php
@@ -8,6 +8,8 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Factory;
jimport('joomla.form.formfield');
@@ -16,7 +18,7 @@
*
* @since 1.6
*/
-class JFormFieldModifiedby extends JFormField
+class FormFieldModifiedby extends FormField
{
/**
* The form field type.
@@ -37,7 +39,7 @@ protected function getInput()
{
// Initialize variables.
$html = array();
- $user = JFactory::getUser();
+ $user = Factory::getUser();
$html[] = '';
$html[] = "" . $user->name . " (" . $user->username . ") ";
diff --git a/tjreports/site/models/fields/submit.php b/tjreports/site/models/fields/submit.php
index 4f6bad4..fee34ef 100755
--- a/tjreports/site/models/fields/submit.php
+++ b/tjreports/site/models/fields/submit.php
@@ -10,6 +10,8 @@
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Language\Text;
jimport('joomla.form.formfield');
@@ -18,7 +20,7 @@
*
* @since 1.6
*/
-class JFormFieldSubmit extends JFormField
+class FormFieldSubmit extends FormField
{
protected $type = 'submit';
@@ -38,9 +40,9 @@ public function getInput()
return '';
}
}
diff --git a/tjreports/site/models/fields/timecreated.php b/tjreports/site/models/fields/timecreated.php
index fdc7923..dfd83b3 100755
--- a/tjreports/site/models/fields/timecreated.php
+++ b/tjreports/site/models/fields/timecreated.php
@@ -8,6 +8,10 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Date\Date;
+use Joomla\CMS\Language\Text;
jimport('joomla.form.formfield');
@@ -16,7 +20,7 @@
*
* @since 1.6
*/
-class JFormFieldTimecreated extends JFormField
+class FormFieldTimecreated extends FormField
{
/**
* The form field type.
@@ -42,7 +46,7 @@ protected function getInput()
if (!strtotime($time_created))
{
- $time_created = JFactory::getDate()->toSql();
+ $time_created = Factory::getDate()->toSql();
$html[] = '';
}
@@ -50,8 +54,8 @@ protected function getInput()
if ($hidden == null || !$hidden)
{
- $jdate = new JDate($time_created);
- $pretty_date = $jdate->format(JText::_('DATE_FORMAT_LC2'));
+ $jdate = new Date($time_created);
+ $pretty_date = $jdate->format(Text::_('DATE_FORMAT_LC2'));
$html[] = "" . $pretty_date . " ";
}
diff --git a/tjreports/site/models/fields/timeupdated.php b/tjreports/site/models/fields/timeupdated.php
index ec3e421..42c9e07 100755
--- a/tjreports/site/models/fields/timeupdated.php
+++ b/tjreports/site/models/fields/timeupdated.php
@@ -8,6 +8,10 @@
*/
defined('JPATH_BASE') or die;
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Date\Date;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Factory;
jimport('joomla.form.formfield');
@@ -16,7 +20,7 @@
*
* @since 1.6
*/
-class JFormFieldTimeupdated extends JFormField
+class FormFieldTimeupdated extends FormField
{
/**
* The form field type.
@@ -49,13 +53,13 @@ protected function getInput()
}
else
{
- $jdate = new JDate($old_time_updated);
- $pretty_date = $jdate->format(JText::_('DATE_FORMAT_LC2'));
+ $jdate = new Date($old_time_updated);
+ $pretty_date = $jdate->format(Text::_('DATE_FORMAT_LC2'));
$html[] = "" . $pretty_date . " ";
}
}
- $time_updated = JFactory::getDate()->toSql();
+ $time_updated = Factory::getDate()->toSql();
$html[] = '';
return implode($html);
diff --git a/tjreports/site/models/report.php b/tjreports/site/models/report.php
index 76fb57e..8ac6498 100644
--- a/tjreports/site/models/report.php
+++ b/tjreports/site/models/report.php
@@ -8,13 +8,17 @@
// No direct access.
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\Model\AdminModel;
+use Joomla\CMS\Table\Table;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Plugin\PluginHelper;
/**
* Tmt model.
*
* @since 1.0
*/
-class TjreportsModelReport extends JModelAdmin
+class TjreportsModelReport extends AdminModel
{
/**
* Method to get a table object, load it if necessary.
@@ -30,7 +34,7 @@ class TjreportsModelReport extends JModelAdmin
public function getTable($type = 'Tjreport', $prefix = 'TjreportsTable', $config = array())
{
- return JTable::getInstance($type, $prefix, $config);
+ return Table::getInstance($type, $prefix, $config);
}
/**
@@ -73,7 +77,7 @@ public function getForm($data = array(), $loadData = true)
protected function loadFormData()
{
// Check the session for previously entered form data.
- $data = JFactory::getApplication()->getUserState(
+ $data = Factory::getApplication()->getUserState(
'com_tjreports.edit.tjreports.data',
array()
);
@@ -97,20 +101,19 @@ protected function loadFormData()
*/
public function delete(&$pks)
{
- $db = JFactory::getDBO();
- JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables');
- $tjrTable = JTable::getInstance('Tjreport', 'TjreportsTable', array('dbo', $db));
+ $db = Factory::getDBO();
+ Table::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables');
+ $tjrTable = Table::getInstance('Tjreport', 'TjreportsTable', array('dbo', $db));
$tjrTable->load(array('id' => &$pks));
$data = $tjrTable;
- if ($tjrTable->userid == JFactory::getUser()->id)
+ if ($tjrTable->userid == Factory::getUser()->id)
{
$tjrTable->delete($pks);
- $dispatcher = JEventDispatcher::getInstance();
- $extension = JFactory::getApplication()->input->get('option');
- JPluginHelper::importPlugin('tjreports');
- $dispatcher->trigger('tjReportsOnAfterReportDelete', array($extension, $data));
+ $extension = Factory::getApplication()->input->get('option');
+ PluginHelper::importPlugin('tjreports');
+ Factory::getApplication()->triggerEvent('tjReportsOnAfterReportDelete', array($extension, $data));
return true;
}
diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php
index 7a89076..2dd0b53 100755
--- a/tjreports/site/models/reports.php
+++ b/tjreports/site/models/reports.php
@@ -9,8 +9,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');
-
use Joomla\CMS\Factory;
+
use Joomla\CMS\Date\Date;
use Joomla\CMS\Table\Table;
Use Joomla\Registry\Registry;
@@ -1609,7 +1609,7 @@ protected function getUserGroups($userId)
return array();
}
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
// Get the titles for the user groups.
diff --git a/tjreports/site/router1.php b/tjreports/site/router1.php
index 0847307..73faa59 100755
--- a/tjreports/site/router1.php
+++ b/tjreports/site/router1.php
@@ -9,6 +9,7 @@
*/
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Component\Router\RouterBase;
JLoader::registerPrefix('Tjreports', JPATH_SITE . '/components/com_tjreports/');
@@ -17,7 +18,7 @@
*
* @since 3.3
*/
-class TjreportsRouter extends JComponentRouterBase
+class TjreportsRouter extends RouterBase
{
/**
* Build method for URLs
diff --git a/tjreports/site/tjreports.php b/tjreports/site/tjreports.php
index 209c524..f712354 100755
--- a/tjreports/site/tjreports.php
+++ b/tjreports/site/tjreports.php
@@ -9,6 +9,8 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\Controller\BaseController;
+use Joomla\CMS\Factory;
if (!defined('DS'))
{
@@ -32,6 +34,6 @@
JLoader::registerPrefix('tjreports', JPATH_COMPONENT);
-$controller = JControllerLegacy::getInstance('tjreports');
-$controller->execute(JFactory::getApplication()->input->get('task'));
+$controller = BaseController::getInstance('tjreports');
+$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();
diff --git a/tjreports/site/views/reports/tmpl/default.php b/tjreports/site/views/reports/tmpl/default.php
index 826fb35..8891709 100644
--- a/tjreports/site/views/reports/tmpl/default.php
+++ b/tjreports/site/views/reports/tmpl/default.php
@@ -9,6 +9,7 @@
// no direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Plugin\PluginHelper;
Use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
@@ -561,7 +562,7 @@
0 && JPluginHelper::isEnabled('system', 'tjsendemail'))
+if ($emailColumCnt > 0 && PluginHelper::isEnabled('system', 'tjsendemail'))
{
HTMLHelper::script('media/editors/tinymce/tinymce.min.js');
HTMLHelper::script('plugins/system/tjsendemail/assets/bulksendemail.min.js');
diff --git a/tjreports/site/views/reports/tmpl/default_filters.php b/tjreports/site/views/reports/tmpl/default_filters.php
index bb41736..e04dbe9 100644
--- a/tjreports/site/views/reports/tmpl/default_filters.php
+++ b/tjreports/site/views/reports/tmpl/default_filters.php
@@ -9,6 +9,7 @@
// no direct access
defined('_JEXEC') or die;
+use Joomla\CMS\HTML\HTMLHelper;
$displayFilters = $this->filters;
$filters = $this->filterValues;
@@ -44,7 +45,7 @@ class="input input-mini filter-input ' . $filterHide . '" ' .
if(isset($this->colKey))
{
- $filterHtml .= JHtml::_('grid.sort', '', $this->colKey, $this->listDirn, $this->listOrder);
+ $filterHtml .= HTMLHelper::_('grid.sort', '', $this->colKey, $this->listDirn, $this->listOrder);
}
}
elseif($searchType == 'select' && isset($filter['select_options']))
@@ -54,7 +55,7 @@ class="input input-mini filter-input ' . $filterHide . '" ' .
$filterHtml = '';
- $filterHtml .= JHtml::_('select.genericlist', $filter['select_options'], 'filters[' . $searchKey . ']',
+ $filterHtml .= HTMLHelper::_('select.genericlist', $filter['select_options'], 'filters[' . $searchKey . ']',
'class="filter-input ' . $filterHide . '" size="1" onchange="tjrContentUI.report.submitTJRData();"',
$svalue, $stext, $searchValue);
@@ -73,7 +74,7 @@ class="input input-mini filter-input ' . $filterHide . '" ' .
if(isset($this->colKey))
{
- $filterHtml .= JHtml::_('grid.sort', '', $this->colKey, $this->listDirn, $this->listOrder);
+ $filterHtml .= HTMLHelper::_('grid.sort', '', $this->colKey, $this->listDirn, $this->listOrder);
}
}
elseif($searchType == 'date.range' || $searchType == 'calendar')
@@ -123,7 +124,7 @@ class="input input-mini filter-input ' . $filterHide . '" ' .
}
$filterHtml .= ' '
- . JHtml::_('calendar', htmlspecialchars($searchValue), 'filters['. $fieldKey . ']', 'filters_' . $fieldKey , $dateFormat, $fieldAttr);
+ . HTMLHelper::_('calendar', htmlspecialchars($searchValue), 'filters['. $fieldKey . ']', 'filters_' . $fieldKey , $dateFormat, $fieldAttr);
if ($this->filterLevel == 1)
{
@@ -140,7 +141,7 @@ class="input input-mini filter-input ' . $filterHide . '" ' .
if(isset($this->colKey))
{
- $filterHtml .= JHtml::_('grid.sort', '', $this->colKey, $this->listDirn, $this->listOrder);
+ $filterHtml .= HTMLHelper::_('grid.sort', '', $this->colKey, $this->listDirn, $this->listOrder);
}
}
}
diff --git a/tjreports/site/views/reports/view.base.php b/tjreports/site/views/reports/view.base.php
index ca455f4..1592182 100644
--- a/tjreports/site/views/reports/view.base.php
+++ b/tjreports/site/views/reports/view.base.php
@@ -12,6 +12,7 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\MVC\View\HtmlView;
Use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
@@ -31,7 +32,7 @@
*
* @since 1.0.0
*/
-class ReportsViewBase extends JViewLegacy
+class ReportsViewBase extends HtmlView
{
protected $items;
diff --git a/tjreports/site/views/reports/view.csv.php b/tjreports/site/views/reports/view.csv.php
index ee81654..97a13db 100644
--- a/tjreports/site/views/reports/view.csv.php
+++ b/tjreports/site/views/reports/view.csv.php
@@ -11,6 +11,10 @@
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
jimport('joomla.application.component.view');
jimport('techjoomla.view.csv');
JLoader::import('components.com_tjreports.helpers.tjreports', JPATH_ADMINISTRATOR);
@@ -42,8 +46,8 @@ class TjreportsViewReports extends TjExportCsv
*/
public function display($tpl = null)
{
- $input = JFactory::getApplication()->input;
- $user = JFactory::getUser();
+ $input = Factory::getApplication()->input;
+ $user = Factory::getUser();
$canDo = TjreportsHelper::getActions();
$reportId = $input->post->get('reportId');
$userAuthorisedExport = $user->authorise('core.export', 'com_tjreports.tjreport.' . $reportId);
@@ -51,8 +55,9 @@ public function display($tpl = null)
if (!$canDo->get('core.export') || !$user)
{
// Redirect to the list screen.
- $redirect = JRoute::_('index.php?option=com_tjreports&view=reports', false);
- JFactory::getApplication()->redirect($redirect, JText::_('JERROR_ALERTNOAUTHOR'));
+ $redirect = Route::_('index.php?option=com_tjreports&view=reports', false);
+ Factory::getApplication()->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
+ Factory::getApplication()->redirect($redirect);
return false;
}
@@ -62,7 +67,7 @@ public function display($tpl = null)
{
$fileName = $input->get('file_name');
$this->download($fileName);
- JFactory::getApplication()->close();
+ Factory::getApplication()->close();
}
else
{
@@ -74,7 +79,7 @@ public function display($tpl = null)
}
else
{
- JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
return false;
}
@@ -93,7 +98,7 @@ private function getItems()
{
JLoader::import('components.com_reports.models.reports', JPATH_SITE);
$reportModel = new TjreportsModelReports;
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$this->limitStart = $input->get('limitstart');
$this->limit = $reportModel->getState('list.limit');
$reportId = $input->post->get('reportId');
@@ -101,8 +106,8 @@ private function getItems()
$reportData = $reportModel->getReportNameById($reportId);
$pluginName = $reportData->plugin;
- JModelLegacy::addIncludePath(JPATH_SITE . '/plugins/tjreports/' . $pluginName);
- $model = JModelLegacy::getInstance($pluginName, 'TjreportsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_SITE . '/plugins/tjreports/' . $pluginName);
+ $model = BaseDatabaseModel::getInstance($pluginName, 'TjreportsModel');
$model->loadLanguage($pluginName);
@@ -136,7 +141,7 @@ private function getItems()
$subTextTitle = $columns[$subKey]['title'];
}
- $colTitleArray[] = $contentTitle . ' ' . JText::sprintf($subTextTitle, $contentTitle, $contentId);
+ $colTitleArray[] = $contentTitle . ' ' . Text::sprintf($subTextTitle, $contentTitle, $contentId);
}
}
else
@@ -152,7 +157,7 @@ private function getItems()
$colTitle = $columns[$colKey]['title'];
}
- $colTitleArray[] = JText::_($colTitle);
+ $colTitleArray[] = Text::_($colTitle);
}
}
diff --git a/tjreports/site/views/reports/view.html.php b/tjreports/site/views/reports/view.html.php
index de2dec5..0784855 100755
--- a/tjreports/site/views/reports/view.html.php
+++ b/tjreports/site/views/reports/view.html.php
@@ -12,11 +12,11 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\HTML\HTMLHelper;
Use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
-use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Component\ComponentHelper;
require_once __DIR__ . '/view.base.php';
@@ -68,7 +68,7 @@ protected function addToolbar()
$bar = JToolBar::getInstance('toolbar');
$canDo = TjreportsHelper::getActions();
- if ($app->isAdmin())
+ if ($app->isClient('administrator'))
{
$title = Text::_('COM_TJREPORTS_TITLE_REPORT');
@@ -128,7 +128,7 @@ protected function addToolbar()
JLoader::import('administrator.components.com_tjreports.helpers.tjreports', JPATH_SITE);
TjreportsHelper::addSubmenu('reports');
- if ($app->isAdmin())
+ if ($app->isClient('administrator'))
{
$this->sidebar = JHtmlSidebar::render();
}
@@ -153,8 +153,8 @@ protected function addDocumentHeaderData()
$bootstrapSetting = $com_params->get('bootstrap_setting', 1);
if (($bootstrapSetting == 3)
- || ( $app->isAdmin() && $bootstrapSetting == 1 )
- || ( !$app->isAdmin() && $bootstrapSetting == 2 ) )
+ || ( $app->isClient('administrator') && $bootstrapSetting == 1 )
+ || ( !$app->isClient('administrator') && $bootstrapSetting == 2 ) )
{
HTMLHelper::stylesheet(Uri::root() . '/media/techjoomla_strapper/bs3/css/bootstrap.min.css');
}
@@ -172,7 +172,7 @@ protected function addDocumentHeaderData()
foreach ($plgScripts as $script)
{
- $document->addScript($script);
+ HTMLHelper::_('script', $script);
}
}
@@ -182,7 +182,7 @@ protected function addDocumentHeaderData()
foreach ($styles as $style)
{
- $document->addStylesheet($style);
+ HTMLHelper::_('stylesheet', $style);
}
}
|