예제 #1
0
 function updateOrderItems()
 {
     vRequest::vmCheckToken();
     $model = tmsModel::getModel('report');
     $model->updateOrderItems();
     $this->setRedirect($this->redirectPath, 'Order Items updated');
 }
예제 #2
0
 public function ajax_save_passenger()
 {
     $input = JFactory::getApplication()->input;
     $virtuemart_order_id = $input->getInt('virtuemart_order_id', 0);
     $passenger_id = $input->getInt('passenger_id', 0);
     $post = $input->getArray();
     $passenger_data = $post['data'];
     $order_mode = tmsModel::getModel('orders');
     $orderTable = $order_mode->getTable('orders');
     $orderTable->load($virtuemart_order_id);
     $order_data = $orderTable->order_data;
     $order_data = json_decode($order_data);
     $list_passenger = $order_data->list_passenger;
     $start_index = 0;
     foreach ($list_passenger as $key => $list_passenger1) {
         for ($i = 0; $i < count($list_passenger1); $i++) {
             if ($start_index == $passenger_id) {
                 $list_passenger->{$key}[$i] = (object) array_merge((array) $list_passenger->{$key}[$i], $passenger_data);
             }
             $start_index++;
         }
     }
     $order_data->list_passenger = $list_passenger;
     $orderTable->order_data = json_encode($order_data);
     if (!$orderTable->store()) {
         echo "<pre>";
         print_r($orderTable, false);
         echo "</pre>";
         die;
     }
     echo 1;
     die;
 }
