Beispiel #1
0
	function getData() {

		$id = JRequest::getInt('id');
		$db = & JFactory::getDBO();
		$query = "SELECT * FROM #__k2_items WHERE id={$id}";
		$db->setQuery($query, 0, 1);
		$row = $db->loadObject();

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OSE Added - OSE and Open Source Excellence is the registered trade mark of the Open Source Excellence PTE LTD.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		require_once(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'init.php');

		$content_ids = oseRegistry::call('content')->getRestrictedContent('k2','article');

		if(in_array($id,$content_ids))
		{
			$row->introtext = $row->introtext.'<br /> This content is members only, please <a href="'.JROUTE::_('index.php?option=com_osemsc&view=register').'">subscribe a membership plan first</a>';
			$row->fulltext = '';
			$row->mscControlled = true;
			$row->mscControlClass = 'osemsc-control';
		}
		else
		{
			$row->mscControlClass = 'osemsc-free';
			$row->mscControlled = false;
		}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OSE Added - OSE and Open Source Excellence is the registered trade mark of the Open Source Excellence PTE LTD.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		return $row;
	}
Beispiel #2
0
    function render($position = "")
    {
        global $gantry;
        ob_start();
        ?>
		<div class="rt-block">
			<div id="rt-accessibility">
				<div class="rt-desc"><?php 
        echo JText::_('TEXT_SIZE');
        ?>
</div>
				<div id="rt-buttons">
					<a href="<?php 
        echo JROUTE::_($gantry->addQueryStringParams($gantry->getCurrentUrl(array('reset-settings')), array('font-size' => 'smaller')));
        ?>
" title="<?php 
        echo JText::_('DEC_FONT_SIZE');
        ?>
" class="small"><span class="button"></span></a>
					<a href="<?php 
        echo JROUTE::_($gantry->addQueryStringParams($gantry->getCurrentUrl(array('reset-settings')), array('font-size' => 'larger')));
        ?>
" title="<?php 
        echo JText::_('INC_FONT_SIZE');
        ?>
" class="large"><span class="button"></span></a>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<?php 
        return ob_get_clean();
    }
Beispiel #3
0
    function render($position = "")
    {
        global $gantry;
        ob_start();
        ?>
		<div class="rt-block">
			<div id="rt-accessibility">
				<div class="rt-desc"><?php 
        echo JText::_('TEXT_SIZE');
        ?>
</div>
				<div id="rt-buttons">
					<a href="<?php 
        echo JROUTE::_($gantry->getCurrentUrl() . "font-size=larger");
        ?>
" title="<?php 
        echo JText::_('INC_FONT_SIZE');
        ?>
" class="large"><span class="button"></span></a>
					<a href="<?php 
        echo JROUTE::_($gantry->getCurrentUrl() . "font-size=smaller");
        ?>
" title="<?php 
        echo JText::_('DEC_FONT_SIZE');
        ?>
" class="small"><span class="button"></span></a>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<?php 
        return ob_get_clean();
    }
Beispiel #4
0
 function display($cachable = false, $urlparams = false)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $menuItem = $app->getMenu()->getActive();
     if (is_object($menuItem)) {
         $mcatid = $menuItem->params->get('mcatid', '');
         $filter_category = !is_array($mcatid) ? array($mcatid) : $mcatid;
     } else {
         $filter_category = '';
     }
     $items = $this->get('Records');
     //		$Itemid		= $app->input->getInt('Itemid');
     $Itemid = JRequest::getInt('Itemid');
     foreach ($items as $item) {
         if (!in_array('', $filter_category) && !in_array('0', $filter_category) && in_array($item->catid, $filter_category) || in_array('', $filter_category) || in_array('0', $filter_category)) {
             // Load individual item creator class.
             $feeditem = new JFeedItem();
             $feeditem->title = $item->title . ' (' . $item->category . ')';
             $feeditem->link = JROUTE::_('index.php?option=com_icagenda&view=list&layout=event&Itemid=' . (int) $Itemid . '&id=' . (int) $item->id . ':' . $item->alias);
             $feeditem->image = icagendaThumb::sizeMedium($item->image);
             $feeditem->description = '<img src="' . $feeditem->image . '" alt="" style="margin: 5px; float: left;">' . $item->desc;
             $feeditem->date = $item->next;
             $feeditem->category = $item->category;
             // Loads item information into RSS array
             $document->addItem($feeditem);
         }
     }
 }
