示例#1
1
 /**
  * swap the ordering of a record in the Xref tables
  * @param  $direction , 1/-1 The increment to reorder by
  */
 function move($direction, $where = '', $orderingkey = 0)
 {
     if (empty($this->_skey)) {
         vmError('No secondary keys defined in VmTableXarray ' . $this->_tbl);
         return false;
     }
     $skeyId = vRequest::getInt($this->_skey, 0);
     // Initialize variables
     $db = JFactory::getDBO();
     $cid = vRequest::getInt($this->_pkey);
     $order = vRequest::getInt('order');
     //I found now two times "order" instead of ordering.
     //This sql is broken
     $query = 'SELECT `id` FROM `' . $this->_tbl . '` WHERE ' . $this->_pkey . ' = ' . (int) $cid[0] . ' AND `tsmart_category_id` = ' . (int) $skeyId;
     $db->setQuery($query);
     $id = $db->loadResult();
     $keys = array_keys($order);
     // TODO next 2 lines not used ????
     if ($direction > 0) {
         $idToSwap = $order[$keys[array_search($id, $keys)] + 1];
     } else {
         $idToSwap = $order[$keys[array_search($id, $keys)] - 1];
     }
     if (isset($cid[0])) {
         $query = 'UPDATE `' . $this->_tbl . '` ' . ' SET `' . $this->_orderingKey . '` = `' . $this->_orderingKey . '` + ' . $direction . ' WHERE `' . $this->_pkey . '` = ' . (int) $cid[0] . ' AND `' . $this->_skey . '`  = ' . (int) $skeyId;
         $db->setQuery($query);
         if (!$db->execute()) {
             $err = $db->getErrorMsg();
             JError::raiseError(500, get_class($this) . ':: move ' . $err);
         }
     }
 }