예제 #3
0
 function display($tpl = null)
 {
     // Load the helper(s)
     $this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
     if (!class_exists('vmPSPlugin')) {
         require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
     }
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $layoutName = vRequest::getCmd('layout', 'default');
     $this->SetViewTitle();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         tsmConfig::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);
             tsmTable::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('tsmartModelVendor')) {
             require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
         }
         $vendor_id = 1;
         $currency = tsmartModelVendor::getVendorCurrency($vendor_id);
         $this->assignRef('vendor_currency', $currency->currency_symbol);
         if ($this->showVendors()) {
             $vendorList = ShopFunctions::renderVendorList($shipment->tsmart_vendor_id);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
         $this->assignRef('shipment', $shipment);
         $this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->tsmart_shoppergroup_ids, true);
         $this->addStandardEditViewCommands($shipment->tsmart_shipmentmethod_id);
     } else {
         JToolBarHelper::custom('cloneshipment', 'copy', 'copy', tsmText::_('com_tsmart_SHIPMENT_CLONE'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $this->shipments = $model->getShipments();
         tsmConfig::loadJLang('com_tsmart_shoppers', TRUE);
         foreach ($this->shipments as &$data) {
             // Write the first 5 shoppergroups in the list
             $data->shipmentShoppersList = shopfunctions::renderGuiList($data->tsmart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
         }
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
예제 #4
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsEditInline();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
예제 #5
0
 public static function get_html_tour_information(&$view, $tsmart_product_id = 0)
 {
     $product_model = tmsModel::getModel('product');
     $product = $product_model->getItem($tsmart_product_id);
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('tour_service_class.service_class_name')->from('#__tsmart_service_class AS tour_service_class')->leftJoin('#__tsmart_tour_id_service_class_id  AS tour_id_service_class_id USING(tsmart_service_class_id)')->where('tour_id_service_class_id.tsmart_product_id=' . (int) $product->tsmart_product_id);
     $product->list_tour_service_class = $db->setQuery($query)->loadColumn();
     $query = $db->getQuery(true);
     $query->select('countries.country_name')->from('#__tsmart_countries AS countries')->leftJoin('#__tsmart_tour_id_country_id  AS tour_id_country_id USING(tsmart_country_id)')->where('tour_id_country_id.tsmart_product_id=' . (int) $product->tsmart_product_id);
     $product->list_country = implode(',', $db->setQuery($query)->loadColumn());
     $query = $db->getQuery(true);
     $query->select('cityarea.city_area_name')->from('#__tsmart_cityarea AS cityarea')->where('cityarea.tsmart_cityarea_id=' . (int) $product->start_city);
     $product->start_city = $db->setQuery($query)->loadResult();
     $query = $db->getQuery(true);
     $query->select('tour_section.tour_section_name')->from('#__tsmart_tour_section AS tour_section')->where('tour_section.tsmart_tour_section_id=' . (int) $product->tsmart_tour_section_id);
     $product->tour_section = $db->setQuery($query)->loadResult();
     $query = $db->getQuery(true);
     $query->select('cityarea.city_area_name')->from('#__tsmart_cityarea AS cityarea')->where('cityarea.tsmart_cityarea_id=' . (int) $product->end_city);
     $product->end_city = $db->setQuery($query)->loadResult();
     $query = $db->getQuery(true);
     $query->select('tour_type.title')->from('#__tsmart_tour_type AS tour_type')->where('tour_type.tsmart_tour_type_id=' . (int) $product->tsmart_tour_type_id);
     $product->tour_type = $db->setQuery($query)->loadResult();
     $query = $db->getQuery(true);
     $query->select('tour_style.title')->from('#__tsmart_tour_style AS tour_style')->where('tour_style.tsmart_tour_style_id=' . (int) $product->tsmart_tour_style_id);
     $product->tour_style = $db->setQuery($query)->loadResult();
     $query = $db->getQuery(true);
     $query->select('physicalgrade.title')->from('#__tsmart_physicalgrade AS physicalgrade')->where('physicalgrade.tsmart_physicalgrade_id=' . (int) $product->tsmart_physicalgrade_id);
     $product->physicalgrade = $db->setQuery($query)->loadResult();
     $view->product = $product;
     ob_start();
     include_once JPATH_ROOT . '/administrator/components/com_tsmart/views/product/tmpl/productinformation.php';
     $content = ob_get_clean();
     return $content;
 }
예제 #6
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->dateavailability = $model->getdateavailability();
         $this->SetViewTitle('', $this->dateavailability->dateavailability_name);
         $this->addStandardEditViewCommands();
     } else {
         $model_product = tmsModel::getModel('product');
         $model_tour_class = tmsModel::getModel('tourclass');
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/vmdateavailability.php';
         $this->list_tour = tsmdateavailability::get_list_tour_private();
         $this->list_tour_class = $model_tour_class->getItemList();
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsdateavailability();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->list_date_availability = $model->getItemList(vRequest::getCmd('search'));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
예제 #7
0
 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->SetViewTitle();
     $model = tmsModel::getModel();
     $this->state = $model->getItem();
     $this->tsmart_country_id = vRequest::getInt('tsmart_country_id', $this->state->tsmart_country_id);
     $isNew = count($this->state) < 1;
     if (empty($countryId) && $isNew) {
         vmWarn('Country id is 0');
         return false;
     }
     $country = tmsModel::getModel('country');
     $country->setId($this->tsmart_country_id);
     $this->country_name = $country->getData()->country_name;
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $zoneModel = tmsModel::getModel('Worldzones');
         $this->worldZones = $zoneModel->getWorldZonesSelectList();
         $this->addStandardEditViewCommands();
     } else {
         //get list country
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmcountries.php';
         $list_country = tsmcountries::get_countries();
         $this->assignRef('list_country', $list_country);
         //end get list country
         $this->addStandardDefaultViewCommandsEditInline();
         $this->addStandardDefaultViewLists($model);
         $this->items = $model->getItemList();
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
예제 #8
0
 public function getItems()
 {
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmprice.php';
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpromotion.php';
     $items = parent::getItems();
     // TODO: Change the autogenerated stub
     // Create Money object that represents 1 EUR
     // Access the Money object's monetary value converted to its base units
     foreach ($items as &$item) {
         $item->sale_price_senior = vmprice::get_sale_price_by_mark_up_and_tax($item->price_senior, $item->mark_up_senior, $item->mark_up_price_senior, $item->tax, $item->mark_up_type);
         $item->sale_price_adult = vmprice::get_sale_price_by_mark_up_and_tax($item->price_adult, $item->mark_up_adult, $item->mark_up_price_adult, $item->tax, $item->mark_up_type);
         $item->sale_price_teen = vmprice::get_sale_price_by_mark_up_and_tax($item->price_teen, $item->mark_up_teen, $item->mark_up_price_teen, $item->tax, $item->mark_up_type);
         $item->sale_price_children1 = vmprice::get_sale_price_by_mark_up_and_tax($item->price_children1, $item->mark_up_children1, $item->mark_up_price_children1, $item->tax, $item->mark_up_type);
         $item->sale_price_children2 = vmprice::get_sale_price_by_mark_up_and_tax($item->price_children2, $item->mark_up_children2, $item->mark_up_price_children2, $item->tax, $item->mark_up_type);
         $item->sale_price_infant = vmprice::get_sale_price_by_mark_up_and_tax($item->price_infant, $item->mark_up_infant, $item->mark_up_price_infant, $item->tax, $item->mark_up_type);
         $item->sale_price_private_room = vmprice::get_sale_price_by_mark_up_and_tax($item->price_private_room, $item->mark_up_private_room, $item->mark_up_price_private_room, $item->tax, $item->mark_up_type);
         $item->sale_price_extra_bed = vmprice::get_sale_price_by_mark_up_and_tax($item->price_extra_bed, $item->mark_up_extra_bed, $item->mark_up_price_extra_bed, $item->tax, $item->mark_up_type);
         $item->sale_promotion_price_senior = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_senior, $item->mark_up_promotion_senior, $item->mark_up_promotion_price_senior, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_senior, $item->mark_up_promotion_net_senior, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_adult = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_adult, $item->mark_up_promotion_adult, $item->mark_up_promotion_price_adult, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_adult, $item->mark_up_promotion_net_adult, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_teen = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_teen, $item->mark_up_promotion_teen, $item->mark_up_promotion_price_teen, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_teen, $item->mark_up_promotion_net_teen, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_children1 = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_children1, $item->mark_up_promotion_children1, $item->mark_up_promotion_price_children1, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_children1, $item->mark_up_promotion_net_children1, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_children2 = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_children2, $item->mark_up_promotion_children2, $item->mark_up_promotion_price_children2, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_children2, $item->mark_up_promotion_net_children2, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_infant = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_infant, $item->mark_up_promotion_infant, $item->mark_up_promotion_price_infant, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_infant, $item->mark_up_promotion_net_infant, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_private_room = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_private_room, $item->mark_up_promotion_private_room, $item->mark_up_promotion_price_private_room, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_private_room, $item->mark_up_promotion_net_private_room, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->sale_promotion_price_extra_bed = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_extra_bed, $item->mark_up_promotion_extra_bed, $item->mark_up_promotion_price_extra_bed, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_extra_bed, $item->mark_up_promotion_net_extra_bed, $item->mark_up_promotion_net_type, $item->promotion_tax);
         $item->full_charge_children1 = $item->tsmart_promotion_price_id ? $item->tour_promotion_price_full_charge_children1 : $item->tour_price_full_charge_children1;
         $item->full_charge_children2 = $item->tsmart_promotion_price_id ? $item->tour_promotion_price_full_charge_children2 : $item->tour_price_full_charge_children2;
     }
     return $items;
 }
예제 #9
0
 function prepareVendor()
 {
     $vendorModel = tmsModel::getModel('vendor');
     $vendor = $vendorModel->getVendor();
     $this->assignRef('vendor', $vendor);
     $vendorModel->addImages($this->vendor, 1);
 }
예제 #10
0
 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);
 }
예제 #11
0
 function display($tpl = null)
 {
     // Load the helper(s)
     $app = JFactory::getApplication();
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php';
     $this->tsmart_product_id = $app->input->get('tsmart_product_id', 0, 'int');
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
예제 #12
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $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);
 }