Beispiel #5
0
 function plgVmConfirmedOrder($cart, $order)
 {
     if (!($method = $this->getVmPluginMethod($order["details"]["BT"]->virtuemart_paymentmethod_id))) {
         return null;
     }
     if (!$this->selectedThisElement($method->payment_element)) {
         return false;
     }
     $this->logInfo('plgVmOnConfirmedOrderGetPaymentForm order number: ' . $order['details']['BT']->order_number, 'message');
     $lang = JFactory::getLanguage();
     $lang->load('plg_vmpayment_epay', JPATH_ADMINISTRATOR);
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     if (!class_exists('VirtueMartModelCurrency')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
     }
     $new_status = '';
     $usrBT = $order['details']['BT'];
     $address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
     $vendorModel = new VirtueMartModelVendor();
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $this->getPaymentCurrency($method);
     $q = ' SELECT `currency_numeric_code` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
     $db =& JFactory::getDBO();
     $db->setQuery($q);
     $currency_numeric_code = $db->loadResult();
     $paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
     $totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, false), 2);
     $cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
     $session = JFactory::getSession();
     $post_variables = array('merchantnumber' => $method->epay_merchant, 'instantcapture' => $method->epay_instantcapture, 'ownreceipt' => $method->epay_ownreceipt, 'group' => $method->epay_group, 'mailreceipt' => $method->epay_authmail, 'language' => $this->_getEpayLanguage(), 'orderid' => $order['details']['BT']->order_number, "amount" => $totalInPaymentCurrency * 100, "currency" => $currency_numeric_code, "accepturl" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id), "callbackurl" => JROUTE::_(JURI::root() . 'index.php?callback=1&option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id), "cancelurl" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id), "windowstate" => $method->epay_windowstate);
     $hash = md5(implode($post_variables, "") . $method->epay_md5key);
     // Prepare data that should be stored in the database
     $dbValues['payment_name'] = $this->renderPluginName($method, $order);
     $dbValues['order_number'] = $order['details']['BT']->order_number;
     $dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
     $this->storePSPluginInternalData($dbValues);
     // add spin image
     $html = '<script type="text/javascript" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" charset="UTF-8"></script>';
     $html .= '<script type="text/javascript">';
     $html .= 'paymentwindow = new PaymentWindow({';
     foreach ($post_variables as $name => $value) {
         $html .= '\'' . $name . '\': "' . $value . '",';
     }
     $html .= '\'hash\': "' . $hash . '"';
     $html .= '});';
     $html .= '</script><input type="button" onclick="javascript: paymentwindow.open()" value="Go to payment" />';
     $html .= ' <script type="text/javascript">';
     $html .= ' paymentwindow.open();';
     $html .= ' </script>';
     // 	2 = don't delete the cart, don't send email and don't redirect
     $cart->_confirmDone = false;
     $cart->_dataValidated = false;
     $cart->setCartIntoSession();
     JRequest::setVar('html', $html);
 }
 function PayFastOneOffPostForm($orderInfo, $params = array())
 {
     $pConfig = oseMscConfig::getConfig('payment', 'obj');
     $merchantId = $pConfig->payfast_merchant_id;
     $merchantKey = $pConfig->payfast_merchant_key;
     $html = array();
     $test_mode = $pConfig->payfast_testmode;
     if (!$test_mode) {
         if (empty($merchantId) || empty($merchantKey)) {
             $html['form'] = "";
             $html['url'] = "";
             return $html;
         }
     }
     if ($test_mode == true) {
         $merchantId = '10000100';
         $merchantKey = '46f0cd694581a';
         $url = "https://sandbox.payfast.co.za/eng/process";
     } else {
         $url = "https://www.payfast.co.za/eng/process";
     }
     $db = oseDB::instance();
     $member = oseRegistry::call('member');
     $member->instance($orderInfo->user_id);
     $payment = oseRegistry::call('payment');
     $paymentOrder = $payment->getInstance('Order');
     $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id);
     $amount = $orderInfo->payment_price;
     $currency = $orderInfo->payment_currency;
     $order_id = $orderInfo->order_id;
     $order_number = $orderInfo->order_number;
     $user =& JFactory::getUser($orderInfo->user_id);
     $orderInfoParams = oseJson::decode($orderInfo->params);
     $cancelUrl = JURI::base() . "index.php";
     $notifyUrl = JURI::base() . "components/com_osemsc/ipn/payfast_notify.php";
     $returnUrl = urldecode(JROUTE::_(JURI::base() . "index.php?option=com_osemsc&view=thankyou&order_id=" . $orderInfo->order_id));
     $returnUrl = $returnUrl ? $returnUrl : JURI::base() . "index.php?option=com_osemsc&view=member&result=success&amount={$amount}&ordernumber={$order_number}";
     // Create description
     $description = '';
     $vendor_image_url = "";
     $app =& JFactory::getApplication();
     $currentSession = JSession::getInstance('none', array());
     $stores = $currentSession->getStores();
     $html['form'] = '<form action="' . $url . '" method="post">';
     // Construct variables for post
     $post_variables = array('merchant_id' => $merchantId, 'merchant_key' => $merchantKey, 'return_url' => $returnUrl, 'cancel_url' => $cancelUrl, 'notify_url' => $notifyUrl, 'name_first' => substr($billinginfo->firstname, 0, 100), 'name_last' => substr($billinginfo->lastname, 0, 100), 'email_address' => substr($billinginfo->email, 0, 255), 'item_name' => JText::_('Order ID: ') . $order_id, 'item_description' => $description, 'amount' => number_format($amount, 2, '.', ''), 'm_payment_id' => $order_id, 'currency_code' => $currency, 'custom_str1' => $order_number, 'user_agent' => 'Open Source Membership Control V5');
     $html['form'] .= '<input type="image" id="payfast_image" name="cartImage" src="' . "components/com_osemsc/assets/images/checkout.png" . '" alt="' . JText::_('Click to pay with PayFast') . '" />';
     // Process payment variables;
     $html['url'] = $url . "?";
     foreach ($post_variables as $name => $value) {
         $html['form'] .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
         $html['url'] .= $name . "=" . urlencode($value) . "&";
     }
     $html['form'] .= '</form>';
     return $html;
 }
 /**
  * Display an image icon for the given image and create a link to the given link.
  *
  * @param string $link Link to use in the href tag
  * @param string $image Name of the image file to display
  * @param string $text Text to use for the image alt text and to display under the image.
  * @param string $route internal links.
  */
 public function panelButton($link, $imageclass, $text, $route = true)
 {
     if ($route === true) {
         $link = JROUTE::_('index.php?option=com_virtuemart&view=' . $link . $this->tmpl);
     }
     $button = '<a class="span12 hasTooltip" title="' . $text . '" href="' . $link . '">';
     $button .= '<i class="' . $imageclass . '"></i> ';
     $button .= $text . '</a>';
     echo $button;
 }
 function init()
 {
     global $gantry;
     if ($this->get('enabled')) {
         $gantry->addScript('gantry-morearticles.js');
         $queryUrl = JROUTE::_($gantry->addQueryStringParams($gantry->getCurrentUrl($gantry->_setbyurl), array('tmpl' => 'component', 'type' => 'raw')));
         $gantry->addInlineScript("window.addEvent('domready', function() { new GantryMoreArticles({'leadings': " . $this->_getCurrentLeadingArticles() . ", 'moreText': '" . addslashes($this->get('text')) . "', 'url': '" . $queryUrl . "'}); })");
         if ($gantry->get('morearticles-pagination')) {
             $gantry->addInlineStyle('.rt-pagination {display: none;}');
         }
     }
 }
