From 4b1ed546b79f0a30e465b062d11c2275d3a0410e Mon Sep 17 00:00:00 2001 From: Amol Date: Wed, 5 Feb 2020 05:48:31 +0000 Subject: [PATCH] Namespace Conversion (#62) * Issue #53 feat: Update classes with namespace * Issue #53 feat: Update classes with namespace * Issue #53 feat: Update classes with namespace --- src/com_tjvendors/admin/controller.php | 10 +- .../admin/controllers/payout.php | 12 +- .../admin/controllers/payouts.php | 5 +- .../admin/controllers/reports.php | 5 +- .../admin/controllers/vendor.php | 41 ++++--- .../admin/controllers/vendorfee.php | 26 +++-- .../admin/controllers/vendorfees.php | 11 +- .../admin/controllers/vendors.php | 22 ++-- .../admin/helpers/listhelper.php | 7 +- src/com_tjvendors/admin/helpers/tjvendors.php | 63 +++++----- .../admin/models/fields/createdby.php | 7 +- .../admin/models/fields/custom_field.php | 2 + .../admin/models/fields/filemultiple.php | 2 + .../admin/models/fields/foreignkey.php | 12 +- .../admin/models/fields/modifiedby.php | 5 +- .../admin/models/fields/paymentgateway.php | 22 ++-- .../admin/models/fields/timecreated.php | 11 +- .../admin/models/fields/timeupdated.php | 11 +- .../admin/models/fields/vendorslist.php | 7 +- src/com_tjvendors/admin/models/payout.php | 63 +++++----- src/com_tjvendors/admin/models/payouts.php | 21 ++-- src/com_tjvendors/admin/models/reports.php | 13 ++- src/com_tjvendors/admin/models/vendor.php | 1 - src/com_tjvendors/admin/models/vendorfee.php | 34 +++--- src/com_tjvendors/admin/models/vendorfees.php | 14 +-- src/com_tjvendors/admin/models/vendors.php | 41 ++++--- src/com_tjvendors/admin/tables/payout.php | 38 +++--- src/com_tjvendors/admin/tables/vendor.php | 106 +++++++++-------- .../admin/tables/vendorclientxref.php | 3 +- src/com_tjvendors/admin/tables/vendorfee.php | 24 ++-- src/com_tjvendors/admin/tjvendors.php | 16 ++- .../admin/views/payout/tmpl/edit.php | 30 ++--- .../admin/views/payout/view.html.php | 23 ++-- .../admin/views/payouts/tmpl/default.php | 63 +++++----- .../admin/views/payouts/view.html.php | 21 ++-- .../admin/views/reports/tmpl/default.php | 97 ++++++++-------- .../admin/views/reports/view.html.php | 18 +-- .../admin/views/vendor/tmpl/edit.php | 69 ++++++----- .../admin/views/vendor/tmpl/update.php | 43 ++++--- .../admin/views/vendor/view.html.php | 45 ++++---- .../admin/views/vendorfee/tmpl/edit.php | 29 ++--- .../admin/views/vendorfee/view.html.php | 28 ++--- .../admin/views/vendorfees/tmpl/default.php | 84 +++++++------- .../admin/views/vendorfees/view.html.php | 19 +-- .../admin/views/vendors/tmpl/default.php | 89 +++++++------- .../admin/views/vendors/view.html.php | 20 ++-- .../layouts/com_tjvendors/subform/default.php | 12 +- .../com_tjvendors/subform/repeatable.php | 20 ++-- .../repeatable/section-byfieldsets.php | 13 ++- .../subform/repeatable/section.php | 9 +- src/com_tjvendors/script.tjvendors.php | 75 ++++++------ src/com_tjvendors/site/controller.php | 3 +- src/com_tjvendors/site/controllers/vendor.php | 48 ++++---- src/com_tjvendors/site/events/vendor.php | 9 +- .../site/helpers/fronthelper.php | 80 +++++++------ src/com_tjvendors/site/helpers/mails.php | 46 +++++--- .../site/models/fields/createdby.php | 7 +- .../site/models/fields/filemultiple.php | 2 + .../site/models/fields/foreignkey.php | 12 +- .../site/models/fields/modifiedby.php | 5 +- .../site/models/fields/paymentgateway.php | 22 ++-- .../site/models/fields/submit.php | 6 +- .../site/models/fields/timecreated.php | 11 +- .../site/models/fields/timeupdated.php | 11 +- src/com_tjvendors/site/models/vendor.php | 61 +++++----- src/com_tjvendors/site/models/vendors.php | 13 ++- src/com_tjvendors/site/tables/vendor.php | 72 ++++++------ src/com_tjvendors/site/tjvendors.php | 2 +- .../site/views/vendor/tmpl/default.php | 38 +++--- .../site/views/vendor/tmpl/edit.php | 72 ++++++------ .../site/views/vendor/tmpl/profile.php | 59 +++++----- .../site/views/vendor/view.html.php | 49 ++++---- .../site/views/vendors/tmpl/default.php | 109 ++++++++++-------- .../site/views/vendors/view.html.php | 13 ++- src/plugins/actionlog/tjvendors/tjvendors.php | 55 +++++---- src/plugins/privacy/tjvendors/tjvendors.php | 37 +++--- 76 files changed, 1286 insertions(+), 1018 deletions(-) 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'); ?>
- 'general')); ?> - + 'general')); ?> +
@@ -74,10 +78,10 @@ function confirmationMsg()
- - + + - +
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 @@ } ?> -
sidebar)) @@ -86,30 +91,30 @@ bulkPayoutStatus != 0) { - echo JText::_('COM_TJVENDOR_PAYOUTS_BULK_PAYOUT_NOTICE'); + echo Text::_('COM_TJVENDOR_PAYOUTS_BULK_PAYOUT_NOTICE'); } else { - echo JText::_('COM_TJVENDOR_PAYOUTS_SINGLE_CLIENT_PAYOUT_NOTICE'); + echo Text::_('COM_TJVENDOR_PAYOUTS_SINGLE_CLIENT_PAYOUT_NOTICE'); } ?>
- -
@@ -121,11 +126,11 @@ bulkPayoutStatus != 0) { - echo JText::_('COM_TJVENDOR_PAYOUTS_BULK_PAYOUT_NOTICE'); + echo Text::_('COM_TJVENDOR_PAYOUTS_BULK_PAYOUT_NOTICE'); } else { - echo JHtml::_('select.genericlist', $this->uniqueClients, "vendor_client", 'class="input-medium" size="1" onchange="document.adminForm.submit();"', "client_value", "vendor_client", $this->state->get('filter.vendor_client')); + echo HTMLHelper::_('select.genericlist', $this->uniqueClients, "vendor_client", 'class="input-medium" size="1" onchange="document.adminForm.submit();"', "client_value", "vendor_client", $this->state->get('filter.vendor_client')); $filterClient = $this->state->get('filter.vendor_client'); } ?> @@ -138,7 +143,7 @@
vendor_details, "vendor_id", 'class="input-medium" size="1" onchange="document.adminForm.submit();"', "vendor_id", "vendor_title", $this->state->get('filter.vendor_id'));?> + echo HTMLHelper::_('select.genericlist', $this->vendor_details, "vendor_id", 'class="input-medium" size="1" onchange="document.adminForm.submit();"', "vendor_id", "vendor_title", $this->state->get('filter.vendor_id'));?>
items[0]->ordering)): ?> - ', 'a.`ordering`', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.`ordering`', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> items[0]->state)){} ?> - + - + - + - + - + @@ -260,7 +265,7 @@ - PAY @@ -274,7 +279,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'); ?> -
- 'personal')); ?> - + 'personal')); ?> +
@@ -49,7 +56,7 @@ item->vendor_id != 0) { - $input=JFactory::getApplication()->input; + $input=Factory::getApplication()->input; $client=$input->get('client', '', 'STRING'); ?> @@ -57,14 +64,14 @@ form->renderField('user_id');?>
- - + + item->vendor_title.""; - echo " ".JText::_('COM_TJVENDORS_DISPLAY_DO_YOU_WANT_TO_ADD'); + echo " ".Text::_('COM_TJVENDORS_DISPLAY_DO_YOU_WANT_TO_ADD'); $tjvendorFrontHelper = new TjvendorFrontHelper(); echo $clientTitle = $tjvendorFrontHelper->getClientName($client); - echo JText::_('COM_TJVENDORS_DISPLAY_AS_A_CLIENT'); + echo Text::_('COM_TJVENDORS_DISPLAY_AS_A_CLIENT'); ?>
item->vendor_logo)) :?>
-
" class="span3 col-md-3 img-thumbnail marginb10 img-polaroid">
+
" class="span3 col-md-3 img-thumbnail marginb10 img-polaroid">
- - + + form->getInput('payment_gateway'); ?> - + item->vendor_id != 0) { ?>
- + - +
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); ?> -
- 'personal')); ?> - + 'personal')); ?> +
@@ -58,31 +63,31 @@
item->vendor_logo)) : ?>
-
+
- - + + form->getInput('payment_gateway');?>
- - + + - +
diff --git a/src/com_tjvendors/admin/views/vendor/view.html.php b/src/com_tjvendors/admin/views/vendor/view.html.php index 827d09ad..59205447 100755 --- a/src/com_tjvendors/admin/views/vendor/view.html.php +++ b/src/com_tjvendors/admin/views/vendor/view.html.php @@ -1,22 +1,27 @@ - * @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; -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 TjvendorsViewVendor extends JViewLegacy +class TjvendorsViewVendor extends HtmlView { protected $state; @@ -37,15 +42,15 @@ class TjvendorsViewVendor extends JViewLegacy */ public function display($tpl = null) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); - $this->params = JComponentHelper::getParams('com_tjvendors'); - $this->input = JFactory::getApplication()->input; - JText::script('COM_TJVENDOR_DUPLICARE_VENDOR_ERROR'); - JText::script('COM_TJVENDOR_PAYMENTGATEWAY_NO_FIELD_MESSAGE'); - JText::script('COM_TJVENDOR_USER_ERROR'); + $this->params = ComponentHelper::getParams('com_tjvendors'); + $this->input = Factory::getApplication()->input; + Text::script('COM_TJVENDOR_DUPLICARE_VENDOR_ERROR'); + Text::script('COM_TJVENDOR_PAYMENTGATEWAY_NO_FIELD_MESSAGE'); + Text::script('COM_TJVENDOR_USER_ERROR'); $this->client = $this->input->get('client', '', 'STRING'); if (empty($this->item->vendor_id)) @@ -77,21 +82,21 @@ 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(); $isNew = ($this->item->vendor_id == 0); - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $this->full_client = $input->get('client', '', 'STRING'); if ($isNew) { - $viewTitle = JText::_('COM_TJVENDOR_VENDORS_ADD_USER_SPECIFIC_COMM'); + $viewTitle = Text::_('COM_TJVENDOR_VENDORS_ADD_USER_SPECIFIC_COMM'); } else { - $viewTitle = JText::_('COM_TJVENDOR_VENDORS_EDIT_USER_SPECIFIC_COMM'); + $viewTitle = Text::_('COM_TJVENDOR_VENDORS_EDIT_USER_SPECIFIC_COMM'); } if (isset($this->item->checked_out)) @@ -105,7 +110,7 @@ protected function addToolbar() $canDo = TjvendorsHelper::getActions(); $clientTitle = TjvendorFrontHelper::getClientName($this->client); - JToolbarHelper::title($clientTitle . ' ' . $viewTitle, 'pencil.png'); + ToolbarHelper::title($clientTitle . ' ' . $viewTitle, 'pencil.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.create')))) diff --git a/src/com_tjvendors/admin/views/vendorfee/tmpl/edit.php b/src/com_tjvendors/admin/views/vendorfee/tmpl/edit.php index 5812d973..2461a4c7 100644 --- a/src/com_tjvendors/admin/views/vendorfee/tmpl/edit.php +++ b/src/com_tjvendors/admin/views/vendorfee/tmpl/edit.php @@ -1,19 +1,22 @@ - * @copyright Copyright (c) 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(); +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Router\Route; -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'); ?>
id . '&vendor_id=' . (int) $this->item->vendor_id);?>" method="post" enctype="multipart/form-data" name="adminform" id="vendorfee-form" class="form-validate">
@@ -55,7 +58,7 @@ - +
diff --git a/src/com_tjvendors/admin/views/vendorfee/view.html.php b/src/com_tjvendors/admin/views/vendorfee/view.html.php index 03c4ae7e..96ea0de6 100644 --- a/src/com_tjvendors/admin/views/vendorfee/view.html.php +++ b/src/com_tjvendors/admin/views/vendorfee/view.html.php @@ -10,15 +10,17 @@ // No direct access defined('_JEXEC') or die; - -jimport('joomla.application.component.view'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; /** * View to edit * * @since 1.6 */ -class TjvendorsViewVendorFee extends JViewLegacy +class TjvendorsViewVendorFee extends HtmlView { protected $state; @@ -37,15 +39,15 @@ class TjvendorsViewVendorFee extends JViewLegacy */ public function display($tpl = null) { - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $this->vendor_id = $input->get('vendor_id', '', 'INT'); $this->id = $input->get('id', '', 'INT'); $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); - $this->input = JFactory::getApplication()->input; - JText::script('COM_TJVENDORS_FEES_NEGATIVE_NUMBER_ERROR'); - JText::script('COM_TJVENDORS_FEES_PERCENT_ERROR'); + $this->input = Factory::getApplication()->input; + Text::script('COM_TJVENDORS_FEES_NEGATIVE_NUMBER_ERROR'); + Text::script('COM_TJVENDORS_FEES_PERCENT_ERROR'); // Check for errors. if (count($errors = $this->get('Errors'))) @@ -66,25 +68,25 @@ 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(); $isNew = ($this->item->vendor_id == 0); - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $client = $input->get('client', '', 'STRING'); if ($isNew) { - $viewTitle = JText::_('COM_TJVENDOR_NEW_USER_SPECIFIC_COMMISSION'); + $viewTitle = Text::_('COM_TJVENDOR_NEW_USER_SPECIFIC_COMMISSION'); } else { - $viewTitle = JText::_('COM_TJVENDOR_EDIT_USER_SPECIFIC_COMMISSION'); + $viewTitle = Text::_('COM_TJVENDOR_EDIT_USER_SPECIFIC_COMMISSION'); } $clientTitle = TjvendorFrontHelper::getClientName($client); - JToolbarHelper::title($clientTitle . ' ' . $viewTitle, 'pencil.png'); + ToolbarHelper::title($clientTitle . ' ' . $viewTitle, 'pencil.png'); JToolBarHelper::apply('vendorfee.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('vendorfee.save', 'JTOOLBAR_SAVE'); diff --git a/src/com_tjvendors/admin/views/vendorfees/tmpl/default.php b/src/com_tjvendors/admin/views/vendorfees/tmpl/default.php index d04253f2..b88e39a5 100644 --- a/src/com_tjvendors/admin/views/vendorfees/tmpl/default.php +++ b/src/com_tjvendors/admin/views/vendorfees/tmpl/default.php @@ -1,25 +1,31 @@ - * @copyright Copyright (c) 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; +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/'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('formbehavior.chosen', 'select'); +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 = Factory::getDocument(); +$document->addStyleSheet(Uri::root() . 'administrator/components/com_tjvendors/assets/css/tjvendors.css'); -$user = JFactory::getUser(); +$user = Factory::getUser(); $userId = $user->get('id'); $listOrder = $this->state->get('list.ordering'); $listDirn = $this->state->get('list.direction'); @@ -29,7 +35,7 @@ if ($saveOrder) { $saveOrderingUrl = 'index.php?option=com_tjvendors&task=vendorfees.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'vendorList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); + HTMLHelper::_('sortablelist.sortable', 'vendorList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); } $sortFields = $this->getSortFields(); @@ -112,7 +118,7 @@
vendor_id . '&client=' . $this->input->get('client', '', 'STRING')); ?>" method="post" name="adminForm" id="adminForm"> sidebar)) @@ -133,47 +139,47 @@
- -
pagination->getLimitBox(); ?>
- +
@@ -184,7 +190,7 @@ ?>
 
