Merge pull request #748 from djfm/release

// fix PSCFV-8260, currency format containing spaces and RTL languages
This commit is contained in:
Damien Metzger committed 2013-09-30 09:21:43 -07:00
commit 9c04f1dace
3 files changed
+18 -4

No files matched your search

@@ -58,7 +58,7 @@
</ul> </ul>
</fieldset> </fieldset>
<h2>{l s='Members of this customer group'}</h2> <h2>{l s='Members of this customer group'}</h2>
<p>{l s='Limited to the 100th first customers.'} {l s='Please use filters to narrow your search.'}</p> <p>{l s='Limited to the first 100 customers.'} {l s='Please use filters to narrow your search.'}</p>
{$customerList} {$customerList}
{/block} {/block}
@@ -984,7 +984,7 @@
<label>{l s='Search customers'}</label> <label>{l s='Search customers'}</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" id="customer" value="" /> <input type="text" id="customer" value="" />
<p>{l s='Search a customer by tapping the first letters of his/her name'}</p> <p>{l s='Search a customer by typing the first letters of his/her name'}</p>
<a class="fancybox button" href="{$link->getAdminLink('AdminCustomers')|escape:'htmlall':'UTF-8'}&addcustomer&liteDisplaying=1&submitFormAjax=1#"> <a class="fancybox button" href="{$link->getAdminLink('AdminCustomers')|escape:'htmlall':'UTF-8'}&addcustomer&liteDisplaying=1&submitFormAjax=1#">
<img src="../img/admin/add.gif" title="new"/><span>{l s='Add new customer'}</span> <img src="../img/admin/add.gif" title="new"/><span>{l s='Add new customer'}</span>
</a> </a>
@@ -999,7 +999,7 @@
<div class="margin-form"> <div class="margin-form">
<input type="hidden" value="" id="id_cart" name="id_cart" /> <input type="hidden" value="" id="id_cart" name="id_cart" />
<input type="text" id="product" value="" /> <input type="text" id="product" value="" />
<p>{l s='Search a product by tapping the first letters of his/her name.'}</p> <p>{l s='Search a product by typing the first letters of his/her name.'}</p>
</div> </div>
<div id="products_found"> <div id="products_found">
<div id="product_list"> <div id="product_list">
+14
View File
@@ -494,6 +494,20 @@ class ToolsCore
if (($is_negative = ($price < 0))) if (($is_negative = ($price < 0)))
$price *= -1; $price *= -1;
$price = Tools::ps_round($price, $c_decimals); $price = Tools::ps_round($price, $c_decimals);
/*
* If the language is RTL and the selected currency format contains spaces as thousands separator
* then the number will be printed in reverse since the space is interpreted as separating words.
* To avoid this we replace the currency format containing a space with the one containing a comma (,) as thousand
* separator when the language is RTL.
*
* TODO: This is not ideal, a currency format should probably be tied to a language, not to a currency.
*/
if(($c_format == 2) && ($context->language->is_rtl == 1))
{
$c_format = 4;
}
switch ($c_format) switch ($c_format)
{ {
/* X 0,000.00 */ /* X 0,000.00 */