예제 #1
0
 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);
 }
예제 #2
0
 function display($tpl = null)
 {
     // Load the helper(s)
     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);
     if ($layoutName == 'edit') {
         //For shoppergroup specific price display
         VmConfig::loadJLang('com_virtuemart_config');
         VmConfig::loadJLang('com_virtuemart_shoppers', true);
         $shoppergroup = $model->getShopperGroup();
         $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
         $vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id);
         $this->assignRef('vendorList', $vendors);
         $this->assignRef('shoppergroup', $shoppergroup);
         $this->addStandardEditViewCommands();
     } else {
         $this->SetViewTitle();
         $showVendors = $this->showVendors();
         $this->assignRef('showVendors', $showVendors);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $shoppergroups = $model->getShopperGroups(false, true);
         $this->assignRef('shoppergroups', $shoppergroups);
         $pagination = $model->getPagination();
         $this->assignRef('sgrppagination', $pagination);
     }
     parent::display($tpl);
 }
예제 #3
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     // 		$this->assignRef('perms', Permissions::getInstance());
     $model = VmModel::getModel();
     $layoutName = JRequest::getWord('layout', 'default');
     if ($layoutName == 'edit') {
         $shoppergroup = $model->getShopperGroup();
         $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
         $vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id);
         $this->assignRef('vendorList', $vendors);
         $this->assignRef('shoppergroup', $shoppergroup);
         $this->addStandardEditViewCommands();
     } else {
         $this->SetViewTitle();
         JToolBarHelper::makeDefault();
         $this->loadHelper('permissions');
         $showVendors = Permissions::getInstance()->check('admin');
         $this->assignRef('showVendors', $showVendors);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $shoppergroups = $model->getShopperGroups(false, true);
         $this->assignRef('shoppergroups', $shoppergroups);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
예제 #4
0
 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('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('vmPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
     }
     $this->assignRef('perms', Permissions::getInstance());
     $model = VmModel::getModel('paymentmethod');
     //@todo should be depended by loggedVendor
     //		$vendorId=1;
     //		$this->assignRef('vendorId', $vendorId);
     // TODO logo
     $this->SetViewTitle();
     $layoutName = JRequest::getWord('layout', 'default');
     $vendorModel = VmModel::getModel('vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $currencyModel = VmModel::getModel('currency');
     $currencyModel = $currencyModel->getCurrency($vendor->vendor_currency);
     $this->assignRef('vendor_currency', $currencyModel->currency_symbol);
     if ($layoutName == 'edit') {
         // Load the helper(s)
         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';
         }
         $payment = $model->getPayment();
         $this->assignRef('payment', $payment);
         $this->assignRef('vmPPaymentList', self::renderInstalledPaymentPlugins($payment->payment_jplugin_id));
         //			$this->assignRef('PaymentTypeList',self::renderPaymentRadioList($paym->payment_type));
         //			$this->assignRef('creditCardList',self::renderCreditCardRadioList($paym->payment_creditcards));
         //			echo 'humpf <pre>'.print_r($paym).'</pre>' ;
         //$this->assignRef('creditCardList',ShopFunctions::renderCreditCardList($paym->payment_creditcards,true));
         $this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($payment->virtuemart_shoppergroup_ids, true));
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($payment->virtuemart_vendor_id);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->addStandardEditViewCommands($payment->virtuemart_paymentmethod_id);
     } else {
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $payments = $model->getPayments();
         $this->assignRef('payments', $payments);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
예제 #5
0
 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)
 {
     // Load the helper(s)
     $this->loadHelper('permissions');
     $this->loadHelper('html');
     if (!class_exists('vmPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
     }
     $this->perms = Permissions::getInstance();
     $model = VmModel::getModel('paymentmethod');
     //@todo should be depended by loggedVendor
     //		$vendorId=1;
     //		$this->assignRef('vendorId', $vendorId);
     $vendorModel = VmModel::getModel('vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $currencyModel = VmModel::getModel('currency');
     $currencyModel->setId($vendor->vendor_currency);
     $currency = $currencyModel->getData();
     $this->vendor_currency = $currency->currency_symbol;
     $layoutName = JRequest::getWord('layout', 'default');
     if ($layoutName == 'edit') {
         // Load the helper(s)
         $this->loadHelper('image');
         // jimport('joomla.html.pane');
         $this->payment = $model->getPayment();
         // $this->vmPPaymentList = self::InstalledPaymentPlgSelectList($payment->payment_jplugin_id);
         //			$this->assignRef('PaymentTypeList',self::renderPaymentRadioList($paym->payment_type));
         //			$this->assignRef('creditCardList',self::renderCreditCardRadioList($paym->payment_creditcards));
         //			echo 'humpf <pre>'.print_r($paym).'</pre>' ;
         //$this->assignRef('creditCardList',ShopFunctions::renderCreditCardList($paym->payment_creditcards,true));
         $this->shopperGroupList = ShopFunctions::renderShopperGroupList($this->payment->virtuemart_shoppergroup_ids, true);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $this->vendorList = ShopFunctions::renderVendorList($this->payment->virtuemart_vendor_id);
         }
         // TODO logo
         $this->SetViewTitle('', $this->payment->payment_name);
         $this->addStandardEditViewCommands($this->payment->virtuemart_paymentmethod_id);
     } else {
         if (JRequest::getWord('format', '') === 'raw') {
             $tpl = 'results';
         } else {
             $this->SetViewTitle();
             $this->addStandardDefaultViewCommands();
             // know payment list
             $this->installedPayments = $this->PaymentPlgList();
         }
         $this->addStandardDefaultViewLists($model);
         $this->payments = $model->getPayments();
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
     if ($tpl === 'results') {
         echo $this->AjaxScripts();
     }
 }
예제 #7
0
 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);
 }
 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();
     }
 }
예제 #9
0
 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);
 }
 function display($tpl = null)
 {
     // Load the helper(s)
     $this->loadHelper('html');
     $model = VmModel::getModel();
     $layoutName = $this->getLayout();
     $this->task = JRequest::getWord('task', $layoutName);
     if ($layoutName == 'edit') {
         $this->perms = Permissions::getInstance();
         VmConfig::loadJLang('com_virtuemart_config');
         $shoppergroup = $model->getShopperGroup();
         $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $this->vendorList = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id, false);
         }
         $this->shoppergroup = $shoppergroup;
         $this->addStandardEditViewCommands();
     } else {
         if (JRequest::getWord('format', '') === 'raw') {
             $tpl = 'results';
         } else {
             $this->SetViewTitle();
             JToolBarHelper::makeDefault();
             $this->addStandardDefaultViewCommands();
         }
         $this->addStandardDefaultViewLists($model);
         $this->loadHelper('permissions');
         $this->showVendors = Permissions::getInstance()->check('admin');
         $this->shoppergroups = $model->getShopperGroups(false, true);
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
     if ($tpl === 'results') {
         echo $this->AjaxScripts();
     }
 }
