Exemplo n.º 1
0
    function plgVmOnDisplayEdit(&$calc, &$html)
    {
        $html .= '<fieldset>
	<legend>' . vmText::_('VMCALCULATION_AVALARA') . '</legend>
	<table class="admintable">';
        $html .= VmHTML::row('checkbox', 'VMCALCULATION_AVALARA_ACTIVATED', 'activated', $calc->activated);
        $html .= VmHTML::row('input', 'VMCALCULATION_AVALARA_COMPANY_CODE', 'company_code', $calc->company_code);
        $html .= VmHTML::row('input', 'VMCALCULATION_AVALARA_ACCOUNT', 'account', $calc->account);
        $html .= VmHTML::row('input', 'VMCALCULATION_AVALARA_LICENSE', 'license', $calc->license);
        $html .= VmHTML::row('checkbox', 'VMCALCULATION_AVALARA_COMMITT', 'committ', $calc->committ);
        $html .= VmHTML::row('checkbox', 'VMCALCULATION_AVALARA_ONLYCART', 'only_cart', $calc->only_cart);
        $html .= VmHTML::row('checkbox', 'VMCALCULATION_AVALARA_ACCRUAL', 'accrual', $calc->accrual);
        $html .= VmHTML::row('checkbox', 'VMCALCULATION_AVALARA_DEV', 'dev', $calc->dev);
        $html .= VmHTML::row('checkbox', 'VMCALCULATION_AVALARA_PREVCHECKOUT_AD_INVALID', 'prevCheckoutAddInv', $calc->prevCheckoutAddInv);
        $label = 'VMCALCULATION_AVALARA_VADDRESS';
        $lang = JFactory::getLanguage();
        $label = $lang->hasKey($label . '_TIP') ? '<span class="hasTip" title="' . vmText::_($label . '_TIP') . '">' . vmText::_($label) . '</span>' : vmText::_($label);
        $html .= '
            <tr>
                <td class="key">
                    ' . $label . '
                </td>
                <td>
                    ' . shopfunctionsF::renderCountryList($calc->avatax_virtuemart_country_id, TRUE, array(), 'avatax_') . '
                </td>';
        /*   $countriesList = ShopFunctions::renderCountryList($calc->calc_countries,True);
                        $this->assignRef('countriesList', $countriesList);
                        $statesList = ShopFunctions::renderStateList($calc->virtuemart_state_ids,'', True);
                        $this->assignRef('statesList', $statesList);
        
                    $label = 'VMCALCULATION_AVALARA_VADDRESS';
                    $lang =JFactory::getLanguage();
                    $label = $lang->hasKey($label.'_TIP') ? '<span class="hasTip" title="'.vmText::_($label.'_TIP').'">'.vmText::_($label).'</span>' : cmText::_($label) ;
                 $html .= '
        			<td>
        				'.shopfunctions::renderStateList($calc->avatax_virtuemart_state_id,'avatax_',TRUE).'
        			</td> */
        $html .= '</tr>';
        //$html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_VADDRESS','vAddress',$calc->vAddress);
        //	$html .= VmHTML::row('checkbox','VMCALCULATION_ISTRAXX_AVALARA_TRACE','trace',$calc->trace);
        $html .= '</table>';
        if ($calc->activated) {
            $html .= $this->ping($calc);
        }
        $html .= vmText::_('VMCALCULATION_AVALARA_MANUAL') . '</fieldset>';
        return TRUE;
    }
