本文整理汇总了PHP中VirtueMartModelVendor类的典型用法代码示例。如果您正苦于以下问题:PHP VirtueMartModelVendor类的具体用法?PHP VirtueMartModelVendor怎么用?PHP VirtueMartModelVendor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VirtueMartModelVendor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plgVmConfirmedOrder
function plgVmConfirmedOrder($cart, $order)
{
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return null;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return false;
}
$session = JFactory::getSession();
$return_context = $session->getId();
$this->_debug = $method->debug;
$this->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');
if (!class_exists('VirtueMartModelOrders')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
if (!class_exists('VirtueMartModelCurrency')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
}
//$usr = & JFactory::getUser();
$html = '';
$usrBT = $order['details']['BT'];
$address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
$vendorModel = new VirtueMartModelVendor();
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$this->getPaymentCurrency($method);
$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
$db =& JFactory::getDBO();
$db->setQuery($q);
$currency_code_3 = $db->loadResult();
//$paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
//$totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total,false), 2);
$totalInPaymentCurrency = round($order['details']['BT']->order_total, 2);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
$user_title = $address->title;
$user_email = $address->email;
$user_name = $address->first_name . ' ' . $address->last_name;
$user_city = $address->city;
$user_address = $address->address_1;
$user_zip = $address->zip;
$user_country = ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_3_code');
$msg_1 = $user_name . " Kd-nr " . $usrBT->virtuemart_user_id;
$msg_2 = "Bestellnr " . $order['details']['BT']->order_number;
$cont = $method->payment_uid . "|" . $method->payment_pid . "|||||" . $totalInPaymentCurrency . "|" . $currency_code_3 . "|" . $msg_1 . "|" . $msg_2 . "|" . $order['details']['BT']->order_number . "|" . $order['details']['BT']->virtuemart_paymentmethod_id . "|VM v2.1||||" . $method->payment_pas;
$hash = md5($cont);
$html .= '<div style="text-align: left; margin-top: 25px; margin-bottom: 25px;">';
$html .= 'Ihre Bestellung ist bei uns eingegangen und wird umgehend von uns bearbeitet.';
$html .= '</div>';
// Prepare data that should be stored in the database
$dbValues = array();
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['payment_name'] = $this->renderPluginName($method, $order);
$dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
$dbValues['payment_currency'] = $method->payment_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency;
$this->storePSPluginInternalData($dbValues);
$new_status = 'C';
return $this->processConfirmedOrderPaymentResponse(1, $cart, $order, $html, $dbValues['payment_name'], $new_status);
}
示例2: plgVmConfirmedOrder
function plgVmConfirmedOrder($cart, $order)
{
if (!($method = $this->getVmPluginMethod($order["details"]["BT"]->virtuemart_paymentmethod_id))) {
return null;
}
if (!$this->selectedThisElement($method->payment_element)) {
return false;
}
$this->logInfo('plgVmOnConfirmedOrderGetPaymentForm order number: ' . $order['details']['BT']->order_number, 'message');
$lang = JFactory::getLanguage();
$lang->load('plg_vmpayment_epay', JPATH_ADMINISTRATOR);
if (!class_exists('VirtueMartModelOrders')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
if (!class_exists('VirtueMartModelCurrency')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
}
$new_status = '';
$usrBT = $order['details']['BT'];
$address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
$vendorModel = new VirtueMartModelVendor();
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$this->getPaymentCurrency($method);
$q = ' SELECT `currency_numeric_code` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
$db =& JFactory::getDBO();
$db->setQuery($q);
$currency_numeric_code = $db->loadResult();
$paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
$totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, false), 2);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
$session = JFactory::getSession();
$post_variables = array('merchantnumber' => $method->epay_merchant, 'instantcapture' => $method->epay_instantcapture, 'ownreceipt' => $method->epay_ownreceipt, 'group' => $method->epay_group, 'mailreceipt' => $method->epay_authmail, 'language' => $this->_getEpayLanguage(), 'orderid' => $order['details']['BT']->order_number, "amount" => $totalInPaymentCurrency * 100, "currency" => $currency_numeric_code, "accepturl" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id), "callbackurl" => JROUTE::_(JURI::root() . 'index.php?callback=1&option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id), "cancelurl" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id), "windowstate" => $method->epay_windowstate);
$hash = md5(implode($post_variables, "") . $method->epay_md5key);
// Prepare data that should be stored in the database
$dbValues['payment_name'] = $this->renderPluginName($method, $order);
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
$this->storePSPluginInternalData($dbValues);
// add spin image
$html = '<script type="text/javascript" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" charset="UTF-8"></script>';
$html .= '<script type="text/javascript">';
$html .= 'paymentwindow = new PaymentWindow({';
foreach ($post_variables as $name => $value) {
$html .= '\'' . $name . '\': "' . $value . '",';
}
$html .= '\'hash\': "' . $hash . '"';
$html .= '});';
$html .= '</script><input type="button" onclick="javascript: paymentwindow.open()" value="Go to payment" />';
$html .= ' <script type="text/javascript">';
$html .= ' paymentwindow.open();';
$html .= ' </script>';
// 2 = don't delete the cart, don't send email and don't redirect
$cart->_confirmDone = false;
$cart->_dataValidated = false;
$cart->setCartIntoSession();
JRequest::setVar('html', $html);
}
示例3: getOptions
protected function getOptions()
{
$options = array();
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = VirtueMartModelVendor::getLoggedVendor();
// set currency_id to logged vendor
if (empty($this->value)) {
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->value = $currency->virtuemart_currency_id;
}
// why not logged vendor? shared is missing
$db = JFactory::getDBO();
$query = 'SELECT `virtuemart_currency_id` AS value, `currency_name` AS text
FROM `#__virtuemart_currencies`
WHERE `virtuemart_vendor_id` = "1" AND `published` = "1" ORDER BY `currency_name` ASC ';
// default value should be vendor currency
$db->setQuery($query);
$values = $db->loadObjectList();
foreach ($values as $v) {
$options[] = JHtml::_('select.option', $v->value, $v->text);
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
示例4: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
if (!class_exists('vmPSPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = vRequest::getCmd('layout', 'default');
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
$shipment = $model->getShipment();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
if (file_exists($formFile)) {
$shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$shipment->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
VmTable::bindParameterableToSubField($shipment, $varsToPush);
$shipment->form->bind($shipment->getProperties());
} else {
$shipment->form = null;
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if ($this->showVendors()) {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->assignRef('shipment', $shipment);
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
foreach ($this->shipments as &$data) {
// Write the first 5 shoppergroups in the list
$data->shipmentShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例5: getCurrencyCode
public function getCurrencyCode($currency_id)
{
$vendorId = VirtueMartModelVendor::getLoggedVendor();
$db = JFactory::getDBO();
$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`=' . $currency_id;
$db->setQuery($q);
return $db->loadResult();
}
示例6: display
/**
* Displays the view, collects needed data for the different layouts
*
* Okey I try now a completly new idea.
* We make a function for every tab and the display is getting the right tabs by an own function
* putting that in an array and after that we call the preparedataforlayoutBlub
*
* @author Max Milbers
*/
function display($tpl = null)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$layoutName = $this->getLayout();
$model = VmModel::getModel();
$virtuemart_vendor_id = JRequest::getInt('virtuemart_vendor_id');
// if ($layoutName=='default') {
if (empty($virtuemart_vendor_id)) {
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_LIST'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_LIST'));
$vendors = $model->getVendors();
$model->addImages($vendors);
$this->assignRef('vendors', $vendors);
} else {
$vendor = $model->getVendor($virtuemart_vendor_id);
$model->addImages($vendor);
if (VmConfig::get('enable_content_plugin', 0)) {
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
shopFunctionsF::triggerContentPlugin($vendor, 'vendor', 'vendor_store_desc');
shopFunctionsF::triggerContentPlugin($vendor, 'vendor', 'vendor_terms_of_service');
}
$this->assignRef('vendor', $vendor);
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
//$usermodel = VmModel::getModel('user');
//$virtuemart_userinfo_id = $usermodel->getBTuserinfo_id($userId);
//$usermodel->getVendor($virtuemart_vendor_id);
//$userFields = $usermodel->getUserInfoInUserFields($layoutName, 'BT', $virtuemart_userinfo_id,true,true);
//$this->assignRef('userFields', $userFields);
if ($layoutName == 'tos') {
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_TOS'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_TOS'));
} elseif ($layoutName == 'contact') {
$user = JFactory::getUser();
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_CONTACT'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_CONTACT'));
$this->assignRef('user', $user);
} else {
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_DETAILS'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_DETAILS'));
$this->setLayout('details');
}
$linkdetails = '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=details&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE) . '">' . JText::_('COM_VIRTUEMART_VENDOR_DETAILS') . '</a>';
$linkcontact = '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE) . '">' . JText::_('COM_VIRTUEMART_VENDOR_CONTACT') . '</a>';
$linktos = '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=tos&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE) . '">' . JText::_('COM_VIRTUEMART_VENDOR_TOS') . '</a>';
//$this->assignRef('lineSeparator', $lineSeparator);
$this->assignRef('linkdetails', $linkdetails);
$this->assignRef('linkcontact', $linkcontact);
$this->assignRef('linktos', $linktos);
}
parent::display($tpl);
}
示例7: mailAskquestion
/**
* Send the ask question email.
* @author Kohl Patrick, Christopher Roussel
*/
public function mailAskquestion()
{
vRequest::vmCheckToken();
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$model = tmsModel::getModel('vendor');
$mainframe = JFactory::getApplication();
$vars = array();
$min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
$max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
$commentSize = vRequest::getString('comment');
if (function_exists('mb_strlen')) {
$commentSize = mb_strlen($commentSize);
} else {
$commentSize = strlen($commentSize);
}
$validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
$virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
//$vendorUser = JFactory::getUser($userId);
if ($commentSize < $min || $commentSize > $max || !$validMail) {
$this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
return;
}
$user = JFactory::getUser();
$fromMail = vRequest::getVar('email');
//is sanitized then
$fromName = vRequest::getVar('name', '');
//is sanitized then
$fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
$fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
if (!empty($user->id)) {
if (empty($fromMail)) {
$fromMail = $user->email;
}
if (empty($fromName)) {
$fromName = $user->name;
}
}
$vars['user'] = array('name' => $fromName, 'email' => $fromMail);
$VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
$vars['vendor'] = array('vendor_store_name' => $fromName);
if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
$string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
} else {
$string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
}
$mainframe->enqueueMessage(tsmText::_($string));
// Display it all
$view = $this->getView('vendor', 'html');
$view->setLayout('mail_confirmed');
$view->display();
}
示例8: determineStoreOwner
/**
* @author Max Milbers
*/
function determineStoreOwner() {
if(!class_exists('VirtueMartModelVendor')) require(VMPATH_ADMIN.DS.'models'.DS.'vendor.php');
$virtuemart_user_id = VirtueMartModelVendor::getUserIdByVendorId(1);
if (isset($virtuemart_user_id) && $virtuemart_user_id > 0) {
$this->_user = JFactory::getUser($virtuemart_user_id);
}
else {
$this->_user = JFactory::getUser();
}
return $this->_user->id;
}
示例9: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$shipment = $model->getShipment();
if (!class_exists('VmImage')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('vmParameters')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->assignRef('pluginList', self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id));
$this->assignRef('shipment', $shipment);
$this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true));
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', JText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$shipments = $model->getShipments();
$this->assignRef('shipments', $shipments);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例10: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . '/helpers');
$this->loadHelper('permissions');
$this->loadHelper('vmpsplugin');
$this->loadHelper('html');
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$shipment = $model->getShipment();
$this->loadHelper('image');
// $this->loadHelper('html');
// $this->loadHelper('parameterparser');
// jimport('joomla.html.pane');
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . '/models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->vendor_currency = $currency->currency_symbol;
if (Vmconfig::get('multix', 'none') !== 'none') {
$this->vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->shipment = $shipment;
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->SetViewTitle('', $shipment->shipment_name);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
if (JRequest::getWord('format', '') === 'raw') {
$tpl = 'results';
} else {
$this->SetViewTitle();
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', JText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->installedShipments = $this->shipmentsPlgList();
}
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
$this->pagination = $model->getPagination();
}
parent::display($tpl);
if ($tpl === 'results') {
echo $this->AjaxScripts();
}
}
示例11: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
$db = JFactory::getDBO();
$query = 'SELECT `virtuemart_currency_id` AS value, `currency_name` AS text
FROM `#__virtuemart_currencies`
WHERE `virtuemart_vendor_id` = "1" AND `published` = "1" ORDER BY `currency_name` ASC ';
// default value should be vendor currency
$db->setQuery($query);
$currencies = $db->loadObjectList();
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = VirtueMartModelVendor::getLoggedVendor();
if (empty($value)) {
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$value = $currency->virtuemart_currency_id;
}
return JHTML::_('select.genericlist', $currencies, $control_name . '[' . $name . '][]', $class, 'value', 'text', $value, $control_name . $name);
}
示例12: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
// get necessary models
$model = VmModel::getModel('manufacturer');
$categoryModel = VmModel::getModel('manufacturercategories');
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$manufacturer = $model->getManufacturer();
$isNew = $manufacturer->virtuemart_manufacturer_id < 1;
$model->addImages($manufacturer);
$this->assignRef('manufacturer', $manufacturer);
/* Process the images */
$mediaModel = VmModel::getModel('media');
$mediaModel->setId($manufacturer->virtuemart_media_id);
$image = $mediaModel->getFile('manufacturer', 'image');
$manufacturerCategories = $categoryModel->getManufacturerCategories(false, true);
$this->assignRef('manufacturerCategories', $manufacturerCategories);
$this->addStandardEditViewCommands($manufacturer->virtuemart_manufacturer_id);
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$virtuemart_vendor_id = VirtueMartModelVendor::getLoggedVendor();
$this->assignRef('virtuemart_vendor_id', $virtuemart_vendor_id);
} else {
$mainframe = JFactory::getApplication();
$categoryFilter = $categoryModel->getCategoryFilter();
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model, 'mf_name');
$manufacturers = $model->getManufacturers();
$this->assignRef('manufacturers', $manufacturers);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
$virtuemart_manufacturercategories_id = $mainframe->getUserStateFromRequest('com_virtuemart.virtuemart_manufacturercategories_id', 'virtuemart_manufacturercategories_id', 0, 'int');
$this->lists['virtuemart_manufacturercategories_id'] = JHTML::_('select.genericlist', $categoryFilter, 'virtuemart_manufacturercategories_id', 'class="inputbox" onchange="this.form.submit()"', 'value', 'text', $virtuemart_manufacturercategories_id);
}
parent::display($tpl);
}
示例13: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
$this->loadHelper('permissions');
$this->loadHelper('vmpsplugin');
$this->loadHelper('html');
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$shipment = $model->getShipment();
$this->loadHelper('image');
// $this->loadHelper('html');
$this->loadHelper('parameterparser');
// jimport('joomla.html.pane');
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->assignRef('pluginList', self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id));
$this->assignRef('shipment', $shipment);
$this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true));
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$shipments = $model->getShipments();
$this->assignRef('shipments', $shipments);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例14: onDisplayEditBECustom
function onDisplayEditBECustom($virtuemart_custom_id, &$customPlugin)
{
//if($this->plugin = $this->selectedThisByMethodId($this->_psType,$virtuemart_custom_id)){
if ($this->plugin = $this->selectedThisByMethodId($virtuemart_custom_id)) {
if (empty($this->plugin)) {
$this->plugin->custom_jplugin_id = null;
return $this->plugin;
}
//Must use here the table to get valid params
$this->plugin = $this->getVmPluginMethod($this->plugin->virtuemart_custom_id);
if (empty($this->plugin->virtuemart_vendor_id)) {
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$this->plugin->virtuemart_vendor_id = VirtueMartModelVendor::getLoggedVendor();
}
$customPlugin = $this->plugin;
// return $this->plugin;
return true;
}
}
示例15: display
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('html');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
$perm = Permissions::getInstance();
$this->assignRef('perm', $perm);
$model = VmModel::getModel();
$currentUser = JFactory::getUser();
$task = JRequest::getWord('task', 'edit');
if ($task == 'editshop') {
if (Vmconfig::get('multix', 'none') !== 'none') {
//Maybe we must check here if the user is vendor and if he has an own id and else map to mainvendor.
$userId = 0;
} else {
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId(1);
}
$this->SetViewTitle('STORE');
} else {
if ($task == 'add') {
$userId = 0;
} else {
$userId = JRequest::getVar('virtuemart_user_id', 0);
if (is_array($userId)) {
$userId = $userId[0];
}
$this->SetViewTitle('USER');
}
}
$userId = $model->setId($userId);
$layoutName = JRequest::getWord('layout', 'default');
$layoutName = $this->getLayout();
if ($layoutName == 'edit' || $layoutName == 'edit_shipto') {
$editor = JFactory::getEditor();
// Get the required helpers
$this->loadHelper('shoppergroup');
$this->loadHelper('image');
//$userFieldsModel = VmModel::getModel('userfields');
$userDetails = $model->getUser();
if ($task == 'editshop' && $userDetails->user_is_vendor) {
// $model->setCurrent();
if (!empty($userDetails->vendor->vendor_store_name)) {
$this->SetViewTitle('STORE', $userDetails->vendor->vendor_store_name);
} else {
$this->SetViewTitle('STORE', JText::_('COM_VIRTUEMART_NEW_VENDOR'));
}
$vendorid = $userDetails->virtuemart_vendor_id;
} else {
$vendorid = 0;
$this->SetViewTitle('USER', $userDetails->JUser->get('name'));
}
$_new = $userDetails->JUser->get('id') < 1;
$this->addStandardEditViewCommands($vendorid);
// User details
$_contactDetails = $model->getContactDetails();
$_groupList = $model->getGroupList();
if (!is_array($_groupList)) {
$this->lists['gid'] = '<input type="hidden" name="gid" value="' . $userDetails->JUser->get('gid') . '" /><strong>' . JText::_($_groupList) . '</strong>';
} else {
$this->lists['gid'] = JHTML::_('select.genericlist', $_groupList, 'gid', 'size="10"', 'value', 'text', $userDetails->JUser->get('gid'));
}
$this->lists['canBlock'] = $currentUser->authorize('com_users', 'block user') && $userDetails->JUser->get('id') != $currentUser->get('id');
// Can't block myself
$this->lists['canSetMailopt'] = $currentUser->authorize('workflow', 'email_events');
$this->lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox"', $userDetails->JUser->get('block'), 'COM_VIRTUEMART_YES', 'COM_VIRTUEMART_NO');
$this->lists['sendEmail'] = JHTML::_('select.booleanlist', 'sendEmail', 'class="inputbox"', $userDetails->JUser->get('sendEmail'), 'COM_VIRTUEMART_YES', 'COM_VIRTUEMART_NO');
$this->lists['params'] = $userDetails->JUser->getParameters(true);
// Shopper info
$this->lists['shoppergroups'] = ShopFunctions::renderShopperGroupList($userDetails->shopper_groups, true);
$this->lists['vendors'] = ShopFunctions::renderVendorList($userDetails->virtuemart_vendor_id);
$this->lists['custnumber'] = $model->getCustomerNumberById($userDetails->JUser->get('id'));
// Shipment address(es)
$this->lists['shipTo'] = ShopFunctions::generateStAddressList($this, $model, 'addST');
$new = false;
if (JRequest::getInt('new', '0') === 1) {
$new = true;
}
$virtuemart_userinfo_id_BT = $model->getBTuserinfo_id($userId);
$userFieldsArray = $model->getUserInfoInUserFields($layoutName, 'BT', $virtuemart_userinfo_id_BT, false);
$userFieldsBT = $userFieldsArray[$virtuemart_userinfo_id_BT];
//$this->lists['perms'] = JHTML::_('select.genericlist', Permissions::getUserGroups(), 'perms', '', 'group_name', 'group_name', $userDetails->perms);
// Load the required scripts
if (count($userFieldsBT['scripts']) > 0) {
foreach ($userFieldsBT['scripts'] as $_script => $_path) {
JHTML::script($_script, $_path);
}
}
// Load the required stylesheets
if (count($userFieldsBT['links']) > 0) {
foreach ($userFieldsBT['links'] as $_link => $_path) {
JHTML::stylesheet($_link, $_path);
}
}
$this->assignRef('userFieldsBT', $userFieldsBT);
$this->assignRef('userInfoID', $virtuemart_userinfo_id_BT);
//.........这里部分代码省略.........