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 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(); $layoutName = $this->getLayout(); $task = vRequest::getCmd('task', $layoutName); $this->assignRef('task', $task); if ($layoutName == 'edit') { //For shoppergroup specific price display tsmConfig::loadJLang('com_tsmart_config'); tsmConfig::loadJLang('com_tsmart_shoppers', true); $shoppergroup = $model->getShopperGroup(); $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name); if ($this->showVendors()) { $this->vendorList = ShopFunctions::renderVendorList($shoppergroup->tsmart_vendor_id); } $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 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 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) { 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 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(); $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) 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); }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel(); JToolBarHelper::save('save', 'Save'); $this->config = $model->getItem(); 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'); $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); }
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); }
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); }
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); }
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); }
function display($tpl = null) { $latestVersion = vRequest::getVar('latestverison', ''); JToolBarHelper::title(tsmText::_('com_tsmart_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); }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel(); $layoutName = vRequest::getCmd('layout', 'default'); // 'A' : sotck Available // 'O' : stock Out // 'R' : stock reserved $this->stockHandelList = array('A' => 'com_tsmart_ORDER_STATUS_STOCK_AVAILABLE', 'R' => 'com_tsmart_ORDER_STATUS_STOCK_RESERVED', 'O' => 'com_tsmart_ORDER_STATUS_STOCK_OUT'); $this->lists = array(); $this->lists['vmCoreStatusCode'] = $model->getVMCoreStatusCode(); if ($layoutName == 'edit') { $this->orderStatus = $model->getData(); $this->SetViewTitle('', tsmText::_($this->orderStatus->order_status_name)); if ($this->orderStatus->tsmart_orderstate_id < 1) { $this->ordering = tsmText::_('com_tsmart_NEW_ITEMS_PLACE'); } else { if (!class_exists('ShopFunctions')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php'; } $this->ordering = ShopFunctions::renderOrderingList('orderstates', 'order_status_name', $this->orderStatus->ordering); } // Vendor selection $vendor_model = tmsModel::getModel('vendor'); $vendor_list = $vendor_model->getVendors(); $this->lists['vendors'] = JHtml::_('select.genericlist', $vendor_list, 'tsmart_vendor_id', '', 'tsmart_vendor_id', 'vendor_name', $this->orderStatus->tsmart_vendor_id); $this->addStandardEditViewCommands(); } else { $this->SetViewTitle(''); $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model); $this->orderStatusList = $model->getOrderStatusList(false); $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'; } // get necessary model $model = tmsModel::getModel(); $this->SetViewTitle('MANUFACTURER_CATEGORY'); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $manufacturerCategory = $model->getData(); $this->assignRef('manufacturerCategory', $manufacturerCategory); $this->addStandardEditViewCommands($manufacturerCategory->tsmart_manufacturercategories_id); } else { $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model); $manufacturerCategories = $model->getManufacturerCategories(); $this->assignRef('manufacturerCategories', $manufacturerCategories); $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'; } // get necessary models $model = tmsModel::getModel('manufacturer'); $categoryModel = tmsModel::getModel('manufacturercategories'); $this->SetViewTitle(); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $this->manufacturer = $model->getManufacturer(); $isNew = $this->manufacturer->tsmart_manufacturer_id < 1; $model->addImages($this->manufacturer); /* Process the images */ $mediaModel = tmsModel::getModel('media'); $mediaModel->setId($this->manufacturer->tsmart_media_id); $image = $mediaModel->getFile('manufacturer', 'image'); $this->manufacturerCategories = $categoryModel->getManufacturerCategories(false, true); $this->addStandardEditViewCommands($this->manufacturer->tsmart_manufacturer_id); if (!class_exists('tsmartModelVendor')) { require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php'; } $this->tsmart_vendor_id = tsmartModelVendor::getLoggedVendor(); } else { $mainframe = JFactory::getApplication(); $categoryFilter = $categoryModel->getCategoryFilter(); $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model, 'mf_name'); $this->manufacturers = $model->getManufacturers(); $this->pagination = $model->getPagination(); $tsmart_manufacturercategories_id = $mainframe->getUserStateFromRequest('com_tsmart.tsmart_manufacturercategories_id', 'tsmart_manufacturercategories_id', 0, 'int'); $this->lists['tsmart_manufacturercategories_id'] = JHtml::_('select.genericlist', $categoryFilter, 'tsmart_manufacturercategories_id', 'class="inputbox" onchange="this.form.submit()"', 'value', 'text', $tsmart_manufacturercategories_id); } parent::display($tpl); }
function display($tpl = null) { if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $this->vendorId = vmAccess::isSuperVendor(); // TODO add icon for media view $this->SetViewTitle(); $model = tmsModel::getModel('media'); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $this->media = $model->getFile(); $this->addStandardEditViewCommands(); } else { $tsmart_product_id = vRequest::getInt('tsmart_product_id'); if (is_array($tsmart_product_id) && count($tsmart_product_id) > 0) { $tsmart_product_id = (int) $tsmart_product_id[0]; } else { $tsmart_product_id = (int) $tsmart_product_id; } $cat_id = vRequest::getInt('tsmart_category_id', 0); $super = vmAccess::isSuperVendor(); if ($super == 1) { JToolBarHelper::custom('synchronizeMedia', 'new', 'new', tsmText::_('com_tsmart_TOOLS_SYNC_MEDIA_FILES'), false); } $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model, null, null, 'searchMedia'); $options = array('' => tsmText::_('com_tsmart_LIST_ALL_TYPES'), 'product' => tsmText::_('com_tsmart_PRODUCT'), 'category' => tsmText::_('com_tsmart_CATEGORY'), 'manufacturer' => tsmText::_('com_tsmart_MANUFACTURER'), 'vendor' => tsmText::_('com_tsmart_VENDOR')); $this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options, 1, '', 'onchange="this.form.submit();"'); $options = array('' => tsmText::_('com_tsmart_LIST_ALL_ROLES'), 'file_is_displayable' => tsmText::_('com_tsmart_FORM_MEDIA_DISPLAYABLE'), 'file_is_downloadable' => tsmText::_('com_tsmart_FORM_MEDIA_DOWNLOADABLE'), 'file_is_forSale' => tsmText::_('com_tsmart_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, $tsmart_product_id, $cat_id); $this->pagination = $model->getPagination(); } parent::display($tpl); }
function display($tpl = null) { //Load helpers if (!class_exists('CurrencyDisplay')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'; } if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } // Get the data $model = tmsModel::getModel('product'); // Create filter $this->addStandardDefaultViewLists($model); $this->inventorylist = $model->getProductListing(false, false, false, false); $this->pagination = $model->getPagination(); // Apply currency $currencydisplay = CurrencyDisplay::getInstance(); foreach ($this->inventorylist as $tsmart_product_id => $product) { //TODO oculd be interesting to show the price for each product, and all stored ones $product->product_in_stock $price = isset($product->allPrices[$product->selectedPrice]['product_price']) ? $product->allPrices[$product->selectedPrice]['product_price'] : 0; $product->product_instock_value = $currencydisplay->priceDisplay($price, '', $product->product_in_stock, false); $product->product_price_display = $currencydisplay->priceDisplay($price, '', 1, false); $product->weigth_unit_display = ShopFunctions::renderWeightUnit($product->product_weight_uom); } $options = array(); $options[] = JHtml::_('select.option', '', tsmText::_('com_tsmart_DISPLAY_STOCK') . ':'); $options[] = JHtml::_('select.option', 'stocklow', tsmText::_('com_tsmart_STOCK_LEVEL_LOW')); $options[] = JHtml::_('select.option', 'stockout', tsmText::_('com_tsmart_STOCK_LEVEL_OUT')); $this->lists['stockfilter'] = JHtml::_('select.genericlist', $options, 'search_type', 'onChange="document.adminForm.submit(); return false;"', 'value', 'text', vRequest::getVar('search_type')); $this->lists['filter_product'] = vRequest::getVar('filter_product'); /* Toolbar */ $this->SetViewTitle('PRODUCT_INVENTORY'); JToolBarHelper::publish(); JToolBarHelper::unpublish(); parent::display($tpl); }
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'); tsmConfig::loadJLang('com_tsmart_log'); if ($layoutName == 'edit') { $logFile = basename(vRequest::filterPath(vRequest::getString('logfile', ''))); $this->SetViewTitle('LOG', $logFile); $fileContent = file_get_contents($log_path . DS . $logFile); $this->fileContentByLine = explode("\n", $fileContent); JToolBarHelper::cancel(); } else { if (!class_exists('JFolder')) { require VMPATH_LIBS . DS . 'joomla' . DS . 'filesystem' . DS . 'folder.php'; } $this->logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html')); $this->SetViewTitle('LOG'); $this->path = $log_path; } parent::display($tpl); }
function display($tpl = null) { tsmConfig::loadJLang('com_tsmart_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 = tmsModel::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->tsmart_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 $this->lists['vendors'] = ''; if ($this->showVendors()) { $lists['vendors'] = ShopFunctions::renderVendorList($this->userField->tsmart_vendor_id); } // Shopper groups for EU VAT Id $shoppergroup_model = tmsModel::getModel('shoppergroup'); $shoppergroup_list = $shoppergroup_model->getShopperGroups(true); array_unshift($shoppergroup_list, '0'); $lists['shoppergroups'] = JHtml::_('select.genericlist', $shoppergroup_list, 'tsmart_shoppergroup_id', '', 'tsmart_shoppergroup_id', 'shopper_group_name', $this->userField->get('tsmart_shoppergroup_id')); // Minimum age select $ages = array(); for ($i = 13; $i <= 25; $i++) { $ages[] = array('key' => $i, 'value' => $i . ' ' . tsmText::_('com_tsmart_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' => tsmText::_('com_tsmart_USERFIELDS_URL_ONLY')), array('key' => 2, 'value' => tsmText::_('com_tsmart_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) ? " (" . tsmText::_($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_tsmart_FIELDMANAGER_REQUIRED', 'required', $this->userField->required, $notoggle); $lists['published'] = VmHTML::row('booleanlist', 'com_tsmart_PUBLISHED', 'published', $this->userField->published, $notoggle); $lists['cart'] = VmHTML::row('booleanlist', 'com_tsmart_FIELDMANAGER_SHOW_ON_CART', 'cart', $this->userField->cart, $notoggle); $lists['shipment'] = VmHTML::row('booleanlist', 'com_tsmart_FIELDMANAGER_SHOW_ON_SHIPPING', 'shipment', $this->userField->shipment, $notoggle); $lists['account'] = VmHTML::row('booleanlist', 'com_tsmart_FIELDMANAGER_SHOW_ON_ACCOUNT', 'account', $this->userField->account, $notoggle); $lists['readonly'] = VmHTML::row('booleanlist', 'com_tsmart_USERFIELDS_READONLY', 'readonly', $this->userField->readonly, $notoggle); $this->assignRef('lists', $lists); $this->assignRef('userFieldValues', $userFieldValues); } else { JToolBarHelper::title(tsmText::_('com_tsmart_MANAGE_USER_FIELDS'), 'vm_user_48 head'); JToolBarHelper::addNew(); JToolBarHelper::editList(); JToolBarHelper::divider(); JToolBarHelper::custom('toggle.required.1', 'publish', '', 'com_tsmart_FIELDMANAGER_REQUIRE'); JToolBarHelper::custom('toggle.required.0', 'unpublish', '', 'com_tsmart_FIELDMANAGER_UNREQUIRE'); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::divider(); $barText = tsmText::_('com_tsmart_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_tsmart_FIELDMANAGER_SHOW_REGISTRATION'); JToolBarHelper::custom('toggle.registration.0', 'unpublish', '', 'com_tsmart_FIELDMANAGER_HIDE_REGISTRATION'); JToolBarHelper::custom('toggle.shipment.1', 'publish', '', 'com_tsmart_FIELDMANAGER_SHOW_SHIPPING'); JToolBarHelper::custom('toggle.shipment.0', 'unpublish', '', 'com_tsmart_FIELDMANAGER_HIDE_SHIPPING'); JToolBarHelper::custom('toggle.account.1', 'publish', '', 'com_tsmart_FIELDMANAGER_SHOW_ACCOUNT'); JToolBarHelper::custom('toggle.account.0', 'unpublish', '', 'com_tsmart_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); }
function display($tpl = null) { //Load helpers if (!class_exists('CurrencyDisplay')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'; } if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } if (!class_exists('vmPSPlugin')) { require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php'; } $orderStatusModel = tmsModel::getModel('orderstatus'); $orderStates = $orderStatusModel->getOrderStatusList(true); $this->SetViewTitle('ORDER'); $orderModel = tmsModel::getModel(); $curTask = vRequest::getCmd('task'); if ($curTask == 'edit') { tsmConfig::loadJLang('com_tsmart_shoppers', TRUE); tsmConfig::loadJLang('com_tsmart_orders', true); //For getOrderStatusName if (!class_exists('ShopFunctions')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php'; } // Load addl models $userFieldsModel = tmsModel::getModel('userfields'); // Get the data $tsmart_order_id = vRequest::getInt('tsmart_order_id'); $order = $orderModel->getOrder($tsmart_order_id); if (empty($order['details'])) { JFactory::getApplication()->redirect('index.php?option=com_tsmart&view=orders', tsmText::_('com_tsmart_ORDER_NOTFOUND')); } $_orderID = $order['details']['BT']->tsmart_order_id; $orderbt = $order['details']['BT']; $orderst = array_key_exists('ST', $order['details']) ? $order['details']['ST'] : $orderbt; $orderbt->invoiceNumber = $orderModel->getInvoiceNumber($orderbt->tsmart_order_id); $currency = CurrencyDisplay::getInstance('', $order['details']['BT']->tsmart_vendor_id); $this->assignRef('currency', $currency); $_userFields = $userFieldsModel->getUserFields('account', array('captcha' => true, 'delimiters' => true), array('delimiter_userinfo', 'user_is_vendor', 'username', 'name', 'password', 'password2', 'agreed', 'address_type')); $userFieldsCart = $userFieldsModel->getUserFields('cart', array('captcha' => true, 'delimiters' => true), array('delimiter_userinfo', 'user_is_vendor', 'username', 'password', 'password2', 'agreed', 'address_type')); $_userFields = array_merge($userFieldsCart, $_userFields); //Fallback for customer_note if (empty($orderbt->customer_note) and !empty($orderbt->oc_note)) { $orderbt->customer_note = $orderbt->oc_note; } $userfields = $userFieldsModel->getUserFieldsFilled($_userFields, $orderbt, 'BT_'); $_userFields = $userFieldsModel->getUserFields('shipment', array(), array('delimiter_userinfo', 'username', 'email', 'password', 'password2', 'agreed', 'address_type')); $shipmentfields = $userFieldsModel->getUserFieldsFilled($_userFields, $orderst, 'ST_'); // Create an array to allow orderlinestatuses to be translated // We'll probably want to put this somewhere in ShopFunctions... $_orderStatusList = array(); foreach ($orderStates as $orderState) { //$_orderStatusList[$orderState->tsmart_orderstate_id] = $orderState->order_status_name; //When I use update, I have to use this? $_orderStatusList[$orderState->order_status_code] = tsmText::_($orderState->order_status_name); } $_itemStatusUpdateFields = array(); $_itemAttributesUpdateFields = array(); foreach ($order['items'] as $_item) { $_itemStatusUpdateFields[$_item->tsmart_order_item_id] = JHtml::_('select.genericlist', $orderStates, "item_id[" . $_item->tsmart_order_item_id . "][order_status]", 'class="selectItemStatusCode"', 'order_status_code', 'order_status_name', $_item->order_status, 'order_item_status' . $_item->tsmart_order_item_id, true); } if (!isset($_orderStatusList[$orderbt->order_status])) { if (empty($orderbt->order_status)) { $orderbt->order_status = 'unknown'; } $_orderStatusList[$orderbt->order_status] = tsmText::_('com_tsmart_UNKNOWN_ORDER_STATUS'); } $this->lists['search'] = ''; /* Assign the data */ $this->assignRef('orderdetails', $order); $this->assignRef('orderID', $_orderID); $this->assignRef('userfields', $userfields); $this->assignRef('shipmentfields', $shipmentfields); $this->assignRef('orderstatuslist', $_orderStatusList); $this->assignRef('itemstatusupdatefields', $_itemStatusUpdateFields); $this->assignRef('itemattributesupdatefields', $_itemAttributesUpdateFields); $this->assignRef('orderbt', $orderbt); $this->assignRef('orderst', $orderst); $this->assignRef('tsmart_shipmentmethod_id', $orderbt->tsmart_shipmentmethod_id); /* Data for the Edit Status form popup */ $_currentOrderStat = $order['details']['BT']->order_status; // used to update all item status in one time $_orderStatusSelect = JHtml::_('select.genericlist', $orderStates, 'order_status', 'style="width:100px;"', 'order_status_code', 'order_status_name', $_currentOrderStat, 'order_items_status', true); $this->assignRef('orderStatSelect', $_orderStatusSelect); $this->assignRef('currentOrderStat', $_currentOrderStat); /* Toolbar */ if (JVM_VERSION < 3) { $backward = "back"; $list = 'back'; } else { $backward = 'backward'; $list = 'list'; } JToolBarHelper::custom('prevItem', $backward, '', 'com_tsmart_ITEM_PREVIOUS', false); JToolBarHelper::custom('nextItem', 'forward', '', 'com_tsmart_ITEM_NEXT', false); JToolBarHelper::divider(); JToolBarHelper::custom('cancel', $list, '', 'com_tsmart_ORDER_LIST_LBL', false, false); } else { if ($curTask == 'editOrderItem') { if (!class_exists('calculationHelper')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php'; } $this->assignRef('orderstatuses', $orderStates); $model = tmsModel::getModel(); $orderId = vRequest::getString('orderId', ''); $orderLineItem = vRequest::getVar('orderLineId', ''); $this->assignRef('tsmart_order_id', $orderId); $this->assignRef('tsmart_order_item_id', $orderLineItem); $orderItem = $model->getOrderLineDetails($orderId, $orderLineItem); $this->assignRef('orderitem', $orderItem); } else { $this->setLayout('orders'); $model = tmsModel::getModel(); $this->addStandardDefaultViewLists($model, 'created_on'); $orderStatusModel = tmsModel::getModel('orderstatus'); $orderstates = vRequest::getCmd('order_status_code', ''); $this->lists['state_list'] = $orderStatusModel->renderOSList($orderstates, 'order_status_code', FALSE, ' onchange="this.form.submit();" '); $orderslist = $model->getOrdersList(); $this->assignRef('orderstatuses', $orderStates); if (!class_exists('CurrencyDisplay')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'; } /* Apply currency This must be done per order since it's vendor specific */ $_currencies = array(); // Save the currency data during this loop for performance reasons if ($orderslist) { foreach ($orderslist as $tsmart_order_id => $order) { if (!empty($order->order_currency)) { $currency = $order->order_currency; } else { if ($order->tsmart_vendor_id) { if (!class_exists('tsmartModelVendor')) { require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php'; } $currObj = tsmartModelVendor::getVendorCurrency($order->tsmart_vendor_id); $currency = $currObj->tsmart_currency_id; } } //This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code if (!array_key_exists('curr' . $currency, $_currencies)) { $_currencies['curr' . $currency] = CurrencyDisplay::getInstance($currency, $order->tsmart_vendor_id); } $order->order_total = $_currencies['curr' . $currency]->priceDisplay($order->order_total); $order->invoiceNumber = $model->getInvoiceNumber($order->tsmart_order_id); } } //update order items button /*$q = 'SELECT * FROM #__tsmart_order_items WHERE `product_discountedPriceWithoutTax` IS NULL '; $db = JFactory::getDBO(); $db->setQuery($q); //$res = $db->loadRow(); if(true) { JToolBarHelper::custom('updateCustomsOrderItems', 'new', 'new', vmText::_('com_tsmart_REPORT_UPDATEORDERITEMS'),false); vmError('com_tsmart_UPDATEORDERITEMS_WARN'); }*/ /* * UpdateStatus removed from the toolbar; don't understand how this was intented to work but * the order ID's aren't properly passed. Might be readded later; the controller needs to handle * the arguments. */ /* Toolbar */ //JToolBarHelper::customX( 'CreateOrderHead', 'new','new','New',false); JToolBarHelper::save('updatestatus', tsmText::_('com_tsmart_UPDATE_STATUS')); if (vmAccess::manager('orders.delete')) { JToolBarHelper::spacer('80'); JToolBarHelper::deleteList(); } /* Assign the data */ $this->assignRef('orderslist', $orderslist); $this->pagination = $model->getPagination(); } } if (JFactory::getApplication()->isSite()) { $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Link', 'back', 'com_tsmart_LEAVE', 'index.php?option=com_tsmart&manage=0'); } shopFunctions::checkSafePath(); parent::display($tpl); }
function display($tpl = null) { if (!class_exists('VmImage')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php'; } tsmConfig::loadJLang('com_tsmart_orders', TRUE); if (JFactory::getApplication()->isSite()) { $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Link', 'back', 'com_tsmart_LEAVE', 'index.php?option=com_tsmart&manage=0'); } $layout = $this->getLayout(); if ($this->manager('report')) { vmSetStartTime('report'); $model = tmsModel::getModel('tsmart'); $nbrCustomers = $model->getTotalCustomers(); $this->nbrCustomers = $nbrCustomers; $nbrActiveProducts = $model->getTotalActiveProducts(); $this->nbrActiveProducts = $nbrActiveProducts; $nbrInActiveProducts = $model->getTotalInActiveProducts(); $this->nbrInActiveProducts = $nbrInActiveProducts; $nbrFeaturedProducts = $model->getTotalFeaturedProducts(); $this->nbrFeaturedProducts = $nbrFeaturedProducts; $ordersByStatus = $model->getTotalOrdersByStatus(); $this->ordersByStatus = $ordersByStatus; $recentOrders = $model->getRecentOrders(); if (!class_exists('CurrencyDisplay')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'; } /* Apply currency This must be done per order since it's vendor specific */ $_currencies = array(); // Save the currency data during this loop for performance reasons foreach ($recentOrders as $tsmart_order_id => $order) { //This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code if (!array_key_exists('v' . $order->tsmart_vendor_id, $_currencies)) { $_currencies['v' . $order->tsmart_vendor_id] = CurrencyDisplay::getInstance('', $order->tsmart_vendor_id); } $order->order_total = $_currencies['v' . $order->tsmart_vendor_id]->priceDisplay($order->order_total); } $this->recentOrders = $recentOrders; $recentCustomers = $model->getRecentCustomers(); $this->recentCustomers = $recentCustomers; $reportModel = tmsModel::getModel('report'); vRequest::setvar('task', ''); $myCurrencyDisplay = CurrencyDisplay::getInstance(); $revenueBasic = $reportModel->getRevenue(60, true); $this->report = $revenueBasic['report']; vmJsApi::addJScript("jsapi", "//google.com/jsapi", false, false, ''); vmJsApi::addJScript('vm.stats_chart', $revenueBasic['js'], false, true); vmTime('Created report', 'report'); } //if($layout=='default'){ $j = 'jQuery("#feed").ready(function(){ var datas = ""; vmSiteurl = "' . JURI::root() . '" jQuery.ajax({ type: "GET", async: true, cache: false, dataType: "json", url: vmSiteurl + "index.php?option=com_tsmart&view=tsmart&task=feed", data: datas, dataType: "html" }) .done(function( data ) { jQuery("#feed").append(data); }); })'; vmJsApi::addJScript('getFeed', $j, false, true); //} self::showACLPref($this); parent::display($tpl); }
/** * This is wrong * @deprecated */ function renderMail() { $this->setLayout('mail_html_waitlist'); $this->subject = tsmText::sprintf('com_tsmart_PRODUCT_WAITING_LIST_EMAIL_SUBJECT', $this->productName); $notice_body = tsmText::sprintf('com_tsmart_PRODUCT_WAITING_LIST_EMAIL_BODY', $this->productName, $this->url); parent::display(); }
function display($tpl = null) { if (!class_exists('VmImage')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php'; } if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel(); $usermodel = tmsModel::getModel('user'); JToolBarHelper::title(tsmText::_('com_tsmart_CONFIG'), 'head vm_config_48'); $this->addStandardEditViewCommands(); $this->config = tsmConfig::loadConfig(); if (!empty($this->config->_params)) { unset($this->config->_params['pdf_invoice']); // parameter remove and replaced by inv_os } $this->userparams = JComponentHelper::getParams('com_users'); $this->jTemplateList = ShopFunctions::renderTemplateList(tsmText::_('com_tsmart_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT')); $this->vmLayoutList = $model->getLayoutList('tsmart'); $this->cartLayoutList = $model->getLayoutList('cart', array('padded.php', 'perror.php')); $this->categoryLayoutList = $model->getLayoutList('category'); $this->productLayoutList = $model->getLayoutList('productdetails'); $this->productsFieldList = $model->getFieldList('products'); $this->noimagelist = $model->getNoImageList(); $this->orderStatusModel = tmsModel::getModel('orderstatus'); $this->os_Options = $this->osWoP_Options = $this->osDel_Options = $this->orderStatusModel->getOrderStatusNames(); $emptyOption = JHtml::_('select.option', -1, tsmText::_('com_tsmart_NONE'), 'order_status_code', 'order_status_name'); array_unshift($this->os_Options, $emptyOption); unset($this->osWoP_Options['P']); array_unshift($this->osWoP_Options, $emptyOption); $deldate_inv = JHtml::_('select.option', 'm', tsmText::_('com_tsmart_DELDATE_INV'), 'order_status_code', 'order_status_name'); unset($this->osDel_Options['P']); array_unshift($this->osDel_Options, $deldate_inv); array_unshift($this->osDel_Options, $emptyOption); //vmdebug('my $this->os_Options',$this->osWoP_Options); $this->currConverterList = $model->getCurrencyConverterList(); $this->activeLanguages = $model->getActiveLanguages(tsmConfig::get('active_languages')); $this->orderByFieldsProduct = $model->getProductFilterFields('browse_orderby_fields'); tmsModel::getModel('category'); foreach (tsmartModelCategory::$_validOrderingFields as $key => $field) { if ($field == 'c.category_shared') { continue; } $fieldWithoutPrefix = $field; $dotps = strrpos($fieldWithoutPrefix, '.'); if ($dotps !== false) { $prefix = substr($field, 0, $dotps + 1); $fieldWithoutPrefix = substr($field, $dotps + 1); } $text = tsmText::_('com_tsmart_' . strtoupper(str_replace(array(',', ' '), array('_', ''), $fieldWithoutPrefix))); $orderByFieldsCat[] = JHtml::_('select.option', $field, $text); } $this->orderByFieldsCat = $orderByFieldsCat; $this->searchFields = $model->getProductFilterFields('browse_search_fields'); $this->aclGroups = $usermodel->getAclGroupIndentedTree(); if (!class_exists('VmTemplate')) { require VMPATH_SITE . DS . 'helpers' . DS . 'vmtemplate.php'; } $this->vmtemplate = VmTemplate::loadVmTemplateStyle(); $this->imagePath = shopFunctions::getAvailabilityIconUrl($this->vmtemplate); $this->listShipment = $this->listIt('shipment'); $this->listPayment = $this->listIt('payment'); shopFunctions::checkSafePath(); $this->checkTCPDFinstalled(); $this->checkVmUserVendor(); //$this -> checkClientIP(); parent::display($tpl); }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel(); $input = JFactory::getApplication()->input; $task = $input->get('task'); $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(); //get list tour require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmhoteladdon.php'; $this->item->list_tour_id = tsmHotelAddon::get_list_tour_id_by_hotel_addon_id($this->item->tsmart_hotel_addon_id); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php'; $list_tour = vmproduct::get_list_product(); $this->assignRef('list_tour', $list_tour); //end get list tour $this->SetViewTitle('', $this->item->title); $this->addStandardEditViewCommandsPopup(); } else { $this->SetViewTitle(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::editList(); JToolBarHelper::addNew('add_new_item'); JToolBarHelper::deleteList(); $this->addStandardDefaultViewLists($model, 0, 'ASC'); $this->items = $model->getItemList(); $this->pagination = $model->getPagination(); $this->state = $model->getState(); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/vmcities.php'; $this->list_cityarea = tsmcities::get_city_state_country(); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmhoteladdon.php'; $this->list_hotel_addon_type = tsmHotelAddon::get_list_hotel_addon_type(); $this->list_hotel_payment_type = tsmHotelAddon::get_list_hotel_payment_type(); $this->list_hotel_addon_service_class = tsmHotelAddon::get_list_hotel_addon_service_class(); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmhotel.php'; require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php'; $list_tour = vmproduct::get_list_product(); $this->assignRef('list_tour', $list_tour); $this->list_hotel = tsmHotel::get_list_hotel(); if ($task == 'edit_item' || $task == 'add_new_item') { $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(); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmhoteladdon.php'; $this->hotel = tsmHotelAddon::get_detail_hotel_by_hotel_id($this->item->tsmart_hotel_id); $this->tour_id_seletecd = tsmHotelAddon::get_list_tour_id_by_hotel_addon_id($this->item->tsmart_hotel_addon_id); //get list tour $this->item->list_tour_id = tsmHotelAddon::get_list_tour_id_by_hotel_addon_id($this->item->tsmart_hotel_addon_id); //end get list tour } } parent::display($tpl); }
function display($tpl = null) { $mainframe = Jfactory::getApplication(); $option = vRequest::getCmd('option'); //Load helpers if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } /* Get the review IDs to retrieve (input variable may be cid, cid[] or tsmart_rating_review_id */ $cids = vRequest::getInt('cid', vRequest::getVar('tsmart_rating_review_id', 0)); if ($cids && !is_array($cids)) { $cids = array($cids); } // Figure out maximum rating scale (default is 5 stars) $this->max_rating = tsmConfig::get('vm_maximum_rating_scale', 5); $model = tmsModel::getModel(); $this->SetViewTitle('REVIEW_RATE'); /* Get the task */ $task = vRequest::getCmd('task'); switch ($task) { case 'edit': /* Get the data $rating = $model->getRating($cids); $this->addStandardEditViewCommands(); break;*/ /* Get the data $rating = $model->getRating($cids); $this->addStandardEditViewCommands(); break;*/ case 'listreviews': /* Get the data */ $this->addStandardDefaultViewLists($model); $tsmart_product_id = vRequest::getInt('tsmart_product_id'); if (is_array($tsmart_product_id) && count($tsmart_product_id) > 0) { $tsmart_product_id = (int) $tsmart_product_id[0]; } else { $tsmart_product_id = (int) $tsmart_product_id; } $this->reviewslist = $model->getReviews($tsmart_product_id, vmAccess::getVendorId()); $lists = array(); $lists['filter_order'] = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', '', 'cmd'); $lists['filter_order_Dir'] = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $this->pagination = $model->getPagination(); $this->addStandardDefaultViewCommands(false, true); break; case 'edit_review': JToolBarHelper::divider(); // Get the data $this->rating = $model->getReview($cids); if (!empty($this->rating)) { $this->SetViewTitle('REVIEW_RATE', $this->rating->product_name . " (" . $this->rating->customer . ")"); JToolBarHelper::custom('saveReview', 'save', 'save', tsmText::_('com_tsmart_SAVE'), false); JToolBarHelper::custom('applyReview', 'apply', 'apply', tsmText::_('com_tsmart_APPLY'), false); } else { $this->SetViewTitle('REVIEW_RATE', 'ERROR'); } JToolBarHelper::custom('cancelEditReview', 'cancel', 'cancel', tsmText::_('com_tsmart_CANCEL'), false); break; default: $this->addStandardDefaultViewCommands(false, true); $this->addStandardDefaultViewLists($model); $this->ratingslist = $model->getRatings(); $this->pagination = $model->getPagination(); break; } parent::display($tpl); }
function display($tpl = null) { // Load the helper(s) $this->addHelperPath(VMPATH_ADMIN . DS . 'helpers'); if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } if (!class_exists('vmPSPlugin')) { require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php'; } $this->user = JFactory::getUser(); $model = tmsModel::getModel('paymentmethod'); // TODO logo $this->SetViewTitle(); $layoutName = vRequest::getCmd('layout', 'default'); $vendorModel = tmsModel::getModel('vendor'); $vendorModel->setId(1); $vendor = $vendorModel->getVendor(); $currencyModel = tmsModel::getModel('currency'); $currencyModel = $currencyModel->getItemList($vendor->vendor_currency); $this->assignRef('vendor_currency', $currencyModel->currency_symbol); if ($layoutName == 'edit') { // Load the helper(s) if (!class_exists('VmImage')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php'; } tsmConfig::loadJLang('plg_vmpsplugin', false); JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields'); $payment = $model->getPayment(); // Get the payment XML. $formFile = vRequest::filterPath(VMPATH_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::getVarsToPushFromForm($payment->form); tsmTable::bindParameterableToSubField($payment, $varsToPush); $payment->form->bind($payment->getProperties()); } else { $payment->form = null; } $this->assignRef('payment', $payment); $this->vmPPaymentList = self::renderInstalledPaymentPlugins($payment->payment_jplugin_id); $this->shopperGroupList = ShopFunctions::renderShopperGroupList($payment->tsmart_shoppergroup_ids, true); if ($this->showVendors()) { $vendorList = ShopFunctions::renderVendorList($payment->tsmart_vendor_id); $this->assignRef('vendorList', $vendorList); } $this->addStandardEditViewCommandsPopup($payment->tsmart_paymentmethod_id); } else { JToolBarHelper::custom('clonepayment', 'copy', 'copy', tsmText::_('com_tsmart_PAYMENT_CLONE'), true); $this->addStandardDefaultViewCommandsPopup(); $this->addStandardDefaultViewLists($model); $this->payments = $model->getPayments(); tsmConfig::loadJLang('com_tsmart_shoppers', TRUE); foreach ($this->payments as &$data) { // Write the first 5 shoppergroups in the list $data->paymShoppersList = shopfunctions::renderGuiList($data->tsmart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'payment'); } $this->pagination = $model->getPagination(); } parent::display($tpl); }