示例#2
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->departure = $model->getdeparture();
         $this->SetViewTitle('', $this->departure->departure_name);
         $this->addStandardEditViewCommands();
     } else {
         $model_product = tmsModel::getModel('product');
         $model_tour_class = tmsModel::getModel('tourclass');
         $this->list_tour = $model_product->getProductListing(false, false, false, false);
         $this->list_tour_class = $model_tour_class->getTourClassList();
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->departures = $model->getdepartureList(vRequest::getCmd('search'));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#3
0
 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->SetViewTitle();
     $model = tmsModel::getModel();
     $this->state = $model->getItem();
     $this->tsmart_country_id = vRequest::getInt('tsmart_country_id', $this->state->tsmart_country_id);
     $isNew = count($this->state) < 1;
     if (empty($countryId) && $isNew) {
         vmWarn('Country id is 0');
         return false;
     }
     $country = tmsModel::getModel('country');
     $country->setId($this->tsmart_country_id);
     $this->country_name = $country->getData()->country_name;
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $zoneModel = tmsModel::getModel('Worldzones');
         $this->worldZones = $zoneModel->getWorldZonesSelectList();
         $this->addStandardEditViewCommands();
     } else {
         //get list country
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmcountries.php';
         $list_country = tsmcountries::get_countries();
         $this->assignRef('list_country', $list_country);
         //end get list country
         $this->addStandardDefaultViewCommandsEditInline();
         $this->addStandardDefaultViewLists($model);
         $this->items = $model->getItemList();
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#4
0
 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->vendorId = VmConfig::isSuperVendor();
     // TODO add icon for media view
     $this->SetViewTitle();
     $model = VmModel::getModel('media');
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $this->media = $model->getFile();
         $this->addStandardEditViewCommands();
     } else {
         $virtuemart_product_id = vRequest::getInt('virtuemart_product_id');
         if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
             $virtuemart_product_id = (int) $virtuemart_product_id[0];
         } else {
             $virtuemart_product_id = (int) $virtuemart_product_id;
         }
         $cat_id = vRequest::getInt('virtuemart_category_id', 0);
         JToolBarHelper::custom('synchronizeMedia', 'new', 'new', vmText::_('COM_VIRTUEMART_TOOLS_SYNC_MEDIA_FILES'), false);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, null, null, 'searchMedia');
         $options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_TYPES'), 'product' => vmText::_('COM_VIRTUEMART_PRODUCT'), 'category' => vmText::_('COM_VIRTUEMART_CATEGORY'), 'manufacturer' => vmText::_('COM_VIRTUEMART_MANUFACTURER'), 'vendor' => vmText::_('COM_VIRTUEMART_VENDOR'));
         $this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options, 1, '', 'onchange="this.form.submit();"');
         $options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_ROLES'), 'file_is_displayable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DISPLAYABLE'), 'file_is_downloadable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DOWNLOADABLE'), 'file_is_forSale' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_FORSALE'));
         $this->lists['search_role'] = VmHTML::selectList('search_role', vRequest::getVar('search_role'), $options, 1, '', 'onchange="this.form.submit();"');
         $this->files = $model->getFiles(false, false, $virtuemart_product_id, $cat_id);
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#5
0
	function display($tpl = null) {

		// Load the helper(s)


		if (!class_exists('VmHTML'))
			require(VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php');

		$this->SetViewTitle();


		$model = VmModel::getModel();

//		$stateId = vRequest::getVar('virtuemart_state_id');
//		$model->setId($stateId);
		$state = $model->getSingleState();

		$countryId = vRequest::getInt('virtuemart_country_id', 0);
		if(empty($countryId)) $countryId = $state->virtuemart_country_id;
		$this->assignRef('virtuemart_country_id',	$countryId);

        $isNew = (count($state) < 1);

		if(empty($countryId) && $isNew){
			vmWarn('Country id is 0');
			return false;
		}

		$country = VmModel::getModel('country');
		$country->setId($countryId);
		$this->assignRef('country_name', $country->getData()->country_name);


		$layoutName = vRequest::getCmd('layout', 'default');
		if ($layoutName == 'edit') {


			$this->assignRef('state', $state);

			$zoneModel = VmModel::getModel('Worldzones');
			$wzsList = $zoneModel->getWorldZonesSelectList();
			$this->assignRef('worldZones', $wzsList);

			$this->addStandardEditViewCommands();

		} else {

			$this->addStandardDefaultViewCommands();
			$this->addStandardDefaultViewLists($model);

			$states = $model->getStates($countryId);
			$this->assignRef('states',	$states);

			$pagination = $model->getPagination();
			$this->assignRef('pagination', $pagination);

		}

		parent::display($tpl);
	}
示例#6
0
 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->SetViewTitle();
     $model = VmModel::getModel();
     $this->state = $model->getSingleState();
     $this->virtuemart_country_id = vRequest::getInt('virtuemart_country_id', $this->state->virtuemart_country_id);
     $isNew = count($this->state) < 1;
     if (empty($countryId) && $isNew) {
         vmWarn('Country id is 0');
         return false;
     }
     $country = VmModel::getModel('country');
     $country->setId($this->virtuemart_country_id);
     $this->country_name = $country->getData()->country_name;
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $zoneModel = VmModel::getModel('Worldzones');
         $this->worldZones = $zoneModel->getWorldZonesSelectList();
         $this->addStandardEditViewCommands();
     } else {
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $this->states = $model->getStates($this->virtuemart_country_id);
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#7
0
	public function __construct(){

// 		JTable::addIncludePath(VMPATH_ADMIN . DS . 'tables');

		$this->_app = JFactory::getApplication();
		$this->_db = JFactory::getDBO();
		// 		$this->_oldToNew = new stdClass();
		$this->starttime = microtime(true);

		$max_execution_time = VmConfig::getExecutionTime();
		$jrmax_execution_time= vRequest::getInt('max_execution_time',300);

		if(!empty($jrmax_execution_time)){
			// 			vmdebug('$jrmax_execution_time',$jrmax_execution_time);
			if($max_execution_time!==$jrmax_execution_time) @ini_set( 'max_execution_time', $jrmax_execution_time );
		}

		$this->maxScriptTime = VmConfig::getExecutionTime() * 0.90-1;	//Lets use 10% of the execution time as reserve to store the progress

		VmConfig::ensureMemoryLimit(128);

		$this->maxMemoryLimit = $this->return_bytes(ini_get('memory_limit')) * 0.85;

		$config = JFactory::getConfig();
		$this->_prefix = $config->get('dbprefix');

		$this->reCreaPri = VmConfig::get('reCreaPri',0);
		$this->reCreaKey = VmConfig::get('reCreaKey',1);
	}
示例#8
0
 function display($tpl = null)
 {
     // Load the helper(s)
     $app = JFactory::getApplication();
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php';
     $this->tsmart_product_id = $app->input->get('tsmart_product_id', 0, 'int');
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#9
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $currency = $model->getCurrency();
         $this->SetViewTitle('', $currency->currency_name);
         $this->assignRef('currency', $currency);
         $this->addStandardEditViewCommands();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $currencies = $model->getCurrenciesList(vRequest::getCmd('search', false));
         $this->assignRef('currencies', $currencies);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
示例#10
0
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->setMimeEncoding('application/json');
     if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) {
         //JResponse::setHeader( 'Content-Disposition', 'attachment; filename="media'.$virtuemart_media_id.'.json"' );
         $model = VmModel::getModel('Media');
         $image = $model->createMediaByIds($virtuemart_media_id);
         // 			echo '<pre>'.print_r($image,1).'</pre>';
         $this->json = $image[0];
         //echo json_encode($this->json);
         if (isset($this->json->file_url)) {
             $this->json->file_root = JURI::root(true) . '/';
             $this->json->msg = 'OK';
             echo @json_encode($this->json);
         } else {
             $this->json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>';
             echo @json_encode($this->json);
         }
     } else {
         if (!class_exists('VmMediaHandler')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'mediahandler.php';
         }
         $start = vRequest::getInt('start', 0);
         $type = vRequest::getCmd('mediatype', 0);
         $list = VmMediaHandler::displayImages($type, $start);
         echo @json_encode($list);
     }
     jExit();
 }