예제 #11
0
 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel('calc');
     if (!class_exists('Permissions')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
     }
     $perms = Permissions::getInstance();
     $this->assignRef('perms', $perms);
     //@todo should be depended by loggedVendor
     $vendorId = 1;
     $this->assignRef('vendorId', $vendorId);
     $db = JFactory::getDBO();
     $this->SetViewTitle();
     $layoutName = JRequest::getWord('layout', 'default');
     if ($layoutName == 'edit') {
         $calc = $model->getCalc();
         $this->assignRef('calc', $calc);
         $isNew = $calc->virtuemart_calc_id < 1;
         if ($isNew) {
             $db = JFactory::getDBO();
             //get default currency of the vendor, if not set get default of the shop
             $q = 'SELECT `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "' . $vendorId . '"';
             $db->setQuery($q);
             $currency = $db->loadResult();
             if (empty($currency)) {
                 $q = 'SELECT `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "1" ';
                 $db->setQuery($q);
                 $currency = $db->loadResult();
                 $calc->calc_currency = $currency;
             } else {
                 $calc->calc_currency = $currency;
             }
         }
         $entryPointsList = self::renderEntryPointsList($calc->calc_kind);
         $this->assignRef('entryPointsList', $entryPointsList);
         $mathOpList = self::renderMathOpList($calc->calc_value_mathop);
         $this->assignRef('mathOpList', $mathOpList);
         /* Get the category tree */
         $categoryTree = null;
         if (isset($calc->calc_categories)) {
             $calc_categories = $calc->calc_categories;
             $categoryTree = ShopFunctions::categoryListTree($calc_categories);
         } else {
             $categoryTree = ShopFunctions::categoryListTree();
         }
         $this->assignRef('categoryTree', $categoryTree);
         $currencyModel = VmModel::getModel('currency');
         $_currencies = $currencyModel->getCurrencies();
         $this->assignRef('currencies', $_currencies);
         /* Get the shoppergroup tree */
         $shopperGroupList = ShopFunctions::renderShopperGroupList($calc->virtuemart_shoppergroup_ids, True);
         $this->assignRef('shopperGroupList', $shopperGroupList);
         $countriesList = ShopFunctions::renderCountryList($calc->calc_countries, True);
         $this->assignRef('countriesList', $countriesList);
         $statesList = ShopFunctions::renderStateList($calc->virtuemart_state_ids, '', True);
         $this->assignRef('statesList', $statesList);
         $manufacturerList = ShopFunctions::renderManufacturerList($calc->virtuemart_manufacturers, true);
         $this->assignRef('manufacturerList', $manufacturerList);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($calc->virtuemart_vendor_id, false);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->addStandardEditViewCommands();
     } else {
         JToolBarHelper::custom('toggle.calc_shopper_published.0', 'unpublish', 'no', JText::_('COM_VIRTUEMART_CALC_SHOPPER_PUBLISH_TOGGLE_OFF'), true);
         JToolBarHelper::custom('toggle.calc_shopper_published.1', 'publish', 'yes', JText::_('COM_VIRTUEMART_CALC_SHOPPER_PUBLISH_TOGGLE_ON'), true);
         JToolBarHelper::custom('toggle.calc_vendor_published.0', 'unpublish', 'no', JText::_('COM_VIRTUEMART_CALC_VENDOR_PUBLISH_TOGGLE_OFF'), true);
         JToolBarHelper::custom('toggle.calc_vendor_published.1', 'publish', 'yes', JText::_('COM_VIRTUEMART_CALC_VENDOR_PUBLISH_TOGGLE_ON'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $search = JRequest::getWord('search', false);
         $calcs = $model->getCalcs(false, false, $search);
         $this->assignRef('calcs', $calcs);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
예제 #12
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);
 }
 function display($tpl = null)
 {
     VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
     // Load the helper(s)
     $this->loadHelper('html');
     $layoutName = JRequest::getWord('layout');
     $model = VmModel::getModel();
     // The list of fields which can't be toggled
     //$lists['coreFields']= array( 'name','username', 'email', 'password', 'password2' );
     $lists['coreFields'] = $model->getCoreFields();
     if ($layoutName == 'edit') {
         $editor = JFactory::getEditor();
         $userField = $model->getUserfield();
         $this->SetViewTitle('USERFIELD', $userField->name);
         $this->userFieldPlugin = '';
         if ($userField->virtuemart_userfield_id < 1) {
             // Insert new userfield
             $this->assignRef('ordering', JText::_('COM_VIRTUEMART_NEW_ITEMS_PLACE'));
             $userFieldValues = array();
             $attribs = '';
             $lists['type'] = JHTML::_('select.genericlist', $this->_getTypes(), 'type', $attribs, 'type', 'text', $userField->type);
         } else {
             // Update existing userfield
             // Ordering dropdown
             $qry = 'SELECT ordering AS value, name AS text' . ' FROM #__virtuemart_userfields' . ' ORDER BY ordering';
             // $ordering = JHTML::_('list.specificordering',  $userField, $userField->virtuemart_userfield_id, $qry);
             $ordering = JHtmlList::ordering('ordering', $qry, '', $userField->virtuemart_userfield_id, 0);
             $this->assignRef('ordering', $ordering);
             $userFieldValues = $model->getUserfieldValues();
             $lists['type'] = $this->_getTypes($userField->type) . '<input id="type" type="hidden" name="type" value="' . $userField->type . '" />';
             if (strpos($userField->type, 'plugin') !== false) {
                 $this->userFieldPlugin = self::renderUserfieldPlugin(substr($userField->type, 6), $userField);
             }
         }
         JToolBarHelper::divider();
         JToolBarHelper::save();
         JToolBarHelper::apply();
         JToolBarHelper::cancel();
         $notoggle = in_array($userField->name, $lists['coreFields']) ? 'class="readonly"' : '';
         // Vendor selection
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $lists['vendors'] = ShopFunctions::renderVendorList($userField->virtuemart_vendor_id);
         }
         // 			$vendor_model = VmModel::getModel('vendor');
         // 			$vendor_list = $vendor_model->getVendors();
         // 			$lists['vendors'] = JHTML::_('select.genericlist', $vendor_list, 'virtuemart_vendor_id', '', 'virtuemart_vendor_id', 'vendor_name', $userField->virtuemart_vendor_id);
         // Shopper groups for EU VAT Id
         $shoppergroup_model = VmModel::getModel('shoppergroup');
         $shoppergroup_list = $shoppergroup_model->getShopperGroups(true);
         array_unshift($shoppergroup_list, '0');
         $lists['shoppergroups'] = JHTML::_('select.genericlist', $shoppergroup_list, 'virtuemart_shoppergroup_id', '', 'virtuemart_shoppergroup_id', 'shopper_group_name', $model->_params->get('virtuemart_shoppergroup_id'));
         // Minimum age select
         $ages = array();
         for ($i = 13; $i <= 25; $i++) {
             $ages[] = array('key' => $i, 'value' => $i . ' ' . JText::_('COM_VIRTUEMART_YEAR_S'));
         }
         $lists['minimum_age'] = JHTML::_('select.genericlist', $ages, 'minimum_age', '', 'key', 'value', $model->_params->get('minimum_age', 18));
         // Web address types
         $webaddress_types = array(array('key' => 0, 'value' => JText::_('COM_VIRTUEMART_USERFIELDS_URL_ONLY')), array('key' => 2, 'value' => JText::_('COM_VIRTUEMART_USERFIELDS_HYPERTEXT_URL')));
         $lists['webaddresstypes'] = JHTML::_('select.genericlist', $webaddress_types, 'webaddresstype', '', 'key', 'value', $model->_params->get('webaddresstype'));
         // Userfield values
         if (($n = count($userFieldValues)) < 1) {
             $lists['userfield_values'] = '<tr>' . '<td><input type="text" value="" name="vValues[0]" /></td>' . '<td><input type="text" size="50" value="" name="vNames[0]" /></td>' . '</tr>';
             $i = 1;
         } else {
             $lists['userfield_values'] = '';
             $lang = JFactory::getLanguage();
             for ($i = 0; $i < $n; $i++) {
                 $translate = $lang->hasKey($userFieldValues[$i]->fieldtitle) ? " (" . JText::_($userFieldValues[$i]->fieldtitle) . ")" : "";
                 $lists['userfield_values'] .= '<tr>' . '<td><input type="text" value="' . $userFieldValues[$i]->fieldvalue . '" name="vValues[' . $i . ']" /></td>' . '<td><input type="text" size="50" value="' . $userFieldValues[$i]->fieldtitle . '" name="vNames[' . $i . ']"   />' . $translate . '<input type="button" class="button deleteRow" value=" - " /></td>' . '</tr>';
             }
         }
         $this->assignRef('valueCount', --$i);
         // 			vmdebug('$userField->shipment',$userField);
         // Toggles
         $lists['required'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_REQUIRED', 'required', $userField->required, $notoggle);
         $lists['published'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_PUBLISHED', 'published', $userField->published, $notoggle);
         $lists['registration'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_REGISTRATION', 'registration', $userField->registration, $notoggle);
         $lists['shipment'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_SHIPPING', 'shipment', $userField->shipment, $notoggle);
         $lists['account'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_ACCOUNT', 'account', $userField->account, $notoggle);
         $lists['readonly'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_USERFIELDS_READONLY', 'readonly', $userField->readonly, $notoggle);
         $this->lists = $lists;
         $this->userField = $userField;
         $this->userFieldValues = $userFieldValues;
         $this->editor = $editor;
     } else {
         if (JRequest::getWord('format', '') === 'raw') {
             $tpl = 'results';
         } else {
             JToolBarHelper::title(JText::_('COM_VIRTUEMART_MANAGE_USER_FIELDS'));
             JToolBarHelper::custom('toggle.registration.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_REGISTRATION');
             JToolBarHelper::custom('toggle.registration.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_REGISTRATION');
             JToolBarHelper::custom('toggle.shipment.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_SHIPPING');
             JToolBarHelper::custom('toggle.shipment.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_SHIPPING');
             JToolBarHelper::custom('toggle.account.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ACCOUNT');
             JToolBarHelper::custom('toggle.account.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_ACCOUNT');
             JToolBarHelper::divider();
             // JToolBarHelper::deleteList();
             JToolBarHelper::custom('toggle.required.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_REQUIRE');
             JToolBarHelper::custom('toggle.required.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_UNREQUIRE');
             $this->addStandardDefaultViewCommands();
         }
         $this->addStandardDefaultViewLists($model, 'ordering', 'ASC');
         $this->userfieldsList = $model->getUserfieldsList();
         $this->pagination = $model->getPagination();
     }
     $this->lists['coreFields'] = $lists['coreFields'];
     parent::display($tpl);
     if ($tpl === 'results') {
         echo $this->AjaxScripts();
     }
 }
예제 #14
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel();
     $currentUser = JFactory::getUser();
     VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
     $task = vRequest::getCmd('task', 'edit');
     if ($task == 'editshop') {
         $isSuperOrVendor = VmConfig::isSuperVendor();
         if (empty($isSuperOrVendor)) {
             JFactory::getApplication()->redirect('index.php?option=com_virtuemart', vmText::_('JERROR_ALERTNOAUTHOR'), 'error');
         } else {
             if (!class_exists('VirtueMartModelVendor')) {
                 require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
             }
             $userId = VirtueMartModelVendor::getUserIdByVendorId($isSuperOrVendor);
         }
         $this->SetViewTitle('STORE');
     } else {
         if ($task == 'add') {
             $userId = 0;
         } else {
             $userId = vRequest::getVar('virtuemart_user_id', 0);
             if (is_array($userId)) {
                 $userId = $userId[0];
             }
             $this->SetViewTitle('USER');
         }
     }
     $userId = $model->setId($userId);
     //$layoutName = vRequest::getCmd('layout', 'default');
     $layoutName = $this->getLayout();
     if ($layoutName == 'edit' || $layoutName == 'edit_shipto') {
         $editor = JFactory::getEditor();
         if (!class_exists('VmImage')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
         }
         $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, 'shop_mart');
             } else {
                 $this->SetViewTitle('STORE', vmText::_('COM_VIRTUEMART_NEW_VENDOR'), 'shop_mart');
             }
             $vendorid = $userDetails->virtuemart_vendor_id;
             if ($vendorid == 1) {
                 $this->checkTCPDFinstalled();
             }
         } else {
             $vendorid = 0;
             $this->SetViewTitle('USER', $userDetails->JUser->get('name'));
         }
         $_new = $userDetails->JUser->get('id') < 1;
         $this->addStandardEditViewCommands($vendorid);
         // User details
         $_contactDetails = $model->getContactDetails();
         $this->lists['canBlock'] = $currentUser->authorise('com_users', 'block user') && $userDetails->JUser->get('id') != $currentUser->get('id');
         // Can't block myself
         $this->lists['canSetMailopt'] = $currentUser->authorise('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, 'virtuemart_shoppergroup_id');
         $this->lists['vendors'] = ShopFunctions::renderVendorList($userDetails->virtuemart_vendor_id);
         $model->setId($userDetails->JUser->get('id'));
         $this->lists['custnumber'] = $model->getCustomerNumberById();
         // Shipment address(es)
         $this->lists['shipTo'] = ShopFunctions::generateStAddressList($this, $model, 'addST');
         $new = false;
         if (vRequest::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];
         // 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);
         $addrtype = vRequest::getCmd('addrtype');
         $virtuemart_userinfo_id = 0;
         if ($layoutName == 'edit_shipto' or $task == 'addST' or $addrtype == 'ST') {
             $virtuemart_userinfo_id = vRequest::getString('virtuemart_userinfo_id', '0', '');
             $userFieldsArray = $model->getUserInfoInUserFields($layoutName, 'ST', $virtuemart_userinfo_id, false);
             if ($new) {
                 $virtuemart_userinfo_id = 0;
             } else {
             }
             $userFieldsST = $userFieldsArray[$virtuemart_userinfo_id];
             $this->assignRef('shipToFields', $userFieldsST);
             vmdebug('hm ST $virtuemart_userinfo_id', $virtuemart_userinfo_id);
         }
         $this->assignRef('shipToId', $virtuemart_userinfo_id);
         $this->assignRef('new', $new);
         if (!$_new) {
             // Check for existing orders for this user
             $orders = VmModel::getModel('orders');
             $orderList = $orders->getOrdersList($userDetails->JUser->get('id'), true);
         } else {
             $orderList = null;
         }
         if (count($orderList) > 0 || !empty($userDetails->user_is_vendor)) {
             if (!class_exists('CurrencyDisplay')) {
                 require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
             }
             $currency = CurrencyDisplay::getInstance();
             $this->assignRef('currency', $currency);
         }
         if (!empty($userDetails->user_is_vendor)) {
             $vendorM = VmModel::getModel('vendor');
             //if(empty($userDetails->vendor->vendor_currency)){
             $vendorCurrency = $vendorM->getVendorCurrency(1);
             if ($vendorCurrency) {
                 $userDetails->vendor->vendor_currency = $vendorCurrency->vendor_currency;
                 vmdebug('No vendor currency given, fallback to main vendor', $userDetails->vendor->vendor_currency);
             }
             //}
             $vendorM->setId($userDetails->virtuemart_vendor_id);
             $vendorM->addImages($userDetails->vendor);
             $this->assignRef('vendor', $userDetails->vendor);
             $currencyModel = VmModel::getModel('currency');
             $_currencies = $currencyModel->getCurrencies();
             $this->assignRef('currencies', $_currencies);
             $configModel = VmModel::getModel('config');
             $TCPDFFontsList = $configModel->getTCPDFFontsList();
             $this->assignRef('pdfFonts', $TCPDFFontsList);
         }
         $this->assignRef('userDetails', $userDetails);
         $this->assignRef('orderlist', $orderList);
         $this->assignRef('contactDetails', $_contactDetails);
         $this->assignRef('editor', $editor);
     } else {
         JToolBarHelper::divider();
         JToolBarHelper::custom('toggle.user_is_vendor.1', 'publish', '', 'COM_VIRTUEMART_USER_ISVENDOR');
         JToolBarHelper::custom('toggle.user_is_vendor.0', 'unpublish', '', 'COM_VIRTUEMART_USER_ISNOTVENDOR');
         JToolBarHelper::divider();
         JToolBarHelper::deleteList();
         JToolBarHelper::editList();
         self::showACLPref('user');
         //This is intentionally, creating new user via BE is buggy and can be done by joomla
         //JToolBarHelper::addNewX();
         $this->addStandardDefaultViewLists($model, 'ju.id');
         $userList = $model->getUserList();
         $this->assignRef('userList', $userList);
         $this->pagination = $model->getPagination();
         $shoppergroupmodel = VmModel::getModel('shopperGroup');
         $this->defaultShopperGroup = $shoppergroupmodel->getDefault(0)->shopper_group_name;
     }
     if (!empty($this->orderlist)) {
         VmConfig::loadJLang('com_virtuemart_orders', TRUE);
     }
     parent::display($tpl);
 }
예제 #15
0
 function shopper($userFields)
 {
     // Shopper info
     if (!class_exists('VirtueMartModelShopperGroup')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'shoppergroup.php';
     }
     $_shoppergroup = VirtueMartModelShopperGroup::getShoppergroupById($this->_model->getId());
     $this->_lists['shoppergroups'] = '';
     if (vmAccess::manager('user.edit')) {
         $shoppergrps = array();
         foreach ($_shoppergroup as $group) {
             $shoppergrps[] = $group['virtuemart_shoppergroup_id'];
         }
         if (!class_exists('ShopFunctions')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $this->_lists['shoppergroups'] = ShopFunctions::renderShopperGroupList($shoppergrps);
     } else {
         foreach ($_shoppergroup as $group) {
             $this->_lists['shoppergroups'] .= tsmText::_($group['shopper_group_name']) . ', ';
         }
         $this->_lists['shoppergroups'] = substr($this->_lists['shoppergroups'], 0, -2);
     }
     if (!empty($this->userDetails->virtuemart_vendor_id)) {
         if (!class_exists('ShopFunctions')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $this->_lists['vendors'] = ShopFunctions::renderVendorList($this->userDetails->virtuemart_vendor_id);
     } else {
         $this->_lists['vendors'] = tsmText::_('COM_VIRTUEMART_USER_NOT_A_VENDOR');
     }
     //todo here is something broken we use $userDetailsList->perms and $this->userDetailsList->perms and perms seems not longer to exist
     //todo we should list here the joomla ACL groups
     // Load the required scripts
     if (count($userFields['scripts']) > 0) {
         foreach ($userFields['scripts'] as $_script => $_path) {
             JHtml::script($_script, $_path);
         }
     }
     // Load the required styresheets
     if (count($userFields['links']) > 0) {
         foreach ($userFields['links'] as $_link => $_path) {
             JHtml::stylesheet($_link, $_path);
         }
     }
 }
예제 #16
0
 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('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('vmPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
     }
     if (!class_exists('vmPSPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
     }
     $perms = Permissions::getInstance();
     $this->assignRef('perms', $perms);
     $model = VmModel::getModel('paymentmethod');
     //@todo should be depended by loggedVendor
     //		$vendorId=1;
     //		$this->assignRef('vendorId', $vendorId);
     // TODO logo
     $this->SetViewTitle();
     $layoutName = JRequest::getWord('layout', 'default');
     $vendorModel = VmModel::getModel('vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $currencyModel = VmModel::getModel('currency');
     $currencyModel = $currencyModel->getCurrency($vendor->vendor_currency);
     $this->assignRef('vendor_currency', $currencyModel->currency_symbol);
     if ($layoutName == 'edit') {
         // Load the helper(s)
         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';
         }
         $payment = $model->getPayment();
         $this->assignRef('payment', $payment);
         $rInsPayPlug = self::renderInstalledPaymentPlugins($payment->payment_jplugin_id);
         $this->assignRef('vmPPaymentList', $rInsPayPlug);
         $rShGrpList = ShopFunctions::renderShopperGroupList($payment->virtuemart_shoppergroup_ids, true);
         $this->assignRef('shopperGroupList', $rShGrpList);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($payment->virtuemart_vendor_id);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->addStandardEditViewCommands($payment->virtuemart_paymentmethod_id);
     } else {
         JToolBarHelper::custom('clonepayment', 'copy', 'copy', JText::_('COM_VIRTUEMART_PAYMENT_CLONE'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $payments = $model->getPayments();
         $this->assignRef('payments', $payments);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     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();
     }
 }
예제 #18
0
파일: view.html.php 프로젝트: lenard112/cms
 function shopper($userFields)
 {
     // Shopper info
     if (!class_exists('VirtueMartModelShopperGroup')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'shoppergroup.php';
     }
     $_shoppergroup = VirtueMartModelShopperGroup::getShoppergroupById($this->_model->getId());
     $user = JFactory::getUser();
     if ($user->authorise('core.admin', 'com_virtuemart') or $user->authorise('core.manage', 'com_virtuemart')) {
         $shoppergrps = array();
         foreach ($_shoppergroup as $group) {
             $shoppergrps[] = $group['virtuemart_shoppergroup_id'];
         }
         $this->_lists['shoppergroups'] = ShopFunctions::renderShopperGroupList($shoppergrps);
         $this->_lists['vendors'] = ShopFunctions::renderVendorList($this->userDetails->virtuemart_vendor_id);
     } else {
         $this->_lists['shoppergroups'] = '';
         foreach ($_shoppergroup as $group) {
             $this->_lists['shoppergroups'] .= $group['shopper_group_name'] . ', ';
         }
         $this->_lists['shoppergroups'] = substr($this->_lists['shoppergroups'], 0, -2);
         if (!empty($this->userDetails->virtuemart_vendor_id)) {
             $this->_lists['vendors'] = $this->userDetails->virtuemart_vendor_id;
         }
         if (empty($this->_lists['vendors'])) {
             $this->_lists['vendors'] = vmText::_('COM_VIRTUEMART_USER_NOT_A_VENDOR');
             // . $_setVendor;
         }
     }
     //todo here is something broken we use $userDetailsList->perms and $this->userDetailsList->perms and perms seems not longer to exist
     //todo we should list here the joomla ACL groups
     // Load the required scripts
     if (count($userFields['scripts']) > 0) {
         foreach ($userFields['scripts'] as $_script => $_path) {
             JHtml::script($_script, $_path);
         }
     }
     // Load the required styresheets
     if (count($userFields['links']) > 0) {
         foreach ($userFields['links'] as $_link => $_path) {
             JHtml::stylesheet($_link, $_path);
         }
     }
 }
예제 #19
0
						<?php 
echo vmText::_('COM_VIRTUEMART_ORDERSTATUS') . $this->lists['state_list'];
?>
						<?php 
echo vmText::_('COM_VIRTUEMART_REPORT_INTERVAL') . $this->lists['intervals'];
?>
                        <?php 
echo vmText::_('COM_VIRTUEMART_REPORT_SET_PERIOD') . $this->lists['select_date'];
echo vmText::_('COM_VIRTUEMART_REPORT_FROM_PERIOD') . vmJsApi::jDate($this->from_period, 'from_period');
echo vmText::_('COM_VIRTUEMART_REPORT_UNTIL_PERIOD') . vmJsApi::jDate($this->until_period, 'until_period');
if (VmConfig::get('multix', 'none') != 'none') {
    $vendorId = vmConfig::isSuperVendor();
    if (vmAccess::manager('managevendors')) {
        $vendorId = vRequest::getInt('virtuemart_vendor_id', $vendorId);
    }
    echo ShopFunctions::renderVendorList($vendorId);
}
?>
                        <button class="btn btn-small" onclick="this.form.period.value='';this.form.submit();"><?php 
echo vmText::_('COM_VIRTUEMART_GO');
?>
                        </button>
                    </td>
                </tr>
            </table>
        </div>
        <div id="resultscounter">
            <?php 
echo $this->pagination->getResultsCounter();
?>
        </div>
예제 #20
0
파일: view.html.php 프로젝트: lenard112/cms
 function display($tpl = null)
 {
     // Load the helper(s)
     $this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('vmPSPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
     }
     $this->user = JFactory::getUser();
     $model = VmModel::getModel('paymentmethod');
     // TODO logo
     $this->SetViewTitle();
     $layoutName = vRequest::getCmd('layout', 'default');
     $vendorModel = VmModel::getModel('vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $currencyModel = VmModel::getModel('currency');
     $currencyModel = $currencyModel->getCurrency($vendor->vendor_currency);
     $this->assignRef('vendor_currency', $currencyModel->currency_symbol);
     if ($layoutName == 'edit') {
         // Load the helper(s)
         if (!class_exists('VmImage')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
         }
         VmConfig::loadJLang('plg_vmpsplugin', false);
         JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
         $payment = $model->getPayment();
         // Get the payment XML.
         $formFile = JPath::clean(JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . $payment->payment_element . DS . $payment->payment_element . '.xml');
         if (file_exists($formFile)) {
             $payment->form = JForm::getInstance($payment->payment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
             $payment->params = new stdClass();
             $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'paymentForm');
             $payment->params->payment_params = $payment->payment_params;
             VmTable::bindParameterable($payment->params, 'payment_params', $varsToPush);
             $payment->form->bind($payment);
         } else {
             $payment->form = null;
         }
         $this->assignRef('payment', $payment);
         $this->assignRef('vmPPaymentList', self::renderInstalledPaymentPlugins($payment->payment_jplugin_id));
         $this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($payment->virtuemart_shoppergroup_ids, true));
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($payment->virtuemart_vendor_id);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->addStandardEditViewCommands($payment->virtuemart_paymentmethod_id);
     } else {
         JToolBarHelper::custom('clonepayment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_PAYMENT_CLONE'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $this->payments = $model->getPayments();
         foreach ($this->payments as &$data) {
             // Write the first 5 shoppergroups in the list
             $data->paymShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'payment');
         }
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
예제 #21
0
 function shopper($userFields)
 {
     // Shopper info
     if (!class_exists('VirtueMartModelShopperGroup')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'shoppergroup.php';
     }
     $_shoppergroup = VirtueMartModelShopperGroup::getShoppergroupById($this->_model->getId());
     if (!class_exists('Permissions')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
     }
     if (Permissions::getInstance()->check('admin,storeadmin')) {
         $shoppergrps = array();
         foreach ($_shoppergroup as $group) {
             $shoppergrps[] = $group['virtuemart_shoppergroup_id'];
         }
         $this->_lists['shoppergroups'] = ShopFunctions::renderShopperGroupList($shoppergrps);
         $this->_lists['vendors'] = ShopFunctions::renderVendorList($this->_userDetails->virtuemart_vendor_id);
     } else {
         $this->_lists['shoppergroups'] = '';
         foreach ($_shoppergroup as $group) {
             $this->_lists['shoppergroups'] .= $group['shopper_group_name'] . ', ';
         }
         $this->_lists['shoppergroups'] = substr($this->_lists['shoppergroups'], 0, -2);
         if (!empty($this->_userDetails->virtuemart_vendor_id)) {
             $this->_lists['vendors'] = $this->_userDetails->virtuemart_vendor_id;
         }
         if (empty($this->_lists['vendors'])) {
             $this->_lists['vendors'] = JText::_('COM_VIRTUEMART_USER_NOT_A_VENDOR');
             // . $_setVendor;
         }
     }
     //todo here is something broken we use $_userDetailsList->perms and $this->_userDetailsList->perms and perms seems not longer to exist
     if (Permissions::getInstance()->check("admin,storeadmin")) {
         $this->_lists['perms'] = JHTML::_('select.genericlist', Permissions::getUserGroups(), 'perms', '', 'group_name', 'group_name', $this->_userDetails->perms);
     } else {
         if (!empty($this->_userDetails->perms)) {
             $this->_lists['perms'] = $this->_userDetails->perms;
             $_hiddenInfo = '<input type="hidden" name="perms" value = "' . $this->_lists['perms'] . '" />';
             $this->_lists['perms'] .= $_hiddenInfo;
         }
     }
     // Load the required scripts
     if (count($userFields['scripts']) > 0) {
         foreach ($userFields['scripts'] as $_script => $_path) {
             JHTML::script($_script, $_path);
         }
     }
     // Load the required styresheets
     if (count($userFields['links']) > 0) {
         foreach ($userFields['links'] as $_link => $_path) {
             JHTML::stylesheet($_link, $_path);
         }
     }
 }
예제 #22
0
 function display($tpl = null)
 {
     VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
     $option = vRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $layoutName = vRequest::getCmd('layout', 'default');
     $model = VmModel::getModel();
     // The list of fields which can't be toggled
     //$lists['coreFields']= array( 'name','username', 'email', 'password', 'password2' );
     $lists['coreFields'] = $model->getCoreFields();
     if ($layoutName == 'edit') {
         $this->editor = JFactory::getEditor();
         $this->userField = $model->getUserfield();
         //vmdebug('user plugin $this->userField',$this->userField);
         $this->SetViewTitle('USERFIELD', $this->userField->name);
         $this->assignRef('viewName', $viewName);
         $userFieldPlugin = '';
         if (!class_exists('ShopFunctions')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $this->ordering = ShopFunctions::renderOrderingList('userfields', 'name', $this->userField->ordering);
         if ($this->userField->virtuemart_userfield_id < 1) {
             // Insert new userfield
             $userFieldValues = array();
             $attribs = '';
             $lists['type'] = JHtml::_('select.genericlist', $this->_getTypes(), 'type', $attribs, 'type', 'text', $this->userField->type);
         } else {
             // Update existing userfield
             // Ordering dropdown
             $userFieldValues = $model->getUserfieldValues();
             $lists['type'] = $this->_getTypes($this->userField->type) . '<input id="type" type="hidden" name="type" value="' . $this->userField->type . '" />';
             if (strpos($this->userField->type, 'plugin') !== false) {
                 $userFieldPlugin = self::renderUserfieldPlugin(substr($this->userField->type, 6), $this->userField);
             }
         }
         $this->assignRef('userFieldPlugin', $userFieldPlugin);
         JToolBarHelper::divider();
         JToolBarHelper::save();
         JToolBarHelper::apply();
         JToolBarHelper::cancel();
         $notoggle = '';
         // (in_array($this->userField->name, $lists['coreFields']) ? 'class="readonly"' : '');
         // Vendor selection
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $lists['vendors'] = ShopFunctions::renderVendorList($this->userField->virtuemart_vendor_id);
         }
         // Shopper groups for EU VAT Id
         $shoppergroup_model = VmModel::getModel('shoppergroup');
         $shoppergroup_list = $shoppergroup_model->getShopperGroups(true);
         array_unshift($shoppergroup_list, '0');
         $lists['shoppergroups'] = JHtml::_('select.genericlist', $shoppergroup_list, 'virtuemart_shoppergroup_id', '', 'virtuemart_shoppergroup_id', 'shopper_group_name', $this->userField->get('virtuemart_shoppergroup_id'));
         // Minimum age select
         $ages = array();
         for ($i = 13; $i <= 25; $i++) {
             $ages[] = array('key' => $i, 'value' => $i . ' ' . vmText::_('COM_VIRTUEMART_YEAR_S'));
         }
         $lists['minimum_age'] = JHtml::_('select.genericlist', $ages, 'minimum_age', '', 'key', 'value', $this->userField->get('minimum_age', 18));
         // Web address types
         $webaddress_types = array(array('key' => 0, 'value' => vmText::_('COM_VIRTUEMART_USERFIELDS_URL_ONLY')), array('key' => 2, 'value' => vmText::_('COM_VIRTUEMART_USERFIELDS_HYPERTEXT_URL')));
         $lists['webaddresstypes'] = JHtml::_('select.genericlist', $webaddress_types, 'webaddresstype', '', 'key', 'value', $this->userField->get('webaddresstype'));
         // Userfield values
         if (($n = count($userFieldValues)) < 1) {
             $lists['userfield_values'] = '<tr>' . '<td><input type="text" value="" name="vValues[0]" /></td>' . '<td><input type="text" size="50" value="" name="vNames[0]" /></td>' . '</tr>';
             $i = 1;
         } else {
             $lists['userfield_values'] = '';
             $lang = JFactory::getLanguage();
             for ($i = 0; $i < $n; $i++) {
                 $translate = $lang->hasKey($userFieldValues[$i]->fieldtitle) ? " (" . vmText::_($userFieldValues[$i]->fieldtitle) . ")" : "";
                 $lists['userfield_values'] .= '<tr>' . '<td><input type="text" value="' . $userFieldValues[$i]->fieldvalue . '" name="vValues[' . $i . ']" /></td>' . '<td><input type="text" size="50" value="' . $userFieldValues[$i]->fieldtitle . '" name="vNames[' . $i . ']"   />' . $translate . '<input type="button" class="button deleteRow" value=" - " /></td>' . '</tr>';
             }
         }
         $this->valueCount = --$i;
         $userFieldTable = $model->getTable();
         $this->existingFields = '"' . implode('","', $userFieldTable->showFullColumns(0, 'Field')) . '"';
         // Toggles
         $lists['required'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_REQUIRED', 'required', $this->userField->required, $notoggle);
         $lists['published'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_PUBLISHED', 'published', $this->userField->published, $notoggle);
         $lists['cart'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_CART', 'cart', $this->userField->cart, $notoggle);
         $lists['shipment'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_SHIPPING', 'shipment', $this->userField->shipment, $notoggle);
         $lists['account'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_ACCOUNT', 'account', $this->userField->account, $notoggle);
         $lists['readonly'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_USERFIELDS_READONLY', 'readonly', $this->userField->readonly, $notoggle);
         $this->assignRef('lists', $lists);
         $this->assignRef('userFieldValues', $userFieldValues);
     } else {
         JToolBarHelper::title(vmText::_('COM_VIRTUEMART_MANAGE_USER_FIELDS'), 'vm_user_48 head');
         JToolBarHelper::addNew();
         JToolBarHelper::editList();
         JToolBarHelper::divider();
         JToolBarHelper::custom('toggle.required.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_REQUIRE');
         JToolBarHelper::custom('toggle.required.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_UNREQUIRE');
         JToolBarHelper::publishList();
         JToolBarHelper::unpublishList();
         JToolBarHelper::divider();
         $barText = vmText::_('COM_VIRTUEMART_FIELDMANAGER_SHOW_HIDE');
         $bar = JToolBar::getInstance('toolbar');
         $bar->appendButton('Separator', '"><span class="bartext">' . $barText . '</span><hr style="display: none;');
         //$bar->appendButton( 'publish', 'upload', $alt, '', 550, 400 );
         JToolBarHelper::custom('toggle.registration.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_REGISTRATION');
         JToolBarHelper::custom('toggle.registration.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_REGISTRATION');
         JToolBarHelper::custom('toggle.shipment.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_SHIPPING');
         JToolBarHelper::custom('toggle.shipment.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_SHIPPING');
         JToolBarHelper::custom('toggle.account.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ACCOUNT');
         JToolBarHelper::custom('toggle.account.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_ACCOUNT');
         JToolBarHelper::divider();
         JToolBarHelper::deleteList();
         $this->addStandardDefaultViewLists($model, 'ordering', 'ASC');
         $this->userfieldsList = $model->getUserfieldsList();
         $this->pagination = $model->getPagination();
         // search filter
         $search = $mainframe->getUserStateFromRequest($option . 'search', 'search', '', 'string');
         $search = JString::strtolower($search);
         $this->lists['search'] = $search;
     }
     $this->lists['coreFields'] = $lists['coreFields'];
     parent::display($tpl);
 }
예제 #23
0
                    <td align="left" width="100%">
						<?php 
echo vmText::_('COM_VIRTUEMART_ORDERSTATUS') . $this->lists['state_list'];
?>

						<?php 
echo vmText::_('COM_VIRTUEMART_REPORT_INTERVAL') . $this->lists['intervals'];
?>

                        <?php 
echo vmText::_('COM_VIRTUEMART_REPORT_SET_PERIOD') . $this->lists['select_date'];
echo vmText::_('COM_VIRTUEMART_REPORT_FROM_PERIOD') . vmJsApi::jDate($this->from_period, 'from_period');
echo vmText::_('COM_VIRTUEMART_REPORT_UNTIL_PERIOD') . vmJsApi::jDate($this->until_period, 'until_period');
if (VmConfig::get('multix', 'none') != 'none') {
    $vendorId = vRequest::getInt('virtuemart_vendor_id', 1);
    echo ShopFunctions::renderVendorList($vendorId, false);
}
?>

                        <button class="btn btn-small" onclick="this.form.period.value='';this.form.submit();"><?php 
echo vmText::_('COM_VIRTUEMART_GO');
?>

                        </button>
                    </td>
                </tr>
            </table>
        </div>
        <div id="resultscounter">
            <?php 
echo $this->pagination->getResultsCounter();
예제 #24
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     // Load the helper(s)
     $this->loadHelper('html');
     $layoutName = JRequest::getWord('layout', 'default');
     $model = VmModel::getModel();
     // The list of fields which can't be toggled
     //$lists['coreFields']= array( 'name','username', 'email', 'password', 'password2' );
     $lists['coreFields'] = $model->getCoreFields();
     if ($layoutName == 'edit') {
         $editor = JFactory::getEditor();
         $userField = $model->getUserfield();
         $this->SetViewTitle('USERFIELD', $userField->name);
         $this->assignRef('viewName', $viewName);
         $userFieldPlugin = '';
         if ($userField->virtuemart_userfield_id < 1) {
             // Insert new userfield
             $this->assignRef('ordering', JText::_('COM_VIRTUEMART_NEW_ITEMS_PLACE'));
             $userFieldValues = array();
             $attribs = '';
             $lists['type'] = JHTML::_('select.genericlist', $this->_getTypes(), 'type', $attribs, 'type', 'text', $userField->type);
         } else {
             // Update existing userfield
             // Ordering dropdown
             $qry = 'SELECT ordering AS value, name AS text' . ' FROM #__virtuemart_userfields' . ' ORDER BY ordering';
             $ordering = JHTML::_('list.specificordering', $userField, $userField->virtuemart_userfield_id, $qry);
             $this->assignRef('ordering', $ordering);
             $userFieldValues = $model->getUserfieldValues();
             $lists['type'] = $this->_getTypes($userField->type) . '<input id="type" type="hidden" name="type" value="' . $userField->type . '" />';
             if (strpos($userField->type, 'plugin') !== false) {
                 $userFieldPlugin = self::renderUserfieldPlugin(substr($userField->type, 6), $userField);
             }
         }
         $this->assignRef('userFieldPlugin', $userFieldPlugin);
         JToolBarHelper::divider();
         JToolBarHelper::save();
         JToolBarHelper::apply();
         JToolBarHelper::cancel();
         $notoggle = in_array($userField->name, $lists['coreFields']) ? 'class="readonly"' : '';
         // Vendor selection
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $lists['vendors'] = ShopFunctions::renderVendorList($userField->virtuemart_vendor_id);
         }
         // 			$vendor_model = VmModel::getModel('vendor');
         // 			$vendor_list = $vendor_model->getVendors();
         // 			$lists['vendors'] = JHTML::_('select.genericlist', $vendor_list, 'virtuemart_vendor_id', '', 'virtuemart_vendor_id', 'vendor_name', $userField->virtuemart_vendor_id);
         // Shopper groups for EU VAT Id
         $shoppergroup_model = VmModel::getModel('shoppergroup');
         $shoppergroup_list = $shoppergroup_model->getShopperGroups(true);
         array_unshift($shoppergroup_list, '0');
         $lists['shoppergroups'] = JHTML::_('select.genericlist', $shoppergroup_list, 'virtuemart_shoppergroup_id', '', 'virtuemart_shoppergroup_id', 'shopper_group_name', $model->_params->get('virtuemart_shoppergroup_id'));
         // Minimum age select
         $ages = array();
         for ($i = 13; $i <= 25; $i++) {
             $ages[] = array('key' => $i, 'value' => $i . ' ' . JText::_('COM_VIRTUEMART_YEAR_S'));
         }
         $lists['minimum_age'] = JHTML::_('select.genericlist', $ages, 'minimum_age', '', 'key', 'value', $model->_params->get('minimum_age', 18));
         // Web address types
         $webaddress_types = array(array('key' => 0, 'value' => JText::_('COM_VIRTUEMART_USERFIELDS_URL_ONLY')), array('key' => 2, 'value' => JText::_('COM_VIRTUEMART_USERFIELDS_HYPERTEXT_URL')));
         $lists['webaddresstypes'] = JHTML::_('select.genericlist', $webaddress_types, 'webaddresstype', '', 'key', 'value', $model->_params->get('webaddresstype'));
         // Userfield values
         if (($n = count($userFieldValues)) < 1) {
             $lists['userfield_values'] = '<tr>' . '<td><input type="text" value="" name="vNames[0]" /></td>' . '<td><input type="text" value="" name="vValues[0]" /></td>' . '</tr>';
             $i = 1;
         } else {
             $lists['userfield_values'] = '';
             for ($i = 0; $i < $n; $i++) {
                 $lists['userfield_values'] .= '<tr>' . '<td><input type="text" value="' . $userFieldValues[$i]->fieldtitle . '" name="vNames[' . $i . ']" readonly="readonly"  class="readonly"/></td>' . '<td><input type="text" value="' . $userFieldValues[$i]->fieldvalue . '" name="vValues[' . $i . ']" /></td>' . '</tr>';
             }
         }
         $this->assignRef('valueCount', --$i);
         // 			vmdebug('$userField->shipment',$userField);
         // Toggles
         $lists['required'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_REQUIRED', 'required', $userField->required, $notoggle);
         $lists['published'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_PUBLISH', 'published', $userField->published, $notoggle);
         $lists['registration'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_REGISTRATION', 'registration', $userField->registration, $notoggle);
         $lists['shipment'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_SHIPPING', 'shipment', $userField->shipment, $notoggle);
         $lists['account'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_ACCOUNT', 'account', $userField->account, $notoggle);
         $lists['readonly'] = VmHTML::row('booleanlist', 'COM_VIRTUEMART_USERFIELDS_READONLY', 'readonly', $userField->readonly, $notoggle);
         $this->assignRef('lists', $lists);
         $this->assignRef('userField', $userField);
         $this->assignRef('userFieldValues', $userFieldValues);
         $this->assignRef('editor', $editor);
     } else {
         JToolBarHelper::title(JText::_('COM_VIRTUEMART_MANAGE_USER_FIELDS'));
         JToolBarHelper::addNewX();
         JToolBarHelper::editListX();
         JToolBarHelper::divider();
         JToolBarHelper::custom('toggle.required.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_REQUIRE');
         JToolBarHelper::custom('toggle.required.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_UNREQUIRE');
         JToolBarHelper::publishList();
         JToolBarHelper::unpublishList();
         JToolBarHelper::divider();
         $barText = JText::_('COM_VIRTUEMART_FIELDMANAGER_SHOW_HIDE');
         $bar =& JToolBar::getInstance('toolbar');
         $bar->appendButton('Separator', '"><span class="bartext">' . $barText . '</span><hr style="display: none;');
         //$bar->appendButton( 'publish', 'upload', $alt, '', 550, 400 );
         JToolBarHelper::custom('toggle.registration.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_REGISTRATION');
         JToolBarHelper::custom('toggle.registration.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_REGISTRATION');
         JToolBarHelper::custom('toggle.shipment.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_SHIPPING');
         JToolBarHelper::custom('toggle.shipment.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_SHIPPING');
         JToolBarHelper::custom('toggle.account.1', 'publish', '', 'COM_VIRTUEMART_FIELDMANAGER_SHOW_ACCOUNT');
         JToolBarHelper::custom('toggle.account.0', 'unpublish', '', 'COM_VIRTUEMART_FIELDMANAGER_HIDE_ACCOUNT');
         JToolBarHelper::divider();
         JToolBarHelper::deleteList();
         $this->addStandardDefaultViewLists($model);
         $userfieldsList = $model->getUserfieldsList();
         $this->assignRef('userfieldsList', $userfieldsList);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
         // search filter
         $search = $mainframe->getUserStateFromRequest($option . 'search', 'search', '', 'string');
         $search = JString::strtolower($search);
         $this->lists['search'] = $search;
     }
     $this->lists['coreFields'] = $lists['coreFields'];
     parent::display($tpl);
 }
예제 #25
0
 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);
         $virtuemart_userinfo_id = JRequest::getString('virtuemart_userinfo_id', '0', '');
         $userFieldsArray = $model->getUserInfoInUserFields($layoutName, 'ST', $virtuemart_userinfo_id, false);
         if ($new) {
             $virtuemart_userinfo_id = 0;
             // 				$userFieldsST = $userFieldsArray[$virtuemart_userinfo_id];
         } else {
             // 				$userFieldsST = $userFieldsArray[$virtuemart_userinfo_id];
             // 				if(empty($virtuemart_userinfo_id)){
             // 					$virtuemart_userinfo_id = $model->getBTuserinfo_id();
             // 				}
         }
         $userFieldsST = $userFieldsArray[$virtuemart_userinfo_id];
         $this->assignRef('shipToFields', $userFieldsST);
         $this->assignRef('shipToId', $virtuemart_userinfo_id);
         $this->assignRef('new', $new);
         if (!$_new) {
             // Check for existing orders for this user
             $orders = VmModel::getModel('orders');
             $orderList = $orders->getOrdersList($userDetails->JUser->get('id'), true);
         } else {
             $orderList = null;
         }
         if (count($orderList) > 0 || !empty($userDetails->user_is_vendor)) {
             if (!class_exists('CurrencyDisplay')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
             }
             $currency = CurrencyDisplay::getInstance();
             $this->assignRef('currency', $currency);
         }
         // 			vmdebug('user $userDetails ',	$userDetails 	);
         if (!empty($userDetails->user_is_vendor)) {
             $vendorModel = VmModel::getModel('vendor');
             $vendorModel->setId($userDetails->virtuemart_vendor_id);
             $vendorModel->addImages($userDetails->vendor);
             $this->assignRef('vendor', $userDetails->vendor);
             $currencyModel = VmModel::getModel('currency');
             $_currencies = $currencyModel->getCurrencies();
             $this->assignRef('currencies', $_currencies);
         }
         $this->assignRef('userDetails', $userDetails);
         $this->assignRef('orderlist', $orderList);
         $this->assignRef('contactDetails', $_contactDetails);
         $this->assignRef('editor', $editor);
     } else {
         JToolBarHelper::divider();
         JToolBarHelper::custom('toggle.user_is_vendor.1', 'publish', '', 'COM_VIRTUEMART_USER_ISVENDOR');
         JToolBarHelper::custom('toggle.user_is_vendor.0', 'unpublish', '', 'COM_VIRTUEMART_USER_ISNOTVENDOR');
         JToolBarHelper::divider();
         JToolBarHelper::deleteList();
         JToolBarHelper::editListX();
         //This is intentionally, creating new user via BE is buggy and can be done by joomla
         //JToolBarHelper::addNewX();
         $this->addStandardDefaultViewLists($model, 'ju.id');
         $userList = $model->getUserList();
         $this->assignRef('userList', $userList);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
         $shoppergroupmodel = VmModel::getModel('shopperGroup');
         $defaultShopperGroup = $shoppergroupmodel->getDefault(0)->shopper_group_name;
         $this->assignRef('defaultShopperGroup', $defaultShopperGroup);
     }
     parent::display($tpl);
 }
예제 #26
0
 function shopper($userFields)
 {
     // Shopper info
     if (!class_exists('VirtueMartModelShopperGroup')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'shoppergroup.php';
     }
     $_shoppergroup = VirtueMartModelShopperGroup::getShoppergroupById($this->_model->getId());
     if (!class_exists('Permissions')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
     }
     if (Permissions::getInstance()->check('admin,storeadmin')) {
         $shoppergrps = array();
         foreach ($_shoppergroup as $group) {
             $shoppergrps[] = $group['virtuemart_shoppergroup_id'];
         }
         $this->_lists['shoppergroups'] = ShopFunctions::renderShopperGroupList($shoppergrps);
         $this->_lists['vendors'] = ShopFunctions::renderVendorList($this->_userDetails->virtuemart_vendor_id);
     } else {
         $this->_lists['shoppergroups'] = '';
         foreach ($_shoppergroup as $group) {
             $this->_lists['shoppergroups'] .= $group['shopper_group_name'] . ', ';
         }
         $this->_lists['shoppergroups'] = substr($this->_lists['shoppergroups'], 0, -2);
         if (!empty($this->_userDetails->virtuemart_vendor_id)) {
             $this->_lists['vendors'] = $this->_userDetails->virtuemart_vendor_id;
         }
         if (empty($this->_lists['vendors'])) {
             $this->_lists['vendors'] = JText::_('COM_VIRTUEMART_USER_NOT_A_VENDOR');
             // . $_setVendor;
         }
     }
     // Load the required scripts
     if (count($userFields['scripts']) > 0) {
         foreach ($userFields['scripts'] as $_script => $_path) {
             JHTML::script($_script, $_path);
         }
     }
     // Load the required styresheets
     if (count($userFields['links']) > 0) {
         foreach ($userFields['links'] as $_link => $_path) {
             JHTML::stylesheet($_link, $_path);
         }
     }
 }
예제 #27
0
    /**
     * This displays a media handler. It displays the full and the thumb (icon) of the media.
     * It also gives a possibility to upload/change/thumbnail media
     *
     * @param string $imageArgs html atttributes, Just for displaying the fullsized image
     */
    public function displayFileHandler()
    {
        VmConfig::loadJLang('com_virtuemart_media');
        $this->addHiddenByType();
        $html = '<fieldset class="checkboxes">';
        $html .= '<legend>' . vmText::_('COM_VIRTUEMART_IMAGE_INFORMATION') . '</legend>';
        $html .= '<div class="vm__img_autocrop">';
        $imageArgs = array('id' => 'vm_display_image');
        $html .= $this->displayMediaFull($imageArgs, false, '', false) . '</div>';
        //This makes problems, when there is already a form, and there would be form in a form. breaks js in some browsers
        //		$html .= '<form name="adminForm" id="adminForm" method="post" enctype="multipart/form-data">';
        $html .= ' <table class="adminform"> ';
        if ($this->published || $this->virtuemart_media_id === 0) {
            $checked = 1;
        } else {
            $checked = 0;
        }
        $html .= '<tr>';
        //  The following was removed bacause the check box (publish/unpublish) was not functioning...
        // 			$this->media_published = $this->published;
        $html .= '<td class="labelcell" style="width:20em">
	<label for="published">' . vmText::_('COM_VIRTUEMART_FILES_FORM_FILE_PUBLISHED') . '</label>
</td>
<td>';
        if (!class_exists('VmHtml')) {
            require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
        }
        $html .= VmHtml::checkbox('media[media_published]', $checked, 1, 0, 'class="inputbox"', 'media[media_published]');
        //<input type="checkbox" class="inputbox" id="media_published'.$identify.'" name="media_published'.$identify.'" '.$checked.' size="16" value="1" />
        $html .= '</td>';
        $imgWidth = VmConfig::get('img_width', '');
        if (!empty($imgWidth)) {
            $imgWidth = 'width:' . VmConfig::get('img_width', 90) . 'px;';
        } else {
            $imgWidth = 'max-width:200px;width:auto;';
        }
        $imgHeight = VmConfig::get('img_height', '');
        if (!empty($imgHeight)) {
            $imgHeight = 'height:' . VmConfig::get('img_height', 90) . 'px;';
        } else {
            $imgHeight = '';
        }
        $html .= '<td rowspan = "8" min-width = "' . (VmConfig::get('img_width', 90) + 10) . 'px" overflow="hidden">';
        $thumbArgs = array('class' => 'vm_thumb_image', 'style' => 'overflow: auto;' . $imgWidth . $imgHeight);
        $html .= $this->displayMediaThumb($thumbArgs);
        //JHTML::image($this->file_url_thumb, 'thumbnail', 'id="vm_thumb_image" style="overflow: auto; float: right;"');
        // $html .= $this->displayMediaThumb('',false,'id="vm_thumb_image" style="overflow: auto; float: right;"');
        $html .= '</td>';
        $html .= '</tr>';
        if (vmAccess::manager('media')) {
            $readonly = 'readonly';
        } else {
            $readonly = '';
        }
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_TITLE', 'file_title');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_DESCRIPTION', 'file_description');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_META', 'file_meta');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_CLASS', 'file_class');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_URL', 'file_url', $readonly);
        //remove the file_url_thumb in case it is standard
        if (!empty($this->file_url_thumb) and is_a($this, 'VmImage')) {
            $file_url_thumb = $this->createThumbFileUrl();
            //vmdebug('my displayFileHandler ',$this,$file_url_thumb);
            if ($this->file_url_thumb == $file_url_thumb) {
                $this->file_url_thumb = vmText::sprintf('COM_VIRTUEMART_DEFAULT_URL', $file_url_thumb);
            }
        }
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_URL_THUMB', 'file_url_thumb', $readonly);
        $this->addMediaAttributesByType();
        $html .= '<tr>
				<td class="labelcell">' . vmText::_('COM_VIRTUEMART_FILES_FORM_ROLE') . '</td>
				<td><fieldset class="checkboxes">' . JHtml::_('select.radiolist', $this->getOptions($this->_mRoles), 'media[media_roles]', '', 'value', 'text', $this->media_role) . '</fieldset></td></tr>';
        // 			$html .= '<tr><td class="labelcell">'.VmHTML::checkbox('file_is_forSale', $this->file_is_forSale);
        // 			$html .= VmHTML::checkbox('file_is_downloadable', $this->file_is_downloadable);
        if (!empty($this->file_type)) {
            $html .= '<tr>
					<td class="labelcell">' . vmText::_('COM_VIRTUEMART_FILES_FORM_LOCATION') . '</td>
					<td><fieldset class="checkboxes">' . vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_' . strtoupper($this->file_type)) . '</fieldset></td></tr>';
        } else {
            $mediaattribtemp = $this->media_attributes;
            if (empty($this->media_attributes)) {
                $mediaattribtemp = 'product';
            }
            $html .= '<tr>
					<td class="labelcell">' . vmText::_('COM_VIRTUEMART_FILES_FORM_LOCATION') . '</td>
					<td><fieldset class="checkboxes">' . JHtml::_('select.radiolist', $this->getOptions($this->_mLocation), 'media[media_attributes]', '', 'value', 'text', $mediaattribtemp) . '</fieldset></td></tr>';
        }
        // select language for image
        $active_languages = VmConfig::get('active_languages');
        if (count($active_languages) > 1) {
            $selectedImageLangue = explode(",", $this->file_lang);
            $configM = VmModel::getModel('config');
            $languages = $configM->getActiveLanguages($selectedImageLangue, 'media[active_languages][]');
            $html .= '<tr>
					<td class="labelcell"><span class="hasTip" title="' . vmText::_('COM_VIRTUEMART_FILES_FORM_LANGUAGE_TIP') . '">' . vmText::_('COM_VIRTUEMART_FILES_FORM_LANGUAGE') . '</span></td>
					<td><fieldset class="inputbox">' . $languages . '</fieldset></td>
					</tr>';
        }
        if (VmConfig::get('multix', 'none') != 'none') {
            if (empty($this->virtuemart_vendor_id)) {
                $vendorId = vmAccess::isSuperVendor();
            } else {
                $vendorId = $this->virtuemart_vendor_id;
            }
            if (!class_exists('ShopFunctions')) {
                require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
            }
            $vendorList = ShopFunctions::renderVendorList($vendorId, 'media[virtuemart_vendor_id]');
            $html .= VmHTML::row('raw', 'COM_VIRTUEMART_VENDOR', $vendorList);
        }
        $html .= '</table>';
        $html .= '<br /></fieldset>';
        $this->addMediaActionByType();
        $html .= '<fieldset class="checkboxes">';
        $html .= '<legend>' . vmText::_('COM_VIRTUEMART_FILE_UPLOAD') . '</legend>';
        $html .= vmText::_('COM_VIRTUEMART_IMAGE_ACTION') . JHtml::_('select.radiolist', $this->getOptions($this->_actions), 'media[media_action]', '', 'value', 'text', 0) . '<br /><br style="clear:both" />';
        $html .= vmText::_('COM_VIRTUEMART_FILE_UPLOAD') . ' <input type="file" name="upload" id="upload" size="50" class="inputbox" /><br />';
        $html .= '<br />' . $this->displaySupportedImageTypes();
        $html .= '<br /></fieldset>';
        $html .= $this->displayFoldersWriteAble();
        $html .= $this->displayHidden();
        //		$html .= '</form>';
        return $html;
    }
예제 #28
0
 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel('calc');
     //@todo should be depended by loggedVendor
     $this->vendorId = vmAccess::getVendorId();
     $this->SetViewTitle();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $calc = $model->getCalc();
         $this->assignRef('calc', $calc);
         $isNew = $calc->virtuemart_calc_id < 1;
         if ($isNew) {
             $calc->virtuemart_vendor_id = $this->vendorId;
             $db = JFactory::getDBO();
             //get default currency of the vendor, if not set get default of the shop
             $q = 'SELECT `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "' . $this->vendorId . '"';
             $db->setQuery($q);
             $currency = $db->loadResult();
             if (empty($currency)) {
                 $q = 'SELECT `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "1" ';
                 $db->setQuery($q);
                 $currency = $db->loadResult();
                 $calc->calc_currency = $currency;
             } else {
                 $calc->calc_currency = $currency;
             }
         }
         $this->entryPointsList = self::renderEntryPointsList($calc->calc_kind);
         $this->mathOpList = self::renderMathOpList($calc->calc_value_mathop);
         if (empty($calc->calc_categories)) {
             $calc->calc_categories = array();
         } else {
             if (!is_array($calc->calc_categories)) {
                 $calc->calc_categories = array($calc->calc_categories);
             }
         }
         $calc_categories = $calc->calc_categories;
         $this->categoryTree = ShopFunctions::categoryListTree($calc_categories);
         $currencyModel = VmModel::getModel('currency');
         $this->currencies = $currencyModel->getCurrencies();
         $this->shopperGroupList = ShopFunctions::renderShopperGroupList($calc->virtuemart_shoppergroup_ids, True);
         if (!class_exists('ShopFunctionsF')) {
             require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
         }
         $this->countriesList = ShopFunctionsF::renderCountryList($calc->calc_countries, True);
         $this->statesList = ShopFunctionsF::renderStateList($calc->virtuemart_state_ids, '', True);
         $this->manufacturerList = ShopFunctions::renderManufacturerList($calc->virtuemart_manufacturers, true);
         if ($this->showVendors()) {
             $this->vendorList = ShopFunctions::renderVendorList($calc->virtuemart_vendor_id);
         }
         $this->addStandardEditViewCommands();
     } else {
         if ($this->showVendors()) {
             JToolBarHelper::custom('toggle.shared.1', 'publish', 'yes', vmText::_('COM_VIRTUEMART_SHARED_TOGGLE_ON'), true);
             JToolBarHelper::custom('toggle.shared.0', 'unpublish', 'no', vmText::_('COM_VIRTUEMART_SHARED_TOGGLE_OFF'), true);
         }
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $search = vRequest::getCmd('search', false);
         $this->calcs = $model->getCalcs(false, false, $search);
         VmConfig::loadJLang('com_virtuemart_shoppers', true);
         foreach ($this->calcs as &$data) {
             $data->calcCategoriesList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'categories', 'category_name', 'category', 'calc_categories', 'virtuemart_calc_id');
             $data->calcShoppersList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'shoppergroups', 'shopper_group_name', 'shoppergroup', 'calc_shoppergroups', 'virtuemart_calc_id');
             $data->calcCountriesList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'countries', 'country_name', 'country', 'calc_countries', 'virtuemart_calc_id');
             $data->calcStatesList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'states', 'state_name', 'states', 'calc_states', 'virtuemart_calc_id');
             $data->calcManufacturersList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'manufacturers', 'mf_name', 'manufacturer', 'calc_manufacturers', 'virtuemart_calc_id');
         }
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }