function display($tpl = null)
 {
     $this->loadHelper('html');
     $model = VmModel::getModel();
     $layoutName = $this->getLayout();
     if ($layoutName == 'edit') {
         $category = $model->getCategory('', false);
         if (isset($category->category_name)) {
             $name = $category->category_name;
         } else {
             $name = '';
         }
         $this->SetViewTitle('CATEGORY', $name);
         $model->addImages($category);
         if ($category->virtuemart_category_id > 1) {
             $relationInfo = $model->getRelationInfo($category->virtuemart_category_id);
             $this->assignRef('relationInfo', $relationInfo);
         }
         $parent = $model->getParentCategory($category->virtuemart_category_id);
         $this->assignRef('parent', $parent);
         if (!class_exists('ShopFunctions')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_CATEGORY_TEMPLATE_DEFAULT'));
         $this->assignRef('jTemplateList', $templateList);
         if (!class_exists('VirtueMartModelConfig')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'config.php';
         }
         $categoryLayoutList = VirtueMartModelConfig::getLayoutList('category');
         $this->assignRef('categoryLayouts', $categoryLayoutList);
         $productLayouts = VirtueMartModelConfig::getLayoutList('productdetails');
         $this->assignRef('productLayouts', $productLayouts);
         //Nice fix by Joe, the 4. param prevents setting an category itself as child
         $categorylist = ShopFunctions::categoryListTree(array($parent->virtuemart_category_id), 0, 0, (array) $category->virtuemart_category_id);
         $this->loadHelper('permissions');
         $perms = Permissions::getInstance();
         $this->assignRef('perms', $perms);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($category->virtuemart_vendor_id, false);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->assignRef('category', $category);
         $this->assignRef('categorylist', $categorylist);
         $this->addStandardEditViewCommands($category->virtuemart_category_id, $category);
     } else {
         $this->SetViewTitle('CATEGORY_S');
         $keyWord = '';
         $this->assignRef('model', $model);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 'category_name');
         $categories = $model->getCategoryTree(0, 0, false, $this->lists['search']);
         $this->assignRef('categories', $categories);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $this->loadHelper('image');
     $this->loadHelper('html');
     $model = VmModel::getModel();
     $usermodel = VmModel::getModel('user');
     JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
     $this->addStandardEditViewCommands();
     $config = VmConfig::loadConfig();
     if (!empty($config->_params)) {
         unset($config->_params['pdf_invoice']);
         // parameter remove and replaced by inv_os
     }
     $this->config = $config;
     $this->userparams = JComponentHelper::getParams('com_users');
     $this->jTemplateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
     $this->vmLayoutList = $model->getLayoutList('virtuemart', VmConfig::get('vmlayout', 0), 'vmlayout');
     $this->categoryLayoutList = $model->getLayoutList('category', VmConfig::get('categorylayout', 0), 'categorylayout');
     $this->productLayoutList = $model->getLayoutList('productdetails', VmConfig::get('productlayout', 0), 'productlayout');
     $this->noimagelist = $model->getNoImageList();
     $this->orderStatusModel = VmModel::getModel('orderstatus');
     $this->currConverterList = $model->getCurrencyConverterList();
     $this->moduleList = $model->getModuleList();
     $this->activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
     $this->orderByFields = $model->getProductFilterFields('browse_orderby_fields');
     $this->searchFields = $model->getProductFilterFields('browse_search_fields');
     $this->aclGroups = $usermodel->getAclGroupIndentedTree();
     if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
         $imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
     } else {
         $imagePath = '/components/com_virtuemart/assets/images/availability/';
     }
     $this->imagePath = $imagePath;
     shopFunctions::checkSafePath();
     $this->checkVmUserVendor();
     parent::display($tpl);
 }
