diff --git a/tjreports/administrator/controller.php b/tjreports/administrator/controller.php index 3202bf7..ef23faa 100755 --- a/tjreports/administrator/controller.php +++ b/tjreports/administrator/controller.php @@ -9,13 +9,15 @@ */ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Factory; /** * Class TjreportsController * * @since 1.6 */ -class TjreportsController extends JControllerLegacy +class TjreportsController extends BaseController { /** * Method to display a view. @@ -29,8 +31,8 @@ class TjreportsController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - $view = JFactory::getApplication()->input->getCmd('view', 'tjreports'); - JFactory::getApplication()->input->set('view', $view); + $view = Factory::getApplication()->input->getCmd('view', 'tjreports'); + Factory::getApplication()->input->set('view', $view); parent::display($cachable, $urlparams); diff --git a/tjreports/administrator/controllers/tjreport.json.php b/tjreports/administrator/controllers/tjreport.json.php index 5829bcc..44e0199 100644 --- a/tjreports/administrator/controllers/tjreport.json.php +++ b/tjreports/administrator/controllers/tjreport.json.php @@ -8,6 +8,9 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\Factory; +use Joomla\CMS\Response\JsonResponse; jimport('joomla.application.component.controllerform'); /** @@ -17,7 +20,7 @@ * @subpackage com_tjreports * @since 0.0.1 */ -class TjreportsControllerTjreport extends JControllerForm +class TjreportsControllerTjreport extends FormController { /** * Contructor @@ -38,7 +41,7 @@ public function getplugins() { try { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $jinput = $app->input; $jform = $jinput->post->get('jform', array(), 'ARRAY'); $client = $jform['client']; @@ -48,11 +51,11 @@ public function getplugins() $model = $this->getModel('tjreport'); $reports = $model->getClientPlugins($client, $id, $userid); - echo new JResponseJson($reports); + echo new JsonResponse($reports); } catch (Exception $e) { - echo new JResponseJson($e); + echo new JsonResponse($e); } } @@ -66,7 +69,7 @@ public function getparams() { try { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $jinput = $app->input; $jform = $jinput->post->get('jform', array(), 'ARRAY'); $plugin = $parent = null; @@ -84,11 +87,11 @@ public function getparams() $model = $this->getModel('tjreport'); $report = $model->getReportPluginData($parent, $plugin); - echo new JResponseJson($report); + echo new JsonResponse($report); } catch (Exception $e) { - echo new JResponseJson($e); + echo new JsonResponse($e); } } } diff --git a/tjreports/administrator/controllers/tjreport.php b/tjreports/administrator/controllers/tjreport.php index ec3818b..d0c5662 100644 --- a/tjreports/administrator/controllers/tjreport.php +++ b/tjreports/administrator/controllers/tjreport.php @@ -8,6 +8,8 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\Factory; jimport('joomla.application.component.controllerform'); /** @@ -17,7 +19,7 @@ * @subpackage com_tjreports * @since 0.0.1 */ -class TjreportsControllerTjreport extends JControllerForm +class TjreportsControllerTjreport extends FormController { /** * Contructor @@ -40,7 +42,7 @@ public function __construct() */ public function setRedirect($url, $msg = null,$type = null) { - $extension = JFactory::getApplication()->input->get('extension', '', 'word'); + $extension = Factory::getApplication()->input->get('extension', '', 'word'); if ($extension) { @@ -61,7 +63,7 @@ public function setRedirect($url, $msg = null,$type = null) */ protected function allowAdd($data = array()) { - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('core.create', 'com_tjreports')) { @@ -86,7 +88,7 @@ protected function allowAdd($data = array()) */ protected function allowEdit($data = array(), $key = 'id') { - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('core.edit', 'com_tjreports')) { diff --git a/tjreports/administrator/controllers/tjreports.php b/tjreports/administrator/controllers/tjreports.php index 4652171..1cc08dd 100644 --- a/tjreports/administrator/controllers/tjreports.php +++ b/tjreports/administrator/controllers/tjreports.php @@ -8,12 +8,17 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\AdminController; +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Language\Text; /** * com tjreports Controller * * @since 0.0.1 */ -class TjreportsControllerTjreports extends JControllerAdmin +class TjreportsControllerTjreports extends AdminController { /** * Proxy for getModel. @@ -46,7 +51,7 @@ public function getModel($name = 'Tjreport', $prefix = 'TjreportsModel', $config */ public function setRedirect($url, $msg = null,$type = null) { - $extension = JFactory::getApplication()->input->get('extension', '', 'word'); + $extension = Factory::getApplication()->input->get('extension', '', 'word'); if ($extension) { @@ -65,10 +70,10 @@ public function setRedirect($url, $msg = null,$type = null) */ public function discover() { - JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjreports/models'); - JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables'); + BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjreports/models'); + Table::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables'); - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select('element'); $query->from($db->quoteName('#__extensions')); @@ -89,9 +94,9 @@ public function discover() foreach ($discoverPlugins as $value) { - $model = JModelLegacy::getInstance('Reports', 'TjreportsModel'); + $model = BaseDatabaseModel::getInstance('Reports', 'TjreportsModel'); $pluginName = $value; - $reportTable = JTable::getInstance('Tjreport', 'TjreportsTable'); + $reportTable = Table::getInstance('Tjreport', 'TjreportsTable'); $details = $model->getPluginInstallationDetail($pluginName); $reportTable->load(array('plugin' => $pluginName, 'userid' => 0)); @@ -110,11 +115,11 @@ public function discover() } } - $message = JText::_('COM_TJREPORTS_NOTHING_TO_DISCOVER_PLUGINS'); + $message = Text::_('COM_TJREPORTS_NOTHING_TO_DISCOVER_PLUGINS'); if ($count > 0) { - $message = JText::sprintf(JText::_('COM_TJREPORTS_DISCOVER_NEW_PLUGINS'), $count); + $message = Text::sprintf(Text::_('COM_TJREPORTS_DISCOVER_NEW_PLUGINS'), $count); } $this->setRedirect('index.php?option=com_tjreports', $message); diff --git a/tjreports/administrator/helpers/tjreports.php b/tjreports/administrator/helpers/tjreports.php index 8b7b8c0..52d1f4b 100644 --- a/tjreports/administrator/helpers/tjreports.php +++ b/tjreports/administrator/helpers/tjreports.php @@ -9,13 +9,17 @@ */ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\Helper\ContentHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Filesystem\File; /** * Cp helper. * * @since 1.6 */ -class TjreportsHelper extends JHelperContent +class TjreportsHelper extends ContentHelper { /** * Configure the Linkbar. @@ -26,17 +30,17 @@ class TjreportsHelper extends JHelperContent */ public static function addSubmenu($view='') { - $client = JFactory::getApplication()->input->get('client', '', 'STRING'); + $client = Factory::getApplication()->input->get('client', '', 'STRING'); $full_client = $client; // Set ordering. - $mainframe = JFactory::getApplication(); + $mainframe = Factory::getApplication(); $full_client = explode('.', $full_client); // Eg com_jgive $component = $full_client[0]; $eName = str_replace('com_', '', $component); - $file = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php'); + $file = Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php'); if (file_exists($file)) { @@ -49,14 +53,14 @@ public static function addSubmenu($view='') { if (is_callable(array($cName, 'addSubmenu'))) { - $lang = JFactory::getLanguage(); + $lang = Factory::getLanguage(); // Loading language file from the administrator/language directory then // Loading language file from the administrator/components/*extension*/language directory $lang->load($component, JPATH_BASE, null, false, false) - || $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, false) + || $lang->load($component, Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, false) || $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false) - || $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), $lang->getDefault(), false, false); + || $lang->load($component, Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component), $lang->getDefault(), false, false); // Call_user_func(array($cName, 'addSubmenu'), 'categories' . (isset($section) ? '.' . $section : '')); call_user_func(array($cName, 'addSubmenu'), $view . (isset($section) ? '.' . $section : '')); @@ -98,7 +102,7 @@ public static function getActions($component = 'com_tjreports', $section = '', $ */ public function getViewpath($component, $viewname, $layout = 'default', $searchTmpPath = 'SITE', $useViewpath = 'SITE') { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $searchTmpPath = ($searchTmpPath == 'SITE') ? JPATH_SITE : JPATH_ADMINISTRATOR; $useViewpath = ($useViewpath == 'SITE') ? JPATH_SITE : JPATH_ADMINISTRATOR; @@ -107,7 +111,7 @@ public function getViewpath($component, $viewname, $layout = 'default', $searchT $override = $searchTmpPath . '/' . 'templates' . '/' . $app->getTemplate() . '/' . 'html' . '/' . $component . '/' . $viewname . '/' . $layoutname; - if (JFile::exists($override)) + if (File::exists($override)) { return $view = $override; } diff --git a/tjreports/administrator/models/fields/createdby.php b/tjreports/administrator/models/fields/createdby.php index aa783f2..d44434d 100755 --- a/tjreports/administrator/models/fields/createdby.php +++ b/tjreports/administrator/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/administrator/models/fields/custom_field.php b/tjreports/administrator/models/fields/custom_field.php index 668fc7c..4ea56f3 100755 --- a/tjreports/administrator/models/fields/custom_field.php +++ b/tjreports/administrator/models/fields/custom_field.php @@ -8,6 +8,7 @@ */ defined('JPATH_BASE') or die; +use Joomla\CMS\Form\FormField; jimport('joomla.html.html'); jimport('joomla.form.formfield'); @@ -17,7 +18,7 @@ * * @since 1.6 */ -class JFormFieldCustomField extends JFormField +class FormFieldCustomField extends FormField { /** * The form field type. diff --git a/tjreports/administrator/models/fields/filemultiple.php b/tjreports/administrator/models/fields/filemultiple.php index aa26b53..f581c50 100755 --- a/tjreports/administrator/models/fields/filemultiple.php +++ b/tjreports/administrator/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/administrator/models/fields/foreignkey.php b/tjreports/administrator/models/fields/foreignkey.php index dbe8c39..e021111 100755 --- a/tjreports/administrator/models/fields/foreignkey.php +++ b/tjreports/administrator/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/administrator/models/fields/modifiedby.php b/tjreports/administrator/models/fields/modifiedby.php index 8f2133e..eafef97 100755 --- a/tjreports/administrator/models/fields/modifiedby.php +++ b/tjreports/administrator/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/administrator/models/fields/timecreated.php b/tjreports/administrator/models/fields/timecreated.php index 158ee51..3e6f984 100755 --- a/tjreports/administrator/models/fields/timecreated.php +++ b/tjreports/administrator/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('now', JFactory::getConfig()->get('offset'))->toSql(true); + $time_created = Factory::getDate('now', Factory::getConfig()->get('offset'))->toSql(true); $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/administrator/models/fields/timeupdated.php b/tjreports/administrator/models/fields/timeupdated.php index 048c280..7aa646c 100755 --- a/tjreports/administrator/models/fields/timeupdated.php +++ b/tjreports/administrator/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('now', JFactory::getConfig()->get('offset'))->toSql(true); + $time_updated = Factory::getDate('now', Factory::getConfig()->get('offset'))->toSql(true); $html[] = ''; return implode($html); diff --git a/tjreports/administrator/models/fields/users.php b/tjreports/administrator/models/fields/users.php index 3de834f..7496f8c 100755 --- a/tjreports/administrator/models/fields/users.php +++ b/tjreports/administrator/models/fields/users.php @@ -9,6 +9,10 @@ // No direct access. defined('_JEXEC') or die(); +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\UserField; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; JFormHelper::loadFieldClass('list'); @@ -17,7 +21,7 @@ * * @since 1.0.0 */ -class JFormFieldUsers extends JFormFieldList +class UserFields extends FormFieldList { /** * The form field type. @@ -44,7 +48,7 @@ class JFormFieldUsers extends JFormFieldList */ protected function getOptions() { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. @@ -61,7 +65,7 @@ protected function getOptions() foreach ($allUsers as $u) { - $options[] = JHtml::_('select.option', $u->id, $u->name); + $options[] = HTMLHelper::_('select.option', $u->id, $u->name); } if (!$this->loadExternally) diff --git a/tjreports/administrator/models/indexer.php b/tjreports/administrator/models/indexer.php index 79a6d64..17e77a1 100644 --- a/tjreports/administrator/models/indexer.php +++ b/tjreports/administrator/models/indexer.php @@ -10,6 +10,7 @@ // No direct access. defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Response\JsonResponse; use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\BaseDatabaseModel; @@ -77,7 +78,7 @@ public function createTable($context) if ($db->execute()) { $msg = 'DB table - ' . $db->quoteName($this->customFieldsTable) . ' created successfully'; - echo new JResponseJson($msg); + echo new JsonResponse($msg); return true; } @@ -88,7 +89,7 @@ public function createTable($context) } catch (Exception $e) { - echo new JResponseJson(null, $e->getMessage(), true); + echo new JsonResponse(null, $e->getMessage(), true); } } } diff --git a/tjreports/administrator/models/tjreport.php b/tjreports/administrator/models/tjreport.php index 08b823a..ee934ca 100644 --- a/tjreports/administrator/models/tjreport.php +++ b/tjreports/administrator/models/tjreport.php @@ -8,12 +8,16 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; /** * jticketing Model * * @since 0.0.1 */ -class TjreportsModelTjreport extends JModelAdmin +class TjreportsModelTjreport extends AdminModel { /** * Constructor. @@ -43,7 +47,7 @@ public function __construct($config = array()) */ public function getTable($type = 'Tjreport', $prefix = 'TjreportsTable', $config = array()) { - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); } /** @@ -86,7 +90,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() ); @@ -117,7 +121,7 @@ protected function loadFormData() */ public function getClientPlugins($client, $currentId = 0, $userId = 0) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select('r.*,r.id as value,r.title as text'); $query->from('#__tj_reports as r'); @@ -152,7 +156,7 @@ public function getReportPluginData($pluginId, $pluginName = null) { if ($pluginId) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select('r.*'); $query->from('#__tj_reports as r'); @@ -170,8 +174,8 @@ public function getReportPluginData($pluginId, $pluginName = null) if ($pluginName || (empty($report->param) && !empty($report->plugin))) { - JModelLegacy::addIncludePath(JPATH_SITE . '/plugins/tjreports/' . $pluginName); - $plgModel = JModelLegacy::getInstance($pluginName, 'TjreportsModel'); + BaseDatabaseModel::addIncludePath(JPATH_SITE . '/plugins/tjreports/' . $pluginName); + $plgModel = BaseDatabaseModel::getInstance($pluginName, 'TjreportsModel'); $defaultColToHide = $plgModel->getState('defaultColToHide'); @@ -215,7 +219,7 @@ public function getReportPluginData($pluginId, $pluginName = null) protected function prepareTable($table) { jimport('joomla.filter.output'); - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); if (empty($table->id)) diff --git a/tjreports/administrator/models/tjreports.php b/tjreports/administrator/models/tjreports.php index 74a71ce..4af05a3 100644 --- a/tjreports/administrator/models/tjreports.php +++ b/tjreports/administrator/models/tjreports.php @@ -8,12 +8,14 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Model\ListModel; +use Joomla\CMS\Factory; /** * Tjreportslist Model * * @since 0.0.1 */ -class TjreportsModelTjreports extends JModelList +class TjreportsModelTjreports extends ListModel { /** * Constructor. @@ -48,7 +50,7 @@ public function __construct($config = array()) protected function getListQuery() { // Initialize variables. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); // Create the base select statement. @@ -107,7 +109,7 @@ protected function getListQuery() public function getItems() { $db = $this->getDbo(); - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; $items = parent::getItems(); @@ -129,7 +131,7 @@ public function getItems() protected function populateState($ordering = null, $direction = null) { // Initialise variables. - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Set ordering. $orderCol = $app->getUserStateFromRequest($this->context . '.filter_order', 'filter_order'); @@ -162,7 +164,7 @@ protected function populateState($ordering = null, $direction = null) $this->setState('filter.client', $client); // Bug fix For a list layout - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $layout = $jinput->get('layout', '', 'STRING'); } } diff --git a/tjreports/administrator/tables/tjreport.php b/tjreports/administrator/tables/tjreport.php index 3b18c0f..f00d380 100644 --- a/tjreports/administrator/tables/tjreport.php +++ b/tjreports/administrator/tables/tjreport.php @@ -8,12 +8,16 @@ */ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; +use Joomla\CMS\Filter\OutputFilter; +use Joomla\CMS\Language\Text; /** * Hello Table class * * @since 0.0.1 */ -class TjreportsTableTjreport extends JTable +class TjreportsTableTjreport extends Table { /** * Constructor @@ -52,10 +56,10 @@ protected function _getAssetName() * * @since 1.0.0 */ - protected function _getAssetParentId(JTable $table = null, $id = null) + protected function _getAssetParentId(Table $table = null, $id = null) { // We will retrieve the parent-asset from the Asset-table - $assetParent = JTable::getInstance('Asset'); + $assetParent = Table::getInstance('Asset'); // Default: if no asset-parent can be found we take the global asset $assetParentId = $assetParent->getRootId(); @@ -81,7 +85,7 @@ protected function _getAssetParentId(JTable $table = null, $id = null) */ public function check() { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $this->alias = trim($this->alias); @@ -92,43 +96,43 @@ public function check() if ($this->alias) { - if (JFactory::getConfig()->get('unicodeslugs') == 1) + if (Factory::getConfig()->get('unicodeslugs') == 1) { - $this->alias = JFilterOutput::stringURLUnicodeSlug($this->alias); + $this->alias = OutputFilter::stringURLUnicodeSlug($this->alias); } else { - $this->alias = JFilterOutput::stringURLSafe($this->alias); + $this->alias = OutputFilter::stringURLSafe($this->alias); } } // Check if course with same alias is present - $table = JTable::getInstance('Tjreport', 'TjreportsTable', array('dbo', $db)); + $table = Table::getInstance('Tjreport', 'TjreportsTable', array('dbo', $db)); if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) { - $msg = JText::_('COM_TJREPORT_SAVE_ALIAS_WARNING'); + $msg = Text::_('COM_TJREPORT_SAVE_ALIAS_WARNING'); while ($table->load(array('alias' => $this->alias))) { $this->alias = JString::increment($this->alias, 'dash'); } - JFactory::getApplication()->enqueueMessage($msg, 'warning'); + Factory::getApplication()->enqueueMessage($msg, 'warning'); } $tjreport_views = array('reports'); if (in_array($this->alias, $tjreport_views)) { - $this->setError(JText::_('COM_TJREPORT_VIEW_WITH_SAME_ALIAS')); + $this->setError(Text::_('COM_TJREPORT_VIEW_WITH_SAME_ALIAS')); return false; } if (trim(str_replace('-', '', $this->alias)) == '') { - $this->alias = JFactory::getDate()->format("Y-m-d-H-i-s"); + $this->alias = Factory::getDate()->format("Y-m-d-H-i-s"); } return parent::check(); diff --git a/tjreports/administrator/tjreports.php b/tjreports/administrator/tjreports.php index 9992afa..dded546 100755 --- a/tjreports/administrator/tjreports.php +++ b/tjreports/administrator/tjreports.php @@ -9,11 +9,15 @@ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\MVC\Controller\BaseController; // Access check. -if (!JFactory::getUser()->authorise('core.manage', 'com_tjreports')) +if (!Factory::getUser()->authorise('core.manage', 'com_tjreports')) { - throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); + throw new Exception(Text::_('JERROR_ALERTNOAUTHOR')); } if (!defined('DS')) @@ -33,14 +37,14 @@ define('COM_TJLMS_WRAPPER_DIV', 'tjlms-wrapper row-fluid'); } -$document = JFactory::getDocument(); -$document->addStyleSheet(JUri::root(true) . '/media/com_tjreports/css/font-awesome/css/font-awesome.min.css'); +$document = Factory::getDocument(); +$document->addStyleSheet(Uri::root(true) . '/media/com_tjreports/css/font-awesome/css/font-awesome.min.css'); // Include dependancies jimport('joomla.application.component.controller'); JLoader::registerPrefix('Tjreports', JPATH_COMPONENT_ADMINISTRATOR); -$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/administrator/views/tjreport/tmpl/edit.php b/tjreports/administrator/views/tjreport/tmpl/edit.php index fe2f011..437ec19 100644 --- a/tjreports/administrator/views/tjreport/tmpl/edit.php +++ b/tjreports/administrator/views/tjreport/tmpl/edit.php @@ -8,8 +8,12 @@ */ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; JHtml::_('behavior.formvalidator'); -$input = JFactory::getApplication()->input; +$input = Factory::getApplication()->input; $showParent = true; if($this->form->getValue('id')) @@ -38,7 +42,7 @@ var params = JSON.stringify(JSON.parse(jQuery("#jform_param").val())); jQuery("#jform_param").val(params) }catch(e){ - alert(Joomla.JText._("COM_TJREPORTS_INVALID_JSON_VALUE")); + alert(Joomla.Text._("COM_TJREPORTS_INVALID_JSON_VALUE")); return false; } } @@ -52,14 +56,14 @@ }; '); ?> -
- 'general')); ?> + 'general')); ?> - + @@ -119,21 +123,21 @@ - + canDo->get('core.admin')) : ?> - +
form->getInput('rules'); ?>
- + - +
- +
diff --git a/tjreports/administrator/views/tjreports/tmpl/default.php b/tjreports/administrator/views/tjreports/tmpl/default.php index 928d17a..d17d2c6 100644 --- a/tjreports/administrator/views/tjreports/tmpl/default.php +++ b/tjreports/administrator/views/tjreports/tmpl/default.php @@ -8,8 +8,13 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; JHtml::_('formbehavior.chosen', 'select'); -$user = JFactory::getUser(); +$user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); @@ -18,10 +23,10 @@ if ($saveOrder) { $saveOrderingUrl = 'index.php?option=com_tjreports&task=tjreports.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'reportList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); + HTMLHelper::_('sortablelist.sortable', 'reportList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); } -$input = JFactory::getApplication()->input; +$input = Factory::getApplication()->input; ?>
sidebar)):?> @@ -36,7 +41,7 @@
$this) ); @@ -48,7 +53,7 @@ - ', 'ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> @@ -56,26 +61,26 @@ - + - + - + - + - + - + @@ -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..bb5340e 100644 --- a/tjreports/administrator/views/tjreports/view.html.php +++ b/tjreports/administrator/views/tjreports/view.html.php @@ -8,13 +8,17 @@ */ // 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; 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 +33,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 +46,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,7 +73,7 @@ public function display($tpl = null) */ protected function addToolBar() { - $name = JText::_('COM_TJREPORTS'); + $name = Text::_('COM_TJREPORTS'); JToolBarHelper::title($name, 'list'); 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 1585029..2b01164 100755 --- a/tjreports/script.tjreports.php +++ b/tjreports/script.tjreports.php @@ -29,11 +29,14 @@ */ defined('_JEXEC') or die( ';)' ); +use Joomla\CMS\Factory; +use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Installer\Installer; +use Joomla\CMS\Table\Table; jimport('joomla.installer.installer'); jimport('joomla.filesystem.file'); jimport('joomla.application.component.helper'); -Use Joomla\CMS\Table\Table; use Joomla\CMS\MVC\Model\BaseDatabaseModel; /** @@ -88,9 +91,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'); @@ -115,7 +118,7 @@ public function uninstall($parent) if ($id) { - $installer = new JInstaller; + $installer = new Installer; $result = $installer->uninstall('plugin', $id); $status->plugins[] = array( 'name' => 'plg_' . $plugin, @@ -173,9 +176,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 @@ -218,7 +221,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); @@ -255,7 +258,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) 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..19fde7c 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,7 +87,7 @@ 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 { @@ -89,17 +95,17 @@ public function saveQuery() $insert_object->id = $id; $dispatcher = JEventDispatcher::getInstance(); - $extension = JFactory::getApplication()->input->get('option'); - JPluginHelper::importPlugin('tjreports'); + $extension = Factory::getApplication()->input->get('option'); + PluginHelper::importPlugin('tjreports'); $dispatcher->trigger('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 +120,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 @@
      + echo LayoutHelper::render('joomla.pagination.link', $pages['start']); + echo LayoutHelper::render('joomla.pagination.link', $pages['previous']); ?> $page) : ?> - + ).*?()#', '$1...$2', $output); ?> @@ -74,8 +75,8 @@ + echo LayoutHelper::render('joomla.pagination.link', $pages['next']); + echo LayoutHelper::render('joomla.pagination.link', $pages['end']); ?>
    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..9463591 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,19 +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'); + $extension = Factory::getApplication()->input->get('option'); + PluginHelper::importPlugin('tjreports'); $dispatcher->trigger('tjReportsOnAfterReportDelete', array($extension, $data)); return true; diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php index 2cd5968..26dea7e 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 23291eb..660b0cb 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 .= '