- +
- ', 'a.`ordering`', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.`ordering`', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> - + - + - + - + - + - + @@ -256,7 +262,7 @@ if (!$saveOrder) { - $disabledLabel = JText::_('JORDERINGDISABLED'); + $disabledLabel = Text::_('JORDERINGDISABLED'); $disableClassName = 'inactive tip-top'; } ?> @@ -279,7 +285,7 @@ }?> - id); ?> + id); ?> vendor_title; ?> @@ -287,7 +293,7 @@ + echo Route::_('index.php?option=com_tjvendors&task=vendorfee.edit&vendor_id=' . (int) $item->vendor_id . '&client=' . $item->client . '&fee_id=' . $item->id);?>"> currency; ?> @@ -315,6 +321,6 @@ - +
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 ) { ?>

- +

-
isClientExist): ?> @@ -55,7 +61,7 @@ input; + $input = Factory::getApplication()->input; if ($this->vendor_id != 0) { @@ -63,19 +69,19 @@
- + escape($this->VendorDetail->vendor_title);?> isClientExist) { - echo " " . JText::_('COM_TJVENDORS_DISPLAY_DO_YOU_WANT_TO_ADD'); + echo " " . Text::_('COM_TJVENDORS_DISPLAY_DO_YOU_WANT_TO_ADD'); $tjvendorFrontHelper = new TjvendorFrontHelper; echo $client = $tjvendorFrontHelper->getClientName($this->client); - echo JText::_('COM_TJVENDORS_DISPLAY_AS_A_CLIENT'); + echo Text::_('COM_TJVENDORS_DISPLAY_AS_A_CLIENT'); } ?>
@@ -102,7 +108,7 @@
- +
@@ -116,7 +122,7 @@
- "> + ">
@@ -127,7 +133,7 @@ } ?>
- params->get('image_size', '', 'STRING'));?> + params->get('image_size', '', 'STRING'));?>
@@ -156,11 +162,11 @@ ?>
- + redirect($link); } ?> diff --git a/src/com_tjvendors/site/views/vendor/tmpl/profile.php b/src/com_tjvendors/site/views/vendor/tmpl/profile.php index 5e93f758..cd75b955 100644 --- a/src/com_tjvendors/site/views/vendor/tmpl/profile.php +++ b/src/com_tjvendors/site/views/vendor/tmpl/profile.php @@ -1,48 +1,55 @@ - * @copyright 2016 Parth Lawate - * @license GNU General Public License version 2 or later; see LICENSE.txt + * @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; +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'); ?>
id ) + if (Factory::getUser()->id ) { ?>

vendor->vendor_title, ENT_COMPAT, 'UTF-8'); ?>

