Exemple #1
0
 function updateOrderItems()
 {
     vRequest::vmCheckToken();
     $model = tmsModel::getModel('report');
     $model->updateOrderItems();
     $this->setRedirect($this->redirectPath, 'Order Items updated');
 }
Exemple #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;
 }
Exemple #3
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);
 }
Exemple #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);
 }
Exemple #5
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);
 }
Exemple #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->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);
 }
Exemple #7
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);
 }
Exemple #8
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);
 }
Exemple #9
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);
 }
 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;
 }
Exemple #11
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);
 }
Exemple #12
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;
 }
Exemple #13
0
 function prepareVendor()
 {
     $vendorModel = tmsModel::getModel('vendor');
     $vendor = $vendorModel->getVendor();
     $this->assignRef('vendor', $vendor);
     $vendorModel->addImages($this->vendor, 1);
 }
Exemple #14
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);
 }
Exemple #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();
     $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);
 }
Exemple #16
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);
 }
 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);
 }
 /**
  * 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);
 }
Exemple #19
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();
 }
 /**
  * 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;
 }
Exemple #21
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);
 }
Exemple #22
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();
 }
Exemple #23
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     JToolBarHelper::save('save', 'Save');
     $this->config = $model->getItem();
     parent::display($tpl);
 }
Exemple #24
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);
 }
 /**
  * if asynchronous mode, ?
  * @param $order
  */
 public function onResponseUpdateOrderHistory($order)
 {
     $order_history = array();
     $amazonState = "";
     $reasonCode = "";
     $authorizeResponse = $this->amazonData;
     // if am
     $getAuthorizationDetailsResult = $authorizeResponse->getGetAuthorizationDetailsResult();
     $authorizationDetails = $getAuthorizationDetailsResult->getAuthorizationDetails();
     if ($authorizationDetails->isSetAuthorizationStatus()) {
         $authorizationStatus = $authorizationDetails->getAuthorizationStatus();
         if (!$authorizationStatus->isSetState()) {
             return false;
         }
         $amazonState = $authorizationStatus->getState();
         if ($authorizationStatus->isSetReasonCode()) {
             $reasonCode = $authorizationStatus->getReasonCode();
         }
     }
     // In asynchronous mode, AuthorizationResponse is always Pending. Order status is not updated
     if ($amazonState == 'Pending') {
         return $amazonState;
     }
     $order_history['customer_notified'] = 1;
     // SYNCHRONOUS MODE: amazon returns in real time the final process status
     if ($amazonState == 'Open') {
         // it should always be the case if the CaptureNow == false
         $order_history['order_status'] = $this->_currentMethod->status_authorization;
         $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_AUTHORIZATION_OPEN');
         $order_history['customer_notified'] = 1;
     } elseif ($amazonState == 'Closed') {
         // it should always be the case if the CaptureNow == true
         if (!($authorizationDetails->isSetCaptureNow() and $authorizationDetails->getCaptureNow())) {
             $this->debugLog('SYNCHRONOUS , capture Now, and Amazon State is NOT CLOSED' . __FUNCTION__ . var_export($authorizeResponse, true), 'error');
             return $amazonState;
         }
         $order_history['order_status'] = $this->_currentMethod->status_capture;
         $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_CAPTURED');
         $order_history['customer_notified'] = 1;
     } elseif ($amazonState == 'Declined') {
         // handling Declined Authorizations
         $order_history['order_status'] = $this->_currentMethod->status_cancel;
         $order_history['comments'] = $reasonCode;
         if ($authorizationStatus->isSetReasonDescription()) {
             $order_history['comments'] .= " " . $authorizationStatus->getReasonDescription();
         }
         $order_history['customer_notified'] = 0;
     }
     $order_history['amazonState'] = $amazonState;
     $modelOrder = tmsModel::getModel('orders');
     $modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order_history, TRUE);
     return $amazonState;
 }
 /**
  * Translates a string into the current language. This just jText of joomla 2.5.x
  *
  * Examples:
  * <script>alert(Joomla.vmText._('<?php echo vmText::_("JDEFAULT", array("script"=>true));?>'));</script>
  * will generate an alert message containing 'Default'
  * <?php echo vmText::_("JDEFAULT");?> it will generate a 'Default' string
  *
  * @param   string $string The string to translate.
  * @param   mixed $jsSafe Boolean: Make the result javascript safe.
  * @param   boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation)
  * @param   boolean $script To indicate that the string will be push in the javascript language store
  *
  * @return  string  The translated string or the key is $script is true
  *
  * @since   11.1
  */
 public static function get_list_group_size_by_tour_id($tsmart_product_id)
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('group_size.tsmart_group_size_id,CONCAT(group_size.group_name,"(",group_size.from,"-",group_size.to,")") AS group_name,group_size.type AS group_type')->from('#__tsmart_tour_id_group_size_id AS tour_id_group_size_id')->leftJoin('#__tsmart_group_size AS group_size ON group_size.tsmart_group_size_id=tour_id_group_size_id.tsmart_group_size_id')->where('tour_id_group_size_id.tsmart_product_id=' . (int) $tsmart_product_id)->where('group_size.tsmart_group_size_id!=0')->order('group_size.from');
     $model_product = tmsModel::getModel('product');
     $product = $model_product->getItem($tsmart_product_id);
     if ($product->price_type == 'multi_price') {
         $query->where('group_size.type!=' . $query->q('flat_price'));
     }
     return $db->setQuery($query)->loadObjectList();
 }
