Permalink
Browse files

Merge branch 'hotfix-1.3.2' into develop

  • Loading branch information...
2 parents 47ea346 + 59240f7 commit 69b6b4b611a57cdb1f7d1bfdee00f4ac5bfee8aa @aschempp aschempp committed Jun 11, 2012
@@ -19,6 +19,25 @@ Version 1.4.beta1 (2012-??-??)
- Added getimagesize data to gallery template (#3173)
+Version 1.3.2 stable (2012-06-11)
+---------------------------------
+
+### Improved
+- Surcharges with percent as price were not rounded
+- Prevent the filter from generating useless "isorc" params
+- Plain text emails could contain HTML when using InsertTags (#3172)
+- Added some german labels
+- Hide the "invoice logo" option in store config, if the server does not support it (#3124)
+
+### Fixed
+- Multiple CC and BCC recipients on emails templates did not work
+- Fixed medium size width & height in inline gallery
+- IsotopeAutomator::convertCurrencies function was not working (#3141)
+- Palette selectors not working correctly in rules (#3138)
+- Authorize.net payment module not proceeding to review (#3223)
+- Price tiers did not show "from"-price
+
+
Version 1.3.1 stable (2012-04-30)
---------------------------------
@@ -272,7 +272,7 @@ public function calculateSurcharge($strPrice, $strLabel, $intTaxClass, $arrProdu
}
$fltSurcharge = (float)substr($strPrice, 0, -1);
- $fltPrice = $fltTotal / 100 * $fltSurcharge;
+ $fltPrice = $this->Isotope->roundPrice($fltTotal / 100 * $fltSurcharge);
}
else
{
@@ -87,28 +87,30 @@ public function deleteOldCarts()
*/
public function convertCurrencies()
{
+ $this->import('Database');
+
$objConfigs = $this->Database->execute("SELECT * FROM tl_iso_config WHERE currencyAutomator='1'");
while ($objConfigs->next())
{
switch ($objConfigs->currencyProvider)
{
case 'ecb.int':
- $fltCourse = ($objConfig->currency == 'EUR') ? 1 : 0;
- $fltCourseOrigin = ($objConfig->currencyOrigin == 'EUR') ? 1 : 0;
+ $fltCourse = ($objConfigs->currency == 'EUR') ? 1 : 0;
+ $fltCourseOrigin = ($objConfigs->currencyOrigin == 'EUR') ? 1 : 0;
// Parse the XML
$strSource = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';
$objXml = new SimpleXMLElement($strSource, null, true);
foreach ($objXml->Cube->Cube->Cube as $rate)
{
- if (!$fltCourse && $currency['code'] == strtolower($objConfig->currency))
+ if (!$fltCourse && $currency['code'] == strtolower($objConfigs->currency))
{
$fltCourse = (float) $currency->kurs;
}
- if (!$fltCourseOrigin && $currency['code'] == strtolower($objConfig->currencyOrigin))
+ if (!$fltCourseOrigin && $currency['code'] == strtolower($objConfigs->currencyOrigin))
{
$fltCourseOrigin = (float) $currency->kurs;
}
@@ -126,21 +128,21 @@ public function convertCurrencies()
break;
case 'admin.ch':
- $fltCourse = ($objConfig->currency == 'CHF') ? 1 : 0;
- $fltCourseOrigin = ($objConfig->currencyOrigin == 'CHF') ? 1 : 0;
+ $fltCourse = ($objConfigs->currency == 'CHF') ? 1 : 0;
+ $fltCourseOrigin = ($objConfigs->currencyOrigin == 'CHF') ? 1 : 0;
// Parse the XML
$strSource = 'http://www.afd.admin.ch/publicdb/newdb/mwst_kurse/wechselkurse.php';
$objXml = new SimpleXMLElement($strSource, null, true);
foreach ($objXml->devise as $currency)
{
- if (!$fltCourse && $currency['code'] == strtolower($objConfig->currency))
+ if (!$fltCourse && $currency['code'] == strtolower($objConfigs->currency))
{
$fltCourse = (float) $currency->kurs;
}
- if (!$fltCourseOrigin && $currency['code'] == strtolower($objConfig->currencyOrigin))
+ if (!$fltCourseOrigin && $currency['code'] == strtolower($objConfigs->currencyOrigin))
{
$fltCourseOrigin = (float) $currency->kurs;
}
@@ -165,7 +167,7 @@ public function convertCurrencies()
foreach ($GLOBALS['ISO_HOOKS']['convertCurrency'] as $callback)
{
$this->import($callback[0]);
- $this->$callback[0]->$callback[1]($objConfig->currencyProvider, $objConfig->currencyOrigin, $objConfig->currency, $objConfig-row());
+ $this->$callback[0]->$callback[1]($objConfigs->currencyProvider, $objConfigs->currencyOrigin, $objConfigs->currency, $objConfigs-row());
}
}
}
@@ -251,10 +251,9 @@ public function sendTo()
$this->strLanguage = $objLanguage->language;
$arrData = $this->arrSimpleTokens;
- $arrPlainData = array_map('strip_tags', $this->arrSimpleTokens);
- $this->objEmail->subject = $this->parseSimpleTokens($this->replaceInsertTags($objLanguage->subject), $arrPlainData);
- $this->objEmail->text = $this->parseSimpleTokens($this->replaceInsertTags($objLanguage->text), $arrPlainData);
+ $this->objEmail->subject = strip_tags($this->parseSimpleTokens($this->replaceInsertTags($objLanguage->subject), $arrData));
+ $this->objEmail->text = strip_tags($this->parseSimpleTokens($this->replaceInsertTags($objLanguage->text), $arrData));
// Generate HTML
if (!$objLanguage->textOnly && $objLanguage->html != '')
@@ -302,7 +301,7 @@ public function sendTo()
// @todo the PDF name could contain user specific information if sent to multiple recipients
if ($this->strDocumentTitle != '')
{
- $strTitle = $this->parseSimpleTokens($this->replaceInsertTags($this->strDocumentTitle), $arrPlainData);
+ $strTitle = strip_tags($this->parseSimpleTokens($this->replaceInsertTags($this->strDocumentTitle), $arrData));
$this->objEmail->attachFileFromString($this->varDocumentData, $strTitle.'.pdf', 'application/pdf');
}
@@ -339,31 +338,9 @@ protected function initializeTemplate($strLanguage, $objCollection)
$this->objEmail->from = $objTemplate->sender ? $objTemplate->sender : $GLOBALS['TL_ADMIN_EMAIL'];
$this->objEmail->priority = $objTemplate->priority;
- $arrCc = trimsplit(',', $objTemplate->cc);
-
- // Recipient_cc
- foreach ((array) $arrCC as $email)
- {
- if ($email == '' || !$this->isValidEmailAddress($email))
- {
- continue;
- }
-
- $this->objEmail->sendCc($email);
- }
-
- $arrBcc = trimsplit(',', $objTemplate->bcc);
-
- // Recipient_bcc
- foreach ((array) $arrBcc as $email)
- {
- if ($email == '' || !$this->isValidEmailAddress($email))
- {
- continue;
- }
-
- $this->objEmail->sendBcc($email);
- }
+ // Add CC and BCC recipients
+ $this->addRecipients($objTemplate->cc, 'sendCc');
+ $this->addRecipients($objTemplate->bcc, 'sendBcc');
$this->strTemplate = $objTemplate->template ? $objTemplate->template : 'mail_default';
@@ -418,5 +395,32 @@ protected function recursiveImplode($strGlue, $arrPieces)
return implode($strGlue, $arrReturn);
}
+
+
+ /**
+ * Add (blind) carbon copy recipients to the email object
+ * @param string
+ * @param string
+ */
+ protected function addRecipients($strRecipients, $strMethod='sendCc')
+ {
+ $arrAdd = array();
+ $arrRecipients = (array) trimsplit(',', $strRecipients);
+
+ foreach ($arrRecipients as $email)
+ {
+ if ($email == '' || !$this->isValidEmailAddress($email))
+ {
+ continue;
+ }
+
+ $arrAdd[] = $email;
+ }
+
+ if (!empty($arrAdd))
+ {
+ $this->objEmail->{$strMethod}($arrAdd);
+ }
+ }
}
@@ -243,8 +243,7 @@ public function __construct($arrData, $arrOptions=null, $blnLocked=false)
ORDER BY p1.config_id DESC, " . ((FE_USER_LOGGED_IN === true && count($this->User->groups)) ? ('p1.member_group=' . implode(' DESC, p1.member_group=', $this->User->groups) . ' DESC') : 'p1.member_group DESC') . ", p1.start DESC, p1.stop DESC
) AS p
GROUP BY pid
- )
- GROUP BY min ORDER BY min ASC LIMIT 1");
+ )");
}
else
{
@@ -84,28 +84,31 @@ public function generate()
if ($this->blnCacheRequest)
{
$time = time();
- $varFilter = is_array($GLOBALS['ISO_FILTERS']) ? serialize($GLOBALS['ISO_FILTERS']) : null;
- $varSorting = is_array($GLOBALS['ISO_SORTING']) ? serialize($GLOBALS['ISO_SORTING']) : null;
- $varLimit = is_array($GLOBALS['ISO_LIMIT']) ? serialize($GLOBALS['ISO_LIMIT']) : null;
+ $varFilter = (is_array($GLOBALS['ISO_FILTERS']) && !empty($GLOBALS['ISO_FILTERS'])) ? serialize($GLOBALS['ISO_FILTERS']) : null;
+ $varSorting = (is_array($GLOBALS['ISO_SORTING']) && !empty($GLOBALS['ISO_SORTING'])) ? serialize($GLOBALS['ISO_SORTING']) : null;
+ $varLimit = (is_array($GLOBALS['ISO_LIMIT']) && !empty($GLOBALS['ISO_LIMIT'])) ? serialize($GLOBALS['ISO_LIMIT']) : null;
- $intCacheId = $this->Database->prepare("SELECT id FROM tl_iso_requestcache WHERE store_id={$this->Isotope->Config->store_id} AND filters" . ($varFilter ? '=' : ' IS ') . "? AND sorting" . ($varSorting ? '=' : ' IS ') . "? AND limits" . ($varLimit ? '=' : ' IS ') . "?")
- ->execute($varFilter, $varSorting, $varLimit)
- ->id;
-
- if ($intCacheId)
- {
- $this->Database->query("UPDATE tl_iso_requestcache SET tstamp=$time WHERE id=$intCacheId");
- }
- else
+ // if all filters are null we don't have to cache (this will prevent useless isorc params from being generated)
+ if ($varFilter !== null && $varLimit !== null && $varSorting !== null)
{
- $intCacheId = $this->Database->prepare("INSERT INTO tl_iso_requestcache (tstamp,store_id,filters,sorting,limits) VALUES ($time, {$this->Isotope->Config->store_id}, ?, ?, ?)")
+ $intCacheId = $this->Database->prepare("SELECT id FROM tl_iso_requestcache WHERE store_id={$this->Isotope->Config->store_id} AND filters" . ($varFilter ? '=' : ' IS ') . "? AND sorting" . ($varSorting ? '=' : ' IS ') . "? AND limits" . ($varLimit ? '=' : ' IS ') . "?")
->execute($varFilter, $varSorting, $varLimit)
- ->insertId;
+ ->id;
+
+ if ($intCacheId)
+ {
+ $this->Database->query("UPDATE tl_iso_requestcache SET tstamp=$time WHERE id=$intCacheId");
+ }
+ else
+ {
+ $intCacheId = $this->Database->prepare("INSERT INTO tl_iso_requestcache (tstamp,store_id,filters,sorting,limits) VALUES ($time, {$this->Isotope->Config->store_id}, ?, ?, ?)")
+ ->execute($varFilter, $varSorting, $varLimit)
+ ->insertId;
+ }
+
+ $this->Input->setGet('isorc', $intCacheId);
+ $this->redirect($this->generateRequestUrl());
}
-
- $strFilterUrl = preg_replace('/&?isorc=[0-9]+&?/', '', $this->Environment->request);
- $this->Input->setGet('isorc', $intCacheId);
- $this->redirect($this->generateRequestUrl());
}
return $strBuffer;
@@ -92,7 +92,7 @@ public function processPayment()
$objOrder->findBy('cart_id', $this->Isotope->Cart->id);
//$arrPaymentData = deserialize($objOrder->payment_data);
- if($this->authCapturePayment($objOrder->id, $objOrder->grandTotal, true))
+ if($this->authCapturePayment($objOrder->id, $this->Isotope->Cart->grandTotal, true))
return true;
global $objPage;
@@ -110,8 +110,14 @@ public function processPayment()
* @param object
* @return string
*/
- public function paymentForm($objModule)
- {
+ public function paymentForm(&$objModule)
+ {
+ if($_SESSION['checkout']['grandTotal']!==$this->Isotope->Cart->grandTotal)
+ $_SESSION['checkout']['success']=false;
+
+ //set/reset grand total.
+ $_SESSION['checkout']['grandTotal'] = $this->Isotope->Cart->grandTotal;
+
$strBuffer = '';
$arrPayment = $this->Input->post('payment');
@@ -209,27 +215,38 @@ public function paymentForm($objModule)
}
if ($this->Input->post('FORM_SUBMIT') == 'iso_mod_checkout_payment' && !$objModule->doNotSubmit && $arrPayment['module']==$this->id && !$_SESSION['CHECKOUT_DATA']['payment']['request_lockout'])
- {
- // Get the current order, review page will create the data
- $objOrder = $this->Database->prepare("SELECT * FROM tl_iso_orders WHERE cart_id=?")->limit(1)->execute($this->Isotope->Cart->id);
+ {
+ //Gather Order data and set IsotopeOrder object
+ $objOrder = new IsotopeOrder();
+
+ if (!$objOrder->findBy('cart_id', $this->Isotope->Cart->id))
+ {
+ $objOrder->uniqid = uniqid($this->Isotope->Config->orderPrefix, true);
+ $objOrder->cart_id = $this->Isotope->Cart->id;
+ $objOrder->findBy('id', $objOrder->save());
+ }
$_SESSION['CHECKOUT_DATA']['payment']['request_lockout'] = true;
-
- $blnResult = $this->authCapturePayment($objOrder->id, $this->Isotope->Cart->grandTotal, false);
+
+ if($_SESSION['CHECKOUT_DATA']['payment']['success']!==true)
+ $blnResult = $this->authCapturePayment($objOrder->id, $this->Isotope->Cart->grandTotal, false);
if($blnResult) //At this point the response data has been saved to the order and the auth was successful.
- {
+ {
unset($_SESSION['CHECKOUT_DATA']['responseMsg']);
- unset($_SESSION['CHECKOUT_DATA']['payment']);
$_SESSION['CHECKOUT_DATA']['payment']['card_accountNumber'] = $this->maskCC($arrPayment['card_accountNumber']); //PCI COMPLIANCE - MASK THE CC DATA
$_SESSION['CHECKOUT_DATA']['payment']['card_cvNumber'] = '***';
- $_SESSION['CHECKOUT_DATA']['payment']['success'] = true;
+ $_SESSION['CHECKOUT_DATA']['payment']['success'] = true;
+ $objModule->doNotSubmit = false;
}
else
{
- $objModule->doNotSubmit = true;
- $_SESSION['CHECKOUT_DATA']['responseMsg'] = sprintf("Transaction failure. Transaction Status: %s, Reason: %s", $this->strStatus, $this->strReason);
+ if($_SESSION['CHECKOUT_DATA']['payment']['success']!==true)
+ {
+ $objModule->doNotSubmit = true;
+ $_SESSION['CHECKOUT_DATA']['responseMsg'] = sprintf("Transaction failure. Transaction Status: %s, Reason: %s", $this->strStatus, $this->strReason);
+ }
}
}
@@ -250,9 +267,10 @@ public function paymentForm($objModule)
public function backendInterface($intOrderId)
{
$arrOrderInfo = $this->Database->prepare("SELECT * FROM tl_iso_orders WHERE id=?")
- ->limit(1)
- ->execute($intOrderId)
- ->fetchAssoc();
+ ->limit(1)
+ ->execute($intOrderId)
+ ->fetchAssoc();
+
$this->Input->setGet('uid', $arrOrderInfo['uniqid']);
$objModule = new ModuleIsotopeOrderDetails($this->Database->execute("SELECT * FROM tl_module WHERE type='iso_orderdetails'"));
@@ -285,11 +303,27 @@ public function backendInterface($intOrderId)
if ($this->Input->post('FORM_SUBMIT') == 'be_pos_terminal' && $arrPaymentData['transaction-id']!=="0")
{
- $blnAuthCapture = $this->authCapturePayment($arrOrderInfo['id'], $arrPaymentData['transaction-id'], $arrOrderInfo['grandTotal'], true);
+ $blnAuthCapture = $this->authCapturePayment($arrOrderInfo['id'], $arrOrderInfo['grandTotal'], true);
$strResponse = '<p class="tl_info">' . sprintf("Transaction Status: %s, Reason: %s", $this->strStatus, $this->strReason) . '</p>';
}
+
+ if($blnAuthCapture)
+ {
+ $objOrder = new IsotopeOrder();
+ if (!$objOrder->findBy('id', $intOrderId))
+ {
+ $objOrder->uniqid = uniqid($this->Isotope->Config->orderPrefix, true);
+ $objOrder->findBy('id', $objOrder->save());
+ }
+
+ $objOrder->status = 'processing';
+
+ $objOrder->save();
+
+ }
+
$return = '<div id="tl_buttons">
<input type="hidden" name="FORM_SUBMIT" value="be_pos_terminal">
<input type="hidden" name="REQUEST_TOKEN" value="'.REQUEST_TOKEN.'">
@@ -301,7 +335,7 @@ public function backendInterface($intOrderId)
$return .= ($strResponse ? $strResponse : '');
$return .= $strOrderDetails;
$return .= '</div></div>';
- if($arrOrderInfo['status']!='complete'){
+ if($arrOrderInfo['status']==$this->new_order_status){
$return .= '<div class="tl_formbody_submit"><div class="tl_submit_container">';
$return .= '<input type="submit" class="submit" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['confirmOrder']) . '"></div></div>';
}
@@ -324,7 +358,7 @@ public function backendInterface($intOrderId)
* @return bool
*/
public function authCapturePayment($intOrderId, $fltOrderTotal, $blnCapture=false)
- {
+ {
//Gather Order data and set IsotopeOrder object
$objOrder = new IsotopeOrder();
@@ -447,6 +481,7 @@ public function authCapturePayment($intOrderId, $fltOrderTotal, $blnCapture=fals
$arrPaymentInfo["x_card_type"] = $GLOBALS['ISO_LANG']['CCT'][$arrData['card_cardType']];
}
+
foreach( $authnet_values as $key => $value ) $fields .= "$key=" . urlencode( $value ) . "&";
$fieldsFinal = rtrim($fields, '&');
Oops, something went wrong.

0 comments on commit 69b6b4b

Please sign in to comment.