示例#11
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsEditInline();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#12
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->dateavailability = $model->getdateavailability();
         $this->SetViewTitle('', $this->dateavailability->dateavailability_name);
         $this->addStandardEditViewCommands();
     } else {
         $model_product = tmsModel::getModel('product');
         $model_tour_class = tmsModel::getModel('tourclass');
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/vmdateavailability.php';
         $this->list_tour = tsmdateavailability::get_list_tour_private();
         $this->list_tour_class = $model_tour_class->getItemList();
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsdateavailability();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->list_date_availability = $model->getItemList(vRequest::getCmd('search'));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#13
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $this->setLayout('default');
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::editList();
     JToolBarHelper::addNew();
     JToolBarHelper::deleteList();
     $this->SetViewTitle();
     $this->addStandardDefaultViewLists($model, 0, 'ASC');
     $this->items = $model->getItemList(vRequest::getCmd('search', false));
     $this->pagination = $model->getPagination();
     $cid = vRequest::getInt('cid');
     $model->setId($cid);
     $this->item = $model->getItem();
     $this->SetViewTitle('', $this->item->title);
     parent::display($tpl);
 }
示例#14
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('vmCustomPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
     }
     $model = VmModel::getModel('custom');
     // TODO Make an Icon for custom
     $this->SetViewTitle('PRODUCT_CUSTOM_FIELD');
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $this->addStandardEditViewCommands();
         $customPlugin = '';
         $this->custom = $model->getCustom();
         $customfields = VmModel::getModel('customfields');
         //vmdebug('VirtuemartViewCustom',$this->custom);
         JPluginHelper::importPlugin('vmcustom');
         $dispatcher = JDispatcher::getInstance();
         $retValue = $dispatcher->trigger('plgVmOnDisplayEdit', array($this->custom->virtuemart_custom_id, &$customPlugin));
         $this->SetViewTitle('PRODUCT_CUSTOM_FIELD', $this->custom->custom_title);
         $selected = 0;
         if (!empty($this->custom->custom_jplugin_id)) {
             VmConfig::loadJLang('plg_vmpsplugin', false);
             JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
             $selected = $this->custom->custom_jplugin_id;
             // Get the payment XML.
             $formFile = JPath::clean(JPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->custom->custom_element . DS . $this->custom->custom_element . '.xml');
             if (file_exists($formFile)) {
                 $this->custom->form = JForm::getInstance($this->custom->custom_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
                 $this->custom->params = new stdClass();
                 $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
                 $this->custom->params->custom_params = $this->custom->custom_params;
                 VmTable::bindParameterable($this->custom->params, 'custom_params', $varsToPush);
                 $this->custom->form->bind($this->custom);
             } else {
                 $this->custom->form = null;
             }
         }
         $this->pluginList = self::renderInstalledCustomPlugins($selected);
         $this->assignRef('customPlugin', $customPlugin);
         $this->assignRef('customfields', $customfields);
     } else {
         JToolBarHelper::custom('createClone', 'copy', 'copy', vmText::_('COM_VIRTUEMART_CLONE'), true);
         JToolBarHelper::custom('toggle.admin_only.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
         JToolBarHelper::custom('toggle.admin_only.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
         JToolBarHelper::custom('toggle.is_hidden.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
         JToolBarHelper::custom('toggle.is_hidden.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $customs = $model->getCustoms(vRequest::getInt('custom_parent_id'), vRequest::getCmd('keyword'));
         $this->assignRef('customs', $customs);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
示例#15
0
	function display($tpl = null) {
			$db = JFactory::getDBO();
		if ( $virtuemart_media_id = vRequest::getInt('virtuemart_media_id') ) {
			//$db = JFactory::getDBO();
			$query='SELECT `file_url`,`file_title` FROM `#__virtuemart_medias` where `virtuemart_media_id`='.$virtuemart_media_id;
			$db->setQuery( $query );
			$json = $db->loadObject();
			if (isset($json->file_url)) {
				$json->file_url = JURI::root().$json->file_url;
				$json->msg =  'OK';
				echo json_encode($json);
			} else {
				$json->msg =  '<b>'.vmText::_('COM_VIRTUEMART_NO_IMAGE_SET').'</b>';
				echo json_encode($json);
			}
		}
		elseif ( $custom_jplugin_id = vRequest::getInt('custom_jplugin_id') ) {

			$table = '#__extensions';
			$ext_id = 'extension_id';

			$q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "'.$custom_jplugin_id.'"';
			$db ->setQuery($q);
			$this->jCustom = $db ->loadObject();

			$customModel = VmModel::getModel('custom');
			$this->custom = $customModel -> getCustom();

			// Get the payment XML.
			$formFile	= JPath::clean( VMPATH_ROOT .DS. 'plugins' .DS. 'vmcustom' .DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml');
			if (file_exists($formFile)){
				VmConfig::loadJLang('plg_vmpsplugin', false);
				if (!class_exists('vmPlugin')) require(VMPATH_PLUGINLIBS . DS . 'vmplugin.php');
				$filename = 'plg_vmcustom_' .  $this->jCustom->element;
				vmPlugin::loadJLang($filename,'vmcustom',$this->jCustom->element);

				$this->custom = VmModel::getModel('custom')->getCustom();
				$varsToPush = vmPlugin::getVarsToPushByXML($formFile,'customForm');
				$this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(),false, '//vmconfig | //config[not(//vmconfig)]');
				$this->custom->params = new stdClass();

				foreach($varsToPush as $k => $field){
					if(strpos($k,'_')!=0){
						$this->custom->params->$k = $field[0];
					}
				}
				$this->custom->form->bind($this->custom->getProperties());
				$form = $this->custom->form;
				include(VMPATH_ADMIN.DS.'fields'.DS.'formrenderer.php');
				echo '<input type="hidden" value="'.$this->jCustom->element.'" name="custom_value">';
			} else {
				$this->custom->form = null;
				VmConfig::$echoDebug = 1;
				vmdebug ('File does not exist '.$formFile);
			}
		}
		jExit();
	}
示例#16
0
 /**
  * Paste the table  in json format
  *
  */
 public function paste()
 {
     // TODO Test user ?
     $json = array();
     $json['fields'] = 'error';
     $json['msg'] = 'Invalid Token';
     $json['structure'] = 'empty';
     if (!vRequest::vmCheckToken(-1)) {
         echo json_encode($json);
         jexit();
     }
     $lang = vRequest::getvar('lg');
     $langs = VmConfig::get('active_languages', array());
     $language = JFactory::getLanguage();
     if (!in_array($lang, $langs)) {
         $json['msg'] = 'Invalid language ! ' . $lang;
         $json['langs'] = $langs;
         echo json_encode($json);
         jexit();
     }
     $lang = strtolower($lang);
     // Remove tag if defaut or
     // if ($language->getDefault() == $lang ) $dblang ='';
     $dblang = strtr($lang, '-', '_');
     $id = vRequest::getInt('id', 0);
     $viewKey = vRequest::getCmd('editView');
     // TODO temp trick for vendor
     if ($viewKey == 'vendor') {
         $id = 1;
     }
     $tables = array('category' => 'categories', 'product' => 'products', 'manufacturer' => 'manufacturers', 'manufacturercategories' => 'manufacturercategories', 'vendor' => 'vendors', 'paymentmethod' => 'paymentmethods', 'shipmentmethod' => 'shipmentmethods');
     if (!array_key_exists($viewKey, $tables)) {
         $json['msg'] = "Invalid view " . $viewKey;
         echo json_encode($json);
         jExit();
     }
     $tableName = '#__virtuemart_' . $tables[$viewKey] . '_' . $dblang;
     $db = JFactory::getDBO();
     $q = 'select * FROM `' . $tableName . '` where `virtuemart_' . $viewKey . '_id` =' . $id;
     $db->setQuery($q);
     if ($json['fields'] = $db->loadAssoc()) {
         $json['structure'] = 'filled';
         $json['msg'] = vmText::_('COM_VIRTUEMART_SELECTED_LANG') . ':' . $lang;
     } else {
         $json['structure'] = 'empty';
         $db->setQuery('SHOW COLUMNS FROM ' . $tableName);
         $tableDescribe = $db->loadAssocList();
         array_shift($tableDescribe);
         $fields = array();
         foreach ($tableDescribe as $key => $val) {
             $fields[$val['Field']] = $val['Field'];
         }
         $json['fields'] = $fields;
         $json['msg'] = vmText::sprintf('COM_VIRTUEMART_LANG_IS_EMPTY', $lang, vmText::_('COM_VIRTUEMART_' . strtoupper($viewKey)));
     }
     echo json_encode($json);
     jExit();
 }
示例#17
0
 /**
  * Send the ask question email.
  * @author Kohl Patrick, Christopher Roussel
  */
 public function mailAskquestion()
 {
     vRequest::vmCheckToken();
     if (!class_exists('shopFunctionsF')) {
         require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $model = tmsModel::getModel('vendor');
     $mainframe = JFactory::getApplication();
     $vars = array();
     $min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
     $max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
     $commentSize = vRequest::getString('comment');
     if (function_exists('mb_strlen')) {
         $commentSize = mb_strlen($commentSize);
     } else {
         $commentSize = strlen($commentSize);
     }
     $validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
     $virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
     if (!class_exists('VirtueMartModelVendor')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
     }
     $userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
     //$vendorUser = JFactory::getUser($userId);
     if ($commentSize < $min || $commentSize > $max || !$validMail) {
         $this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
         return;
     }
     $user = JFactory::getUser();
     $fromMail = vRequest::getVar('email');
     //is sanitized then
     $fromName = vRequest::getVar('name', '');
     //is sanitized then
     $fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
     $fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
     if (!empty($user->id)) {
         if (empty($fromMail)) {
             $fromMail = $user->email;
         }
         if (empty($fromName)) {
             $fromName = $user->name;
         }
     }
     $vars['user'] = array('name' => $fromName, 'email' => $fromMail);
     $VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
     $vars['vendor'] = array('vendor_store_name' => $fromName);
     if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
         $string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
     } else {
         $string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
     }
     $mainframe->enqueueMessage(tsmText::_($string));
     // Display it all
     $view = $this->getView('vendor', 'html');
     $view->setLayout('mail_confirmed');
     $view->display();
 }
示例#18
0
 /**
  * @return null
  * @throws KlarnaApiException
  */
 public function languagepack()
 {
     $sSubAction = vRequest::getWord('subAction');
     if (!isset($this->template['name']) || $this->template['name'] == '') {
         $this->template['name'] = "default";
     }
     if ($sSubAction == "klarna_box") {
         $sNewISO = vRequest::getWord('newIso');
         $sCountry = vRequest::getWord('country');
         $iSum = vRequest::getFloat('sum', 0);
         $iInvoiceFee = vRequest::getFloat('fee', 0);
         $iFlag = vRequest::getInt('flag');
         $sType = vRequest::getWord('type');
         $aParams = vRequest::getVar('params');
         $aValues = vRequest::getVar('values');
         // foreach($aValues as $key => $value) {
         // $aValues[$key] = utf8_encode($value);
         // }
         // foreach($aParams as $key => $value) {
         // $aParams[$key] = utf8_decode($value);
         // }
         if ($sType != "part" && $sType != "invoice" && $sType != "spec") {
             throw new KlarnaApiException("Invalid parameters");
         }
         $this->api->setCountry($sCountry);
         if ($sType == 'spec') {
             $types = array(KlarnaPClass::SPECIAL);
         } else {
             $types = array(KlarnaPClass::CAMPAIGN, KlarnaPClass::ACCOUNT, KlarnaPClass::FIXED);
         }
         $oApi = new KlarnaAPI($sCountry, $sNewISO, $sType, $iSum, $iFlag, $this->api, $types, VMKLARNAPLUGINWEBROOT);
         // $oApi->addSetupValue ('web_root', $this->webroot);
         // $oApi->setPaths ();
         $oApi->addSetupValue('eid', $this->eid);
         if ($sType == 'invoice') {
             $oApi->setInvoiceFee($iInvoiceFee);
         }
         $oApi->setCurrency($this->api->getCurrency());
         if (count($this->coSetup) > 0) {
             $oApi->addMultipleSetupValues($this->coSetup);
         }
         return $oApi->retrieveLayout($aParams, $aValues);
         // if ($sType == 'spec') {
         // return $oApi->retrieveHTML($aParams, $aValues, null, $this->template);
         // } else {
         // return $oApi->retrieveHTML ($aParams, $aValues);
         // }
     } else {
         if ($sSubAction == 'jsLanguagePack') {
             $sNewISO = vRequest::getWord('newIso');
             $sFetch = "";
         } else {
             throw new KlarnaApiException("Invalid sub-action");
         }
     }
 }
示例#19
0
 function removeAddressST()
 {
     $virtuemart_userinfo_id = vRequest::getInt('virtuemart_userinfo_id');
     $virtuemart_user_id = vRequest::getInt('virtuemart_user_id');
     //Lets do it dirty for now
     $userModel = VmModel::getModel('user');
     vmdebug('removeAddressST', $virtuemart_user_id, $virtuemart_userinfo_id);
     $userModel->setId($virtuemart_user_id[0]);
     $userModel->removeAddress($virtuemart_userinfo_id);
     $layout = vRequest::getCmd('layout', 'edit');
     $this->setRedirect('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $virtuemart_user_id[0]);
 }
示例#20
0
 function display($tpl = null)
 {
     // Load the helper(s)
     $app = JFactory::getApplication();
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $task = $app->input->getString('task', '');
     $tsmart_product_id = $app->input->getInt('tsmart_product_id', 0);
     $model = tmsModel::getModel();
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php';
     $this->tsmart_product_id = $app->input->get('tsmart_product_id', 0, 'int');
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmhotel.php';
     $this->list_hotel = tsmHotel::get_list_hotel();
     $this->list_hotel = JArrayHelper::pivot($this->list_hotel, 'tsmart_hotel_id');
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->item = $model->getItem();
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
         if ($task == 'edit_item' || $task == 'add_new_item') {
             $app = JFactory::getApplication();
             $input = $app->input;
             $tsmart_itinerary_id = $input->getInt('tsmart_itinerary_id', 0);
             $tsmart_product_id = $input->getInt('tsmart_product_id', 0);
             $cid = vRequest::getInt('cid');
             $tsmart_accommodation_id = $cid[0];
             require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmserviceclass.php';
             $this->list_service_class = tsmserviceclass::get_list_service_class_by_tour_id($tsmart_product_id);
             require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/vmaccommodation.php';
             $this->list_hotel_selected_by_service_class_id_and_itinerary_id = tsmaccommodation::get_list_hotel_selected_by_service_class_id_and_itinerary_id_accommodation_id($this->list_service_class, $tsmart_itinerary_id, $tsmart_accommodation_id);
         }
     }
     parent::display($tpl);
 }
示例#21
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $this->view_height = 1000;
         $model->setId($cid);
         $this->item = $model->getItem();
         //get list tour
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpayment.php';
         $this->item->list_tour_id = vmPayment::get_list_tour_id_by_payment_id($this->item->tsmart_payment_id);
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php';
         $this->list_tour = vmproduct::get_list_product();
         //end get list tour
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmcurrency.php';
         $list_currency = tsmcurrency::get_list_currency();
         $this->assignRef('list_currency', $list_currency);
         //get list payment method
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php';
         $list_payment_method = vmpaymentmethod::get_list_payment_method();
         $this->assignRef('list_payment_method', $list_payment_method);
         $this->item->list_payment_method_id = vmpaymentmethod::get_list_payment_method_id_by_payment_id($this->item->tsmart_payment_id);
         //end get list payment method
         //get list mode payment
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php';
         $list_mode_payment = vmpaymentmethod::get_list_mode_payment();
         $this->assignRef('list_mode_payment', $list_mode_payment);
         //end get list mode payment
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#22
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $this->view_height = 1500;
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->service_class_name);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $app = JFactory::getApplication();
         $input = $app->input;
         $this->SetViewTitle();
         JToolBarHelper::save('save', 'Save');
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentsetting.php';
         $this->list_config_mode = vmpaymentsetting::get_config_mode();
         $this->hold_seat_type = vmpaymentsetting::get_hold_seat_type();
         $this->currencies = vmpaymentsetting::get_list_currency();
         //get list payment method
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php';
         $list_payment_method = vmpaymentmethod::get_list_payment_method();
         $this->assignRef('list_payment_method', $list_payment_method);
         //end get list payment method
         $tsmart_paymentsetting_id = $input->get('tsmart_paymentsetting_id', 0, 'int');
         if (!$tsmart_paymentsetting_id) {
             $db = JFactory::getDbo();
             $query = $db->getQuery(true);
             $query->select('tsmart_paymentsetting_id')->from('#__tsmart_paymentsetting');
             $tsmart_paymentsetting_id = $db->setQuery($query)->loadResult();
         }
         $this->item = $model->getItem($tsmart_paymentsetting_id);
         //
         $list_payment_method = vmpaymentsetting::get_list_payment_method_by_paymentsetting_id($tsmart_paymentsetting_id);
         $this->assignRef('list_payment_method', $list_payment_method);
     }
     parent::display($tpl);
 }
示例#23
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $app = JFactory::getApplication();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     $this->tsmart_product_id = $app->input->get('tsmart_product_id', 0, 'int');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         //get supplier_type and service_type
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmsupplier.php';
         $list_supplier_type = vmsupplier::get_list_supplier_type();
         $this->assignRef('list_supplier_type', $list_supplier_type);
         $list_service_type = vmsupplier::get_list_service_type();
         $this->assignRef('list_service_type', $list_service_type);
         //end get supplier_type and service_type
         $list_state_province = vmsupplier::get_list_state_province();
         $this->assignRef('list_state_province', $list_state_province);
         $list_country = vmsupplier::get_list_country();
         $this->assignRef('list_country', $list_country);
         $list_city_area = vmsupplier::get_list_city_area();
         $this->assignRef('list_city_area', $list_city_area);
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php';
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsPopup();
         $model->setDefaultValidOrderingFields('supplier');
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->state = $model->getState();
         $this->filterForm = $this->getFilterForm();
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#24
0
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     if (!class_exists('VmImage')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
     }
     $virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', 0);
     $mf_category_id = vRequest::getInt('mf_category_id', 0);
     // get necessary models
     $model = VmModel::getModel('manufacturer');
     if ($virtuemart_manufacturer_id != 0) {
         $manufacturer = $model->getManufacturer();
         $model->addImages($manufacturer, 1);
         $manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"', false);
         if (VmConfig::get('enable_content_plugin', 0)) {
             if (!class_exists('shopFunctionsF')) {
                 require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
             }
             shopFunctionsF::triggerContentPlugin($manufacturer, 'manufacturer', 'mf_desc');
         }
         $document->setTitle(vmText::_('COM_VIRTUEMART_MANUFACTURER_DETAILS') . ' ' . strip_tags($manufacturer->mf_name));
         //added so that the canonical points to page with visible products thx to P2Peter
         // remove joomla canonical before adding it
         foreach ($document->_links as $k => $array) {
             if ($array['relation'] == 'canonical') {
                 unset($document->_links[$k]);
                 break;
             }
         }
         $document->addHeadLink(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $virtuemart_manufacturer_id, FALSE), 'canonical', 'rel', '');
         $this->assignRef('manufacturerImage', $manufacturerImage);
         $this->assignRef('manufacturer', $manufacturer);
         $pathway->addItem(strip_tags($manufacturer->mf_name));
         $this->setLayout('details');
     } else {
         $document->setTitle(vmText::_('COM_VIRTUEMART_MANUFACTURER_PAGE'));
         $manufacturers = $model->getManufacturers(true, true, true);
         $model->addImages($manufacturers, 1);
         $this->assignRef('manufacturers', $manufacturers);
         $this->setLayout('default');
     }
     parent::display($tpl);
 }