예제 #13
0
 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct('tsmart_custom_id');
     $this->setMainTable('customs');
     $this->setToggleName('admin_only');
     $this->setToggleName('is_hidden');
 }
 public function go_to_pay_now()
 {
     $input = JFactory::getApplication()->input;
     $booking_summary = $input->getString('booking_summary', '');
     $booking_summary = json_decode($booking_summary);
     $contact_data = $booking_summary->contact_data;
     $contact_data = json_decode($contact_data);
     $bookprivategroupsumary_model = tmsModel::getModel('bookprivategroupsumary');
     $email_address = $contact_data->email_address;
     $user_model = tmsModel::getModel('user');
     $table_user = JTable::getInstance('user');
     $table_user->parent_load(array('email' => $email_address));
     $send_email = false;
     $new_member = false;
     if (!$table_user->id) {
         $user_model->create_new_user_from_contact_data($contact_data, $send_email);
         $new_member = true;
     }
     $table_user->parent_load(array('email' => $email_address));
     $order = $bookprivategroupsumary_model->save_order($booking_summary, $table_user->id);
     $bookprivategroupsumary_model->send_bookprivategroupsumary($booking_summary, $contact_data->email_address, $new_member, $order, $table_user->activation);
     die;
     $this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=bookprivategroupsumaryalert'));
     return true;
 }