Exemple #27
0
 /**
  * Translates a string into the current language. This just jText of joomla 2.5.x
  *
  * Examples:
  * <script>alert(Joomla.vmText._('<?php echo vmText::_("JDEFAULT", array("script"=>true));?>'));</script>
  * will generate an alert message containing 'Default'
  * <?php echo vmText::_("JDEFAULT");?> it will generate a 'Default' string
  *
  * @param   string   $string                The string to translate.
  * @param   mixed    $jsSafe                Boolean: Make the result javascript safe.
  * @param   boolean  $interpretBackSlashes  To interpret backslashes (\\=\, \n=carriage return, \t=tabulation)
  * @param   boolean  $script                To indicate that the string will be push in the javascript language store
  *
  * @return  string  The translated string or the key is $script is true
  *
  * @since   11.1
  */
 public static function get_list_group_size_by_tour_id($tsmart_product_id)
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('group_size.tsmart_group_size_id,CONCAT(group_size.group_name,"(",group_size.from,"-",group_size.to,")") AS group_name,group_size.type AS group_type')->from('#__tsmart_tour_id_group_size_id AS tour_id_group_size_id')->leftJoin('#__tsmart_group_size AS group_size ON group_size.tsmart_group_size_id=tour_id_group_size_id.tsmart_group_size_id')->where('tour_id_group_size_id.tsmart_product_id=' . (int) $tsmart_product_id)->where('group_size.tsmart_group_size_id!=0')->order('group_size.from');
     $model_product = tmsModel::getModel('product');
     $product = $model_product->getItem($tsmart_product_id);
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmgroupsize.php';
     if ($product->price_type != tsmGroupSize::FLAT_PRICE) {
         $query->where('group_size.type!=' . $query->q('flat_price'));
     }
     return $db->setQuery($query)->loadObjectList();
 }
 function getInput()
 {
     tsmConfig::loadConfig();
     $model = tmsModel::getModel('Manufacturer');
     $manufacturers = $model->getManufacturers(true, true, false);
     $emptyOption = JHtml::_('select.option', '', tsmText::_('com_tsmart_LIST_EMPTY_OPTION'), 'tsmart_manufacturer_id', 'mf_name');
     if (!empty($manufacturers) and is_array($manufacturers)) {
         array_unshift($manufacturers, $emptyOption);
     } else {
         $manufacturers = array($emptyOption);
     }
     return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox"  size="1"', 'tsmart_manufacturer_id', 'mf_name', $this->value, $this->id);
 }
 protected function getOptions()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart', false);
     $cModel = tmsModel::getModel('currency');
     $values = $cModel->getVendorAcceptedCurrrenciesList();
     $options[] = JHtml::_('select.option', 0, tsmText::_('com_tsmart_DEFAULT_VENDOR_CURRENCY'));
     $options[] = JHtml::_('select.option', -1, tsmText::_('com_tsmart_SELECTED_MODULE_CURRENCY'));
     foreach ($values as $v) {
         $options[] = JHtml::_('select.option', $v->tsmart_currency_id, $v->currency_txt);
     }
     return $options;
 }
Exemple #30
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $this->view_height = 1500;
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->service_class_name);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $app = JFactory::getApplication();
         $input = $app->input;
         $this->SetViewTitle();
         JToolBarHelper::save('save', 'Save');
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentsetting.php';
         $this->list_config_mode = vmpaymentsetting::get_config_mode();
         $this->hold_seat_type = vmpaymentsetting::get_hold_seat_type();
         $this->currencies = vmpaymentsetting::get_list_currency();
         //get list payment method
         require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php';
         $list_payment_method = vmpaymentmethod::get_list_payment_method();
         $this->assignRef('list_payment_method', $list_payment_method);
         //end get list payment method
         $tsmart_paymentsetting_id = $input->get('tsmart_paymentsetting_id', 0, 'int');
         if (!$tsmart_paymentsetting_id) {
             $db = JFactory::getDbo();
             $query = $db->getQuery(true);
             $query->select('tsmart_paymentsetting_id')->from('#__tsmart_paymentsetting');
             $tsmart_paymentsetting_id = $db->setQuery($query)->loadResult();
         }
         $this->item = $model->getItem($tsmart_paymentsetting_id);
         //
         $list_payment_method = vmpaymentsetting::get_list_payment_method_by_paymentsetting_id($tsmart_paymentsetting_id);
         $this->assignRef('list_payment_method', $list_payment_method);
     }
     parent::display($tpl);
 }