Beispiel #9
0
	function render($position="") {
		global $gantry;
	    ob_start();
	    ?>
		<div class="rt-block">
			<span  id="gantry-resetsettings">
				<a href="<?php echo JROUTE::_($gantry->addQueryStringParams($gantry->getCurrentUrl($gantry->_setbyurl),array('reset-settings'=>''))); ?>"><?php echo $this->get('text'); ?></a>
			</span>
		</div>
		<?php
	    return ob_get_clean();
	}
 function QuickpayOneOffPay($orderInfo, $params = array())
 {
     $pConfig = oseMscConfig::getConfig('payment', 'obj');
     $merchant = $pConfig->quickpay_merchant;
     $secret = $pConfig->quickpay_secret;
     $test_mode = $pConfig->quickpay_testmode;
     $cardtypelock = $pConfig->quickpay_cardtypelock;
     $autocapture = $pConfig->quickpay_autocapture;
     $autofee = $pConfig->quickpay_autofee;
     $lang = empty($pConfig->quickpay_lang) ? 'en' : $pConfig->quickpay_lang;
     $db = oseDB::instance();
     $member = oseRegistry::call('member');
     $member->instance($orderInfo->user_id);
     $payment = oseRegistry::call('payment');
     $paymentOrder = $payment->getInstance('Order');
     $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id);
     $amount = $orderInfo->payment_price * 100;
     $currency = $orderInfo->payment_currency;
     $order_id = $orderInfo->order_id;
     $order_number = $orderInfo->order_number;
     $desc = self::generateDesc($order_id);
     $user =& JFactory::getUser($orderInfo->user_id);
     $order_id = sprintf("%04d", $order_id);
     $orderInfoParams = oseJson::decode($orderInfo->params);
     //$cancelUrl = JURI :: base()."index.php";
     $notifyUrl = JURI::base() . "components/com_osemsc/ipn/quickpay_notify.php";
     $returnUrl = urldecode(JROUTE::_(JURI::base() . "index.php?option=com_osemsc&view=thankyou&order_id=" . $orderInfo->order_id));
     $returnUrl = $returnUrl ? $returnUrl : JURI::base() . "index.php?option=com_osemsc&view=member&result=success&amount={$amount}&ordernumber={$order_number}";
     $date = oseHTML::getDateTime();
     $url = "https://secure.quickpay.dk/form/";
     $html['form'] = '<form action="' . $url . '" method="post">';
     // Construct variables for post
     $post_variables = array('protocol' => 5, 'msgtype' => 'authorize', 'merchant' => $merchant, 'language' => $lang, 'ordernumber' => $order_id, 'amount' => $amount, 'currency' => $currency, 'continueurl' => $returnUrl, 'continueurl' => $returnUrl, 'cancelurl' => $returnUrl, 'callbackurl' => $notifyUrl, 'autocapture' => $autocapture, 'autofee' => $autofee, 'cardtypelock' => $cardtypelock, 'description' => $desc, 'testmode' => $test_mode);
     $md5String = '';
     foreach ($post_variables as $name => $value) {
         $md5String .= $value;
     }
     $md5String .= $secret;
     $post_variables['md5check'] = md5($md5String);
     //print_r($post_variables);exit;
     $html['form'] .= '<input type="image" id="quickpay_image" name="cartImage" src="' . "components/com_osemsc/assets/images/checkout.png" . '" alt="' . JText::_('Click to pay with Quickpay') . '" />';
     // Process payment variables;
     $html['url'] = $url . "?";
     foreach ($post_variables as $name => $value) {
         $html['form'] .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
         $html['url'] .= $name . "=" . urlencode($value) . "&";
     }
     $html['form'] .= '</form>';
     return $html;
 }
 function PagSeguroOneOffPay($orderInfo, $params = array())
 {
     require_once OSEMSC_B_LIB . DS . 'PagSeguroLibrary' . DS . 'PagSeguroLibrary.php';
     $pConfig = oseMscConfig::getConfig('payment', 'obj');
     $account = $pConfig->pagseguro_account;
     $token = $pConfig->pagseguro_token;
     $paymentRequest = new PaymentRequest();
     $payment = oseRegistry::call('payment');
     $paymentOrder = $payment->getInstance('Order');
     $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id);
     $address = $billinginfo->addr1 . ' ' . $billinginfo->addr2;
     $orderInfoParams = oseJson::decode($orderInfo->params);
     $redirectUrl = urldecode(JROUTE::_(JURI::base() . "index.php?option=com_osemsc&view=thankyou&order_id=" . $orderInfo->order_id));
     $redirectUrl = $redirectUrl ? $redirectUrl : JURI::root() . "index.php?option=com_osemsc&view=member";
     $des = $this->generateDesc($orderInfo->order_id);
     // Sets the currency
     $paymentRequest->setCurrency($orderInfo->payment_currency);
     // Add an item for this payment request
     $paymentRequest->addItem($orderInfo->order_id, $des, 1, $orderInfo->payment_price);
     // Sets a reference code for this payment request, it is useful to identify this payment in future notifications.
     $paymentRequest->setReference($orderInfo->order_number);
     // Sets shipping information for this payment request
     $CODIGO_SEDEX = ShippingType::getCodeByType('SEDEX');
     $paymentRequest->setShippingType($CODIGO_SEDEX);
     $paymentRequest->setShippingAddress('', $address, $billinginfo->telephone, null, null, $billinginfo->city, $billinginfo->state, $billinginfo->country);
     // Sets your customer information.
     $paymentRequest->setSender($billinginfo->firstname . ' ' . $billinginfo->lastname, $billinginfo->email, null, null);
     $redirectUrl = str_replace('https://', '', $redirectUrl);
     $redirectUrl = str_replace('http://', '', $redirectUrl);
     $paymentRequest->setRedirectUrl($redirectUrl);
     $result = array();
     $result['payment_method'] = 'pagseguro';
     try {
         $credentials = new AccountCredentials($account, $token);
         $url = $paymentRequest->register($credentials);
         $result['success'] = true;
         $result['url'] = $url;
     } catch (PagSeguroServiceException $e) {
         $result['success'] = false;
         $result['title'] = 'Error';
         $result['content'] = $e->getMessage();
         //$result['url'] = '';
     }
     return $result;
 }
Beispiel #12
0
    function render($position = "")
    {
        global $gantry;
        ob_start();
        ?>
		<div class="clear"></div>
		<span  id="gantry-resetsettings">
			[ <a href="<?php 
        echo JROUTE::_($gantry->getCurrentUrl() . "reset-settings");
        ?>
"><?php 
        echo $this->get('text');
        ?>
</a> ]
		</span>
		<div class="clear"></div>
		<?php 
        return ob_get_clean();
    }
    function render($position)
    {
        /** @var $gantry Gantry */
        global $gantry;
        ob_start();
        ?>
	<div class="clear"></div>
	<span id="gantry-resetsettings">
			[ <a href="<?php 
        echo JROUTE::_($gantry->addQueryStringParams($gantry->getCurrentUrl($gantry->_setbyurl), array('reset-settings' => '')));
        ?>
" rel="nofollow"><?php 
        echo $this->get('text');
        ?>
</a> ]
		</span>
	<div class="clear"></div>
	<?php 
        return ob_get_clean();
    }
Beispiel #14
0
 public function createHtml(Email $email, $contato)
 {
     $html = file_get_contents($email->file_url);
     preg_match_all('#<img.*?src="(.+?)".*?/>#', $html, $result);
     for ($i = 0; $i < count($result[0]); $i++) {
         $img = $result[0][$i];
         $file = $result[1][$i];
         $fileNew = $email->base_url . '/' . $file;
         $imgNew = str_replace($file, $fileNew, $img);
         $html = str_replace($img, $imgNew, $html);
     }
     $u =& JURI::getInstance();
     $host = $u->getScheme() . '://' . $u->getHost();
     $sid = $this->getSID($email->id, $contato);
     preg_match('#<body.*?>#', $html, $result);
     $link = $host . JROUTE::_('index.php?option=com_edesktop&view=mailing&layout=exibir&id=' . $email->id . '&e=' . $contato . '&sid=' . $sid . '&Itemid=200');
     $linkTopo = $result[0] . '<center><font size="1" color="#000000" face="Arial">Caso não consiga visualizar este e-mail corretamente, <a href="' . $link . '" style="color:#0000ff;">clique aqui!</a></font></center><br />' . "\n";
     $html = str_replace($result[0], $linkTopo, $html);
     return $html;
 }
 function display($cachable = false, $urlparams = false)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $items = $this->get('Records');
     //		$Itemid		= $app->input->getInt('Itemid');
     $Itemid = JRequest::getInt('Itemid');
     foreach ($items as $item) {
         // Load individual item creator class.
         $feeditem = new JFeedItem();
         $feeditem->title = $item->title;
         $feeditem->link = JROUTE::_('index.php?option=com_icagenda&view=list&layout=event&Itemid=' . (int) $Itemid . '&id=' . (int) $item->id);
         //			$feeditem->image		= iCagendaThumb::sizeMedium($item->image);
         //			$feeditem->description	= '<img src="' . $feeditem->image . '" alt="" style="margin: 5px; float: left;">' . $item->desc;
         $feeditem->description = $item->desc;
         $feeditem->date = $item->next;
         $feeditem->category = $item->catid;
         // Loads item information into RSS array
         $document->addItem($feeditem);
     }
 }