예제 #15
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->departure = $model->getdeparture();
         $this->SetViewTitle('', $this->departure->departure_name);
         $this->addStandardEditViewCommands();
     } else {
         $model_product = tmsModel::getModel('product');
         $model_tour_class = tmsModel::getModel('tourclass');
         $this->list_tour = $model_product->getProductListing(false, false, false, false);
         $this->list_tour_class = $model_tour_class->getTourClassList();
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->departures = $model->getdepartureList(vRequest::getCmd('search'));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
예제 #16
0
 function save($data = 0)
 {
     $fileModel = tmsModel::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 = tsmText::_('com_tsmart_FILE_SAVED_SUCCESS');
     }
     $cmd = vRequest::getCmd('task');
     if ($cmd == 'apply') {
         $redirection = 'index.php?option=com_tsmart&view=media&task=edit&tsmart_media_id=' . $id;
     } else {
         $redirection = 'index.php?option=com_tsmart&view=media';
     }
     $this->setRedirect($redirection, $msg);
 }
예제 #17
0
 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);
 }
예제 #18
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $this->setLayout('default');
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::editList();
     JToolBarHelper::addNew();
     JToolBarHelper::deleteList();
     $this->SetViewTitle();
     $this->addStandardDefaultViewLists($model, 0, 'ASC');
     $this->items = $model->getItemList(vRequest::getCmd('search', false));
     $this->pagination = $model->getPagination();
     $cid = vRequest::getInt('cid');
     $model->setId($cid);
     $this->item = $model->getItem();
     $this->SetViewTitle('', $this->item->title);
     parent::display($tpl);
 }
예제 #19
0
 /**
  *
  * Task for disabling dangerous database tools, used after install
  * @author Max Milbers
  */
 public function disableDangerousTools()
 {
     $data = vRequest::getRequest();
     $config = tmsModel::getInstance('config', 'tsmartModel');
     $config->setDangerousToolsOff();
     $this->display();
 }
 function store(&$data)
 {
     if (!vmAccess::manager('manufacturercategories')) {
         vmWarn('Insufficient permissions to store manufacturer category');
         return false;
     }
     return parent::store($data);
 }
예제 #21
0
 function remove($ids)
 {
     if (!vmAccess::manager('paymentsetting')) {
         vmWarn('Insufficient permissions to remove paymentsetting');
         return false;
     }
     return parent::remove($ids);
 }
 /**
  * Only send an email if the ERP is enabled, and authorization is done by ERP
  * IN all other cases, there will be an authorization after OrderConfirmed, that will send an email
  * @param $order
  */
 function onResponseUpdateOrderHistory($order)
 {
     $order_history['order_status'] = $this->_currentMethod->status_orderconfirmed;
     $order_history['customer_notified'] = $this->getCustomerNotified();
     $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_ORDERCONFIRMED');
     $modelOrder = tmsModel::getModel('orders');
     $modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order_history, false);
 }
예제 #23
0
 function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $model = tmsModel::getModel('Manufacturer');
     $manufacturers = $model->getManufacturers(true, true, false);
     return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox"   ', 'value', 'text', $this->value, $this->id);
 }
예제 #24
0
 /**
  * Constructor for the calc model.
  *
  * The calc id is read and detmimined if it is an array of ids or just one single id.
  *
  * @author RickG
  */
 public function __construct()
 {
     parent::__construct();
     $this->setMainTable('calcs');
     $this->setToggleName('calc_shopper_published');
     $this->setToggleName('calc_vendor_published');
     $this->setToggleName('shared');
     $this->addvalidOrderingFieldName(array('tsmart_category_id', 'tsmart_country_id', 'tsmart_state_id', 'tsmart_shoppergroup_id', 'tsmart_manufacturer_id'));
 }
예제 #25
0
 /**
  * Send the ask question email.
  * @author Kohl Patrick, Christopher Roussel
  */
 public function mailAskquestion()
 {
     vRequest::vmCheckToken();
     if (!class_exists('shopFunctionsF')) {
         require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $model = tmsModel::getModel('vendor');
     $mainframe = JFactory::getApplication();
     $vars = array();
     $min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
     $max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
     $commentSize = vRequest::getString('comment');
     if (function_exists('mb_strlen')) {
         $commentSize = mb_strlen($commentSize);
     } else {
         $commentSize = strlen($commentSize);
     }
     $validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
     $virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
     if (!class_exists('VirtueMartModelVendor')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
     }
     $userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
     //$vendorUser = JFactory::getUser($userId);
     if ($commentSize < $min || $commentSize > $max || !$validMail) {
         $this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
         return;
     }
     $user = JFactory::getUser();
     $fromMail = vRequest::getVar('email');
     //is sanitized then
     $fromName = vRequest::getVar('name', '');
     //is sanitized then
     $fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
     $fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
     if (!empty($user->id)) {
         if (empty($fromMail)) {
             $fromMail = $user->email;
         }
         if (empty($fromName)) {
             $fromName = $user->name;
         }
     }
     $vars['user'] = array('name' => $fromName, 'email' => $fromMail);
     $VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
     $vars['vendor'] = array('vendor_store_name' => $fromName);
     if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
         $string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
     } else {
         $string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
     }
     $mainframe->enqueueMessage(tsmText::_($string));
     // Display it all
     $view = $this->getView('vendor', 'html');
     $view->setLayout('mail_confirmed');
     $view->display();
 }
