function display($tpl = null) { tsmConfig::loadJLang('com_tsmart_countries'); //co if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel('language'); $zoneModel = tmsModel::getModel('worldzones'); $this->SetViewTitle(); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $this->language = $model->getData(); $this->wzsList = $zoneModel->getWorldZonesSelectList(); $this->addStandardEditViewCommands(); } else { $this->addStandardDefaultViewCommandsEditInline(true, false); //First the view lists, it sets the state of the model $this->addStandardDefaultViewLists($model, 0, 'ASC'); $filter_language = vRequest::getCmd('filter_language', false); $this->items = $model->getItemList(); $this->pagination = $model->getPagination(); } parent::display($tpl); }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('language.*')->from('#__tsmart_language AS language'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('language.language_name LIKE ' . $search); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'language.tsmart_language_id'); $orderDirn = $this->state->get('list.direction', 'asc'); if ($orderCol == 'language.ordering') { $orderCol = $db->quoteName('language.language_name') . ' ' . $orderDirn . ', ' . $db->quoteName('language.ordering'); } $query->order($db->escape($orderCol . ' ' . $orderDirn)); return $query; }
function display ($tpl = null) { // Load the helper(s) jimport('joomla.filesystem.file'); $config = JFactory::getConfig(); $log_path = $config->get('log_path', VMPATH_ROOT . "/log"); $layoutName = vRequest::getCmd('layout', 'default'); VmConfig::loadJLang('com_virtuemart_log'); if ($layoutName == 'edit') { $logFile = vRequest::getString('logfile', ''); $this->SetViewTitle('LOG', $logFile); $fileContent = file_get_contents($log_path . DS . $logFile); $fileContentByLine = explode("\n", $fileContent); $this->assignRef('fileContentByLine', $fileContentByLine); JToolBarHelper::cancel(); } else { if(!class_exists('JFolder')) require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php'); $logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html')); $this->SetViewTitle('LOG'); $this->assignRef('logFiles', $logFiles); $this->assignRef('path', $log_path); } parent::display($tpl); }
function save($data = 0) { $fileModel = VmModel::getModel('media'); //Now we try to determine to which this media should be long to $data = array_merge(vRequest::getRequest(), vRequest::get('media')); //$data['file_title'] = vRequest::getVar('file_title','','post','STRING',JREQUEST_ALLOWHTML); if (!empty($data['file_description'])) { $data['file_description'] = JComponentHelper::filterText($data['file_description']); //vRequest::filter(); vRequest::getHtml('file_description',''); } /*$data['media_action'] = vRequest::getCmd('media[media_action]'); $data['media_attributes'] = vRequest::getCmd('media[media_attributes]'); $data['file_type'] = vRequest::getCmd('media[file_type]');*/ if (empty($data['file_type'])) { $data['file_type'] = $data['media_attributes']; } $msg = ''; if ($id = $fileModel->store($data)) { $msg = vmText::_('COM_VIRTUEMART_FILE_SAVED_SUCCESS'); } $cmd = vRequest::getCmd('task'); if ($cmd == 'apply') { $redirection = 'index.php?option=com_virtuemart&view=media&task=edit&virtuemart_media_id=' . $id; } else { $redirection = 'index.php?option=com_virtuemart&view=media'; } $this->setRedirect($redirection, $msg); }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('product.*,products_en_gb.product_name,tour_type.title AS tour_type,tour_style.title AS tour_style_name')->from('#__tsmart_products AS product')->leftJoin('#__tsmart_products_en_gb AS products_en_gb USING(tsmart_product_id)')->leftJoin('#__tsmart_tour_type AS tour_type USING(tsmart_tour_type_id)')->leftJoin('#__tsmart_tour_style AS tour_style USING(tsmart_tour_style_id)'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('product.product_name LIKE ' . $search); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'product.tsmart_product_id'); $orderDirn = $this->state->get('list.direction', 'asc'); if ($orderCol == 'product.ordering') { $orderCol = $db->quoteName('product.tsmart_product_id') . ' ' . $orderDirn . ', ' . $db->quoteName('product.ordering'); } $query->order($db->escape($orderCol . ' ' . $orderDirn)); return $query; }
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); }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $this->setLayout('default'); $model = tmsModel::getModel(); $app = JFactory::getApplication(); $task = $app->input->getString('task', ''); $config = JFactory::getConfig(); $layoutName = vRequest::getCmd('layout', 'default'); $this->tsmart_product_id = $app->input->get('tsmart_product_id', 0, 'int'); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php'; $this->SetViewTitle(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::editList(); JToolBarHelper::addNew(); JToolBarHelper::deleteList(); $model->setDefaultValidOrderingFields('itinerary'); $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(); if ($task == 'edit' || $task == 'add') { require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/vmcities.php'; $this->item = $model->getItem(); $cities = tsmcities::get_cities(); $this->assignRef('cities', $cities); } parent::display($tpl); }
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); }
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); }
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); }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('group_size.*')->from('#__tsmart_group_size AS group_size'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('group_size.group_name LIKE ' . $search); } if (empty($this->_selectedOrdering)) { vmTrace('empty _getOrdering'); } if (empty($this->_selectedOrderingDir)) { vmTrace('empty _selectedOrderingDir'); } $query->order('group_size.' . $this->_selectedOrdering . ' ' . $this->_selectedOrderingDir); //echo $query->dump(); return $query; }
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); }
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); }
function getListQuery() { $app = JFactory::getApplication(); $input = $app->input; $tsmart_product_id = $input->getInt('tsmart_product_id', 0); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('itinerary.*,cityarea.city_area_name,accommodation.tsmart_accommodation_id')->from('#__tsmart_itinerary AS itinerary')->where('itinerary.tsmart_product_id=' . (int) $tsmart_product_id)->leftJoin('#__tsmart_accommodation AS accommodation USING(tsmart_itinerary_id)')->leftJoin('#__tsmart_cityarea AS cityarea USING(tsmart_cityarea_id)')->group('itinerary.tsmart_itinerary_id'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('itinerary.title LIKE ' . $search); } $orderCol = $this->state->get('list.ordering', 'itinerary.ordering'); $orderDirn = $this->state->get('list.direction', 'asc'); if ($orderCol == 'itinerary.ordering') { $orderCol = $db->quoteName('itinerary.title') . ' ' . $orderDirn . ', ' . $db->quoteName('itinerary.ordering'); } $query->order($db->escape($orderCol . ' ' . $orderDirn)); return $query; }
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); }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('excursion_addon.*')->from('#__tsmart_excursion_addon AS excursion_addon')->leftJoin('me1u8_tsmart_cityarea AS cityarea USING(tsmart_cityarea_id)')->select('cityarea.city_area_name AS city_area_name'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('excursionaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('excursion_addon.excursion_addon_name LIKE ' . $search); } if (empty($this->_selectedOrdering)) { vmTrace('empty _getOrdering'); } if (empty($this->_selectedOrderingDir)) { vmTrace('empty _selectedOrderingDir'); } $query->order($this->_selectedOrdering . ' ' . $this->_selectedOrderingDir); return $query; }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('country.*,COUNT(states.tsmart_state_id) AS total_state')->from('#__tsmart_countries AS country')->leftJoin('#__tsmart_states AS states using (tsmart_country_id)')->leftJoin('#__tsmart_currencies AS currency using (tsmart_currency_id)')->select('currency.currency_name')->leftJoin('#__tsmart_language AS language using (tsmart_language_id)')->select('language.language_name')->group('country.tsmart_country_id'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('country.country_name LIKE ' . $search); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'country.tsmart_country_id'); $orderDirn = $this->state->get('list.direction', 'asc'); if ($orderCol == 'country.ordering') { $orderCol = $db->quoteName('country.tsmart_country_id') . ' ' . $orderDirn . ', ' . $db->quoteName('country.ordering'); } $query->order($db->escape($orderCol . ' ' . $orderDirn)); return $query; }
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); }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('hotel.*')->from('#__tsmart_hotel AS hotel')->leftJoin('#__tsmart_cityarea AS cityarea USING(tsmart_cityarea_id)')->leftJoin('#__tsmart_states AS states ON states.tsmart_state_id=cityarea.tsmart_state_id')->leftJoin('#__tsmart_countries AS countries ON countries.tsmart_country_id=states.tsmart_country_id')->select('CONCAT(cityarea.city_area_name,",",states.state_name,",",countries.country_name) AS location'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('hotel.title LIKE ' . $search); } if (empty($this->_selectedOrdering)) { vmTrace('empty _getOrdering'); } if (empty($this->_selectedOrderingDir)) { vmTrace('empty _selectedOrderingDir'); } $query->order($this->_selectedOrdering . ' ' . $this->_selectedOrderingDir); //echo $query->dump(); return $query; }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('state.*, countries.flag AS country_flag,countries.country_name,COUNT(cityarea.tsmart_cityarea_id) AS total_city')->from('#__tsmart_states AS state')->leftJoin('#__tsmart_countries AS countries using (tsmart_country_id)')->leftJoin('#__tsmart_cityarea AS cityarea using (tsmart_state_id)')->group('state.tsmart_state_id')->leftJoin('#__tsmart_states AS states ON states.tsmart_state_id=cityarea.tsmart_state_id')->leftJoin('#__tsmart_airport AS airport ON airport.tsmart_cityarea_id=cityarea.tsmart_cityarea_id')->select('GROUP_CONCAT(airport.airport_name,"(",airport.ata_code,")") AS list_airport_name'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('state.state_name LIKE ' . $search); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'state.tsmart_state_id'); $orderDirn = $this->state->get('list.direction', 'asc'); if ($orderCol == 'state.ordering') { $orderCol = $db->quoteName('state.tsmart_state_id') . ' ' . $orderDirn . ', ' . $db->quoteName('state.ordering'); } $query->order($db->escape($orderCol . ' ' . $orderDirn)); return $query; }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('faq.*,categoryfaq.categoryfaq_name')->from('#__tsmart_faq AS faq')->leftJoin('#__tsmart_categoryfaq AS categoryfaq ON categoryfaq.tsmart_categoryfaq_id=faq.tsmart_categoryfaq_id'); $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('transferaddon.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('faq.title LIKE ' . $search); } if (empty($this->_selectedOrdering)) { vmTrace('empty _getOrdering'); } if (empty($this->_selectedOrderingDir)) { vmTrace('empty _selectedOrderingDir'); } $query->order($this->_selectedOrdering . ' ' . $this->_selectedOrderingDir); return $query; }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmConfig')) { require JPATH_COMPONENT_ADMINISTRATOR . '/helpers/config.php'; } VmConfig::loadConfig(); VmConfig::loadJLang('com_virtuemart_countries'); if (!class_exists('VmHTML')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php'; } $model = VmModel::getModel('country'); $zoneModel = VmModel::getModel('worldzones'); $this->SetViewTitle(); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $country = $model->getData(); $this->assignRef('country', $country); $wzsList = $zoneModel->getWorldZonesSelectList(); $this->assignRef('worldZones', $wzsList); $this->addStandardEditViewCommands(); } else { $this->addStandardDefaultViewCommands(true, false); //First the view lists, it sets the state of the model $this->addStandardDefaultViewLists($model, 0, 'ASC'); $filter_country = vRequest::getCmd('filter_country', false); $countries = $model->getCountries(false, false, $filter_country); $this->assignRef('countries', $countries); $pagination = $model->getPagination(); $this->assignRef('pagination', $pagination); } parent::display($tpl); }
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); }
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); }
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(); }
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); }
function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('payment.*')->from('#__tsmart_payment AS payment')->leftJoin('#__tsmart_currencies AS currencies USING(tsmart_currency_id)')->select('CONCAT(currencies.currency_code_3," ",currencies.currency_symbol) AS currency_symbol'); //get list tour apply $query1 = $db->getQuery(true); $query1->select('GROUP_CONCAT(products_en_gb.product_name)')->from('#__tsmart_tour_id_payment_id AS tour_id_payment_id')->leftJoin('#__tsmart_products_en_gb AS products_en_gb USING(tsmart_product_id)')->where('tour_id_payment_id.tsmart_payment_id=payment.tsmart_payment_id'); $query->select("({$query1}) AS list_tour"); //end get list tour apply $user = JFactory::getUser(); $shared = ''; if (vmAccess::manager()) { //$query->where('payment.shared=1','OR'); } $search = vRequest::getCmd('search', false); if (empty($search)) { $search = vRequest::getString('search', false); } // add filters if ($search) { $db = JFactory::getDBO(); $search = '"%' . $db->escape($search, true) . '%"'; $query->where('payment.title LIKE ' . $search); } if (empty($this->_selectedOrdering)) { vmTrace('empty _getOrdering'); } if (empty($this->_selectedOrderingDir)) { vmTrace('empty _selectedOrderingDir'); } $query->order($this->_selectedOrdering . ' ' . $this->_selectedOrderingDir); return $query; }
function __construct() { $this->type = vRequest::getCmd('type', false); $this->row = vRequest::getInt('row', false); $this->db = JFactory::getDBO(); $this->model = tmsModel::getModel('Customfields'); }
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); }
/** * Handle the save task */ function save($data = 0){ vRequest::vmCheckToken(); $model = VmModel::getModel('config'); $data = vRequest::getPost(); if(strpos($data['offline_message'],'|')!==false){ $data['offline_message'] = str_replace('|','',$data['offline_message']); } $msg = ''; if ($model->store($data)) { $msg = vmText::_('COM_VIRTUEMART_CONFIG_SAVED'); // Load the newly saved values into the session. VmConfig::loadConfig(); } $redir = 'index.php?option=com_virtuemart'; if(vRequest::getCmd('task') == 'apply'){ $redir = $this->redirectPath; } $this->setRedirect($redir, $msg); }