示例#25
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommands();
         //get state
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmstates.php';
         $states = tmartstates::get_states();
         $this->assignRef('states', $states);
         //end get state
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsEditInline(true, false, true);
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         //get state
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmstates.php';
         $list_state = tmartstates::get_states();
         $this->assignRef('list_state', $list_state);
         //end get state
         //get country
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmcountries.php';
         $list_country = tsmcountries::get_countries();
         $this->assignRef('list_country', $list_country);
         //end get country
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
示例#26
0
 /**
  * Clone a shipment
  *
  * @author Valérie Isaksen
  */
 public function CloneShipment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('shipmentmethod', 'html');
     $model = VmModel::getModel('shipmentmethod');
     $msgtype = '';
     $cids = vRequest::getVar($this->_cidName, vRequest::getInt('virtuemart_shipment_id'));
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = vmText::_('COM_VIRTUEMART_SHIPMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = vmText::_('COM_VIRTUEMART_SHIPMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=shipmentmethod', $msg, $msgtype);
 }
示例#27
0
 /**
  * Collect the filters for the query
  * @author Max Milbers
  */
 private function getInventoryFilter()
 {
     // Check some filters
     $filters = array();
     if ($search = vRequest::getVar('filter_inventory', false)) {
         $db = JFactory::getDBO();
         $search = '"%' . $db->escape($search, true) . '%"';
         $filters[] = '`#__tsmart_products`.`product_name` LIKE ' . $search;
     }
     if (vRequest::getInt('stockfilter', 0) == 1) {
         $filters[] = '`#__tsmart_products`.`product_in_stock` > 0';
     }
     if ($catId = vRequest::getInt('tsmart_category_id', 0) > 0) {
         $filters[] = '`#__tsmart_categories`.`tsmart_category_id` = ' . $catId;
     }
     $filters[] = '(`#__tsmart_shoppergroups`.`default` = 1 OR `#__tsmart_shoppergroups`.`default` is NULL)';
     return ' WHERE ' . implode(' AND ', $filters) . $this->_getOrdering();
 }