Beispiel #16
0
 function onShowUserDisplayUserfield($userId, $fieldName)
 {
     if ($userId == 0) {
         return;
     }
     $html = '';
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $view = vRequest::getString('view', '');
     $this->loadJLang('plg_vmpayment_realex_hpp_api', 'vmpayment');
     if ($view == 'user') {
         $storedCreditCards = $this->getStoredCreditCards($userId);
         if (empty($storedCreditCards)) {
             return vmText::_('VMUSERFIELD_REALEX_HPP_API_NO_CARD_SAVED');
         }
         //$storedCreditCards = $this->isValidExpiredDate($storedCreditCards);
         $deleteUpdateAuthorized = true;
         $html = $this->renderByLayout("creditcardlist", array("storedCreditCards" => $storedCreditCards, 'deleteUpdateAuthorized' => $deleteUpdateAuthorized));
     } elseif ($view == 'order') {
         $userlink = JROUTE::_('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $userId, FALSE);
         $html = JHTML::_('link', JRoute::_($userlink, FALSE), JText::_('VMUSERFIELD_REALEX_HPP_API_MANAGE_CARDS'), array('title' => JText::_('VMUSERFIELD_REALEX_HPP_API_MANAGE_CARDS')));
     }
     return $html;
 }
Beispiel #17
0
                </thead>
                <?php 
$k = 0;
$add_new = $show_edit_in_line == 1 && count($cid) == 0;
if ($add_new) {
    $item = new stdClass();
    $item->published = 1;
    array_unshift($this->items, $item);
}
for ($i = 0, $n = count($this->items); $i < $n; $i++) {
    $row = $this->items[$i];
    $checked = JHtml::_('grid.id', $i, $row->tsmart_cityarea_id);
    $published = $this->gridPublished($row, $i);
    $editlink = JROUTE::_('index.php?option=com_tsmart&view=cityarea&task=edit_in_line&cid[]=' . $row->tsmart_cityarea_id);
    $edit = $this->gridEdit($row, $i, 'tsmart_cityarea_id', $editlink);
    $save_link = JROUTE::_('index.php?option=com_tsmart&view=cityarea&task=save_in_line&cid[]=' . $row->tsmart_cityarea_id);
    $save = $this->grid_save_in_line($row, $i, 'tsmart_cityarea_id', $save_link);
    $delete = $this->grid_delete_in_line($row, $i, 'tsmart_cityarea_id');
    $cancel = $this->grid_cancel_in_line($row, $i, 'tsmart_cityarea_id');
    $show_edit = $show_edit_in_line == 1 && in_array($row->tsmart_cityarea_id, $cid) || $show_edit_in_line == 1 && count($cid) == 0 && $i == 0;
    ?>
                    <tr class="row<?php 
    echo $k;
    ?>
">
                        <td class="admin-checkbox">
                            <?php 
    if ($show_edit) {
        ?>
                                <?php 
        echo VmHTML::inputHidden(array(tsmart_cityarea_id => $row->tsmart_cityarea_id));
	/**
	 * @param $cart
	 * @param $order
	 * @return bool|null
	 */
	function plgVmConfirmedOrder ($cart, $order) {

		if (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_paymentmethod_id))) {
			return NULL; // Another method was selected, do nothing
		}
		if (!$this->selectedThisElement ($method->payment_element)) {
			return FALSE;
		}
		$session = JFactory::getSession ();
		$return_context = $session->getId ();
		$this->_debug = $method->debug;
		$this->logInfo ('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');

		if (!class_exists ('VirtueMartModelOrders')) {
			require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php');
		}
		if (!class_exists ('VirtueMartModelCurrency')) {
			require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php');
		}

		$address = ((isset($order['details']['ST'])) ? $order['details']['ST'] : $order['details']['BT']);

		if (!class_exists ('TableVendors')) {
			require(JPATH_VM_ADMINISTRATOR . DS . 'table' . DS . 'vendors.php');
		}
		$vendorModel = VmModel::getModel ('Vendor');
		$vendorModel->setId (1);
		$vendor = $vendorModel->getVendor ();
		$vendorModel->addImages ($vendor, 1);
		$this->getPaymentCurrency ($method);
		$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
		$db = JFactory::getDBO ();
		$db->setQuery ($q);
		$currency_code_3 = $db->loadResult ();

		$paymentCurrency = CurrencyDisplay::getInstance ($method->payment_currency);
		$totalInPaymentCurrency = round ($paymentCurrency->convertCurrencyTo ($method->payment_currency, $order['details']['BT']->order_total, FALSE), 2);
		$cd = CurrencyDisplay::getInstance ($cart->pricesCurrency);
		if ($totalInPaymentCurrency <= 0) {
			vmInfo (JText::_ ('VMPAYMENT_PAYPAL_PAYMENT_AMOUNT_INCORRECT'));
			return FALSE;
		}
		$merchant_email = $this->_getMerchantEmail ($method);
		if (empty($merchant_email)) {
			vmInfo (JText::_ ('VMPAYMENT_PAYPAL_MERCHANT_EMAIL_NOT_SET'));
			return FALSE;
		}

		$post_variables = Array(
			'cmd'              => '_ext-enter',
			'redirect_cmd'     => '_xclick',
			'upload'           => '1', //Indicates the use of third-party shopping cart
			'business'         => $merchant_email, //Email address or account ID of the payment recipient (i.e., the merchant).
			'receiver_email'   => $merchant_email, //Primary email address of the payment recipient (i.e., the merchant
			'order_number'     => $order['details']['BT']->order_number,
			"invoice"          => $order['details']['BT']->order_number,
			'custom'           => $return_context,
			'item_name'        => JText::_ ('VMPAYMENT_PAYPAL_ORDER_NUMBER') . ': ' . $order['details']['BT']->order_number,
			"amount"           => $totalInPaymentCurrency,
			"currency_code"    => $currency_code_3,
			/*
					 * 1 – L'adresse spécifiée dans les variables pré-remplies remplace l'adresse de livraison enregistrée auprès de PayPal.
					 * Le payeur voit l'adresse qui est transmise mais ne peut pas la modifier.
					 * Aucune adresse n'est affichée si l'adresse n'est pas valable
					 * (par exemple si des champs requis, tel que le pays, sont manquants) ou pas incluse.
					 * Valeurs autorisées : 0, 1. Valeur par défaut : 0
					 */
			"address_override" => isset($method->address_override) ? $method->address_override : 0, // 0 ??   Paypal does not allow your country of residence to ship to the country you wish to
			"first_name"       => $address->first_name,
			"last_name"        => $address->last_name,
			"address1"         => $address->address_1,
			"address2"         => isset($address->address_2) ? $address->address_2 : '',
			"zip"              => $address->zip,
			"city"             => $address->city,
			"state"            => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID ($address->virtuemart_state_id) : '',
			"country"          => ShopFunctions::getCountryByID ($address->virtuemart_country_id, 'country_2_code'),
			"email"            => $order['details']['BT']->email,
			"night_phone_b"    => $address->phone_1,
			"return"           => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),
			// Keep this line, needed when testing
			//"return" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'),
			"notify_url"       => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'),
			"cancel_return"    => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),
			//"undefined_quantity" => "0",
			"ipn_test"         => $method->debug,
			"rm"               => '2', // the buyer’s browser is redirected to the return URL by using the POST method, and all payment variables are included
			//"pal" => "NRUBJXESJTY24",
			"image_url"        => JURI::root () . $vendor->images[0]->file_url,
			"no_shipping"      => isset($method->no_shipping) ? $method->no_shipping : 0,
			"no_note"          => "1");


		/*
			  $i = 1;
			  foreach ($cart->products as $key => $product) {
			  $post_variables["item_name_" . $i] = substr(strip_tags($product->product_name), 0, 127);
			  $post_variables["item_number_" . $i] = $i;
			  $post_variables["amount_" . $i] = $cart->pricesUnformatted[$key]['salesPrice'];
			  $post_variables["quantity_" . $i] = $product->quantity;
			  $i++;
			  }
			  if ($cart->pricesUnformatted ['shipmentValue']) {
			  $post_variables["item_name_" . $i] = JText::_('VMPAYMENT_PAYPAL_SHIPMENT_PRICE');
			  $post_variables["item_number_" . $i] = $i;
			  $post_variables["amount_" . $i] = $cart->pricesUnformatted ['shipmentValue'];
			  $post_variables["quantity_" . $i] = 1;
			  $i++;
			  }
			  if ($cart->pricesUnformatted ['paymentValue']) {
			  $post_variables["item_name_" . $i] = JText::_('VMPAYMENT_PAYPAL_PAYMENT_PRICE');
			  $post_variables["item_number_" . $i] = $i;
			  $post_variables["amount_" . $i] = $cart->pricesUnformatted ['paymentValue'];
			  $post_variables["quantity_" . $i] = 1;
			  $i++;
			  }
			  if (!empty($order->cart->coupon)) {
			  $post_variables["discount_amount_cart"] = $cart->pricesUnformatted['discountAmount'];
			  }
			 */

		// Prepare data that should be stored in the database
		$dbValues['order_number'] = $order['details']['BT']->order_number;
		$dbValues['payment_name'] = $this->renderPluginName ($method, $order);
		$dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
		$dbValues['paypal_custom'] = $return_context;
		$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
		$dbValues['cost_percent_total'] = $method->cost_percent_total;
		$dbValues['payment_currency'] = $method->payment_currency;
		$dbValues['payment_order_total'] = $totalInPaymentCurrency;
		$dbValues['tax_id'] = $method->tax_id;
		$this->storePSPluginInternalData ($dbValues);

		$url = $this->_getPaypalUrlHttps ($method);

		// add spin image
		$html = '<html><head><title>Redirection</title></head><body><div style="margin: auto; text-align: center;">';
		$html .= '<form action="' . "https://" . $url . '" method="post" name="vm_paypal_form" >';
		$html .= '<input type="submit"  value="' . JText::_ ('VMPAYMENT_PAYPAL_REDIRECT_MESSAGE') . '" />';
		foreach ($post_variables as $name => $value) {
			$html .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars ($value) . '" />';
		}
		$html .= '</form></div>';
		$html .= ' <script type="text/javascript">';
		$html .= ' document.vm_paypal_form.submit();';
		$html .= ' </script></body></html>';

		// 	2 = don't delete the cart, don't send email and don't redirect
		$cart->_confirmDone = FALSE;
		$cart->_dataValidated = FALSE;
		$cart->setCartIntoSession ();
		JRequest::setVar ('html', $html);

		/*

			  $qstring = '?';
			  foreach ($post_variables AS $k => $v) {
			  $qstring .= ( empty($qstring) ? '' : '&')
			  . urlencode($k) . '=' . urlencode($v);
			  }
			  // we can display the logo, or do the redirect
			  $mainframe = JFactory::getApplication();
			  $mainframe->redirect("https://" . $url . $qstring);


			  return false; // don't delete the cart, don't send email
			 */
	}