Esempio n. 3
0
 function display($tpl = null)
 {
     if (!class_exists('VmImage')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
     }
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $usermodel = tmsModel::getModel('user');
     JToolBarHelper::title(tsmText::_('com_tsmart_CONFIG'), 'head vm_config_48');
     $this->addStandardEditViewCommands();
     $this->config = tsmConfig::loadConfig();
     if (!empty($this->config->_params)) {
         unset($this->config->_params['pdf_invoice']);
         // parameter remove and replaced by inv_os
     }
     $this->userparams = JComponentHelper::getParams('com_users');
     $this->jTemplateList = ShopFunctions::renderTemplateList(tsmText::_('com_tsmart_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
     $this->vmLayoutList = $model->getLayoutList('tsmart');
     $this->cartLayoutList = $model->getLayoutList('cart', array('padded.php', 'perror.php'));
     $this->categoryLayoutList = $model->getLayoutList('category');
     $this->productLayoutList = $model->getLayoutList('productdetails');
     $this->productsFieldList = $model->getFieldList('products');
     $this->noimagelist = $model->getNoImageList();
     $this->orderStatusModel = tmsModel::getModel('orderstatus');
     $this->os_Options = $this->osWoP_Options = $this->osDel_Options = $this->orderStatusModel->getOrderStatusNames();
     $emptyOption = JHtml::_('select.option', -1, tsmText::_('com_tsmart_NONE'), 'order_status_code', 'order_status_name');
     array_unshift($this->os_Options, $emptyOption);
     unset($this->osWoP_Options['P']);
     array_unshift($this->osWoP_Options, $emptyOption);
     $deldate_inv = JHtml::_('select.option', 'm', tsmText::_('com_tsmart_DELDATE_INV'), 'order_status_code', 'order_status_name');
     unset($this->osDel_Options['P']);
     array_unshift($this->osDel_Options, $deldate_inv);
     array_unshift($this->osDel_Options, $emptyOption);
     //vmdebug('my $this->os_Options',$this->osWoP_Options);
     $this->currConverterList = $model->getCurrencyConverterList();
     $this->activeLanguages = $model->getActiveLanguages(tsmConfig::get('active_languages'));
     $this->orderByFieldsProduct = $model->getProductFilterFields('browse_orderby_fields');
     tmsModel::getModel('category');
     foreach (tsmartModelCategory::$_validOrderingFields as $key => $field) {
         if ($field == 'c.category_shared') {
             continue;
         }
         $fieldWithoutPrefix = $field;
         $dotps = strrpos($fieldWithoutPrefix, '.');
         if ($dotps !== false) {
             $prefix = substr($field, 0, $dotps + 1);
             $fieldWithoutPrefix = substr($field, $dotps + 1);
         }
         $text = tsmText::_('com_tsmart_' . strtoupper(str_replace(array(',', ' '), array('_', ''), $fieldWithoutPrefix)));
         $orderByFieldsCat[] = JHtml::_('select.option', $field, $text);
     }
     $this->orderByFieldsCat = $orderByFieldsCat;
     $this->searchFields = $model->getProductFilterFields('browse_search_fields');
     $this->aclGroups = $usermodel->getAclGroupIndentedTree();
     if (!class_exists('VmTemplate')) {
         require VMPATH_SITE . DS . 'helpers' . DS . 'vmtemplate.php';
     }
     $this->vmtemplate = VmTemplate::loadVmTemplateStyle();
     $this->imagePath = shopFunctions::getAvailabilityIconUrl($this->vmtemplate);
     $this->listShipment = $this->listIt('shipment');
     $this->listPayment = $this->listIt('payment');
     shopFunctions::checkSafePath();
     $this->checkTCPDFinstalled();
     $this->checkVmUserVendor();
     //$this -> checkClientIP();
     parent::display($tpl);
 }
Esempio n. 4
0
 function display($tpl = null)
 {
     if (!class_exists('VirtueMartModelConfig')) {
         require VMPATH_ADMIN . 'models/config.php';
     }
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel();
     $layoutName = $this->getLayout();
     $task = vRequest::getCmd('task', $layoutName);
     $this->assignRef('task', $task);
     $this->user = $user = JFactory::getUser();
     if ($layoutName == 'edit') {
         $category = $model->getCategory('', false);
         // Toolbar
         $text = '';
         if (isset($category->category_name)) {
             $name = $category->category_name;
         } else {
             $name = '';
         }
         if (!empty($category->virtuemart_category_id)) {
             $text = '<a href="' . juri::root() . 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id . '" target="_blank" >' . $name . '<span class="vm2-modallink"></span></a>';
         }
         $this->SetViewTitle('CATEGORY', $text);
         $model->addImages($category);
         if ($category->virtuemart_category_id > 1) {
             $relationInfo = $model->getRelationInfo($category->virtuemart_category_id);
             $this->assignRef('relationInfo', $relationInfo);
         }
         $parent = $model->getParentCategory($category->virtuemart_category_id);
         $this->assignRef('parent', $parent);
         if (!class_exists('ShopFunctions')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $templateList = ShopFunctions::renderTemplateList(vmText::_('COM_VIRTUEMART_CATEGORY_TEMPLATE_DEFAULT'));
         $this->assignRef('jTemplateList', $templateList);
         $categoryLayoutList = VirtueMartModelConfig::getLayoutList('category');
         $this->assignRef('categoryLayouts', $categoryLayoutList);
         $productLayouts = VirtueMartModelConfig::getLayoutList('productdetails');
         $this->assignRef('productLayouts', $productLayouts);
         //Nice fix by Joe, the 4. param prevents setting an category itself as child
         $categorylist = ShopFunctions::categoryListTree(array($parent->virtuemart_category_id), 0, 0, (array) $category->virtuemart_category_id);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($category->virtuemart_vendor_id, false);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->assignRef('category', $category);
         $this->assignRef('categorylist', $categorylist);
         $this->addStandardEditViewCommands($category->virtuemart_category_id, $category);
     } else {
         $this->SetViewTitle('CATEGORY_S');
         $keyWord = '';
         $this->assignRef('catmodel', $model);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 'category_name');
         $categories = $model->getCategoryTree(0, 0, false, $this->lists['search']);
         $this->assignRef('categories', $categories);
         $pagination = $model->getPagination();
         $this->assignRef('catpagination', $pagination);
         //we need a function of the FE shopfunctions helper to cut the category descriptions
         if (!class_exists('shopFunctionsF')) {
             require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
         }
     }
     parent::display($tpl);
 }
Esempio n. 5
0
 function display($tpl = null)
 {
     if (!class_exists('VmImage')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
     }
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel();
     $usermodel = VmModel::getModel('user');
     JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
     $this->addStandardEditViewCommands();
     $config = VmConfig::loadConfig();
     if (!empty($config->_params)) {
         unset($config->_params['pdf_invoice']);
         // parameter remove and replaced by inv_os
     }
     $this->assignRef('config', $config);
     $mainframe = JFactory::getApplication();
     $this->assignRef('joomlaconfig', $mainframe);
     $userparams = JComponentHelper::getParams('com_users');
     $this->assignRef('userparams', $userparams);
     $templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
     $this->assignRef('jTemplateList', $templateList);
     $vmLayoutList = $model->getLayoutList('virtuemart');
     $this->assignRef('vmLayoutList', $vmLayoutList);
     $categoryLayoutList = $model->getLayoutList('category');
     $this->assignRef('categoryLayoutList', $categoryLayoutList);
     $productLayoutList = $model->getLayoutList('productdetails');
     $this->assignRef('productLayoutList', $productLayoutList);
     $noimagelist = $model->getNoImageList();
     $this->assignRef('noimagelist', $noimagelist);
     $orderStatusModel = VmModel::getModel('orderstatus');
     $this->assignRef('orderStatusModel', $orderStatusModel);
     $currConverterList = $model->getCurrencyConverterList();
     $this->assignRef('currConverterList', $currConverterList);
     $moduleList = $model->getModuleList();
     $this->assignRef('moduleList', $moduleList);
     $activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
     $this->assignRef('activeLanguages', $activeLanguages);
     $orderByFieldsProduct = $model->getProductFilterFields('browse_orderby_fields');
     $this->assignRef('orderByFieldsProduct', $orderByFieldsProduct);
     VmModel::getModel('category');
     foreach (VirtueMartModelCategory::$_validOrderingFields as $key => $field) {
         if ($field == 'c.category_shared') {
             continue;
         }
         $fieldWithoutPrefix = $field;
         $dotps = strrpos($fieldWithoutPrefix, '.');
         if ($dotps !== false) {
             $prefix = substr($field, 0, $dotps + 1);
             $fieldWithoutPrefix = substr($field, $dotps + 1);
         }
         $text = JText::_('COM_VIRTUEMART_' . strtoupper($fieldWithoutPrefix));
         $orderByFieldsCat[] = JHTML::_('select.option', $field, $text);
     }
     //$orderByFieldsCat = $model->get;
     $this->assignRef('orderByFieldsCat', $orderByFieldsCat);
     $searchFields = $model->getProductFilterFields('browse_search_fields');
     $this->assignRef('searchFields', $searchFields);
     $aclGroups = $usermodel->getAclGroupIndentedTree();
     $this->assignRef('aclGroups', $aclGroups);
     if (!class_exists('shopFunctionsF')) {
         require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $vmtemplate = shopFunctionsF::loadVmTemplateStyle();
     if (is_Dir(JPATH_ROOT . DS . 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS)) {
         $imagePath = '/templates/' . $vmtemplate . '/images/availability/';
     } else {
         $imagePath = '/components/com_virtuemart/assets/images/availability/';
     }
     $this->assignRef('imagePath', $imagePath);
     shopFunctions::checkSafePath();
     $this->checkVmUserVendor();
     parent::display($tpl);
 }
Esempio n. 6
0
 function display($tpl = null)
 {
     if (!class_exists('VmImage')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
     }
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel();
     $usermodel = VmModel::getModel('user');
     JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
     $this->addStandardEditViewCommands();
     $config = VmConfig::loadConfig();
     if (!empty($config->_params)) {
         unset($config->_params['pdf_invoice']);
         // parameter remove and replaced by inv_os
     }
     $this->assignRef('config', $config);
     $mainframe = JFactory::getApplication();
     $this->assignRef('joomlaconfig', $mainframe);
     $userparams = JComponentHelper::getParams('com_users');
     $this->assignRef('userparams', $userparams);
     $templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
     $this->assignRef('jTemplateList', $templateList);
     $vmLayoutList = $model->getLayoutList('virtuemart');
     $this->assignRef('vmLayoutList', $vmLayoutList);
     $categoryLayoutList = $model->getLayoutList('category');
     $this->assignRef('categoryLayoutList', $categoryLayoutList);
     $productLayoutList = $model->getLayoutList('productdetails');
     $this->assignRef('productLayoutList', $productLayoutList);
     $noimagelist = $model->getNoImageList();
     $this->assignRef('noimagelist', $noimagelist);
     $orderStatusModel = VmModel::getModel('orderstatus');
     $this->assignRef('orderStatusModel', $orderStatusModel);
     $currConverterList = $model->getCurrencyConverterList();
     $this->assignRef('currConverterList', $currConverterList);
     $moduleList = $model->getModuleList();
     $this->assignRef('moduleList', $moduleList);
     $activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
     $this->assignRef('activeLanguages', $activeLanguages);
     $orderByFields = $model->getProductFilterFields('browse_orderby_fields');
     $this->assignRef('orderByFields', $orderByFields);
     $searchFields = $model->getProductFilterFields('browse_search_fields');
     $this->assignRef('searchFields', $searchFields);
     $aclGroups = $usermodel->getAclGroupIndentedTree();
     $this->assignRef('aclGroups', $aclGroups);
     if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
         $imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
     } else {
         $imagePath = '/components/com_virtuemart/assets/images/availability/';
     }
     $this->assignRef('imagePath', $imagePath);
     shopFunctions::checkSafePath();
     $this->checkVmUserVendor();
     $cache = JFactory::getCache('_virtuemart');
     $cached = $cache->getCaching();
     if ($cached) {
         vmInfo('COM_VIRTUEMART_CFG_CACHE_ACTIVE');
     }
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $this->loadHelper('html');
     $this->loadHelper('permissions');
     if (!class_exists('shopFunctionsF')) {
         require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $model = VmModel::getModel();
     $layoutName = $this->getLayout();
     $task = JRequest::getWord('task', $layoutName);
     $this->task = $task;
     $this->perms = Permissions::getInstance();
     // to add in vmview ?
     $multivendor = Vmconfig::get('multix', 'none');
     $this->multiX = $multivendor !== 'none' && $multivendor != '' ? true : false;
     if ($layoutName == 'edit') {
         $this->loadHelper('shopfunctions');
         $category = $model->getCategory('', false);
         if (isset($category->category_name)) {
             $name = $category->category_name;
         } else {
             $name = '';
         }
         $this->SetViewTitle('CATEGORY', $name);
         $model->addImages($category);
         if ($category->virtuemart_category_id) {
             $this->relationInfo = $model->getRelationInfo($category->virtuemart_category_id);
         }
         $this->parent = $model->getParentCategory($category->virtuemart_category_id);
         $this->jTemplateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_CATEGORY_TEMPLATE_DEFAULT'));
         if (!class_exists('VirtueMartModelConfig')) {
             require JPATH_VM_ADMINISTRATOR . '/models' . DS . 'config.php';
         }
         $this->productLayouts = VirtueMartModelConfig::getLayoutList('productdetails', $category->category_product_layout, 'category_product_layout');
         $this->categoryLayouts = VirtueMartModelConfig::getLayoutList('category', $category->category_layout, 'categorylayout');
         // front autoset parent category
         if (!$category->virtuemart_category_id) {
             $this->parent->virtuemart_category_id = jRequest::getInt('category_parent_id', 0);
         }
         //Nice fix by Joe, the 4. param prevents setting an category itself as child
         // Note Studio42, the fix is not suffisant, you can set the category in a children and get infinit loop in router for eg.
         $this->categorylist = ShopFunctions::categoryListTree(array($this->parent->virtuemart_category_id), 0, 0, (array) $category->virtuemart_category_id);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $this->vendorList = ShopFunctions::renderVendorList($category->virtuemart_vendor_id, false);
         }
         $this->category = $category;
         $this->addStandardEditViewCommands($category->virtuemart_category_id, $category);
     } else {
         $category_id = JRequest::getInt('filter_category_id');
         if (JRequest::getWord('format', '') === 'raw') {
             $tpl = 'results';
         } else {
             $this->SetViewTitle('CATEGORY_S');
             $this->addStandardDefaultViewCommands();
             $this->categorylist = ShopFunctions::categoryListTreeLoop((array) $category_id, 0, 0);
             if ($this->multiX && $this->adminVendor == 1) {
                 JToolBarHelper::custom('toggle.shared.1', 'publish', 'yes', JText::_('COM_VIRTUEMART_SHARED'), true);
                 JToolBarHelper::custom('toggle.shared.0', 'unpublish', 'no', JText::_('COM_VIRTUEMART_SHARED'), true);
             }
         }
         $this->catmodel = $model;
         $this->addStandardDefaultViewLists($model, 'category_name');
         $this->categories = $model->getCategoryTree($category_id, 0, false, $this->lists['search']);
         $this->pagination = $model->getPagination();
         //we need a function of the FE shopfunctions helper to cut the category descriptions
         jimport('joomla.filter.output');
     }
     parent::display($tpl);
     if ($tpl === 'results') {
         echo $this->AjaxScripts();
     }
 }
 function display($tpl = null)
 {
     // Load the helper(s)
     $this->loadHelper('image');
     $this->loadHelper('html');
     $model = VmModel::getModel();
     $usermodel = VmModel::getModel('user');
     JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
     $this->addStandardEditViewCommands();
     $config = VmConfig::loadConfig();
     unset($config->_params['pdf_invoice']);
     // parameter remove and replaced by inv_os
     $this->assignRef('config', $config);
     $mainframe = JFactory::getApplication();
     $this->assignRef('joomlaconfig', $mainframe);
     $userparams = JComponentHelper::getParams('com_users');
     $this->assignRef('userparams', $userparams);
     $templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
     $this->assignRef('jTemplateList', $templateList);
     $vmLayoutList = $model->getLayoutList('virtuemart');
     $this->assignRef('vmLayoutList', $vmLayoutList);
     // Outcommented to revert rev. 2916
     //		$vendorList = ShopFunctions::renderVendorList(VmConfig::get('default_virtuemart_vendor_id'));
     //		// We must replace the fieldname and ID 'virtuemart_vendor_id' to 'default_vendor'
     //		$vendorList = preg_replace('/"virtuemart_vendor_id"/', '"default_virtuemart_vendor_id"', $vendorList);
     //		$this->assignRef('vendorList', $vendorList);
     $categoryLayoutList = $model->getLayoutList('category');
     $this->assignRef('categoryLayoutList', $categoryLayoutList);
     $productLayoutList = $model->getLayoutList('productdetails');
     $this->assignRef('productLayoutList', $productLayoutList);
     $noimagelist = $model->getNoImageList();
     $this->assignRef('noimagelist', $noimagelist);
     $orderStatusModel = VmModel::getModel('orderstatus');
     $orderStates = $orderStatusModel->getOrderStatusList();
     $orderStatusList = array();
     $orderStatusList[0] = JText::_('COM_VIRTUEMART_NONE');
     foreach ($orderStates as $orderState) {
         $orderStatusList[$orderState->order_status_code] = JText::_($orderState->order_status_name);
     }
     $this->assignRef('orderStatusList', $orderStatusList);
     /*
     		$oderstatusModel = VmModel::getModel('Orderstatus');
     		$orderStatusList = $oderstatusModel->getOrderStatusList();
     		$this->assignRef('orderStatusList', $orderStatusList);
     */
     $currConverterList = $model->getCurrencyConverterList();
     $this->assignRef('currConverterList', $currConverterList);
     $moduleList = $model->getModuleList();
     $this->assignRef('moduleList', $moduleList);
     //$contentLinks = $model->getContentLinks();
     //$this->assignRef('contentLinks', $contentLinks);
     $activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
     $this->assignRef('activeLanguages', $activeLanguages);
     $orderByFields = $model->getProductFilterFields('browse_orderby_fields');
     $this->assignRef('orderByFields', $orderByFields);
     $searchFields = $model->getProductFilterFields('browse_search_fields');
     $this->assignRef('searchFields', $searchFields);
     $aclGroups = $usermodel->getAclGroupIndentedTree();
     $this->assignRef('aclGroups', $aclGroups);
     if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
         $imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
     } else {
         $imagePath = '/components/com_virtuemart/assets/images/availability/';
     }
     $this->assignRef('imagePath', $imagePath);
     $safePath = VmConfig::get('forSale_path', 0);
     $lastIndex = strrpos(JPATH_ROOT, DS);
     $suggestedPath = substr(JPATH_ROOT, 0, $lastIndex) . DS . 'vmfiles';
     if (empty($safePath)) {
         VmWarn('COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath);
     } else {
         $exists = JFolder::exists($safePath);
         if (!$exists) {
             VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_WRONG', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath);
         }
     }
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('VmImage')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
     }
     if (!class_exists('CurrencyDisplay')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
     }
     //Load helpers
     //$this->loadHelper('currencydisplay');
     //$this->loadHelper('html');
     $configModel = VmModel::getModel('config');
     $model = VmModel::getModel();
     $shipModel = VmModel::getModel('shipmentmethod');
     $shipments = $shipModel->getShipments();
     function cmpShipments($a, $b)
     {
         return strcmp($a->virtuemart_shipmentmethod_id, $b->virtuemart_shipmentmethod_id);
     }
     usort($shipments, "cmpShipments");
     //sort, coz it comes in random order
     $this->assignRef('shipmentMethods', $shipments);
     $this->assignRef('js_path', $model->updateJSApi());
     $this->assignRef('moduleVersion', $model->checkModuleVersion());
     $this->assignRef('errors', $model->errors);
     $this->assignRef('warnings', $model->warnings);
     $paymentModel = VmModel::getModel('paymentmethod');
     $payments = $paymentModel->getPayments();
     function cmpPayments($a, $b)
     {
         return strcmp($a->virtuemart_paymentmethod_id, $b->virtuemart_paymentmethod_id);
     }
     usort($payments, "cmpPayments");
     //sort, coz it comes in random order
     $this->assignRef('paymentMethods', $payments);
     $usermodel = VmModel::getModel('user');
     $ordersModel = VmModel::getModel('zasilkovna_orders');
     $task = JRequest::getWord('task');
     if (!class_exists('vmPSPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
     }
     $orderStatusModel = VmModel::getModel('orderstatus');
     $orderStates = $orderStatusModel->getOrderStatusList();
     $this->SetViewTitle('ORDER');
     JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
     $config = VmConfig::loadConfig();
     unset($config->_params['pdf_invoice']);
     // parameter remove and replaced by inv_os
     $this->assignRef('config', $config);
     $mainframe = JFactory::getApplication();
     $this->assignRef('joomlaconfig', $mainframe);
     $userparams = JComponentHelper::getParams('com_users');
     $this->assignRef('userparams', $userparams);
     $templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
     $this->assignRef('jTemplateList', $templateList);
     $vmLayoutList = $configModel->getLayoutList('virtuemart');
     $this->assignRef('vmLayoutList', $vmLayoutList);
     $categoryLayoutList = $configModel->getLayoutList('category');
     $this->assignRef('categoryLayoutList', $categoryLayoutList);
     $productLayoutList = $configModel->getLayoutList('productdetails');
     $this->assignRef('productLayoutList', $productLayoutList);
     $noimagelist = $configModel->getNoImageList();
     $this->assignRef('noimagelist', $noimagelist);
     $orderStatusModel = VmModel::getModel('orderstatus');
     $this->assignRef('orderStatusModel', $orderStatusModel);
     $currConverterList = $configModel->getCurrencyConverterList();
     $this->assignRef('currConverterList', $currConverterList);
     $activeLanguages = $configModel->getActiveLanguages(VmConfig::get('active_languages'));
     $this->assignRef('activeLanguages', $activeLanguages);
     $orderByFields = $configModel->getProductFilterFields('browse_orderby_fields');
     $this->assignRef('orderByFields', $orderByFields);
     $searchFields = $configModel->getProductFilterFields('browse_search_fields');
     $this->assignRef('searchFields', $searchFields);
     $aclGroups = $usermodel->getAclGroupIndentedTree();
     $this->assignRef('aclGroups', $aclGroups);
     if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
         $imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
     } else {
         $imagePath = '/components/com_virtuemart/assets/images/availability/';
     }
     $this->assignRef('imagePath', $imagePath);
     $this->setLayout('orders');
     $this->addStandardDefaultViewLists($ordersModel, 'created_on');
     $this->lists['state_list'] = $this->renderOrderstatesList();
     $shipping_method_selectec_id = JRequest::getInt('order_shipment_code');
     $orderslist = $ordersModel->getOrdersListByShipment($shipping_method_selectec_id);
     $this->assignRef('orderstatuses', $orderStates);
     if (!class_exists('CurrencyDisplay')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
     }
     /* Apply currency This must be done per order since it's vendor specific */
     $_currencies = array();
     // Save the currency data during this loop for performance reasons
     if ($orderslist) {
         foreach ($orderslist as $virtuemart_order_id => $order) {
             //This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code
             if (!array_key_exists('v' . $order->virtuemart_vendor_id, $_currencies)) {
                 $_currencies['v' . $order->virtuemart_vendor_id] = CurrencyDisplay::getInstance('', $order->virtuemart_vendor_id);
             }
             $order->order_total = $_currencies['v' . $order->virtuemart_vendor_id]->priceDisplay($order->order_total);
             $order->invoiceNumber = $ordersModel->getInvoiceNumber($order->virtuemart_order_id);
         }
     }
     /*
      * UpdateStatus removed from the toolbar; don't understand how this was intented to work but
      * the order ID's aren't properly passed. Might be readded later; the controller needs to handle
      * the arguments.
      */
     /* Toolbar */
     JToolBarHelper::apply();
     JToolBarHelper::save('updateAndExportZasilkovnaOrders', 'CSV');
     $zas_model = VmModel::getModel('zasilkovna');
     $zas_model->updateJSApi();
     //to correcly show dest. branches
     $this->assignRef('media_url', $zas_model->_media_url);
     $this->assignRef('restrictionInstalled', $zas_model->isShipmentPaymentRestrictionInstalled());
     $this->assignRef('branches', $zas_model->getBranches());
     JToolBarHelper::save('submitToZasilkovna', JText::_('PLG_VMSHIPMENT_ZASILKOVNA_SUBMIT_ORDERS_TO_ZASILKOVNA'));
     JToolBarHelper::custom('printLabels', 'copy', '', JText::_('PLG_VMSHIPMENT_ZASILKOVNA_DO_PRINT_LABELS'), false, false);
     /* Assign the data */
     $this->assignRef('orderslist', $orderslist);
     $pagination = $ordersModel->getPagination();
     $this->assignRef('pagination', $pagination);
     $this->assignRef('shipmentSelect', $this->renderShipmentsList());
     $model->raiseErrors();
     parent::display($tpl);
 }