예제 #26
0
 /**
  * Method to get the field input markup. Use as name the view of the desired layout list + "layout".
  * For example <field name="categorylayout" for all layouts of hte category view.
  *
  * @author   Max Milbers
  * @return	string	The field input markup.
  * @since	2.0.24a
  */
 function getInput()
 {
     tsmConfig::loadJLang('com_tsmart');
     $view = substr($this->fieldname, 0, -6);
     $model = tmsModel::getModel('config');
     $vmLayoutList = $model->getFieldList('products');
     $html = JHtml::_('Select.genericlist', $vmLayoutList, $this->name, 'size=1 width=200', 'value', 'text', array($this->value));
     return $html;
 }
예제 #27
0
 function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
     $val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
     $model = tmsModel::getModel('vendor');
     $vendors = $model->getVendors(true, true, false);
     return JHtml::_('select.genericlist', $vendors, $this->name, 'class="inputbox"  size="1"', 'tsmart_vendor_id', 'vendor_name', $this->value, $this->id);
 }
예제 #28
0
 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     if ($tsmart_media_id = vRequest::getInt('tsmart_media_id')) {
         //$db = JFactory::getDBO();
         $query = 'SELECT `file_url`,`file_title` FROM `#__tsmart_medias` where `tsmart_media_id`=' . $tsmart_media_id;
         $db->setQuery($query);
         $json = $db->loadObject();
         if (isset($json->file_url)) {
             $json->file_url = JURI::root() . $json->file_url;
             $json->msg = 'OK';
             echo vmJsApi::safe_json_encode($json);
         } else {
             $json->msg = '<b>' . tsmText::_('com_tsmart_NO_IMAGE_SET') . '</b>';
             echo json_encode($json);
         }
     } elseif ($custom_jplugin_id = vRequest::getInt('custom_jplugin_id')) {
         $table = '#__extensions';
         $ext_id = 'extension_id';
         $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "' . $custom_jplugin_id . '"';
         $db->setQuery($q);
         $this->jCustom = $db->loadObject();
         $customModel = tmsModel::getModel('custom');
         $this->custom = $customModel->getCustom();
         // Get the payment XML.
         $formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml');
         if (file_exists($formFile)) {
             tsmConfig::loadJLang('plg_vmpsplugin', false);
             if (!class_exists('vmPlugin')) {
                 require VMPATH_PLUGINLIBS . DS . 'vmplugin.php';
             }
             $filename = 'plg_vmcustom_' . $this->jCustom->element;
             vmPlugin::loadJLang($filename, 'vmcustom', $this->jCustom->element);
             $this->custom = tmsModel::getModel('custom')->getCustom();
             $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
             $this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
             $this->custom->params = new stdClass();
             foreach ($varsToPush as $k => $field) {
                 if (strpos($k, '_') != 0) {
                     $this->custom->params->{$k} = $field[0];
                 }
             }
             $this->custom->form->bind($this->custom->getProperties());
             $form = $this->custom->form;
             include VMPATH_ADMIN . DS . 'fields' . DS . 'formrenderer.php';
             echo '<input type="hidden" value="' . $this->jCustom->element . '" name="custom_value">';
         } else {
             $this->custom->form = null;
             //VmConfig::$echoDebug = 1;
             vmdebug('File does not exist ' . $formFile);
         }
     }
     jExit();
 }
예제 #29
0
 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);
 }
예제 #30
0
 /**
  * Collect all data to show on the template
  *
  * @author RolandD, Max Milbers
  */
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $virtuemart_price_id = $input->getInt('virtuemart_price_id', 0);
     $trip_model = tmsModel::getModel('trip');
     $this->trip = $trip_model->getItem($virtuemart_price_id);
     $product_model = tmsModel::getModel('product');
     $this->product = $product_model->getItem($this->trip->virtuemart_product_id);
     parent::display($tpl);
 }