Beispiel #19
0
?>
			</th>
			   <th><?php 
echo $this->sort('tsmart_manufacturercategories_id', 'com_tsmart_ID');
?>
</th>
		</tr>
		</thead>
		<?php 
$k = 0;
for ($i = 0, $n = count($this->manufacturerCategories); $i < $n; $i++) {
    $row = $this->manufacturerCategories[$i];
    $checked = JHtml::_('grid.id', $i, $row->tsmart_manufacturercategories_id);
    $published = $this->gridPublished($row, $i);
    $editlink = JROUTE::_('index.php?option=com_tsmart&view=manufacturercategories&task=edit&tsmart_manufacturercategories_id=' . $row->tsmart_manufacturercategories_id);
    $manufacturersList = JROUTE::_('index.php?option=com_tsmart&view=manufacturer&tsmart_manufacturercategories_id=' . $row->tsmart_manufacturercategories_id);
    ?>
			<tr class="row<?php 
    echo $k;
    ?>
">
				<td class="admin-checkbox">
					<?php 
    echo $checked;
    ?>
				</td>
				<td align="left">
					<a href="<?php 
    echo $editlink;
    ?>
"><?php 
Beispiel #20
0
 function plgVmConfirmedOrder($cart, $order)
 {
     if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
         return NULL;
         // Another method was selected, do nothing
     }
     if (!$this->selectedThisElement($method->payment_element)) {
         return FALSE;
     }
     $session = JFactory::getSession();
     $return_context = $session->getId();
     $this->_debug = $method->HEIDELPAY_DEBUG;
     if (!class_exists('VirtueMartModelOrders')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
     }
     if (!class_exists('VirtueMartModelCurrency')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'currency.php';
     }
     $address = isset($order['details']['BT']) ? $order['details']['BT'] : $order['details']['ST'];
     if (!class_exists('TableVendors')) {
         require VMPATH_ADMIN . DS . 'table' . DS . 'vendors.php';
     }
     $vendorModel = VmModel::getModel('Vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $vendorModel->addImages($vendor, 1);
     $this->getPaymentCurrency($method);
     $currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
     $paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
     $totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, FALSE), 2);
     $cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
     // prepare the post var values:
     $languageTag = $this->getLang();
     $params = array();
     /*
      * Default configuration for hco
      */
     $params['FRONTEND.MODE'] = "DEFAULT";
     $params['FRONTEND.ENABLED'] = "true";
     $params['FRONTEND.POPUP'] = "false";
     $params['FRONTEND.REDIRECT_TIME'] = "0";
     $params['REQUEST.VERSION'] = "1.0";
     $params['FRONTEND.NEXTTARGET'] = "top.location.href";
     $params['PRESENTATION.AMOUNT'] = $totalInPaymentCurrency;
     $params['PRESENTATION.CURRENCY'] = $currency_code_3;
     $params['FRONTEND.LANGUAGE'] = $languageTag;
     $params['CRITERION.LANG'] = $params['FRONTEND.LANGUAGE'];
     $params['IDENTIFICATION.TRANSACTIONID'] = $order['details']['BT']->order_number;
     /*
      * Set payment methode to PA for online transfer, invoice and prepayment
      */
     $PaymentTypePA = array('OT', 'PP', 'IV');
     if (in_array(substr($method->HEIDELPAY_PAYMENT_TYPE, 0, 2), $PaymentTypePA)) {
         $method->HEIDELPAY_PAYMENT_METHOD = "PA";
     } else {
         $method->HEIDELPAY_PAYMENT_METHOD = $method->HEIDELPAY_PAYMENT_METHOD;
     }
     $params['PAYMENT.CODE'] = substr($method->HEIDELPAY_PAYMENT_TYPE, 0, 2) . "." . $method->HEIDELPAY_PAYMENT_METHOD;
     $params['TRANSACTION.CHANNEL'] = $method->HEIDELPAY_CHANNEL_ID;
     /*
      * Special case for paypal without hco iframe
      */
     if ($method->HEIDELPAY_PAYMENT_TYPE == "VAPAYPAL") {
         $params['PAYMENT.CODE'] = "VA.DB";
         $params['ACCOUNT.BRAND'] = "PAYPAL";
         $params['FRONTEND.PM.DEFAULT_DISABLE_ALL'] = "true";
         $params['FRONTEND.PM.0.ENABLED'] = "true";
         $params['FRONTEND.PM.0.METHOD'] = "VA";
         $params['FRONTEND.PM.0.SUBTYPES'] = "PAYPAL";
     }
     /*
      * Special case for MangirKart without hco iframe
      */
     if ($method->HEIDELPAY_PAYMENT_TYPE == "PCMANGIR") {
         $params['PAYMENT.CODE'] = "PC.PA";
         $params['ACCOUNT.BRAND'] = "MANGIRKART";
     }
     /*
      * case for GiroPay
      */
     if ($method->HEIDELPAY_PAYMENT_TYPE == "OTGIR") {
         $params['FRONTEND.SEPA'] = 'YES';
         $params['FRONTEND.SEPASWITCH'] = 'NO';
     }
     /*
      * Special case for BarPay without hco iframe
      */
     if ($method->HEIDELPAY_PAYMENT_TYPE == "PPBARPAY") {
         $params['PAYMENT.CODE'] = "PP.PA";
         $params['ACCOUNT.BRAND'] = "BARPAY";
     }
     /*
      * Special case for BillSAFE
      */
     if ($method->HEIDELPAY_PAYMENT_TYPE == "IVBILLSAFE") {
         $toCheck = array('last_name', 'first_name', 'middle_name', 'phone_1', 'phone_2', 'fax', 'address_1', 'address_2', 'city', 'virtuemart_state_id', 'virtuemart_country_id', 'zip');
         $bsError = false;
         foreach ($toCheck as $val) {
             if (isset($order['details']['ST']->{$val})) {
                 if ($order['details']['ST']->{$val} != $order['details']['BT']->{$val}) {
                     $bsError = true;
                     $errorVal = $val;
                     break;
                 }
             }
         }
         if ($bsError) {
             $msg = vmText::_('VMPAYMENT_HEIDELPAY_TECHNICAL_ERROR') . "<br />" . vmText::_('VMPAYMENT_HEIDELPAY_BILLSAFE_ERROR') . "<br />";
             $app = JFactory::getApplication();
             $app->redirect('index.php?option=com_virtuemart&view=cart', $msg);
         }
         $params['PAYMENT.CODE'] = "IV.PA";
         $params['ACCOUNT.BRAND'] = "BILLSAFE";
         $params = array_merge($params, $this->getBasketDetails());
     }
     /*
      *  User account information
      */
     $params['ACCOUNT.HOLDER'] = $address->first_name . " " . $address->last_name;
     $params['NAME.GIVEN'] = $address->first_name;
     $params['NAME.FAMILY'] = $address->last_name;
     if (!empty($address->company)) {
         $params['NAME.COMPANY'] = $address->company;
     }
     $params['ADDRESS.STREET'] = $address->address_1;
     isset($address->address_2) ? $params['ADDRESS.STREET'] .= " " . $address->address_2 : '';
     $params['ADDRESS.ZIP'] = $address->zip;
     $params['ADDRESS.CITY'] = $address->city;
     $params['ADDRESS.COUNTRY'] = ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code');
     $params['CONTACT.EMAIL'] = $order['details']['BT']->email;
     $params['CONTACT.IP'] = $_SERVER['REMOTE_ADDR'];
     /*
      * Add debug informations for merchiant support
      */
     $params['SHOP.TYPE'] = 'VirtueMart ' . VmConfig::getInstalledVersion();
     $params['SHOPMODULE.VERSION'] = $this->version;
     $params['CRITERION.PAYMENT_NAME'] = vmText::_('VMPAYMENT_HEIDELPAY_' . $method->HEIDELPAY_PAYMENT_TYPE);
     $params['CRITERION.PAYMENT_NAME'] = strip_tags($params['CRITERION.PAYMENT_NAME']);
     /*
      * Create hash to secure the response
      */
     $params['CRITERION.SECRET'] = $this->createSecretHash($order['details']['BT']->order_number, $method->HEIDELPAY_SECRET);
     /*
      * Set transaction mode
      */
     if ($method->HEIDELPAY_TRANSACTION_MODE == 2) {
         $params['TRANSACTION.MODE'] = "LIVE";
     } elseif ($method->HEIDELPAY_TRANSACTION_MODE == 0) {
         $params['TRANSACTION.MODE'] = "INTEGRATOR_TEST";
     } else {
         $params['TRANSACTION.MODE'] = "CONNECTOR_TEST";
     }
     /*
      * Add response and css path
      */
     $params['FRONTEND.RESPONSE_URL'] = JROUTE::_(JURI::root(), $xhtml = true, $ssl = 0) . 'plugins/vmpayment/heidelpay/heidelpay/heidelpay_response.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . urlencode($order['details']['BT']->order_number) . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id;
     $cssFile = "heidelpay_default.css";
     if (!empty($method->HEIDELPAY_STYLE)) {
         $cssFile = $method->HEIDELPAY_STYLE;
     }
     $params['FRONTEND.CSS_PATH'] = JROUTE::_(JURI::root(), $xhtml = true, $ssl = 0) . 'plugins/vmpayment/heidelpay/heidelpay/' . $cssFile;
     $requestUrl = $method->HEIDELPAY_PAYMENT_URL;
     $params['SECURITY.SENDER'] = $method->HEIDELPAY_SECURITY_SENDER;
     $params['USER.LOGIN'] = $method->HEIDELPAY_USER_LOGIN;
     $params['USER.PWD'] = $method->HEIDELPAY_USER_PW;
     if (substr($method->HEIDELPAY_PAYMENT_TYPE, 0, 2) == 'DD') {
         $sepaform = array();
         $sepaform = $this->switchDirectDebitFrom($method->HEIDELPAY_SEPA_FORM);
         $params = array_merge($sepaform, $params);
     }
     /*
      * send request to payment server
      */
     $response = $this->doRequest($requestUrl, $params, $method->HEIDELPAY_DEBUG);
     if ($params['TRANSACTION.MODE'] != "LIVE") {
         vmInfo('VMPAYMENT_HEIDELPAY_PAYMENT_TESTMODE');
     }
     /*
      * On success show iframe or show error information for your customer
      */
     $returnValue = 0;
     if ($response['PROCESSING_RESULT'] == "ACK" || $response['POST_VALIDATION'] == "ACK") {
         $returnValue = 2;
         $html = $this->renderByLayout('displaypayment', array('response' => $response['FRONTEND_REDIRECT_URL']));
     } else {
         $html = vmText::_('VMPAYMENT_HEIDELPAY_TECHNICAL_ERROR') . " <br /> - " . addslashes($response['PROCESSING_RETURN']) . "<br />" . vmText::_('VMPAYMENT_HEIDELPAY_CONTACT_SHOPOWNER');
     }
     /*
      * Show debug information
      */
     if ($method->HEIDELPAY_DEBUG == 1) {
         vmDebug('HEIDELPAY plgVmConfirmedOrder', $params);
     }
     return $this->processConfirmedOrderPaymentResponse($returnValue, $cart, $order, $html, '', '');
 }