Exemplo n.º 2
0
 function lUser()
 {
     $_groupList = $this->_model->getGroupList();
     if (!is_array($_groupList)) {
         $this->_lists['gid'] = '<input type="hidden" name="gid" value="' . $this->_userDetails->JUser->get('gid') . '" /><strong>' . JText::_($_groupList) . '</strong>';
     } else {
         $this->_lists['gid'] = JHTML::_('select.genericlist', $_groupList, 'gid', 'size="10"', 'value', 'text', $this->_userDetails->JUser->get('gid'));
     }
     if (!class_exists('shopFunctionsF')) {
         require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $comUserOption = shopfunctionsF::getComUserOption();
     $this->_lists['canBlock'] = $this->_currentUser->authorize($comUserOption, 'block user') && $this->_model->getId() != $this->_cuid;
     // Can't block myself TODO I broke that, please retest if it is working again
     $this->_lists['canSetMailopt'] = $this->_currentUser->authorize('workflow', 'email_events');
     $this->_lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox"', $this->_userDetails->JUser->get('block'), 'COM_VIRTUEMART_YES', 'COM_VIRTUEMART_NO');
     $this->_lists['sendEmail'] = JHTML::_('select.booleanlist', 'sendEmail', 'class="inputbox"', $this->_userDetails->JUser->get('sendEmail'), 'COM_VIRTUEMART_YES', 'COM_VIRTUEMART_NO');
     $this->_lists['params'] = $this->_userDetails->JUser->getParameters(true);
     $this->_lists['custnumber'] = $this->_model->getCustomerNumberById($this->_model->getId());
     //TODO I do not understand for what we have that by Max.
     if ($this->_model->getId() < 1) {
         $this->_lists['register_new'] = 1;
     } else {
         $this->_lists['register_new'] = 0;
     }
 }
Exemplo n.º 3
0
 * @license     GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.joomlashine.com
 * Technical Support:  Feedback - http://www.joomlashine.com/contact-us/get-support.html
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
if (!class_exists('JSNMobilizeHelper')) {
    require_once JPATH_ROOT . '/administrator/components/com_mobilize/helpers/mobilize.php';
}
$isloaded = JSNMobilizeHelper::checkVMVersion();
if ($isloaded != true) {
    if (!class_exists('shopFunctionsF')) {
        require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
    }
    $comUserOption = shopfunctionsF::getComUserOption();
}
if (empty($this->url)) {
    $uri = JFactory::getURI();
    $url = $uri->toString(array('path', 'query', 'fragment'));
} else {
    $url = $this->url;
}
$user = JFactory::getUser();
if (!isset($this->show)) {
    $this->show = true;
}
if ($this->show and $user->id == 0) {
    JHtml::_('behavior.formvalidation');
    JHTML::_('behavior.modal');
    //Extra login stuff, systems like openId and plugins HERE
Exemplo n.º 4
0
 public function display($tpl = null)
 {
     $vendorId = JRequest::getInt('vendorid', 1);
     $vendorModel = VmModel::getModel('vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     if (VmConfig::get('enable_content_plugin', 0)) {
         shopFunctionsF::triggerContentPlugin($vendor, 'vendor', 'vendor_store_desc');
         shopFunctionsF::triggerContentPlugin($vendor, 'vendor', 'vendor_terms_of_service');
     }
     $this->assignRef('vendor', $vendor);
     if (!VmConfig::get('shop_is_offline', 0)) {
         $categoryModel = VmModel::getModel('category');
         $productModel = VmModel::getModel('product');
         $products = array();
         $categoryId = JRequest::getInt('catid', 0);
         $categoryChildren = $categoryModel->getChildCategoryList($vendorId, $categoryId);
         $categoryModel->addImages($categoryChildren, 1);
         $this->assignRef('categories', $categoryChildren);
         if (!class_exists('CurrencyDisplay')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
         }
         $currency = CurrencyDisplay::getInstance();
         $this->assignRef('currency', $currency);
         $products_per_row = VmConfig::get('homepage_products_per_row', 3);
         $featured_products_rows = VmConfig::get('featured_products_rows', 1);
         $featured_products_count = $products_per_row * $featured_products_rows;
         if (!empty($featured_products_count) and VmConfig::get('show_featured', 1)) {
             $products['featured'] = $productModel->getProductListing('featured', $featured_products_count);
             $productModel->addImages($products['featured'], 1);
         }
         $latest_products_rows = VmConfig::get('latest_products_rows');
         $latest_products_count = $products_per_row * $latest_products_rows;
         if (!empty($latest_products_count) and VmConfig::get('show_latest', 1)) {
             $products['latest'] = $productModel->getProductListing('latest', $latest_products_count);
             $productModel->addImages($products['latest'], 1);
         }
         $topTen_products_rows = VmConfig::get('topTen_products_rows');
         $topTen_products_count = $products_per_row * $topTen_products_rows;
         if (!empty($topTen_products_count) and VmConfig::get('show_topTen', 1)) {
             $products['topten'] = $productModel->getProductListing('topten', $topTen_products_count);
             $productModel->addImages($products['topten'], 1);
         }
         $recent_products_rows = VmConfig::get('recent_products_rows');
         $recent_products_count = $products_per_row * $recent_products_rows;
         $recent_products = $productModel->getProductListing('recent');
         if (!empty($recent_products_count) and VmConfig::get('show_recent', 1) and !empty($recent_products)) {
             $products['recent'] = $productModel->getProductListing('recent', $recent_products_count);
             $productModel->addImages($products['recent'], 1);
         }
         $this->assignRef('products', $products);
         if (!class_exists('Permissions')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
         }
         $showBasePrice = Permissions::getInstance()->check('admin');
         //todo add config settings
         $this->assignRef('showBasePrice', $showBasePrice);
         //		$layoutName = VmConfig::get('vmlayout','default');
         $layout = VmConfig::get('vmlayout', 'default');
         $this->setLayout($layout);
     } else {
         $this->setLayout('off_line');
     }
     # Set the titles
     $document = JFactory::getDocument();
     // Add feed links
     if ($products && (VmConfig::get('feed_featured_published', 0) == 1 or VmConfig::get('feed_topten_published', 0) == 1 or VmConfig::get('feed_latest_published', 0) == 1)) {
         $link = '&format=feed&limitstart=';
         $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
         $document->addHeadLink(JRoute::_($link . '&type=rss', FALSE), 'alternate', 'rel', $attribs);
         $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
         $document->addHeadLink(JRoute::_($link . '&type=atom', FALSE), 'alternate', 'rel', $attribs);
     }
     $error = JRequest::getInt('error', 0);
     //Todo this may not work everytime as expected, because the error must be set in the redirect links.
     if (!empty($error)) {
         $document->setTitle(JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND') . JText::sprintf('COM_VIRTUEMART_HOME', $vendor->vendor_store_name));
     } else {
         if (empty($vendor->customtitle)) {
             $app = JFactory::getApplication();
             $menus = $app->getMenu();
             $menu = $menus->getActive();
             if ($menu) {
                 $menuTitle = $menu->params->get('page_title');
                 if (empty($menuTitle)) {
                     $menuTitle = JText::sprintf('COM_VIRTUEMART_HOME', $vendor->vendor_store_name);
                 }
                 $document->setTitle($menuTitle);
             } else {
                 $title = JText::sprintf('COM_VIRTUEMART_HOME', $vendor->vendor_store_name);
                 $document->setTitle($title);
             }
         } else {
             $document->setTitle($vendor->customtitle);
         }
         if (!empty($vendor->metadesc)) {
             $document->setMetaData('description', $vendor->metadesc);
         }
         if (!empty($vendor->metakey)) {
             $document->setMetaData('keywords', $vendor->metakey);
         }
         if (!empty($vendor->metarobot)) {
             $document->setMetaData('robots', $vendor->metarobot);
         }
         if (!empty($vendor->metaauthor)) {
             $document->setMetaData('author', $vendor->metaauthor);
         }
     }
     $template = VmConfig::get('vmtemplate', 'default');
     shopfunctionsF::setTemplate($template);
     parent::display($tpl);
 }