示例#28
0
 /**
  * Clone a product
  *
  * @author Max Milbers
  */
 public function createClone()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('custom', 'html');
     $model = tmsModel::getModel('custom');
     $msgtype = '';
     $cids = vRequest::getInt($this->_cidName, vRequest::getInt('tsmart_custom_id'));
     foreach ($cids as $custom_id) {
         if ($model->createClone($custom_id)) {
             $msg = tsmText::_('com_tsmart_CUSTOM_CLONED_SUCCESSFULLY');
         } else {
             $msg = tsmText::_('com_tsmart_CUSTOM_NOT_CLONED_SUCCESSFULLY') . ' : ' . $custom_id;
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_tsmart&view=custom', $msg, $msgtype);
 }
示例#29
0
 function display($tpl = null)
 {
     $latestVersion = vRequest::getVar('latestverison', '');
     JToolBarHelper::title(vmText::_('COM_VIRTUEMART_UPDATE_MIGRATION'), 'head vm_config_48');
     if (!class_exists('VmImage')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
     }
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->assignRef('checkbutton_style', $checkbutton_style);
     $this->assignRef('downloadbutton_style', $downloadbutton_style);
     $this->assignRef('latestVersion', $latestVersion);
     $freshInstall = vRequest::getInt('redirected', 0);
     if ($freshInstall) {
         $this->setLayout('install');
     }
     parent::display($tpl);
 }
示例#30
0
 public function display($cachable = false, $urlparams = false)
 {
     if (vRequest::getvar('search')) {
         $view = $this->getView('category', 'html');
         $view->display();
     } else {
         // Display it all
         $document = JFactory::getDocument();
         $viewType = $document->getType();
         $viewName = vRequest::getCmd('view', $this->default_view);
         $viewLayout = vRequest::getCmd('layout', 'default');
         $view = $this->getView($viewName, $viewType, '', array('layout' => $viewLayout));
         $view->assignRef('document', $document);
         $view->display();
     }
     if ($categoryId = vRequest::getInt('virtuemart_category_id', 0)) {
         shopFunctionsF::setLastVisitedCategoryId($categoryId);
     }
     return $this;
 }