diff --git a/src/com_tjvendors/admin/controller.php b/src/com_tjvendors/admin/controller.php
index c71d49e5..bb62591b 100755
--- a/src/com_tjvendors/admin/controller.php
+++ b/src/com_tjvendors/admin/controller.php
@@ -10,19 +10,21 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\MVC\Controller\BaseController;
/**
* Class TjvendorsController
*
* @since 1.6
*/
-class TjvendorsController extends JControllerLegacy
+class TjvendorsController extends BaseController
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
- * @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link InputFilter::clean()}.
*
* @return JController This object to support chaining.
*
@@ -30,8 +32,8 @@ class TjvendorsController extends JControllerLegacy
*/
public function display($cachable = false, $urlparams = false)
{
- $view = JFactory::getApplication()->input->getCmd('view', 'vendors');
- JFactory::getApplication()->input->set('view', $view);
+ $view = Factory::getApplication()->input->getCmd('view', 'vendors');
+ Factory::getApplication()->input->set('view', $view);
parent::display($cachable, $urlparams);
diff --git a/src/com_tjvendors/admin/controllers/payout.php b/src/com_tjvendors/admin/controllers/payout.php
index f35d053c..56dff7c0 100644
--- a/src/com_tjvendors/admin/controllers/payout.php
+++ b/src/com_tjvendors/admin/controllers/payout.php
@@ -10,15 +10,15 @@
// No direct access
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.controllerform');
+use Joomla\CMS\Factory;
+use Joomla\CMS\MVC\Controller\FormController;
/**
* Vendor controller class.
*
* @since 1.6
*/
-class TjvendorsControllerPayout extends JControllerForm
+class TjvendorsControllerPayout extends FormController
{
/**
* Constructor
@@ -28,7 +28,7 @@ class TjvendorsControllerPayout extends JControllerForm
public function __construct()
{
$this->view_list = 'payouts';
- $this->input = JFactory::getApplication()->input;
+ $this->input = Factory::getApplication()->input;
if (empty($this->client))
{
@@ -48,7 +48,7 @@ public function __construct()
protected function getRedirectToListAppend()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$vendor_id = $input->get('vendor_id', '', 'INTEGER');
$client = $input->get('client', '', 'STRING');
$append = parent::getRedirectToListAppend();
@@ -80,7 +80,7 @@ public function addCreditEntry()
*/
public function changePayoutStatus()
{
- $input = JFactory::getApplication()->input->post;
+ $input = Factory::getApplication()->input->post;
$payout_id = $input->get('payout_id', '', 'STRING');
$paidUnpaid = $input->get('paidUnpaid', '', 'STRING');
$model = $this->getModel('Payout');
diff --git a/src/com_tjvendors/admin/controllers/payouts.php b/src/com_tjvendors/admin/controllers/payouts.php
index 40f91e2c..1f8e13de 100644
--- a/src/com_tjvendors/admin/controllers/payouts.php
+++ b/src/com_tjvendors/admin/controllers/payouts.php
@@ -10,15 +10,14 @@
// No direct access.
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.controlleradmin');
+use Joomla\CMS\MVC\Controller\AdminController;
/**
* Vendors list controller class.
*
* @since 1.6
*/
-class TjvendorsControllerPayouts extends JControllerAdmin
+class TjvendorsControllerPayouts extends AdminController
{
/**
* Proxy for getModel.
diff --git a/src/com_tjvendors/admin/controllers/reports.php b/src/com_tjvendors/admin/controllers/reports.php
index e18f305f..4919ae19 100644
--- a/src/com_tjvendors/admin/controllers/reports.php
+++ b/src/com_tjvendors/admin/controllers/reports.php
@@ -10,15 +10,14 @@
// No direct access.
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.controlleradmin');
+use Joomla\CMS\MVC\Controller\AdminController;
/**
* Vendors list controller class.
*
* @since 1.6
*/
-class TjvendorsControllerReports extends JControllerAdmin
+class TjvendorsControllerReports extends AdminController
{
/**
* Proxy for getModel.
diff --git a/src/com_tjvendors/admin/controllers/vendor.php b/src/com_tjvendors/admin/controllers/vendor.php
index 1d1ff2df..a2315adb 100755
--- a/src/com_tjvendors/admin/controllers/vendor.php
+++ b/src/com_tjvendors/admin/controllers/vendor.php
@@ -10,16 +10,21 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Controller\FormController;
+use Joomla\CMS\Response\JsonResponse;
+use Joomla\CMS\Router\Route;
-jimport('joomla.application.component.controllerform');
-JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/tjvendors.php');
+HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/tjvendors.php');
/**
* Vendor controller class.
*
* @since 1.6
*/
-class TjvendorsControllerVendor extends JControllerForm
+class TjvendorsControllerVendor extends FormController
{
/**
* Constructor
@@ -45,7 +50,7 @@ public function __construct()
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'vendor_id')
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
$vendor_id = $input->get('vendor_id', '', 'STRING');
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
@@ -63,7 +68,7 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'vendor_i
*/
public function checkDuplicateUser()
{
- $input = JFactory::getApplication()->input->post;
+ $input = Factory::getApplication()->input->post;
$user = $input->get('user', '', 'STRING');
$model = $this->getModel('vendor');
$results = $model->checkDuplicateUser($user);
@@ -81,7 +86,7 @@ public function checkDuplicateUser()
*/
public function vendorApprove()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$vendor_id = $input->post->get('vendor_id', '', 'INTEGER');
$vendorApprove = $input->post->get('vendorApprove', '', 'INTEGER');
$client = $input->get('client', '', 'STRING');
@@ -91,7 +96,7 @@ public function vendorApprove()
$data['approved'] = $vendorApprove;
$result = $model->save($data);
- echo new JResponseJson($result, JText::_('COM_TJVENDORS_VENDOR_APPROVAL_ERROR'), true);
+ echo new JsonResponse($result, Text::_('COM_TJVENDORS_VENDOR_APPROVAL_ERROR'), true);
}
/**
@@ -103,7 +108,7 @@ public function vendorApprove()
*/
public function generateGatewayFields()
{
- $input = JFactory::getApplication()->input->post;
+ $input = Factory::getApplication()->input->post;
$payment_gateway = $input->get('payment_gateway', '', 'STRING');
$parentTag = $input->get('parent_tag', '', 'STRING');
$vendor_id = $input->get('vendor_id', '', 'INTEGER');
@@ -122,7 +127,7 @@ public function generateGatewayFields()
*/
protected function getRedirectToListAppend()
{
- $input = JFactory::getApplication()->input->post;
+ $input = Factory::getApplication()->input->post;
$client = $input->get('client', '', 'STRING');
$append = parent::getRedirectToListAppend();
$append .= '&client=' . $client;
@@ -144,13 +149,13 @@ protected function getRedirectToListAppend()
public function save($key = null, $urlVar = null)
{
// Initialise variables.
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$model = $this->getModel('Vendor', 'TjvendorsModel');
$input = $app->input;
$client = $input->get('client', '', 'STRING');
// Get the user data.
- $data = JFactory::getApplication()->input->get('jform', array(), 'array');
+ $data = Factory::getApplication()->input->get('jform', array(), 'array');
// Validate the posted data.
$form = $model->getForm();
@@ -187,7 +192,7 @@ public function save($key = null, $urlVar = null)
$id = (int) $app->getUserState('com_tjvendors.edit.vendor.id');
$app->setUserState('com_tjvendors.edit.vendor.data', $data);
- $this->setRedirect(JRoute::_('index.php?option=com_tjvendors&view=vendor&layout=edit&client=' . $client . '&vendor_id=' . $id, false));
+ $this->setRedirect(Route::_('index.php?option=com_tjvendors&view=vendor&layout=edit&client=' . $client . '&vendor_id=' . $id, false));
return false;
}
@@ -201,13 +206,13 @@ public function save($key = null, $urlVar = null)
// Redirect back to the edit screen.
$id = (int) $app->getUserState('com_tjvendors.edit.vendor.id');
- $this->setMessage(JText::sprintf('COM_TJVENDORS_VENDOR_ERROR_MSG_SAVE', $model->getError()), 'warning');
- $this->setRedirect(JRoute::_('index.php?option=com_tjvendors&view=vendor&layout=edit&client=' . $client . '&vendor_id=' . $id, false));
+ $this->setMessage(Text::sprintf('COM_TJVENDORS_VENDOR_ERROR_MSG_SAVE', $model->getError()), 'warning');
+ $this->setRedirect(Route::_('index.php?option=com_tjvendors&view=vendor&layout=edit&client=' . $client . '&vendor_id=' . $id, false));
return false;
}
- $msg = JText::_('COM_TJVENDORS_MSG_SUCCESS_SAVE_VENDOR');
+ $msg = Text::_('COM_TJVENDORS_MSG_SUCCESS_SAVE_VENDOR');
$id = $input->get('vendor_id');
if (empty($id))
@@ -219,13 +224,13 @@ public function save($key = null, $urlVar = null)
if ($task == 'apply')
{
- $redirect = JRoute::_('index.php?option=com_tjvendors&view=vendor&layout=update&client=' . $client . '&vendor_id=' . $id, false);
+ $redirect = Route::_('index.php?option=com_tjvendors&view=vendor&layout=update&client=' . $client . '&vendor_id=' . $id, false);
$app->redirect($redirect, $msg);
}
if ($task == 'save2new')
{
- $redirect = JRoute::_('index.php?option=com_tjvendors&view=vendor&layout=edit&client=' . $client, false);
+ $redirect = Route::_('index.php?option=com_tjvendors&view=vendor&layout=edit&client=' . $client, false);
$app->redirect($redirect, $msg);
}
@@ -239,7 +244,7 @@ public function save($key = null, $urlVar = null)
}
// Redirect to the list screen.
- $redirect = JRoute::_('index.php?option=com_tjvendors&view=vendors&client=' . $client, false);
+ $redirect = Route::_('index.php?option=com_tjvendors&view=vendors&client=' . $client, false);
$app->redirect($redirect, $msg);
// Flush the data from the session.
diff --git a/src/com_tjvendors/admin/controllers/vendorfee.php b/src/com_tjvendors/admin/controllers/vendorfee.php
index 1fe90cb3..b02167cf 100644
--- a/src/com_tjvendors/admin/controllers/vendorfee.php
+++ b/src/com_tjvendors/admin/controllers/vendorfee.php
@@ -10,15 +10,17 @@
// No direct access
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.controllerform');
+use Joomla\CMS\Factory;
+use Joomla\CMS\MVC\Controller\FormController;
+use Joomla\CMS\Router\Route;
+use Joomla\Registry\Registry;
/**
* Vendor controller class.
*
* @since 1.6
*/
-class TjvendorsControllerVendorFee extends JControllerForm
+class TjvendorsControllerVendorFee extends FormController
{
/**
* Constructor
@@ -28,7 +30,7 @@ class TjvendorsControllerVendorFee extends JControllerForm
public function __construct()
{
$this->view_list = 'vendorfees';
- $this->input = JFactory::getApplication()->input;
+ $this->input = Factory::getApplication()->input;
if (empty($this->client))
{
@@ -50,9 +52,9 @@ public function __construct()
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$cid = $input->post->get('cid', array(), 'array');
- $formData = new JRegistry($input->get('jform', '', 'array'));
+ $formData = new Registry($input->get('jform', '', 'array'));
$client = $input->get('client', '', 'STRING');
$vendor_id = $input->get('vendor_id', '', 'INTEGER');
$append = parent::getRedirectToItemAppend($recordId);
@@ -70,9 +72,9 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
*/
protected function getRedirectToListAppend()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$cid = $input->post->get('cid', array(), 'array');
- $formData = new JRegistry($input->get('jform', '', 'array'));
+ $formData = new Registry($input->get('jform', '', 'array'));
$client = $input->get('client', '', 'STRING');
$vendor_id = $input->get('vendor_id', '', 'STRING');
@@ -87,19 +89,19 @@ protected function getRedirectToListAppend()
* Function to edit field data
*
* @param integer $key null.
- *
+ *
* @param integer $urlVar null.
- *
+ *
* @return void
*/
public function edit($key = null, $urlVar = null)
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$cid = $input->post->get('cid', array(), 'array');
$vendorId = (int) (count($cid) ? $cid[0] : $input->getInt('vendor_id'));
$client = $input->get('client', '', 'STRING');
$feeId = (int) (count($cid) ? $cid[0] : $input->getInt('fee_id'));
- $link = JRoute::_(
+ $link = Route::_(
'index.php?option=com_tjvendors&view=vendorfee&layout=edit&id=' . $feeId . '&vendor_id=' . $vendorId . '&client=' . $client, false
);
$this->setRedirect($link);
diff --git a/src/com_tjvendors/admin/controllers/vendorfees.php b/src/com_tjvendors/admin/controllers/vendorfees.php
index d083b197..5081a9f2 100644
--- a/src/com_tjvendors/admin/controllers/vendorfees.php
+++ b/src/com_tjvendors/admin/controllers/vendorfees.php
@@ -10,15 +10,16 @@
// No direct access.
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.controlleradmin');
+use Joomla\CMS\Factory;
+use Joomla\CMS\MVC\Controller\AdminController;
+use Joomla\CMS\Router\Route;
/**
* Vendors list controller class.
*
* @since 1.6
*/
-class TjvendorsControllerVendorFees extends JControllerAdmin
+class TjvendorsControllerVendorFees extends AdminController
{
/**
* Proxy for getModel.
@@ -46,10 +47,10 @@ public function getModel($name = 'vendorfee', $prefix = 'TjvendorsModel', $confi
public function back()
{
// Get the input
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Redirect to the list screen.
- $this->setRedirect(JRoute::_('index.php?option=com_tjvendors&view=vendors&client=' . $input->get('client', '', 'STRING'), false));
+ $this->setRedirect(Route::_('index.php?option=com_tjvendors&view=vendors&client=' . $input->get('client', '', 'STRING'), false));
}
}
diff --git a/src/com_tjvendors/admin/controllers/vendors.php b/src/com_tjvendors/admin/controllers/vendors.php
index 6e4d32a2..4b98285e 100755
--- a/src/com_tjvendors/admin/controllers/vendors.php
+++ b/src/com_tjvendors/admin/controllers/vendors.php
@@ -10,15 +10,17 @@
// No direct access.
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.controlleradmin');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Log\Log;
+use Joomla\CMS\MVC\Controller\AdminController;
/**
* Vendors list controller class.
*
* @since 1.6
*/
-class TjvendorsControllerVendors extends JControllerAdmin
+class TjvendorsControllerVendors extends AdminController
{
/**
* Proxy for getModel.
@@ -45,9 +47,9 @@ public function getModel($name = 'vendor', $prefix = 'TjvendorsModel', $config =
*/
public function delete()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
- $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
+ $cid = Factory::getApplication()->input->get('cid', array(), 'array');
$model = $this->getModel("vendors");
foreach ($cid as $vendor_id)
@@ -66,10 +68,10 @@ public function delete()
*/
public function publish()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$post = $input->post;
$client = $input->get('client', '', 'STRING');
- $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
+ $cid = Factory::getApplication()->input->get('cid', array(), 'array');
$data = array('publish' => 1, 'unpublish' => 0, 'archive' => 2, 'trash' => -2, 'report' => -3);
$task = $this->getTask();
$value = JArrayHelper::getValue($data, $task, 0, 'int');
@@ -78,7 +80,7 @@ public function publish()
if (empty($cid))
{
- JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
+ Log::add(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'), Log::WARNING, 'jerror');
}
else
{
@@ -102,11 +104,11 @@ public function publish()
$ntext = $this->text_prefix . '_N_ITEMS_UNPUBLISHED';
}
- $this->setMessage(JText::plural($ntext, count($cid)));
+ $this->setMessage(Text::plural($ntext, count($cid)));
}
catch (Exception $e)
{
- $this->setMessage(JText::_('JLIB_DATABASE_ERROR_ANCESTOR_NODES_LOWER_STATE'), 'error');
+ $this->setMessage(Text::_('JLIB_DATABASE_ERROR_ANCESTOR_NODES_LOWER_STATE'), 'error');
}
}
diff --git a/src/com_tjvendors/admin/helpers/listhelper.php b/src/com_tjvendors/admin/helpers/listhelper.php
index 03815a5e..3fcd4309 100755
--- a/src/com_tjvendors/admin/helpers/listhelper.php
+++ b/src/com_tjvendors/admin/helpers/listhelper.php
@@ -10,6 +10,7 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Language\Text;
/**
* Tjvendors Listhelper.
@@ -34,15 +35,15 @@ abstract class JHtmlListhelper
public static function toggle($view, $field, $i, $value = 0)
{
$states = array(
- 0 => array('icon-remove', JText::_('Toggle'), 'inactive btn-danger'),
- 1 => array('icon-checkmark', JText::_('Toggle'), 'active btn-success'),
+ 0 => array('icon-remove', Text::_('Toggle'), 'inactive btn-danger'),
+ 1 => array('icon-checkmark', Text::_('Toggle'), 'active btn-success'),
);
$state = \Joomla\Utilities\ArrayHelper::getValue($states, (int) $value, $states[0]);
$text = '';
$html = '' . $text . '';
+ $field . '\')" title="' . Text::_($state[1]) . '">' . $text . '';
return $html;
}
diff --git a/src/com_tjvendors/admin/helpers/tjvendors.php b/src/com_tjvendors/admin/helpers/tjvendors.php
index f1dc03c0..959b3bf1 100644
--- a/src/com_tjvendors/admin/helpers/tjvendors.php
+++ b/src/com_tjvendors/admin/helpers/tjvendors.php
@@ -10,6 +10,13 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Filesystem\Path;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
+use Joomla\CMS\Object\CMSObject;
+use Joomla\CMS\Table\Table;
/**
* Tjvendors helper.
@@ -27,13 +34,13 @@ class TjvendorsHelper
*/
public static function addSubmenu($vName = '')
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$full_client = $input->get('client', '', 'STRING');
$full_client = explode('.', $full_client);
$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))
{
@@ -47,12 +54,12 @@ public static function addSubmenu($vName = '')
{
if (is_callable(array($cName, 'addSubmenu')))
{
- $lang = JFactory::getLanguage();
+ $lang = Factory::getLanguage();
$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'), $vName . (isset($section) ? '.' . $section : ''));
}
@@ -73,27 +80,27 @@ public static function addSubmenu($vName = '')
}
JHtmlSidebar::addEntry(
- JText::_('COM_TJVENDORS_TJNOTIFICATIONS_MENU'), 'index.php?option=com_tjnotifications&extension=com_tjvendors',
+ Text::_('COM_TJVENDORS_TJNOTIFICATIONS_MENU'), 'index.php?option=com_tjnotifications&extension=com_tjvendors',
$notifications
);
// Load bootsraped filter
- JHtml::_('bootstrap.tooltip');
+ HTMLHelper::_('bootstrap.tooltip');
}
}
/**
* Gets a list of the actions that can be performed.
*
- * @return JObject
+ * @return CMSObject
*
* @since 1.6
*/
public static function getActions()
{
- $user = JFactory::getUser();
- $result = new JObject;
+ $user = Factory::getUser();
+ $result = new CMSObject;
$assetName = 'com_tjvendors';
@@ -116,7 +123,7 @@ public static function getActions()
*/
public static function getUniqueClients()
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$columns = $db->quoteName('client');
$query->select('distinct' . $columns);
@@ -129,7 +136,7 @@ public static function getUniqueClients()
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($rows))
@@ -138,7 +145,7 @@ public static function getUniqueClients()
}
$uniqueClient = array();
- $uniqueClient[] = array("vendor_client" => JText::_('JFILTER_PAYOUT_CHOOSE_CLIENT'), "client_value" => '');
+ $uniqueClient[] = array("vendor_client" => Text::_('JFILTER_PAYOUT_CHOOSE_CLIENT'), "client_value" => '');
foreach ($rows as $row)
{
@@ -163,7 +170,7 @@ public static function getUniqueClients()
*/
public static function getTotalAmount($vendor_id, $currency, $client)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$subQuery = $db->getQuery(true);
$subQuery->select('max(' . $db->quoteName('id') . ')');
@@ -196,7 +203,7 @@ public static function getTotalAmount($vendor_id, $currency, $client)
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($result))
@@ -218,8 +225,8 @@ public static function getTotalAmount($vendor_id, $currency, $client)
*/
public static function bulkPendingAmount($vendor_id, $currency)
{
- JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models');
- $tjvendorsModelVendor = JModelLegacy::getInstance('Vendor', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models');
+ $tjvendorsModelVendor = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel');
$vendorClients = self::getClients($vendor_id);
$bulkPendingAmount = 0;
@@ -246,7 +253,7 @@ public static function bulkPendingAmount($vendor_id, $currency)
*/
public static function getClients($vendor_id)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select('distinct' . $db->quoteName('client'));
$query->from($db->quoteName('#__tjvendors_passbook'));
@@ -264,7 +271,7 @@ public static function getClients($vendor_id)
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($clients))
@@ -289,7 +296,7 @@ public static function getClients($vendor_id)
public static function checkUniqueCurrency($currency, $vendor_id, $client)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('currency'));
$query->from($db->quoteName('#__tjvendors_fee'));
@@ -312,7 +319,7 @@ public static function checkUniqueCurrency($currency, $vendor_id, $client)
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
foreach ($currencies as $i)
@@ -340,7 +347,7 @@ public static function checkUniqueCurrency($currency, $vendor_id, $client)
*/
public static function getCurrencies($vendor_id)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select('DISTINCT' . $db->quoteName('currency'));
$query->from($db->quoteName('#__tjvendors_passbook'));
@@ -358,7 +365,7 @@ public static function getCurrencies($vendor_id)
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($currencies))
@@ -378,12 +385,12 @@ public static function getCurrencies($vendor_id)
*/
public static function addVendor($data)
{
- JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendor');
- $tjvendorsModelVendors = JModelLegacy::getInstance('Vendor', 'TjvendorsModel');
- JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/tables', 'vendor');
+ BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendor');
+ $tjvendorsModelVendors = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel');
+ Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/tables', 'vendor');
$vendorsDetail = $tjvendorsModelVendors->save($data);
- JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjvendors/tables');
- $table = JTable::getInstance('vendor', 'TJVendorsTable', array());
+ Table::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjvendors/tables');
+ $table = Table::getInstance('vendor', 'TJVendorsTable', array());
$table->load(array('user_id' => $data['user_id']));
return $table->vendor_id;
diff --git a/src/com_tjvendors/admin/models/fields/createdby.php b/src/com_tjvendors/admin/models/fields/createdby.php
index 24f113de..0b547b52 100755
--- a/src/com_tjvendors/admin/models/fields/createdby.php
+++ b/src/com_tjvendors/admin/models/fields/createdby.php
@@ -1,3 +1,6 @@
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Form\Form;
+use Joomla\CMS\Factory;
name . '" value="' . $user->id . '" />';
}
diff --git a/src/com_tjvendors/admin/models/fields/custom_field.php b/src/com_tjvendors/admin/models/fields/custom_field.php
index 5be748b6..9a5c115b 100755
--- a/src/com_tjvendors/admin/models/fields/custom_field.php
+++ b/src/com_tjvendors/admin/models/fields/custom_field.php
@@ -1,3 +1,5 @@
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Form\Form;
getQuery(true);
// Support for multiple fields on fk_values
@@ -114,7 +118,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;
@@ -137,10 +141,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/src/com_tjvendors/admin/models/fields/modifiedby.php b/src/com_tjvendors/admin/models/fields/modifiedby.php
index ff1ff99f..3404f723 100755
--- a/src/com_tjvendors/admin/models/fields/modifiedby.php
+++ b/src/com_tjvendors/admin/models/fields/modifiedby.php
@@ -1,3 +1,6 @@
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Form\Form;
+use Joomla\CMS\Factory;
name . '" value="' . $user->id . '" />';
$html[] = "
" . $user->name . " (" . $user->username . ")
";
diff --git a/src/com_tjvendors/admin/models/fields/paymentgateway.php b/src/com_tjvendors/admin/models/fields/paymentgateway.php
index b7d30164..20f28c0a 100644
--- a/src/com_tjvendors/admin/models/fields/paymentgateway.php
+++ b/src/com_tjvendors/admin/models/fields/paymentgateway.php
@@ -10,9 +10,15 @@
// No direct access.
defined('_JEXEC') or die();
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\Form\FormHelper;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Plugin\PluginHelper;
jimport('joomla.form.helper');
-JFormHelper::loadFieldClass('list');
+FormHelper::loadFieldClass('list');
/**
* Supports an HTML select list of courses
@@ -40,38 +46,38 @@ class JFormFieldPaymentGateway extends JFormFieldList
/**
* Method to get a list of options for a list input.
*
- * @return array An array of JHtml options.
+ * @return array An array of HTMLHelper options.
*
* @since 11.4
*/
protected function getOptions()
{
$type = "payment";
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
$options = array();
- $options[] = JHtml::_('select.option', '', JText::_('COM_TJVENDOR_PAYMENT_DETAILS_DEFAULT'));
+ $options[] = HTMLHelper::_('select.option', '', Text::_('COM_TJVENDOR_PAYMENT_DETAILS_DEFAULT'));
if (!empty($client))
{
- $com_params = JComponentHelper::getParams($client);
+ $com_params = ComponentHelper::getParams($client);
$gateways = (array) $com_params->get('gateways');
if (!empty($gateways))
{
foreach ($gateways as $detail)
{
- $options[] = JHtml::_('select.option', $detail, $detail);
+ $options[] = HTMLHelper::_('select.option', $detail, $detail);
}
}
}
else
{
- $gateways = JPluginHelper::getPlugin($type, $plugin = null);
+ $gateways = PluginHelper::getPlugin($type, $plugin = null);
foreach ($gateways as $detail)
{
- $options[] = JHtml::_('select.option', $detail->name, $detail->name);
+ $options[] = HTMLHelper::_('select.option', $detail->name, $detail->name);
}
}
diff --git a/src/com_tjvendors/admin/models/fields/timecreated.php b/src/com_tjvendors/admin/models/fields/timecreated.php
index 835591bb..5ed86fc1 100755
--- a/src/com_tjvendors/admin/models/fields/timecreated.php
+++ b/src/com_tjvendors/admin/models/fields/timecreated.php
@@ -1,3 +1,8 @@
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Form\Form;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Date\Date;
+use Joomla\CMS\Language\Text;
get('offset'))->toSql(true);
+ $time_created = Factory::getDate('now', Factory::getConfig()->get('offset'))->toSql(true);
$html[] = '';
}
@@ -51,8 +56,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/src/com_tjvendors/admin/models/fields/timeupdated.php b/src/com_tjvendors/admin/models/fields/timeupdated.php
index e1d51a2a..56c82849 100755
--- a/src/com_tjvendors/admin/models/fields/timeupdated.php
+++ b/src/com_tjvendors/admin/models/fields/timeupdated.php
@@ -1,3 +1,8 @@
+use Joomla\CMS\Form\FormField;
+use Joomla\CMS\Form\Form;
+use Joomla\CMS\Date\Date;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Factory;
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/src/com_tjvendors/admin/models/fields/vendorslist.php b/src/com_tjvendors/admin/models/fields/vendorslist.php
index 4ffcc82c..facbab78 100644
--- a/src/com_tjvendors/admin/models/fields/vendorslist.php
+++ b/src/com_tjvendors/admin/models/fields/vendorslist.php
@@ -10,13 +10,12 @@
// No direct access.
defined('_JEXEC') or die();
-
use Joomla\CMS\Factory;
-use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
jimport('joomla.form.helper');
-\JFormHelper::loadFieldClass('list');
+\FormHelper::loadFieldClass('list');
/**
* Supports an HTML select list of vendors
@@ -36,7 +35,7 @@ class JFormFieldVendorsList extends \JFormFieldList
/**
* Method to get a list of options for a list input.
*
- * @return array An array of JHtml options.
+ * @return array An array of HTMLHelper options.
*
* @since 1.3.2
*/
diff --git a/src/com_tjvendors/admin/models/payout.php b/src/com_tjvendors/admin/models/payout.php
index fbbf9fbd..d3e4dcdd 100644
--- a/src/com_tjvendors/admin/models/payout.php
+++ b/src/com_tjvendors/admin/models/payout.php
@@ -10,8 +10,13 @@
// No direct access.
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\AdminModel;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
+use Joomla\CMS\Table\Table;
-jimport('joomla.application.component.modeladmin');
JLoader::import('com_tjvendors.helpers.fronthelper', JPATH_SITE . '/components');
/**
@@ -19,7 +24,7 @@
*
* @since 1.6
*/
-class TjvendorsModelPayout extends JModelAdmin
+class TjvendorsModelPayout extends AdminModel
{
/**
* @var string The prefix to use with controller messages.
@@ -46,13 +51,13 @@ class TjvendorsModelPayout extends JModelAdmin
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
- * @return JTable A database object
+ * @return Table A database object
*
* @since 1.6
*/
public function getTable($type = 'payout', $prefix = 'TjvendorsTable', $config = array())
{
- return JTable::getInstance($type, $prefix, $config);
+ return Table::getInstance($type, $prefix, $config);
}
/**
@@ -61,14 +66,14 @@ public function getTable($type = 'payout', $prefix = 'TjvendorsTable', $config =
* @param array $data An optional array of data for the form to interogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
- * @return JForm A JForm object on success, false on failure
+ * @return Form A Form object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Initialise variables.
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
// Get the form.
$form = $this->loadForm(
@@ -95,12 +100,12 @@ public function getForm($data = array(), $loadData = true)
*/
protected function loadFormData()
{
- JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models');
- $tjvendorsModelVendor = JModelLegacy::getInstance('Vendor', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models');
+ $tjvendorsModelVendor = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel');
// Check the session for previously entered form data.
- $data = JFactory::getApplication()->getUserState('com_tjvendors.edit.payout.data', array());
- $com_params = JComponentHelper::getParams('com_tjvendors');
+ $data = Factory::getApplication()->getUserState('com_tjvendors.edit.payout.data', array());
+ $com_params = ComponentHelper::getParams('com_tjvendors');
$bulkPayoutStatus = $com_params->get('bulk_payout');
if (empty($data))
@@ -126,8 +131,8 @@ protected function loadFormData()
}
$this->item->reference_order_id = '';
- JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendor');
- $tjvendorsModelVendor = JModelLegacy::getInstance('Vendor', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendor');
+ $tjvendorsModelVendor = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel');
$vendorDetail = $tjvendorsModelVendor->getItem();
$this->item->vendor_title = $vendorDetail->vendor_title;
}
@@ -146,12 +151,12 @@ public function save($data)
{
if (!isset($data['adaptive_payout']))
{
- $com_params = JComponentHelper::getParams('com_tjvendors');
+ $com_params = ComponentHelper::getParams('com_tjvendors');
$bulkPayoutStatus = $com_params->get('bulk_payout');
$tjvendorFrontHelper = new TjvendorFrontHelper;
- JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'payout');
- $tjvendorsModelPayout = JModelLegacy::getInstance('Payout', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'payout');
+ $tjvendorsModelPayout = BaseDatabaseModel::getInstance('Payout', 'TjvendorsModel');
$vendorDetail = $tjvendorsModelPayout->getItem();
@@ -169,7 +174,7 @@ public function save($data)
$pending_amount = TjvendorsHelper::getTotalAmount($vendorDetail->vendor_id, $vendorDetail->currency, $client['client']);
$data['debit'] = $pending_amount['total'];
$data['total'] = 0;
- $data['transaction_time'] = JFactory::getDate()->toSql();
+ $data['transaction_time'] = Factory::getDate()->toSql();
$data['client'] = $client['client'];
$transactionClient = $tjvendorFrontHelper->getClientName($client['client']);
$data['transaction_id'] = $transactionClient . '-' . $vendorDetail->currency . '-' . $vendorDetail->vendor_id . '-';
@@ -189,11 +194,11 @@ public function save($data)
$payout_update->transaction_id = $data['transaction_id'] . $payout_update->id;
// Update their details in the users table using id as the primary key.
- JFactory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');
+ Factory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');
}
- $message = JText::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE');
- JFactory::getApplication()->enqueueMessage($message);
+ $message = Text::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE');
+ Factory::getApplication()->enqueueMessage($message);
}
return true;
@@ -202,7 +207,7 @@ public function save($data)
$data['debit'] = $data['total'];
$payableAmount = TjvendorsHelper::getTotalAmount($item->vendor_id, $item->currency, $item->client);
$data['total'] = $payableAmount['total'] - $data['debit'];
- $data['transaction_time'] = JFactory::getDate()->toSql();
+ $data['transaction_time'] = Factory::getDate()->toSql();
$data['client'] = $vendorDetail->client;
$transactionClient = $tjvendorFrontHelper->getClientName($data['client']);
$data['transaction_id'] = $transactionClient . '-' . $vendorDetail->currency . '-' . $vendorDetail->vendor_id . '-';
@@ -223,10 +228,10 @@ public function save($data)
$payout_update->transaction_id = $data['transaction_id'] . $payout_update->id;
// Update their details in the users table using id as the primary key.
- $result = JFactory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');
+ $result = Factory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');
- $message = JText::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE');
- JFactory::getApplication()->enqueueMessage($message);
+ $message = Text::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE');
+ Factory::getApplication()->enqueueMessage($message);
return true;
}
@@ -256,11 +261,11 @@ public function updatingCreditData($data)
try
{
// Update their details in the users table using id as the primary key.
- $result = JFactory::getDbo()->updateObject('#__tjvendors_passbook', $object, 'id');
+ $result = Factory::getDbo()->updateObject('#__tjvendors_passbook', $object, 'id');
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($result))
@@ -295,11 +300,11 @@ public function addCreditEntry($data)
try
{
// Insert the object into the passbook table.
- $result = JFactory::getDbo()->insertObject('#__tjvendors_passbook', $creditEntry);
+ $result = Factory::getDbo()->insertObject('#__tjvendors_passbook', $creditEntry);
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($result))
@@ -335,13 +340,13 @@ public function changePayoutStatus($payout_id, $paidUnpaid)
try
{
// Update their details in the users table using id as the primary key.
- $result = JFactory::getDbo()->updateObject('#__tjvendors_passbook', $object, 'id');
+ $result = Factory::getDbo()->updateObject('#__tjvendors_passbook', $object, 'id');
return true;
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
}
}
diff --git a/src/com_tjvendors/admin/models/payouts.php b/src/com_tjvendors/admin/models/payouts.php
index 6ed3a64c..68275807 100644
--- a/src/com_tjvendors/admin/models/payouts.php
+++ b/src/com_tjvendors/admin/models/payouts.php
@@ -9,15 +9,16 @@
*/
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.modellist');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\MVC\Model\ListModel;
/**
* Methods supporting a list of Tjvendors records.
*
* @since 1.6
*/
-class TjvendorsModelPayouts extends JModelList
+class TjvendorsModelPayouts extends ListModel
{
/**
* Constructor.
@@ -58,7 +59,7 @@ public function __construct($config = array())
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
// Set ordering.
$orderCol = $app->getUserStateFromRequest($this->context . '.filter_order', 'filter_order');
@@ -88,7 +89,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('filter.search', $search);
// Load the parameters.
- $params = JComponentHelper::getParams('com_tjvendors');
+ $params = ComponentHelper::getParams('com_tjvendors');
$this->setState('params', $params);
$this->setState('list.limit', '0');
@@ -107,24 +108,24 @@ protected function populateState($ordering = null, $direction = null)
public function getListQuery()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$vendor_id = $input->get('vendor_id', '', 'INTEGER');
$urlClient = $input->get('client', '', 'STRING');
$filterClient = $this->getState('filter.vendor_client');
- $com_params = JComponentHelper::getParams('com_tjvendors');
+ $com_params = ComponentHelper::getParams('com_tjvendors');
$payout_day_limit = $com_params->get('payout_limit_days', '0', 'INT');
- $date = JFactory::getDate();
+ $date = Factory::getDate();
$payout_date_limit = $date->modify("-" . $payout_day_limit . " day");
$bulkPayoutStatus = $com_params->get('bulk_payout');
$vendor = $this->getState('filter.vendor_id');
if (!empty($urlClient))
{
- $component_params = JComponentHelper::getParams($urlClient);
+ $component_params = ComponentHelper::getParams($urlClient);
$com_currency = $component_params->get('currency');
}
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select(array('vendors.vendor_id', 'vendors.vendor_title', 'pass.*'));
diff --git a/src/com_tjvendors/admin/models/reports.php b/src/com_tjvendors/admin/models/reports.php
index f01f0d4f..39f3aa58 100644
--- a/src/com_tjvendors/admin/models/reports.php
+++ b/src/com_tjvendors/admin/models/reports.php
@@ -9,15 +9,16 @@
*/
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.modellist');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\MVC\Model\ListModel;
/**
* Methods supporting a list of Tjvendors records.
*
* @since 1.6
*/
-class TjvendorsModelReports extends JModelList
+class TjvendorsModelReports extends ListModel
{
/**
* Constructor.
@@ -65,7 +66,7 @@ public function __construct($config = array())
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
// Set ordering.
$orderCol = $app->getUserStateFromRequest($this->context . '.filter_order', 'filter_order');
@@ -103,7 +104,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('filter.search', $search);
// Load the parameters.
- $params = JComponentHelper::getParams('com_tjvendors');
+ $params = ComponentHelper::getParams('com_tjvendors');
$this->setState('params', $params);
// List state information.
@@ -125,7 +126,7 @@ public function getListQuery()
$currency = $this->getState('filter.currency', '');
$vendor_id = $this->getState('filter.vendor_id', '');
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select(array('vendors.vendor_id', 'vendors.vendor_title', 'pass.*'));
diff --git a/src/com_tjvendors/admin/models/vendor.php b/src/com_tjvendors/admin/models/vendor.php
index 5f1d7eba..d2a4c1f0 100644
--- a/src/com_tjvendors/admin/models/vendor.php
+++ b/src/com_tjvendors/admin/models/vendor.php
@@ -11,7 +11,6 @@
// No direct access.
defined('_JEXEC') or die;
-jimport('joomla.application.component.modeladmin');
/**
* Tjvendors model.
*
diff --git a/src/com_tjvendors/admin/models/vendorfee.php b/src/com_tjvendors/admin/models/vendorfee.php
index eb7d7cab..a7103e0a 100644
--- a/src/com_tjvendors/admin/models/vendorfee.php
+++ b/src/com_tjvendors/admin/models/vendorfee.php
@@ -10,15 +10,19 @@
// No direct access.
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.modeladmin');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\AdminModel;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
+use Joomla\CMS\Plugin\PluginHelper;
+use Joomla\CMS\Table\Table;
/**
* Tjvendors model.
*
* @since 1.6
*/
-class TjvendorsModelVendorFee extends JModelAdmin
+class TjvendorsModelVendorFee extends AdminModel
{
/**
* @var string The prefix to use with controller messages.
@@ -45,16 +49,16 @@ class TjvendorsModelVendorFee extends JModelAdmin
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
- * @return JTable A database object
+ * @return Table A database object
*
* @since 1.6
*/
public function getTable($type = 'Vendorfee', $prefix = 'TjvendorsTable', $config = array())
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$tables = $db->getTableList();
- return JTable::getInstance($type, $prefix, $config);
+ return Table::getInstance($type, $prefix, $config);
}
/**
@@ -63,14 +67,14 @@ public function getTable($type = 'Vendorfee', $prefix = 'TjvendorsTable', $confi
* @param array $data An optional array of data for the form to interogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
- * @return JForm A JForm object on success, false on failure
+ * @return Form A Form object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Initialise variables.
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
// Get the form.
$form = $this->loadForm('com_tjvendors.vendorfee', 'vendorfee', array('control' => 'jform', 'load_data' => $loadData));
@@ -95,8 +99,8 @@ public function getForm($data = array(), $loadData = true)
public function getItem($pk = null)
{
$data = parent::getItem($pk);
- JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendor');
- $TjvendorsModelVendor = JModelLegacy::getInstance('Vendor', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendor');
+ $TjvendorsModelVendor = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel');
$vendorDetail = $TjvendorsModelVendor->getItem();
$data->vendor_title = $vendorDetail->vendor_title;
@@ -113,7 +117,7 @@ public function getItem($pk = null)
protected function loadFormData()
{
// Check the session for previously entered form data.
- $data = JFactory::getApplication()->getUserState('com_tjvendors.edit.vendorfee.data', array());
+ $data = Factory::getApplication()->getUserState('com_tjvendors.edit.vendorfee.data', array());
if (empty($data))
{
@@ -139,9 +143,9 @@ protected function loadFormData()
public function save($data)
{
$isNew = (empty($data['id']))? true : false;
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$table = $this->getTable();
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$input = $app->input;
$data['vendor_id'] = $input->get('vendor_id', '', 'INTEGER');
$uniqueCurrency = TjvendorsHelper::checkUniqueCurrency($data['currency'], $data['vendor_id'], $data['client']);
@@ -156,7 +160,7 @@ public function save($data)
}
$dispatcher = JDispatcher::getInstance();
- JPluginHelper::importPlugin('tjvendors');
+ PluginHelper::importPlugin('tjvendors');
$dispatcher->trigger('tjVendorsOnAfterVendorFeeSave', array($data, $isNew));
return true;
@@ -164,7 +168,7 @@ public function save($data)
}
else
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_VENDORFEE_DUPLICATE_CURRENCY'), 'error');
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_VENDORFEE_DUPLICATE_CURRENCY'), 'error');
}
return false;
diff --git a/src/com_tjvendors/admin/models/vendorfees.php b/src/com_tjvendors/admin/models/vendorfees.php
index bd21bcc2..e8e236ff 100644
--- a/src/com_tjvendors/admin/models/vendorfees.php
+++ b/src/com_tjvendors/admin/models/vendorfees.php
@@ -9,16 +9,16 @@
*/
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.modellist');
-jimport('joomla.application.component.model');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\MVC\Model\ListModel;
/**
* Methods supporting a list of Tjvendors records.
*
* @since 1.6
*/
-class TjvendorsModelVendorFees extends JModelList
+class TjvendorsModelVendorFees extends ListModel
{
/**
* Constructor.
@@ -58,7 +58,7 @@ public function __construct($config = array())
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
// Set ordering.
$orderCol = $app->getUserStateFromRequest($this->context . '.filter_order', 'filter_order');
@@ -75,7 +75,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('filter.search', $search);
// Load the parameters.
- $params = JComponentHelper::getParams('com_tjvendors');
+ $params = ComponentHelper::getParams('com_tjvendors');
$this->setState('params', $params);
// List state information.
@@ -91,7 +91,7 @@ protected function populateState($ordering = null, $direction = null)
*/
protected function getListQuery()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$this->vendor_id = $input->get('vendor_id', '', 'INT');
$vendor_id = $this->vendor_id ? $this->vendor_id : $this->getState('vendor_id');
$client = $input->get('client', '', 'STRING');
diff --git a/src/com_tjvendors/admin/models/vendors.php b/src/com_tjvendors/admin/models/vendors.php
index 584289e7..967b2607 100755
--- a/src/com_tjvendors/admin/models/vendors.php
+++ b/src/com_tjvendors/admin/models/vendors.php
@@ -10,15 +10,20 @@
// No direct access
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.modellist');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
+use Joomla\CMS\MVC\Model\ListModel;
+use Joomla\CMS\Plugin\PluginHelper;
+use Joomla\CMS\Table\Table;
/**
* Methods supporting a list of Tjvendors records.
*
* @since 1.6
*/
-class TjvendorsModelVendors extends JModelList
+class TjvendorsModelVendors extends ListModel
{
/**
* Constructor.
@@ -58,7 +63,7 @@ public function __construct($config = array())
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
// Set ordering.
$orderCol = $app->getUserStateFromRequest($this->context . '.filter_order', 'filter_order');
@@ -78,7 +83,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('filter.state', $published);
// Load the parameters.
- $params = JComponentHelper::getParams('com_tjvendors');
+ $params = ComponentHelper::getParams('com_tjvendors');
$this->setState('params', $params);
// List state information.
@@ -95,7 +100,7 @@ protected function populateState($ordering = null, $direction = null)
protected function getListQuery()
{
// Get client
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
// Create a new query object.
@@ -163,7 +168,7 @@ public function checkForAvailableRecords($vendor_id)
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($result))
@@ -206,9 +211,9 @@ public function deleteVendor($vendor_id)
*/
public function deleteClientFromVendor($vendor_id, $client)
{
- JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models');
- $tjvendorsModelVendor = JModelLegacy::getInstance('Vendor', 'TjvendorsModel');
- $tjvendorsModelVendorFees = JModelLegacy::getInstance('VendorFees', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models');
+ $tjvendorsModelVendor = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel');
+ $tjvendorsModelVendorFees = BaseDatabaseModel::getInstance('VendorFees', 'TjvendorsModel');
$vendorData = $tjvendorsModelVendor->getItem($vendor_id);
$db = $this->getDbo();
@@ -226,7 +231,7 @@ public function deleteClientFromVendor($vendor_id, $client)
// If Vendor Payable amount is remaining then don't allow to delete vendor
if (!empty($result))
{
- JFactory::getApplication()->enqueueMessage(sprintf(JText::_("COM_TJVENDORS_VENDOR_DELETE_ERROR_MESSAGE"), $vendorData->vendor_title), 'error');
+ Factory::getApplication()->enqueueMessage(sprintf(Text::_("COM_TJVENDORS_VENDOR_DELETE_ERROR_MESSAGE"), $vendorData->vendor_title), 'error');
return false;
}
@@ -250,7 +255,7 @@ public function deleteClientFromVendor($vendor_id, $client)
}
catch (Exception $e)
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
+ Factory::getApplication()->enqueueMessage(Text::_('COM_TJVENDORS_DB_EXCEPTION_WARNING_MESSAGE'), 'error');
}
if (empty($result))
@@ -266,7 +271,7 @@ public function deleteClientFromVendor($vendor_id, $client)
}
$dispatcher = JDispatcher::getInstance();
- JPluginHelper::importPlugin('tjvendors');
+ PluginHelper::importPlugin('tjvendors');
$dispatcher->trigger('tjvendorOnAfterVendorDelete', array($vendorData, $client));
}
@@ -283,12 +288,12 @@ public function deleteClientFromVendor($vendor_id, $client)
*/
public function setItemState($items, $state, $client)
{
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
foreach ($items as $id)
{
- JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjvendors/tables');
- $tjvendorsTablevendorclientxref = JTable::getInstance('vendorclientxref', 'TjvendorsTable', array());
+ Table::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjvendors/tables');
+ $tjvendorsTablevendorclientxref = Table::getInstance('vendorclientxref', 'TjvendorsTable', array());
$tjvendorsTablevendorclientxref->load(array('vendor_id' => $id, 'client' => $client));
$updateState = new stdClass;
@@ -297,7 +302,7 @@ public function setItemState($items, $state, $client)
$updateState->state = $state;
// Update their details in the users table using id as the primary key.
- JFactory::getDbo()->updateObject('#__vendor_client_xref', $updateState, 'id');
+ Factory::getDbo()->updateObject('#__vendor_client_xref', $updateState, 'id');
/* Send Mail when Admin users change vendor state of vendor, these mails are not needed.. */
/*
@@ -315,7 +320,7 @@ public function setItemState($items, $state, $client)
}
$dispatcher = JDispatcher::getInstance();
- JPluginHelper::importPlugin('tjvendors');
+ PluginHelper::importPlugin('tjvendors');
$dispatcher->trigger('tjVendorsOnAfterVendorStateChange', array($items, $state, $client));
return true;
diff --git a/src/com_tjvendors/admin/tables/payout.php b/src/com_tjvendors/admin/tables/payout.php
index 19c6fff7..5c5182bd 100644
--- a/src/com_tjvendors/admin/tables/payout.php
+++ b/src/com_tjvendors/admin/tables/payout.php
@@ -10,7 +10,11 @@
// No direct access
defined('_JEXEC') or die;
-
+use Joomla\CMS\Factory;
+use Joomla\CMS\Access\Access;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Table\Table;
+use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
/**
@@ -18,7 +22,7 @@
*
* @since 1.6
*/
-class TjvendorsTablePayout extends JTable
+class TjvendorsTablePayout extends Table
{
/**
* Constructor
@@ -39,32 +43,32 @@ public function __construct(&$db)
*
* @return null|string null is operation was satisfactory, otherwise returns an error
*
- * @see JTable:bind
+ * @see Table:bind
* @since 1.5
*/
public function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['params']);
$array['params'] = (string) $registry;
}
if (isset($array['metadata']) && is_array($array['metadata']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['metadata']);
$array['metadata'] = (string) $registry;
}
- if (!JFactory::getUser()->authorise('core.admin', 'com_tjvendors.payout.' . $array['id']))
+ if (!Factory::getUser()->authorise('core.admin', 'com_tjvendors.payout.' . $array['id']))
{
- $actions = JAccess::getActionsFromFile(
+ $actions = Access::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/com_tjvendors/access.xml',
"/access/section[@name='payout']/"
);
- $default_actions = JAccess::getAssetRules('com_tjvendors.payout.' . $array['id'])->getData();
+ $default_actions = Access::getAssetRules('com_tjvendors.payout.' . $array['id'])->getData();
$array_jaccess = array();
foreach ($actions as $action)
@@ -85,9 +89,9 @@ public function bind($array, $ignore = '')
}
/**
- * This function convert an array of JAccessRule objects into an rules array.
+ * This function convert an array of Rule objects into an rules array.
*
- * @param array $jaccessrules An array of JAccessRule objects.
+ * @param array $jaccessrules An array of Rule objects.
*
* @return array
*/
@@ -162,7 +166,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
// Nothing to set publishing state on, return false.
else
{
- throw new Exception(500, JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
+ throw new Exception(500, Text::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
}
}
@@ -198,7 +202,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
}
}
- // If the JTable instance value is in the list of primary keys that were set, set the instance.
+ // If the Table instance value is in the list of primary keys that were set, set the instance.
if (in_array($this->$k, $pks))
{
$this->state = $state;
@@ -212,7 +216,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
*
* @return string The asset name
*
- * @see JTable::_getAssetName
+ * @see Table::_getAssetName
*/
protected function _getAssetName()
{
@@ -224,17 +228,17 @@ protected function _getAssetName()
/**
* Returns the parent asset's id. If you have a tree structure, retrieve the parent's id using the external key field
*
- * @param JTable $table Table name
+ * @param Table $table Table name
* @param integer $id Id
*
- * @see JTable::_getAssetParentId
+ * @see Table::_getAssetParentId
*
* @return mixed The id on success, false on failure.
*/
- 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();
diff --git a/src/com_tjvendors/admin/tables/vendor.php b/src/com_tjvendors/admin/tables/vendor.php
index 54ec97f9..48f613ec 100644
--- a/src/com_tjvendors/admin/tables/vendor.php
+++ b/src/com_tjvendors/admin/tables/vendor.php
@@ -10,7 +10,13 @@
// No direct access
defined('_JEXEC') or die;
-
+use Joomla\CMS\Factory;
+use Joomla\CMS\Access\Access;
+use Joomla\CMS\Filesystem\File;
+use Joomla\CMS\Filter\OutputFilter;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Table\Table;
+use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
/**
@@ -18,7 +24,7 @@
*
* @since 1.6
*/
-class TjvendorsTablevendor extends JTable
+class TjvendorsTablevendor extends Table
{
/**
* Constructor
@@ -40,32 +46,32 @@ public function __construct(&$db)
*
* @return null|string null is operation was satisfactory, otherwise returns an error
*
- * @see JTable:bind
+ * @see Table:bind
* @since 1.5
*/
public function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['params']);
$array['params'] = (string) $registry;
}
if (isset($array['metadata']) && is_array($array['metadata']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['metadata']);
$array['metadata'] = (string) $registry;
}
- if (!JFactory::getUser()->authorise('core.admin', 'com_tjvendors.vendor.' . $array['vendor_id']))
+ if (!Factory::getUser()->authorise('core.admin', 'com_tjvendors.vendor.' . $array['vendor_id']))
{
- $actions = JAccess::getActionsFromFile(
+ $actions = Access::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/com_tjvendors/access.xml',
"/access/section[@name='vendor']/"
);
- $default_actions = JAccess::getAssetRules('com_tjvendors.vendor.' . $array['vendor_id'])->getData();
+ $default_actions = Access::getAssetRules('com_tjvendors.vendor.' . $array['vendor_id'])->getData();
$array_jaccess = array();
foreach ($actions as $action)
@@ -86,9 +92,9 @@ public function bind($array, $ignore = '')
}
/**
- * This function convert an array of JAccessRule objects into an rules array.
+ * This function convert an array of Rule objects into an rules array.
*
- * @param array $jaccessrules An array of JAccessRule objects.
+ * @param array $jaccessrules An array of Rule objects.
*
* @return array
*/
@@ -120,7 +126,7 @@ public function check()
{
jimport('joomla.filesystem.file');
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$this->alias = trim($this->alias);
if (!$this->alias)
@@ -130,29 +136,29 @@ 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 event with same alias is present
- $table = JTable::getInstance('Vendor', 'TjVendorsTable', array('dbo', $db));
+ $table = Table::getInstance('Vendor', 'TjVendorsTable', array('dbo', $db));
if ($table->load(array('alias' => $this->alias)) && ($table->vendor_id != $this->vendor_id || $this->vendor_id == 0))
{
- $msg = JText::_('COM_TJVENDORS_SAVE_ALIAS_WARNING');
+ $msg = Text::_('COM_TJVENDORS_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');
}
// If there is an ordering column and this is a new row then get the next ordering value
@@ -161,7 +167,7 @@ public function check()
$this->ordering = self::getNextOrder();
}
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$vendor_id = $app->input->get('vendor_id');
$files = $app->input->files->get('jform', array(), 'raw');
@@ -181,13 +187,13 @@ public function check()
switch ($fileError)
{
case 1:
- $message = JText::_('COM_TJVENDOR_FILE_SIZE_EXCEEDS');
+ $message = Text::_('COM_TJVENDOR_FILE_SIZE_EXCEEDS');
break;
case 2:
- $message = JText::_('COM_TJVENDOR_FILE_SIZE_EXCEEDS_FORM');
+ $message = Text::_('COM_TJVENDOR_FILE_SIZE_EXCEEDS_FORM');
break;
case 3:
- $message = JText::_('COM_TJVENDOR_FILE_PARTIAL_UPLOAD_ERROR');
+ $message = Text::_('COM_TJVENDOR_FILE_PARTIAL_UPLOAD_ERROR');
break;
}
@@ -212,14 +218,14 @@ public function check()
if ($fileSize > 26214400)
{
- $app->enqueueMessage(JText::_('COM_TJVENDOR_FILE_BIGGER_UPLOAD_ERROR'), 'warning');
- $this->setError(JText::_('COM_TJVENDOR_FILE_BIGGER_UPLOAD_ERROR'));
+ $app->enqueueMessage(Text::_('COM_TJVENDOR_FILE_BIGGER_UPLOAD_ERROR'), 'warning');
+ $this->setError(Text::_('COM_TJVENDOR_FILE_BIGGER_UPLOAD_ERROR'));
return false;
}
- $filename = JFile::stripExt($singleFile['name']);
- $extension = JFile::getExt($singleFile['name']);
+ $filename = File::stripExt($singleFile['name']);
+ $extension = File::getExt($singleFile['name']);
$fileType = $singleFile['type'];
$filename = md5(time()) . $filename;
$filepath = '/media/com_tjvendor/vendor/' . $filename . '.' . $extension;
@@ -240,24 +246,24 @@ public function check()
// If the mime type is not allowed we don't upload it and show the mime code error to the user
if ($result === false)
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
}
else
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
}
else
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
@@ -267,16 +273,16 @@ public function check()
{
if (($extension !== "png") && ($extension !== "jpg") && ($extension !== "jpeg"))
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
}
else
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
@@ -286,26 +292,26 @@ public function check()
{
if (($fileType !== "image/png") && ($fileType !== "image/jpg") && ($fileType !== "image/jpeg"))
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
}
else
{
- $app->enqueueMessage(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
- $this->setError(JText::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
+ $app->enqueueMessage(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'), 'warning');
+ $this->setError(Text::_('COM_TJVENDORS_WRONG_FILE_UPLOAD'));
return false;
}
- if (! JFile::exists($uploadPath))
+ if (! File::exists($uploadPath))
{
- if (! JFile::upload($fileTemp, $uploadPath))
+ if (! File::upload($fileTemp, $uploadPath))
{
- $app->enqueueMessage(JText::_('COM_TJVENDOR_FILE_MOVING_ERROR'), 'warning');
- $this->setError(JText::_('COM_TJVENDOR_FILE_MOVING_ERROR'));
+ $app->enqueueMessage(Text::_('COM_TJVENDOR_FILE_MOVING_ERROR'), 'warning');
+ $this->setError(Text::_('COM_TJVENDOR_FILE_MOVING_ERROR'));
return false;
}
@@ -411,7 +417,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
// Nothing to set publishing state on, return false.
else
{
- throw new Exception(500, JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
+ throw new Exception(500, Text::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
}
}
@@ -442,7 +448,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
}
}
- // If the JTable instance value is in the list of primary keys that were set, set the instance.
+ // If the Table instance value is in the list of primary keys that were set, set the instance.
if (in_array($this->$k, $pks))
{
$this->state = $state;
@@ -456,7 +462,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
*
* @return string The asset name
*
- * @see JTable::_getAssetName
+ * @see Table::_getAssetName
*/
protected function _getAssetName()
{
@@ -468,17 +474,17 @@ protected function _getAssetName()
/**
* Returns the parent asset's id. If you have a tree structure, retrieve the parent's id using the external key field
*
- * @param JTable $table Table name
+ * @param Table $table Table name
* @param integer $id Id
*
- * @see JTable::_getAssetParentId
+ * @see Table::_getAssetParentId
*
* @return mixed The id on success, false on failure.
*/
- 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();
diff --git a/src/com_tjvendors/admin/tables/vendorclientxref.php b/src/com_tjvendors/admin/tables/vendorclientxref.php
index 341288a8..1e015d11 100644
--- a/src/com_tjvendors/admin/tables/vendorclientxref.php
+++ b/src/com_tjvendors/admin/tables/vendorclientxref.php
@@ -10,13 +10,14 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Table\Table;
/**
* vendor Table class
*
* @since 1.6
*/
-class TjvendorsTablevendorclientxref extends JTable
+class TjvendorsTablevendorclientxref extends Table
{
/**
* Constructor
diff --git a/src/com_tjvendors/admin/tables/vendorfee.php b/src/com_tjvendors/admin/tables/vendorfee.php
index 5991fb52..27f7874f 100644
--- a/src/com_tjvendors/admin/tables/vendorfee.php
+++ b/src/com_tjvendors/admin/tables/vendorfee.php
@@ -10,13 +10,17 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Access\Access;
+use Joomla\CMS\Table\Table;
+use Joomla\Registry\Registry;
/**
* vendor Table class
*
* @since 1.6
*/
-class TjvendorsTablevendorfee extends JTable
+class TjvendorsTablevendorfee extends Table
{
/**
* Constructor
@@ -37,32 +41,32 @@ public function __construct(&$db)
*
* @return null|string null is operation was satisfactory, otherwise returns an error
*
- * @see JTable:bind
+ * @see Table:bind
* @since 1.5
*/
public function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['params']);
$array['params'] = (string) $registry;
}
if (isset($array['metadata']) && is_array($array['metadata']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['metadata']);
$array['metadata'] = (string) $registry;
}
- if (!JFactory::getUser()->authorise('core.admin', 'com_tjvendors.vendorfee.' . $array['id']))
+ if (!Factory::getUser()->authorise('core.admin', 'com_tjvendors.vendorfee.' . $array['id']))
{
- $actions = JAccess::getActionsFromFile(
+ $actions = Access::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/com_tjvendors/access.xml',
"/access/section[@name='vendor']/"
);
- $default_actions = JAccess::getAssetRules('com_tjvendors.vendorfee.' . $array['id'])->getData();
+ $default_actions = Access::getAssetRules('com_tjvendors.vendorfee.' . $array['id'])->getData();
$array_jaccess = array();
foreach ($actions as $action)
@@ -83,9 +87,9 @@ public function bind($array, $ignore = '')
}
/**
- * This function convert an array of JAccessRule objects into an rules array.
+ * This function convert an array of Rule objects into an rules array.
*
- * @param array $jaccessrules An array of JAccessRule objects.
+ * @param array $jaccessrules An array of Rule objects.
*
* @return array
*/
@@ -129,7 +133,7 @@ public function check()
*
* @return string The asset name
*
- * @see JTable::_getAssetName
+ * @see Table::_getAssetName
*/
protected function _getAssetName()
{
diff --git a/src/com_tjvendors/admin/tjvendors.php b/src/com_tjvendors/admin/tjvendors.php
index c1c24d9e..8b8e4b74 100755
--- a/src/com_tjvendors/admin/tjvendors.php
+++ b/src/com_tjvendors/admin/tjvendors.php
@@ -10,11 +10,15 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Controller\BaseController;
+use Joomla\CMS\Uri\Uri;
// Access check.
-if (!JFactory::getUser()->authorise('core.manage', 'com_tjvendors'))
+if (!Factory::getUser()->authorise('core.manage', 'com_tjvendors'))
{
- throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'));
+ throw new Exception(Text::_('JERROR_ALERTNOAUTHOR'));
}
// Include dependancies
@@ -22,11 +26,11 @@
JLoader::registerPrefix('Tjvendors', JPATH_COMPONENT_ADMINISTRATOR);
-$controller = JControllerLegacy::getInstance('Tjvendors');
-$controller->execute(JFactory::getApplication()->input->get('task'));
+$controller = BaseController::getInstance('Tjvendors');
+$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();
-$document = JFactory::getDocument();
-$document->addScript(JUri::root(true) . '/media/com_tjvendor/js/tjvendors.js');
+$document = Factory::getDocument();
+$document->addScript(Uri::root(true) . '/media/com_tjvendor/js/tjvendors.js');
$tjvendorFrontHelper = JPATH_ROOT . '/components/com_tjvendors/helpers/fronthelper.php';
diff --git a/src/com_tjvendors/admin/views/payout/tmpl/edit.php b/src/com_tjvendors/admin/views/payout/tmpl/edit.php
index 9ff186f5..1208fe78 100644
--- a/src/com_tjvendors/admin/views/payout/tmpl/edit.php
+++ b/src/com_tjvendors/admin/views/payout/tmpl/edit.php
@@ -8,16 +8,20 @@
*/
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Uri\Uri;
-JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
+HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');
+HTMLHelper::_('behavior.tooltip');
+HTMLHelper::_('behavior.formvalidation');
+HTMLHelper::_('formbehavior.chosen', 'select');
+HTMLHelper::_('behavior.keepalive');
// Import CSS
-$document = JFactory::getDocument();
-$document->addStyleSheet(JUri::root() . 'media/com_tjvendors/css/form.css');
+$document = Factory::getDocument();
+$document->addStyleSheet(Uri::root() . 'media/com_tjvendors/css/form.css');
?>
diff --git a/src/com_tjvendors/admin/views/payout/view.html.php b/src/com_tjvendors/admin/views/payout/view.html.php
index 0ea40a5b..78d0ce13 100644
--- a/src/com_tjvendors/admin/views/payout/view.html.php
+++ b/src/com_tjvendors/admin/views/payout/view.html.php
@@ -10,15 +10,18 @@
// No direct access
defined('_JEXEC') or die;
-
-jimport('joomla.application.component.view');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\View\HtmlView;
+use Joomla\CMS\Toolbar\ToolbarHelper;
/**
* View to edit
*
* @since 1.6
*/
-class TjvendorsViewPayout extends JViewLegacy
+class TjvendorsViewPayout extends HtmlView
{
protected $state;
@@ -40,8 +43,8 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
- $this->input = JFactory::getApplication()->input;
- $com_params = JComponentHelper::getParams('com_tjvendors');
+ $this->input = Factory::getApplication()->input;
+ $com_params = ComponentHelper::getParams('com_tjvendors');
$this->bulkPayoutStatus = $com_params->get('bulk_payout');
// Check for errors.
@@ -63,16 +66,16 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
- JFactory::getApplication()->input->set('hidemainmenu', true);
+ Factory::getApplication()->input->set('hidemainmenu', true);
- $user = JFactory::getUser();
+ $user = Factory::getUser();
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
// Let's get the extension name
$client = $input->get('client', '', 'STRING');
- $viewTitle = JText::_('COM_TJVENDOR_EDIT_PAYOUT');
+ $viewTitle = Text::_('COM_TJVENDOR_EDIT_PAYOUT');
if (isset($this->item->checked_out))
{
@@ -84,7 +87,7 @@ protected function addToolbar()
}
$clientTitle = TjvendorFrontHelper::getClientName($client);
- JToolbarHelper::title($clientTitle . ' ' . $viewTitle, 'pencil.png');
+ ToolbarHelper::title($clientTitle . ' ' . $viewTitle, 'pencil.png');
if (empty($this->item->id))
{
diff --git a/src/com_tjvendors/admin/views/payouts/tmpl/default.php b/src/com_tjvendors/admin/views/payouts/tmpl/default.php
index 1a61f8a5..a1ef1a13 100644
--- a/src/com_tjvendors/admin/views/payouts/tmpl/default.php
+++ b/src/com_tjvendors/admin/views/payouts/tmpl/default.php
@@ -9,32 +9,37 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Uri\Uri;
-JHtml::_('bootstrap.tooltip');
-JHtml::_('behavior.multiselect');
-JHtml::_('formbehavior.chosen', 'select');
+HTMLHelper::_('bootstrap.tooltip');
+HTMLHelper::_('behavior.multiselect');
+HTMLHelper::_('formbehavior.chosen', 'select');
JLoader::import('vendor', JPATH_SITE . '/components/com_tjvendors/models');
$tjvendorsModelVendor = new TjvendorsModelVendor;
// Import CSS
-$document = JFactory::getDocument();
-$document->addStyleSheet(JUri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css');
-$document->addStyleSheet(JUri::root() . 'media/com_tjvendors/css/list.css');
+$document = Factory::getDocument();
+$document->addStyleSheet(Uri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css');
+$document->addStyleSheet(Uri::root() . 'media/com_tjvendors/css/list.css');
-$user = JFactory::getUser();
+$user = Factory::getUser();
$userId = $user->get('id');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
$canOrder = $user->authorise('core.edit.state', 'com_tjvendors');
$saveOrder = $listOrder == 'a.`ordering`';
-$input = JFactory::getApplication()->input;
+$input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_tjvendors&task=payouts.saveOrderAjax&tmpl=component';
- JHtml::_('sortablelist.sortable', 'payoutList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
+ HTMLHelper::_('sortablelist.sortable', 'payoutList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
?>
@@ -65,7 +70,7 @@
}
?>
-
diff --git a/src/com_tjvendors/admin/views/payouts/view.html.php b/src/com_tjvendors/admin/views/payouts/view.html.php
index e2cd8a22..803ccc4e 100644
--- a/src/com_tjvendors/admin/views/payouts/view.html.php
+++ b/src/com_tjvendors/admin/views/payouts/view.html.php
@@ -10,8 +10,13 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
+use Joomla\CMS\MVC\View\HtmlView;
+use Joomla\CMS\Toolbar\ToolbarHelper;
-jimport('joomla.application.component.view');
JLoader::import('com_tjvendors.helpers.fronthelper', JPATH_SITE . '/components');
/**
@@ -19,7 +24,7 @@
*
* @since 1.6
*/
-class TjvendorsViewPayouts extends JViewLegacy
+class TjvendorsViewPayouts extends HtmlView
{
protected $items;
@@ -47,16 +52,16 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->model = $this->getModel('payouts');
- $this->input = JFactory::getApplication()->input;
+ $this->input = Factory::getApplication()->input;
// Getting vendor id from url
$vendor_id = $this->input->get('vendor_id', '', 'INT');
- JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendors');
- $tjvendorsModelVendors = JModelLegacy::getInstance('Vendors', 'TjvendorsModel');
+ BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'vendors');
+ $tjvendorsModelVendors = BaseDatabaseModel::getInstance('Vendors', 'TjvendorsModel');
$vendorsDetail = $tjvendorsModelVendors->getItems();
$this->vendor_details = $vendorsDetail;
$this->uniqueClients = TjvendorsHelper::getUniqueClients();
- $com_params = JComponentHelper::getParams('com_tjvendors');
+ $com_params = ComponentHelper::getParams('com_tjvendors');
$this->bulkPayoutStatus = $com_params->get('bulk_payout');
// Check for errors.
@@ -82,7 +87,7 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
$state = $this->get('State');
@@ -94,7 +99,7 @@ protected function addToolbar()
$title = !empty($client) ? $clientTitle . ' : ' : '';
- JToolbarHelper::title($title . JText::_('COM_TJVENDORS_TITLE_PAYOUTS'), 'list.png');
+ ToolbarHelper::title($title . Text::_('COM_TJVENDORS_TITLE_PAYOUTS'), 'list.png');
if ($canDo->get('core.admin'))
{
diff --git a/src/com_tjvendors/admin/views/reports/tmpl/default.php b/src/com_tjvendors/admin/views/reports/tmpl/default.php
index cd367c12..8175a4d4 100644
--- a/src/com_tjvendors/admin/views/reports/tmpl/default.php
+++ b/src/com_tjvendors/admin/views/reports/tmpl/default.php
@@ -9,22 +9,27 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Uri\Uri;
-JHtml::_('bootstrap.tooltip');
-JHtml::_('behavior.multiselect');
-JHtml::_('formbehavior.chosen', 'select');
+HTMLHelper::_('bootstrap.tooltip');
+HTMLHelper::_('behavior.multiselect');
+HTMLHelper::_('formbehavior.chosen', 'select');
// Import CSS
-$document = JFactory::getDocument();
-$document->addStyleSheet(JUri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css');
-$document->addStyleSheet(JUri::root() . 'media/com_tjvendors/css/list.css');
+$document = Factory::getDocument();
+$document->addStyleSheet(Uri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css');
+$document->addStyleSheet(Uri::root() . 'media/com_tjvendors/css/list.css');
-$user = JFactory::getUser();
+$user = Factory::getUser();
$userId = $user->get('id');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
$canOrder = $user->authorise('core.edit.state', 'com_tjvendors');
-$input = JFactory::getApplication()->input;
+$input = Factory::getApplication()->input;
$client = $input->get('client', '', 'STRING');
?>
-
diff --git a/src/com_tjvendors/admin/views/vendor/tmpl/update.php b/src/com_tjvendors/admin/views/vendor/tmpl/update.php
index 9c11617a..1b890c16 100644
--- a/src/com_tjvendors/admin/views/vendor/tmpl/update.php
+++ b/src/com_tjvendors/admin/views/vendor/tmpl/update.php
@@ -8,21 +8,26 @@
*/
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Uri\Uri;
-JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
+HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');
+HTMLHelper::_('behavior.tooltip');
+HTMLHelper::_('behavior.formvalidation');
+HTMLHelper::_('formbehavior.chosen', 'select');
+HTMLHelper::_('behavior.keepalive');
-$lang = JFactory::getLanguage();
+$lang = Factory::getLanguage();
$lang->load('plg_payment_paypal', JPATH_ADMINISTRATOR);
?>
-
diff --git a/src/com_tjvendors/admin/views/vendorfees/view.html.php b/src/com_tjvendors/admin/views/vendorfees/view.html.php
index 5779a976..b9925048 100644
--- a/src/com_tjvendors/admin/views/vendorfees/view.html.php
+++ b/src/com_tjvendors/admin/views/vendorfees/view.html.php
@@ -10,8 +10,11 @@
// No direct access
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\View\HtmlView;
+use Joomla\CMS\Toolbar\ToolbarHelper;
-jimport('joomla.application.component.view');
JLoader::import('com_tjvendors.helpers.fronthelper', JPATH_SITE . '/components');
/**
@@ -19,7 +22,7 @@
*
* @since 1.6
*/
-class TjvendorsViewVendorFees extends JViewLegacy
+class TjvendorsViewVendorFees extends HtmlView
{
protected $items;
@@ -38,12 +41,12 @@ class TjvendorsViewVendorFees extends JViewLegacy
*/
public function display($tpl = null)
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$this->vendor_id = $input->get('vendor_id', '', 'INT');
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
- $this->input = JFactory::getApplication()->input;
+ $this->input = Factory::getApplication()->input;
$this->client = $this->input->get('client', '', 'STRING');
// Check for errors.
@@ -68,7 +71,7 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
- $input = JFactory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$state = $this->get('State');
$canDo = TjvendorsHelper::getActions();
@@ -78,7 +81,7 @@ protected function addToolbar()
$tjvendorFrontHelper = new TjvendorFrontHelper;
$clientTitle = $tjvendorFrontHelper->getClientName($this->client);
- JToolbarHelper::title($clientTitle . ' : ' . JText::_('COM_TJVENDORS_TITLE_VENDORS_FEES'), 'list.png');
+ ToolbarHelper::title($clientTitle . ' : ' . Text::_('COM_TJVENDORS_TITLE_VENDORS_FEES'), 'list.png');
if ($canDo->get('core.edit.state'))
{
@@ -109,8 +112,8 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'b.`percent_commission`' => JText::_('COM_TJVENDORS_VENDORS_PERCENT_COMMISSION'),
- 'b.`flat_commission`' => JText::_('COM_TJVENDORS_VENDORS_FLAT_COMMISSION'),
+ 'b.`percent_commission`' => Text::_('COM_TJVENDORS_VENDORS_PERCENT_COMMISSION'),
+ 'b.`flat_commission`' => Text::_('COM_TJVENDORS_VENDORS_FLAT_COMMISSION'),
);
}
}
diff --git a/src/com_tjvendors/admin/views/vendors/tmpl/default.php b/src/com_tjvendors/admin/views/vendors/tmpl/default.php
index a9fad5d1..bbac7a52 100755
--- a/src/com_tjvendors/admin/views/vendors/tmpl/default.php
+++ b/src/com_tjvendors/admin/views/vendors/tmpl/default.php
@@ -1,25 +1,32 @@
- * @copyright Copyright 2009-2017 TechJoomla. All rights reserved.
- * @license GNU General Public License version 2 or later.
+ * @package TJVendors
+ * @subpackage com_tjvendors
+ *
+ * @author Techjoomla
+ * @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
-// No direct access
+
defined('_JEXEC') or die;
-JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/');
-JHtml::_('bootstrap.tooltip');
-JHtml::_('behavior.multiselect');
-JHtml::_('formbehavior.chosen', 'select');
+use Joomla\CMS\Factory;
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Uri\Uri;
+
+HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/');
+HTMLHelper::_('bootstrap.tooltip');
+HTMLHelper::_('behavior.multiselect');
+HTMLHelper::_('formbehavior.chosen', 'select');
// Import CSS
-$document = JFactory::getDocument();
-$document->addStyleSheet(JUri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css');
-$document->addStyleSheet(JUri::root() . 'media/com_tjvendors/css/list.css');
+$document = Factory::getDocument();
+$document->addStyleSheet(Uri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css');
+$document->addStyleSheet(Uri::root() . 'media/com_tjvendors/css/list.css');
-$user = JFactory::getUser();
+$user = Factory::getUser();
$userId = $user->id;
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
@@ -29,7 +36,7 @@
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_tjvendors&task=vendors.saveOrderAjax&tmpl=component';
- JHtml::_('sortablelist.sortable', 'vendorList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
+ HTMLHelper::_('sortablelist.sortable', 'vendorList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
?>
id )
+if (Factory::getUser()->id )
{
?>
-
+
-