Beispiel #21
0
echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_PO_STATUS');
?>
</strong></td>
				<td><?php 
echo $this->orderstatuslist[$this->orderbt->order_status];
?>
</td>
			</tr>
			<tr>
				<td class="key"><strong><?php 
echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_NAME');
?>
</strong></td>
				<td><?php 
if ($this->orderbt->virtuemart_user_id) {
    $userlink = JROUTE::_('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $this->orderbt->virtuemart_user_id);
    echo JHtml::_('link', JRoute::_($userlink), $this->orderbt->order_name, array('title' => vmText::_('COM_VIRTUEMART_ORDER_EDIT_USER') . ' ' . $this->orderbt->order_name));
} else {
    echo $this->orderbt->first_name . ' ' . $this->orderbt->last_name;
}
?>
				</td>
			</tr>
			<tr>
				<td class="key"><strong><?php 
echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_PO_IPADDRESS');
?>
</strong></td>
				<td><?php 
echo $this->orderbt->ip_address;
?>
Beispiel #22
0
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: default_update.php 3274 2011-05-17 20:43:48Z Milbo $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
$checkLatestVerisonLink = JROUTE::_('index.php?option=com_virtuemart&view=updatesmigration&task=checkForLatestVersion');
$testVersionLink = JROUTE::_('index.php?option=com_virtuemart&view=updatesmigration&task=testVersion&view=updatesmigration');
$installSampleLink = JROUTE::_('index.php?option=com_virtuemart&view=updatesmigration&task=installSample&view=updatesmigration');
$updateVMTables10to11Link = JROUTE::_('index.php?option=com_virtuemart&view=updatesmigration&task=updateVMTables10to11&view=updatesmigration');
$updateVMTables11to15Link = JROUTE::_('index.php?option=com_virtuemart&view=updatesmigration&task=updateVMTables11to15&view=updatesmigration');
$linkDeleteALL = JROUTE::_('index2.php?option=com_virtuemart&view=updatesmigration&view=updatesmigration&task=deleteAll');
$linkDeleteOnlyRestorable = JROUTE::_('index2.php?option=com_virtuemart&view=updatesmigration&view=updatesmigration&task=deleteRestorable');
$linkDoNothing = JROUTE::_('index2.php');
?>
<br />
<table class="admintable">
    <tr>
	<td class="key"><?php 
echo JText::_('COM_VIRTUEMART_UPDATE_CHECK_VERSION_INSTALLED');
?>
</td>
	<td>
	    <h1 style="display:inline">
		<?php 
echo VmConfig::getInstalledVersion();
?>
	    </h1>
	</td>
Beispiel #23
0
?>
			</th>
			<th width="20">
				<?php 
echo JText::_('COM_VIRTUEMART_USERGROUPS_LEVEL');
?>
			</th>
		</tr>
		</thead>
		<?php 
$k = 0;
for ($i = 0, $n = count($this->usergroups); $i < $n; $i++) {
    $row = $this->usergroups[$i];
    $checked = JHTML::_('grid.id', $i, $row->virtuemart_shoppergroup_id);
    //			$published = JHTML::_('grid.published', $row, $i);
    $editlink = JROUTE::_('index.php?option=com_virtuemart&view=usergroups&task=edit&cid[]=' . $row->virtuemart_shoppergroup_id);
    ?>
			<tr class="<?php 
    echo "row" . $k;
    ?>
">
				<td width="10" align="right">
					<?php 
    echo $row->virtuemart_shoppergroup_id;
    ?>
				</td>
				<td width="10">
					<?php 
    echo $checked;
    ?>
				</td>
	</div>

	<!-- new Payment method preselect in modal -->
	<div id="PaymentsModal" class="modal hide" tabindex="-1" aria-hidden="true">
		<div class="module-title nav-header"><?php 
echo JText::_('COM_VIRTUEMART_PAYMENTMETHOD_S') . ' (' . JText::_('COM_VIRTUEMART_ADD') . ')';
?>
<button type="button" class="close" aria-hidden="true">&times;</button></div>
		<div class="modal-body">
		<div class="row-striped">
		<?php 
// payment_jplugin_id
// var_dump($this->installedPayments);
foreach ($this->installedPayments as $payment) {
    if ($payment->enabled == 1) {
        $link = JROUTE::_('index.php?option=com_virtuemart&view=paymentmethod&task=add&payment_jplugin_id=' . $payment->extension_id);
        ?>
				<div class="row-fluid"><a href="<?php 
        echo $link;
        ?>
"> <?php 
        echo $payment->name;
        ?>
</a></div>
			<?php 
    } else {
        ?>
					<div><?php 
        echo $payment->name;
        ?>
</div>
Beispiel #25
0
echo $this->sort('virtuemart_shipmentmethod_id', 'COM_VIRTUEMART_ID');
?>
</th>
		</tr>
		</thead>
		<?php 
$k = 0;
for ($i = 0, $n = count($this->shipments); $i < $n; $i++) {
    $row = $this->shipments[$i];
    $published = $this->gridPublished($row, $i);
    //$row->published = 1;
    $checked = JHtml::_('grid.id', $i, $row->virtuemart_shipmentmethod_id);
    if ($this->showVendors) {
        $shared = $this->toggle($row->shared, $i, 'toggle.shared');
    }
    $editlink = JROUTE::_('index.php?option=com_virtuemart&view=shipmentmethod&task=edit&cid[]=' . $row->virtuemart_shipmentmethod_id);
    ?>
			<tr class="row<?php 
    echo $k;
    ?>
">
				<td width="10">
					<?php 
    echo $checked;
    ?>
				</td>
				<td align="left">
					<?php 
    echo JHtml::_('link', $editlink, vmText::_($row->shipment_name));
    ?>
				</td>
Beispiel #26
0
echo JText::_('COM_VIRTUEMART_PUBLISHED');
?>
		    </th>
		      <th><?php 
echo $this->sort('m.virtuemart_manufacturer_id', 'COM_VIRTUEMART_ID');
?>
</th>
		</tr>
	    </thead>
	    <?php 
$k = 0;
for ($i = 0, $n = count($this->manufacturers); $i < $n; $i++) {
    $row = $this->manufacturers[$i];
    $checked = JHTML::_('grid.id', $i, $row->virtuemart_manufacturer_id, null, 'virtuemart_manufacturer_id');
    $published = JHTML::_('grid.published', $row, $i);
    $editlink = JROUTE::_('index.php?option=com_virtuemart&view=manufacturer&task=edit&virtuemart_manufacturer_id=' . $row->virtuemart_manufacturer_id);
    ?>
	    <tr class="row<?php 
    echo $k;
    ?>
">
		<td width="10">
			<?php 
    echo $checked;
    ?>
		</td>
		<td align="left">
		    <a href="<?php 
    echo $editlink;
    ?>
"><?php 
Beispiel #27
0
                    </th>
                    <?php 
/*	<th width="10">
				<?php echo vmText::_('com_tsmart_SHARED'); ?>
			</th> */
?>
                </tr>
                </thead>
                <?php 
$k = 0;
for ($i = 0, $n = count($this->items); $i < $n; $i++) {
    $row = $this->items[$i];
    $checked = JHtml::_('grid.id', $i, $row->tsmart_supplier_id);
    $published = $this->gridPublished($row, $i);
    $delete = $this->grid_delete_in_line($row, $i, 'tsmart_supplier_id');
    $editlink = JROUTE::_('index.php?option=com_tsmart&view=supplier&task=show_parent_popup&cid[]=' . $row->tsmart_supplier_id);
    $edit = $this->gridEdit($row, $i, 'tsmart_supplier_id', $editlink);
    ?>
                    <tr class="row<?php 
    echo $k;
    ?>
">


                        <td class="admin-checkbox">
                            <?php 
    echo $checked;
    ?>
                        </td>
                        <td align="left">
                            <a href="<?php 
Beispiel #28
0
 /**
  * @param $cart
  * @param $order
  * @return bool|null
  */
 function plgVmConfirmedOrder($cart, $order)
 {
     if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
         return NULL;
         // Another method was selected, do nothing
     }
     if (!$this->selectedThisElement($method->payment_element)) {
         return FALSE;
     }
     $session = JFactory::getSession();
     $return_context = $session->getId();
     $this->_debug = $method->debug;
     $this->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     if (!class_exists('VirtueMartModelCurrency')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
     }
     $address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
     if (!class_exists('TableVendors')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'tables' . DS . 'vendors.php';
     }
     $vendorModel = VmModel::getModel('Vendor');
     $vendorModel->setId(1);
     $vendor = $vendorModel->getVendor();
     $vendorModel->addImages($vendor, 1);
     $this->getPaymentCurrency($method);
     $email_currency = $this->getEmailCurrency($method);
     $currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
     $paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
     $totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, FALSE), 2);
     $cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
     if ($totalInPaymentCurrency <= 0) {
         vmInfo(JText::_('VMPAYMENT_PAYPAL_PAYMENT_AMOUNT_INCORRECT'));
         return FALSE;
     }
     $merchant_email = $this->_getMerchantEmail($method);
     if (empty($merchant_email)) {
         vmInfo(JText::_('VMPAYMENT_PAYPAL_MERCHANT_EMAIL_NOT_SET'));
         return FALSE;
     }
     $quantity = 0;
     foreach ($cart->products as $key => $product) {
         $quantity = $quantity + $product->quantity;
     }
     $post_variables = array('cmd' => '_ext-enter', 'redirect_cmd' => '_xclick', 'upload' => '1', 'business' => $merchant_email, 'receiver_email' => $merchant_email, 'order_number' => $order['details']['BT']->order_number, "invoice" => $order['details']['BT']->order_number, 'custom' => $return_context, 'item_name' => JText::_('VMPAYMENT_PAYPAL_ORDER_NUMBER') . ': ' . $order['details']['BT']->order_number, "amount" => $totalInPaymentCurrency, "currency_code" => $currency_code_3, "address_override" => isset($method->address_override) ? $method->address_override : 0, "first_name" => $address->first_name, "last_name" => $address->last_name, "address1" => $address->address_1, "address2" => isset($address->address_2) ? $address->address_2 : '', "zip" => $address->zip, "city" => $address->city, "state" => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID($address->virtuemart_state_id, 'state_2_code') : '', "country" => ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code'), "email" => $order['details']['BT']->email, "night_phone_b" => $address->phone_1, "return" => substr(JURI::root(false, ''), 0, -1) . JROUTE::_('index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt('Itemid'), false), "notify_url" => substr(JURI::root(false, ''), 0, -1) . JROUTE::_('index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component', false), "cancel_return" => substr(JURI::root(false, ''), 0, -1) . JROUTE::_('index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt('Itemid'), false), "ipn_test" => $method->debug, "rm" => '2', "bn" => "VirtueMart_Cart_PPA", "image_url" => JURI::root() . $vendor->images[0]->file_url, "no_shipping" => isset($method->no_shipping) ? $method->no_shipping : 0, "no_note" => "1");
     /*
      $i = 1;
      foreach ($cart->products as $key => $product) {
      $post_variables["item_name_" . $i] = substr(strip_tags($product->product_name), 0, 127);
      $post_variables["item_number_" . $i] = $i;
      $post_variables["amount_" . $i] = $cart->pricesUnformatted[$key]['salesPrice'];
      $post_variables["quantity_" . $i] = $product->quantity;
      $i++;
      }
      if ($cart->pricesUnformatted ['shipmentValue']) {
      $post_variables["item_name_" . $i] = JText::_('VMPAYMENT_PAYPAL_SHIPMENT_PRICE');
      $post_variables["item_number_" . $i] = $i;
      $post_variables["amount_" . $i] = $cart->pricesUnformatted ['shipmentValue'];
      $post_variables["quantity_" . $i] = 1;
      $i++;
      }
      if ($cart->pricesUnformatted ['paymentValue']) {
      $post_variables["item_name_" . $i] = JText::_('VMPAYMENT_PAYPAL_PAYMENT_PRICE');
      $post_variables["item_number_" . $i] = $i;
      $post_variables["amount_" . $i] = $cart->pricesUnformatted ['paymentValue'];
      $post_variables["quantity_" . $i] = 1;
      $i++;
      }
      if (!empty($order->cart->coupon)) {
      $post_variables["discount_amount_cart"] = $cart->pricesUnformatted['discountAmount'];
      }
     */
     // Prepare data that should be stored in the database
     $dbValues['order_number'] = $order['details']['BT']->order_number;
     $dbValues['payment_name'] = $this->renderPluginName($method, $order);
     $dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
     $dbValues['paypal_custom'] = $return_context;
     $dbValues['cost_per_transaction'] = $method->cost_per_transaction;
     $dbValues['cost_percent_total'] = $method->cost_percent_total;
     $dbValues['payment_currency'] = $method->payment_currency;
     $dbValues['email_currency'] = $email_currency;
     $dbValues['payment_order_total'] = $totalInPaymentCurrency;
     $dbValues['tax_id'] = $method->tax_id;
     $this->storePSPluginInternalData($dbValues);
     $url = $this->_getPaypalUrlHttps($method);
     // add spin image
     $html = '<html><head><title>Redirection</title></head><body><div style="margin: auto; text-align: center;">';
     $html .= '<form action="' . "https://" . $url . '" method="post" name="vm_paypal_form"  accept-charset="UTF-8">';
     $html .= '<input type="submit"  value="' . JText::_('VMPAYMENT_PAYPAL_REDIRECT_MESSAGE') . '" />';
     $html .= '<input type="hidden" name="charset" value="utf-8">';
     foreach ($post_variables as $name => $value) {
         $html .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
     }
     $html .= '</form>';
     $html .= ' <script type="text/javascript">';
     $html .= ' document.vm_paypal_form.submit();';
     $html .= ' </script></body></html>';
     // 	2 = don't delete the cart, don't send email and don't redirect
     $cart->_confirmDone = FALSE;
     $cart->_dataValidated = FALSE;
     $cart->setCartIntoSession();
     JRequest::setVar('html', $html);
     /*
     
      $qstring = '?';
      foreach ($post_variables AS $k => $v) {
      $qstring .= ( empty($qstring) ? '' : '&')
      . urlencode($k) . '=' . urlencode($v);
      }
      // we can display the logo, or do the redirect
      $mainframe = JFactory::getApplication();
      $mainframe->redirect("https://" . $url . $qstring);
     
     
      return false; // don't delete the cart, don't send email
     */
 }
	<td colspan="2" >
	<fieldset>
		<legend>
		<?php 
echo vmText::_('COM_VIRTUEMART_PRODUCT_FORM_CHILD_PARENT');
?>
</legend>
		<table class="adminform">
			<tr class="row<?php 
echo $i;
?>
">
				<td width="50%">
					<?php 
if ($this->product->virtuemart_product_id) {
    $link = JROUTE::_('index.php?option=com_virtuemart&view=product&task=createVariant&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&token=' . JUtility::getToken());
    $add_child_button = "";
} else {
    $link = "";
    $add_child_button = " not-active";
}
?>
					<div class="button2-left <?php 
echo $add_child_button;
?>
">
						<div class="blank">
							<?php 
if ($link) {
    ?>
								<a href="<?php 
Beispiel #30
0
			<th>
				<?php 
echo $this->sort('tsmart_shoppergroup_id', 'com_tsmart_ID');
?>
			</th>
		  </tr>
		</thead><?php 
$k = 0;
for ($i = 0, $n = count($this->shoppergroups); $i < $n; $i++) {
    $row = $this->shoppergroups[$i];
    $published = $this->gridPublished($row, $i);
    $checked = '';
    if ($row->default == 0) {
        $checked = JHtml::_('grid.id', $i, $row->tsmart_shoppergroup_id, null, 'tsmart_shoppergroup_id');
    }
    $editlink = JROUTE::_('index.php?option=com_tsmart&view=shoppergroup&task=edit&tsmart_shoppergroup_id[]=' . $row->tsmart_shoppergroup_id);
    ?>

		  <tr class="row<?php 
    echo $k;
    ?>
">
			<td class="admin-checkbox">
				<?php 
    echo $checked;
    ?>
			</td>
			<td align="left">
			  <a href="<?php 
    echo $editlink;
    ?>