-
@@ -69,7 +76,7 @@
- +
@@ -81,7 +88,7 @@
- " class="img-thumbnail"> + " class="img-thumbnail">
@@ -92,7 +99,7 @@ form->renderField('vendor_logo'); ?>
- params->get('image_size', '', 'STRING'));?> + params->get('image_size', '', 'STRING'));?>
@@ -115,13 +122,13 @@
- +
@@ -130,8 +137,8 @@ } else { - $link = JRoute::_('index.php?option=com_users'); - $app = JFactory::getApplication(); + $link = Route::_('index.php?option=com_users'); + $app = Factory::getApplication(); $app->redirect($link); } ?> diff --git a/src/com_tjvendors/site/views/vendor/view.html.php b/src/com_tjvendors/site/views/vendor/view.html.php index 17bcb087..640ce101 100755 --- a/src/com_tjvendors/site/views/vendor/view.html.php +++ b/src/com_tjvendors/site/views/vendor/view.html.php @@ -1,22 +1,29 @@ - * @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; - -jimport('joomla.application.component.view'); +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\Router\Route; +use Joomla\CMS\Table\Table; /** * View to edit * * @since 1.6 */ -class TjvendorsViewVendor extends JViewLegacy +class TjvendorsViewVendor extends HtmlView { protected $state; @@ -53,34 +60,34 @@ class TjvendorsViewVendor extends JViewLegacy */ public function display($tpl = null) { - $this->params = JComponentHelper::getParams('com_tjvendors'); + $this->params = ComponentHelper::getParams('com_tjvendors'); $this->state = $this->get('State'); $this->vendor = $this->get('Item'); $this->form = $this->get('Form'); - $this->input = JFactory::getApplication()->input; + $this->input = Factory::getApplication()->input; $this->client = $this->input->get('client', '', 'STRING'); - JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models', 'vendor'); - $tjvendorsModelVendor = JModelLegacy::getInstance('Vendor', 'TjvendorsModel'); + BaseDatabaseModel::addIncludePath(JPATH_SITE . '/components/com_tjvendors/models', 'vendor'); + $tjvendorsModelVendor = BaseDatabaseModel::getInstance('Vendor', 'TjvendorsModel'); $tjvendorFrontHelper = new TjvendorFrontHelper; $this->vendor_id = $tjvendorFrontHelper->getvendor(); $this->client = $this->input->get('client', '', 'STRING'); $this->isClientExist = $tjvendorFrontHelper->isClientExist($this->client, $this->vendor_id); - $this->vendorClientXrefTable = JTable::getInstance('vendorclientxref', 'TjvendorsTable', array()); + $this->vendorClientXrefTable = Table::getInstance('vendorclientxref', 'TjvendorsTable', array()); $this->vendorClientXrefTable->load(array('vendor_id' => $this->vendor_id, 'client' => $this->client)); $this->VendorDetail = $tjvendorsModelVendor->getItem($this->vendor_id); - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setUserState("vendor.client", $this->client); $app->setUserState("vendor.vendor_id", $this->vendor->vendor_id); $this->layout = $this->input->get('layout', '', 'STRING'); - JText::script('COM_TJVENDOR_PAYMENTGATEWAY_NO_FIELD_MESSAGE'); - JText::script('COM_TJVENDOR_DESCRIPTION_READ_MORE'); - JText::script('COM_TJVENDOR_DESCRIPTION_READ_LESS'); + Text::script('COM_TJVENDOR_PAYMENTGATEWAY_NO_FIELD_MESSAGE'); + Text::script('COM_TJVENDOR_DESCRIPTION_READ_MORE'); + Text::script('COM_TJVENDOR_DESCRIPTION_READ_LESS'); if ($this->layout == 'profile' && $this->vendor_id != $this->vendor->vendor_id) { - throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); + throw new Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403); } if (!empty($this->vendor_id) && $this->layout == "edit") @@ -91,9 +98,9 @@ public function display($tpl = null) { if ($client == $this->client) { - $link = JRoute::_('index.php?option=com_tjvendors&view=vendor&layout=profile&client=' . $this->client . '&vendor_id=' . $this->vendor_id); - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('COM_TJVENDOR_REGISTRATION_REDIRECT_MESSAGE')); + $link = Route::_('index.php?option=com_tjvendors&view=vendor&layout=profile&client=' . $this->client . '&vendor_id=' . $this->vendor_id); + $app = Factory::getApplication(); + $app->enqueueMessage(Text::_('COM_TJVENDOR_REGISTRATION_REDIRECT_MESSAGE')); $app->redirect($link); } } diff --git a/src/com_tjvendors/site/views/vendors/tmpl/default.php b/src/com_tjvendors/site/views/vendors/tmpl/default.php index 80ca64a5..6ea51155 100755 --- a/src/com_tjvendors/site/views/vendors/tmpl/default.php +++ b/src/com_tjvendors/site/views/vendors/tmpl/default.php @@ -1,14 +1,21 @@ + * @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved. + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ + // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; -JHtml::_('formbehavior.chosen', 'select'); +HTMLHelper::_('formbehavior.chosen', 'select'); $listOrder = $this->state->get('list.ordering'); $listDirn = $this->state->get('list.direction'); @@ -35,15 +42,15 @@

- +

id; + $user_id = Factory::getUser()->id; if (!empty($this->vendor_id)) { ?> - +
@@ -51,15 +58,15 @@
- state->get('filter.fromDate'), 'fromDates', 'dates', '%Y-%m-%d', array('class' => 'inputbox date__field', 'onchange' => 'document.adminForm.submit()')); ?> + state->get('filter.fromDate'), 'fromDates', 'dates', '%Y-%m-%d', array('class' => 'inputbox date__field', 'onchange' => 'document.adminForm.submit()')); ?> - state->get('filter.toDate'), 'toDates', 'date', '%Y-%m-%d', array('class' => 'inputbox date__field', 'onchange' => 'document.adminForm.submit()')); ?> + state->get('filter.toDate'), 'toDates', 'date', '%Y-%m-%d', array('class' => 'inputbox date__field', 'onchange' => 'document.adminForm.submit()')); ?> - @@ -75,7 +82,7 @@
  • @@ -89,7 +96,7 @@
  • uniqueClients, "vendor_client", 'class="input-medium" size="1" onchange="document.adminForm.submit();"', "clientType", "clientValue", $this->state->get('filter.vendor_client')); + echo HTMLHelper::_('select.genericlist', $this->uniqueClients, "vendor_client", 'class="input-medium" size="1" onchange="document.adminForm.submit();"', "clientType", "clientValue", $this->state->get('filter.vendor_client')); $clientFilter = $this->state->get('filter.vendor_client'); ?>
    @@ -101,11 +108,11 @@
  • @@ -114,7 +121,7 @@
  • @@ -132,7 +139,7 @@ ?>
    - +
    - - + +
    @@ -154,11 +161,11 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -227,19 +234,19 @@
    - totalDetails['creditAmount'] . ' ' . $currency; ?> + totalDetails['creditAmount'] . ' ' . $currency; ?> - totalDetails['debitAmount'] . ' ' . $currency; ?> + totalDetails['debitAmount'] . ' ' . $currency; ?> - totalDetails['pendingAmount'] . ' ' . $currency; ?> + totalDetails['pendingAmount'] . ' ' . $currency; ?>
    @@ -261,7 +268,7 @@ pagination->getRowOffset($i);?> - + transaction_id, ENT_COMPAT, 'UTF-8'); ?> @@ -269,7 +276,7 @@ if ($this->vendorClient == '' && $clientFilter == 'all') { ?> - + getClientName($row->client); @@ -282,7 +289,7 @@ if ($currency == '0') { ?> - + currency, ENT_COMPAT, 'UTF-8');?> - + credit <='0') { @@ -309,26 +316,26 @@ if ($transactionType == "Debit" || empty($transactionType)) { ?> - + debit, ENT_COMPAT, 'UTF-8');?> - + reference_order_id, ENT_COMPAT, 'UTF-8');?> - + transaction_time, ENT_COMPAT, 'UTF-8');?> - + total), ENT_COMPAT, 'UTF-8');?> - + params, true); @@ -336,21 +343,21 @@ { if ($row->status == 1) { - echo JText::_('COM_TJVENDOR_PAYOUT_DONE'); + echo Text::_('COM_TJVENDOR_PAYOUT_DONE'); } else { - echo JText::_('COM_TJVENDOR_PAYOUT_PENDING'); + echo Text::_('COM_TJVENDOR_PAYOUT_PENDING'); } } elseif ($status['entry_status'] == "credit_for_ticket_buy") { - echo JText::_('COM_TJVENDOR_CREDIT_DONE'); + echo Text::_('COM_TJVENDOR_CREDIT_DONE'); } ?> - + - +
  • vendor_id && $user_id) { ?> -
    +
    redirect($link); } ?> diff --git a/src/com_tjvendors/site/views/vendors/view.html.php b/src/com_tjvendors/site/views/vendors/view.html.php index 7029db36..d0a1cb6a 100755 --- a/src/com_tjvendors/site/views/vendors/view.html.php +++ b/src/com_tjvendors/site/views/vendors/view.html.php @@ -10,15 +10,16 @@ // No direct access to this file defined('_JEXEC') or die; - -JLoader::import('joomla.application.component.model'); +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\MVC\View\HtmlView; /** * List view : Pending Payouts * * @since 1.6 */ -class TjvendorsViewVendors extends JViewLegacy +class TjvendorsViewVendors extends HtmlView { protected $user_id; @@ -51,12 +52,12 @@ class TjvendorsViewVendors extends JViewLegacy */ public function display($tpl = null) { - $app = JFactory::getApplication(); - $this->user_id = JFactory::getUser()->id; + $app = Factory::getApplication(); + $this->user_id = Factory::getUser()->id; $this->input = $app->input; // Get data from the model - $items_model = JModelLegacy::getInstance('vendors', 'TjvendorsModel'); + $items_model = BaseDatabaseModel::getInstance('vendors', 'TjvendorsModel'); $this->items = $items_model->getItems(); $this->pagination = $items_model->getPagination(); $this->state = $items_model->getState(); diff --git a/src/plugins/actionlog/tjvendors/tjvendors.php b/src/plugins/actionlog/tjvendors/tjvendors.php index 0bb5d5e3..8b1b6909 100644 --- a/src/plugins/actionlog/tjvendors/tjvendors.php +++ b/src/plugins/actionlog/tjvendors/tjvendors.php @@ -9,16 +9,21 @@ */ defined('_JEXEC') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Table\Table; JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php'); -JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjvendors/tables'); +Table::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjvendors/tables'); /** * TJVendors Actions Logging Plugin. * * @since 1.3.1 */ -class PlgActionlogTjvendors extends JPlugin +class PlgActionlogTjvendors extends CMSPlugin { /** * Load plugin language file automatically so that it can be used inside component @@ -47,22 +52,22 @@ public function tjVendorsOnAfterVendorSave($vendorData, $isNew) return; } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $context = $app->input->get('option'); - $jUser = JFactory::getUser(); + $jUser = Factory::getUser(); $userId = $jUser->id; $userName = $jUser->username; if ($vendorData['vendor_client']) { - $language = JFactory::getLanguage(); + $language = Factory::getLanguage(); $language->load($vendorData['vendor_client']); } // If admin create user as vendor from backend if ($app->isAdmin()) { - $vendorInfor = JFactory::getUser($vendorData['user_id']); + $vendorInfor = Factory::getUser($vendorData['user_id']); $vendorID = $vendorInfor->id; $vendorUserName = $vendorInfor->username; $action = ($isNew) ? 'add' : 'update'; @@ -77,7 +82,7 @@ public function tjVendorsOnAfterVendorSave($vendorData, $isNew) $message = array( 'action' => $action, 'type' => 'PLG_ACTIONLOG_TJVENDORS_TYPE_VENDOR', - 'clientname' => JText::_(strtoupper($vendorData['vendor_client'])), + 'clientname' => Text::_(strtoupper($vendorData['vendor_client'])), 'clientlink' => 'index.php?option=' . $vendorData['vendor_client'], 'vendorusername' => $vendorUserName, 'vendoruserlink' => 'index.php?option=com_users&task=user.edit&id=' . $vendorID, @@ -106,7 +111,7 @@ public function tjVendorsOnAfterVendorSave($vendorData, $isNew) $message = array( 'action' => $action, 'type' => 'PLG_ACTIONLOG_TJVENDORS_TYPE_VENDOR', - 'clientname' => JText::_(strtoupper($vendorData['vendor_client'])), + 'clientname' => Text::_(strtoupper($vendorData['vendor_client'])), 'clientlink' => 'index.php?option=' . $vendorData['vendor_client'], 'vendorname' => $vendorData['vendor_title'], 'vendorusername' => $vendorUserName, @@ -128,7 +133,7 @@ public function tjVendorsOnAfterVendorSave($vendorData, $isNew) $message = array( 'action' => $action, 'type' => 'PLG_ACTIONLOG_TJVENDORS_TYPE_VENDOR', - 'clientname' => JText::_(strtoupper($vendorData['vendor_client'])), + 'clientname' => Text::_(strtoupper($vendorData['vendor_client'])), 'clientlink' => 'index.php?option=' . $vendorData['vendor_client'], 'userid' => $userId, 'username' => $userName, @@ -140,7 +145,7 @@ public function tjVendorsOnAfterVendorSave($vendorData, $isNew) $message = array( 'action' => $action, 'type' => 'PLG_ACTIONLOG_TJVENDORS_TYPE_VENDOR', - 'clientname' => JText::_(strtoupper($vendorData['vendor_client'])), + 'clientname' => Text::_(strtoupper($vendorData['vendor_client'])), 'clientlink' => 'index.php?option=' . $vendorData['vendor_client'], 'userid' => $userId, 'username' => $userName, @@ -172,12 +177,12 @@ public function tjVendorsOnAfterVendorStateChange($pks, $state, $client) return; } - $jUser = JFactory::getUser(); + $jUser = Factory::getUser(); $userId = $jUser->id; $userName = $jUser->username; - $context = JFactory::getApplication()->input->get('option'); - $tjvendorsTableVendor = JTable::getInstance('vendor', 'TjvendorsTable', array()); - $language = JFactory::getLanguage(); + $context = Factory::getApplication()->input->get('option'); + $tjvendorsTableVendor = Table::getInstance('vendor', 'TjvendorsTable', array()); + $language = Factory::getLanguage(); $language->load($client); switch ($state) @@ -206,7 +211,7 @@ public function tjVendorsOnAfterVendorStateChange($pks, $state, $client) 'vendorname' => $tjvendorsTableVendor->vendor_title, 'vendorid' => $tjvendorsTableVendor->user_id, 'vendorlink' => 'index.php?option=com_users&task=user.edit&id=' . $tjvendorsTableVendor->user_id, - 'clientname' => JText::_(strtoupper($client)), + 'clientname' => Text::_(strtoupper($client)), 'clientlink' => 'index.php?option=' . $client, 'userid' => $userId, 'username' => $userName, @@ -236,8 +241,8 @@ public function tjvendorOnAfterVendorDelete($vendorData, $client) return; } - $context = JFactory::getApplication()->input->get('option'); - $jUser = JFactory::getUser(); + $context = Factory::getApplication()->input->get('option'); + $jUser = Factory::getUser(); $messageLanguageKey = 'PLG_ACTIONLOG_TJVENDORS_VENDOR_DELETED'; $action = 'delete'; $userId = $jUser->id; @@ -245,7 +250,7 @@ public function tjvendorOnAfterVendorDelete($vendorData, $client) if ($client) { - $language = JFactory::getLanguage(); + $language = Factory::getLanguage(); $language->load($client); } @@ -253,7 +258,7 @@ public function tjvendorOnAfterVendorDelete($vendorData, $client) 'action' => $action, 'type' => 'PLG_ACTIONLOG_TJVENDORS_TYPE_VENDOR', 'vendorname' => $vendorData->vendor_title, - 'clientname' => JText::_(strtoupper($client)), + 'clientname' => Text::_(strtoupper($client)), 'clientlink' => 'index.php?option=' . $client, 'userid' => $userId, 'username' => $userName, @@ -282,18 +287,18 @@ public function tjVendorsOnAfterVendorFeeSave($vendorFeeData, $isNew) return; } - $context = JFactory::getApplication()->input->get('option'); - $jUser = JFactory::getUser(); + $context = Factory::getApplication()->input->get('option'); + $jUser = Factory::getUser(); $messageLanguageKey = ($isNew) ? 'PLG_ACTIONLOG_TJVENDORS_VENDOR_FEE_SAVE' : 'PLG_ACTIONLOG_TJVENDORS_VENDOR_FEE_UPDATE'; $action = ($isNew) ? 'add' : 'update'; $userId = $jUser->id; $userName = $jUser->username; - $tjvendorsTableVendor = JTable::getInstance('vendor', 'TjvendorsTable', array()); + $tjvendorsTableVendor = Table::getInstance('vendor', 'TjvendorsTable', array()); $tjvendorsTableVendor->load(array('vendor_id' => $vendorFeeData['vendor_id'])); if ($vendorFeeData['client']) { - $language = JFactory::getLanguage(); + $language = Factory::getLanguage(); $language->load($vendorFeeData['client']); } @@ -304,7 +309,7 @@ public function tjVendorsOnAfterVendorFeeSave($vendorFeeData, $isNew) 'vendorlink' => 'index.php?option=com_users&task=user.edit&id=' . $tjvendorsTableVendor->user_id, 'feelink' => 'index.php?option=com_tjvendors&view=vendorfee&layout=edit&id=' . $vendorFeeData['id'] . '&vendor_id=' . $vendorFeeData['vendor_id'] . '&client=' . $vendorFeeData['client'], 'clientlink' => 'index.php?option=' . $vendorFeeData['client'], - 'clientname' => JText::_(strtoupper($vendorFeeData['client'])), + 'clientname' => Text::_(strtoupper($vendorFeeData['client'])), 'userid' => $userId, 'username' => $userName, 'accountlink' => 'index.php?option=com_users&task=user.edit&id=' . $userId, @@ -332,7 +337,7 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu JLoader::register('ActionlogsModelActionlog', JPATH_ADMINISTRATOR . '/components/com_actionlogs/models/actionlog.php'); /* @var ActionlogsModelActionlog $model */ - $model = JModelLegacy::getInstance('Actionlog', 'ActionlogsModel'); + $model = BaseDatabaseModel::getInstance('Actionlog', 'ActionlogsModel'); $model->addLog($messages, $messageLanguageKey, $context, $userId); } } diff --git a/src/plugins/privacy/tjvendors/tjvendors.php b/src/plugins/privacy/tjvendors/tjvendors.php index b2ce20f4..9df9fab2 100644 --- a/src/plugins/privacy/tjvendors/tjvendors.php +++ b/src/plugins/privacy/tjvendors/tjvendors.php @@ -10,7 +10,8 @@ // No direct access. defined('_JEXEC') or die(); -jimport('joomla.application.component.model'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\User\User; JLoader::register('PrivacyPlugin', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/plugin.php'); JLoader::register('PrivacyRemovalStatus', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/removal/status.php'); @@ -51,8 +52,8 @@ public function onPrivacyCollectAdminCapabilities() $this->loadLanguage(); return array( - JText::_('PLG_PRIVACY_TJVENDORS') => array( - JText::_('PLG_PRIVACY_TJVENDORS_PRIVACY_CAPABILITY_USER_DETAIL'), + Text::_('PLG_PRIVACY_TJVENDORS') => array( + Text::_('PLG_PRIVACY_TJVENDORS_PRIVACY_CAPABILITY_USER_DETAIL'), ), ); } @@ -68,21 +69,21 @@ public function onPrivacyCollectAdminCapabilities() * - #__tjvendors_passbook * * @param PrivacyTableRequest $request The request record being processed - * @param JUser $user The user account associated with this request if available + * @param User $user The user account associated with this request if available * * @return PrivacyExportDomain[] * * @since 1.3.1 */ - public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user = null) + public function onPrivacyExportRequest(PrivacyTableRequest $request, User $user = null) { if (!$user) { return array(); } - /** @var JTableUser $userTable */ - $userTable = JUser::getTable(); + /** @var User $userTable */ + $userTable = User::getTable(); $userTable->load($user->id); // Create the domain for the TJVendors vednor data @@ -107,13 +108,13 @@ public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user /** * Create the domain for the TJvendor user data * - * @param JTableUser $user The JTableUser object to process + * @param User $user The User object to process * * @return PrivacyExportDomain * * @since 1.3.1 */ - private function createVendorDomain(JTableUser $user) + private function createVendorDomain(User $user) { $domain = $this->createDomain('TJvendor user', 'TJvendor user data'); @@ -135,13 +136,13 @@ private function createVendorDomain(JTableUser $user) /** * Create the domain for the TJvendor to get vendor client data * - * @param JTableUser $user The JTableUser object to process + * @param User $user The User object to process * * @return PrivacyExportDomain * * @since 1.3.1 */ - private function createVendorClientDomain(JTableUser $user) + private function createVendorClientDomain(User $user) { $domain = $this->createDomain('TJvendor user client', 'TJvendor user clients data'); @@ -175,13 +176,13 @@ private function createVendorClientDomain(JTableUser $user) /** * Create the domain for the TJvendor to get vendor Fee data * - * @param JTableUser $user The JTableUser object to process + * @param User $user The User object to process * * @return PrivacyExportDomain * * @since 1.3.1 */ - private function createVendorFessDomain(JTableUser $user) + private function createVendorFessDomain(User $user) { $domain = $this->createDomain('TJvendor user fees', 'TJvendor user fees data'); @@ -215,13 +216,13 @@ private function createVendorFessDomain(JTableUser $user) /** * Create the domain for the TJvendor to get vendor passbook data * - * @param JTableUser $user The JTableUser object to process + * @param User $user The User object to process * * @return PrivacyExportDomain * * @since 1.3.1 */ - private function createVendorPassbookDomain(JTableUser $user) + private function createVendorPassbookDomain(User $user) { $domain = $this->createDomain('TJvendor user passbook', 'TJvendor user passbook data'); @@ -258,13 +259,13 @@ private function createVendorPassbookDomain(JTableUser $user) * This event will not allow a super user account to be removed * * @param PrivacyTableRequest $request The request record being processed - * @param JUser $user The user account associated with this request if available + * @param User $user The user account associated with this request if available * * @return PrivacyRemovalStatus * * @since 1.3.1 */ - public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser $user = null) + public function onPrivacyCanRemoveData(PrivacyTableRequest $request, User $user = null) { $status = new PrivacyRemovalStatus; @@ -283,7 +284,7 @@ public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser $user if ($vendorId) { $status->canRemove = false; - $status->reason = JText::_('PLG_PRIVACY_TJVENDORS_ERROR_CANNOT_REMOVE_USER_DATA'); + $status->reason = Text::_('PLG_PRIVACY_TJVENDORS_ERROR_CANNOT_REMOVE_USER_DATA'); } return $status;