Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
Kevin Granger committed 2013-11-27 11:35:41 +01:00
commit dd36a9e8b7
14 files changed
+43 -32

No files matched your search

@@ -55,14 +55,14 @@
{if (isset($module->id) && $module->id > 0) || !isset($module->type) || $module->type != 'addonsMustHave'} {if (isset($module->id) && $module->id > 0) || !isset($module->type) || $module->type != 'addonsMustHave'}
<input type="checkbox" name="modules" value="{$module->name}" <input type="checkbox" name="modules" value="{$module->name}"
{if !isset($module->confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if} {if !isset($module->confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if}
class="noborder"> class="noborder" title="{l s='Module %1s '|sprintf:$module->name}" />
{/if} {/if}
</td> </td>
<td> <td>
<img width="32" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}" /> <img width="32" alt="{$module->displayName}" title="{$module->displayName}" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}" />
</td> </td>
<td> <td>
<div id="anchor{$module->name|ucfirst}"> <div id="anchor{$module->name|ucfirst}" title="{$module->displayName}">
<div class="text-muted"> <div class="text-muted">
{$module->categoryName} {$module->categoryName}
</div> </div>
+5 -1
View File
@@ -152,7 +152,11 @@ class CartCore extends ObjectModel
public function __construct($id = null, $id_lang = null) public function __construct($id = null, $id_lang = null)
{ {
parent::__construct($id, $id_lang); parent::__construct($id);
if (!is_null($id_lang))
$this->id_lang = (int)(Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT');
if ($this->id_customer) if ($this->id_customer)
{ {
if (isset(Context::getContext()->customer) && Context::getContext()->customer->id == $this->id_customer) if (isset(Context::getContext()->customer) && Context::getContext()->customer->id == $this->id_customer)
+4 -1
View File
@@ -122,7 +122,10 @@ class EmployeeCore extends ObjectModel
public function __construct($id = null, $id_lang = null, $id_shop = null) public function __construct($id = null, $id_lang = null, $id_shop = null)
{ {
parent::__construct($id, $id_lang, $id_shop); parent::__construct($id, null, $id_shop);
if (!is_null($id_lang))
$this->id_lang = (int)(Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT');
if ($this->id) if ($this->id)
$this->associated_shops = $this->getAssociatedShops(); $this->associated_shops = $this->getAssociatedShops();
+1
View File
@@ -45,6 +45,7 @@ class MediaCore
'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), 'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true),
'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true), 'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true),
'ui.progressbar' => array('fileName' => 'jquery.ui.progressbar.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), 'ui.progressbar' => array('fileName' => 'jquery.ui.progressbar.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true),
'ui.tooltip' => array('fileName' => 'jquery.ui.tooltip.min.js', 'dependencies' => array('ui.core', 'ui.widget','ui.position','effects.core'), 'theme' => true),
'effects.core' => array('fileName' => 'jquery.effects.core.min.js', 'dependencies' => array(), 'theme' => false), 'effects.core' => array('fileName' => 'jquery.effects.core.min.js', 'dependencies' => array(), 'theme' => false),
'effects.blind' => array('fileName' => 'jquery.effects.blind.min.js', 'dependencies' => array('effects.core'), 'theme' => false), 'effects.blind' => array('fileName' => 'jquery.effects.blind.min.js', 'dependencies' => array('effects.core'), 'theme' => false),
'effects.bounce' => array('fileName' => 'jquery.effects.bounce.min.js', 'dependencies' => array('effects.core'), 'theme' => false), 'effects.bounce' => array('fileName' => 'jquery.effects.bounce.min.js', 'dependencies' => array('effects.core'), 'theme' => false),
+1 -1
View File
@@ -114,7 +114,7 @@ class StoreCore extends ObjectModel
public function __construct($id_store = null, $id_lang = null) public function __construct($id_store = null, $id_lang = null)
{ {
parent::__construct($id_store, $id_lang); parent::__construct($id_store);
$this->id_image = ($this->id && file_exists(_PS_STORE_IMG_DIR_.(int)$this->id.'.jpg')) ? (int)$this->id : false; $this->id_image = ($this->id && file_exists(_PS_STORE_IMG_DIR_.(int)$this->id.'.jpg')) ? (int)$this->id : false;
$this->image_dir = _PS_STORE_IMG_DIR_; $this->image_dir = _PS_STORE_IMG_DIR_;
} }
+1 -1
View File
@@ -1993,7 +1993,7 @@ class AdminControllerCore extends Controller
} }
// Execute Hook AdminController SetMedia // Execute Hook AdminController SetMedia
Hook::exec('actionAdminControllerSetMedia', array()); Hook::exec('actionAdminControllerSetMedia');
} }
/** /**
+1 -1
View File
@@ -330,7 +330,7 @@ class FrontControllerCore extends Controller
'cart_qties' => (int)$cart->nbProducts(), 'cart_qties' => (int)$cart->nbProducts(),
'currencies' => Currency::getCurrencies(), 'currencies' => Currency::getCurrencies(),
'languages' => $languages, 'languages' => $languages,
'meta_language' => implode('-', $meta_language), 'meta_language' => implode(',', $meta_language),
'priceDisplay' => Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer), 'priceDisplay' => Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer),
'add_prod_display' => (int)Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => (int)Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'shop_name' => Configuration::get('PS_SHOP_NAME'), 'shop_name' => Configuration::get('PS_SHOP_NAME'),
+2 -1
View File
@@ -222,7 +222,8 @@ abstract class ModuleGraphCore extends Module
protected function _displayCsv() protected function _displayCsv()
{ {
ob_end_clean(); if (ob_get_length())
ob_end_clean();
header('Content-Type: application/octet-stream'); header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$this->displayName.' - '.time().'.csv"'); header('Content-Disposition: attachment; filename="'.$this->displayName.' - '.time().'.csv"');
echo $this->_csv; echo $this->_csv;
+1 -1
View File
@@ -394,7 +394,7 @@ class AdminModulesControllerCore extends AdminController
foreach($zip_folders as $folder) foreach($zip_folders as $folder)
if (!in_array($folder, array('.', '..', '.svn', '.git', '__MACOSX')) && !Module::getInstanceByName($folder)) if (!in_array($folder, array('.', '..', '.svn', '.git', '__MACOSX')) && !Module::getInstanceByName($folder))
{ {
$this->errors[] = Tools::displayError('The \'.$folder.\' you uploaded is not a module'); $this->errors[] = sprintf(Tools::displayError('The folder %1$s you uploaded is not a module.'), $folder);
$this->recursiveDeleteOnDisk(_PS_MODULE_DIR_.$folder); $this->recursiveDeleteOnDisk(_PS_MODULE_DIR_.$folder);
} }
@@ -32,6 +32,8 @@ class AttachmentControllerCore extends FrontController
if (!$a->id) if (!$a->id)
Tools::redirect('index.php'); Tools::redirect('index.php');
Hook::exec('actionDownloadAttachment', array('attachment' => &$a);
if (ob_get_level()) if (ob_get_level())
ob_end_clean(); ob_end_clean();
+1 -1
View File
@@ -134,7 +134,7 @@
{foreach $order_details as $order_detail} {foreach $order_details as $order_detail}
{cycle values='#FFF,#DDD' assign=bgcolor} {cycle values='#FFF,#DDD' assign=bgcolor}
<tr style="line-height:6px;background-color:{$bgcolor};"> <tr style="line-height:6px;background-color:{$bgcolor};">
<td style="text-align: left; width: 45%">{$order_detail.product_name}</td> <td style="text-align: left; width: 45%">{$order_detail.product_name}{if isset($order_detail.product_reference) && !empty($order_detail.product_reference)} ({l s='Reference :' pdf='true'} {$order_detail.product_reference}){/if}</td>
<!-- unit price tax excluded is mandatory --> <!-- unit price tax excluded is mandatory -->
{if !$tax_excluded_display} {if !$tax_excluded_display}
<td style="text-align: right; width: 10%"> <td style="text-align: right; width: 10%">
+1 -1
View File
@@ -130,7 +130,7 @@
{foreach $order_details as $order_detail} {foreach $order_details as $order_detail}
{cycle values='#FFF,#DDD' assign=bgcolor} {cycle values='#FFF,#DDD' assign=bgcolor}
<tr style="line-height:6px;background-color:{$bgcolor};"> <tr style="line-height:6px;background-color:{$bgcolor};">
<td style="text-align: left; width: {if !$tax_excluded_display}35%{else}45%{/if}">{$order_detail.product_name}</td> <td style="text-align: left; width: {if !$tax_excluded_display}35%{else}45%{/if}">{$order_detail.product_name}{if isset($order_detail.product_reference) && !empty($order_detail.product_reference)} ({l s='Reference :' pdf='true'} {$order_detail.product_reference}){/if}</td>
<!-- unit price tax excluded is mandatory --> <!-- unit price tax excluded is mandatory -->
{if !$tax_excluded_display} {if !$tax_excluded_display}
<td style="text-align: right; width: 20%; white-space: nowrap;"> <td style="text-align: right; width: 20%; white-space: nowrap;">
+10 -10
View File
@@ -30,12 +30,12 @@ function ps_round(value, precision)
if (typeof(precision) === 'undefined') if (typeof(precision) === 'undefined')
precision = 2; precision = 2;
method = roundMode; var method = roundMode;
if (method === 0) if (method === 0)
return ceilf(value, precision); return ceilf(value, precision);
else if (method === 1) else if (method === 1)
return floorf(value, precision); return floorf(value, precision);
precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision);
return Math.round(value * precisionFactor) / precisionFactor; return Math.round(value * precisionFactor) / precisionFactor;
} }
@@ -43,9 +43,9 @@ function ceilf(value, precision)
{ {
if (typeof(precision) === 'undefined') if (typeof(precision) === 'undefined')
precision = 0; precision = 0;
precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision);
tmp = value * precisionFactor; var tmp = value * precisionFactor;
tmp2 = tmp.toString(); var tmp2 = tmp.toString();
if (tmp2[tmp2.length - 1] === 0) if (tmp2[tmp2.length - 1] === 0)
return value; return value;
return Math.ceil(value * precisionFactor) / precisionFactor; return Math.ceil(value * precisionFactor) / precisionFactor;
@@ -55,9 +55,9 @@ function floorf(value, precision)
{ {
if (typeof(precision) === 'undefined') if (typeof(precision) === 'undefined')
precision = 0; precision = 0;
precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision);
tmp = value * precisionFactor; var tmp = value * precisionFactor;
tmp2 = tmp.toString(); var tmp2 = tmp.toString();
if (tmp2[tmp2.length - 1] === 0) if (tmp2[tmp2.length - 1] === 0)
return value; return value;
return Math.floor(value * precisionFactor) / precisionFactor; return Math.floor(value * precisionFactor) / precisionFactor;
@@ -81,7 +81,7 @@ function formatedNumberToFloat(price, currencyFormat, currencySign)
function formatCurrency(price, currencyFormat, currencySign, currencyBlank) function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
{ {
// if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class)
blank = ''; var blank = '';
price = parseFloat(price.toFixed(6)); price = parseFloat(price.toFixed(6));
price = ps_round(price, priceDisplayPrecision); price = ps_round(price, priceDisplayPrecision);
if (currencyBlank > 0) if (currencyBlank > 0)
@@ -95,7 +95,7 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
if (currencyFormat == 4) if (currencyFormat == 4)
return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign); return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign);
if (currencyFormat == 5) if (currencyFormat == 5)
return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign); return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '\'', '.'));
return price; return price;
} }
+10 -10
View File
@@ -30,12 +30,12 @@ function ps_round(value, precision)
if (typeof(precision) === 'undefined') if (typeof(precision) === 'undefined')
precision = 2; precision = 2;
method = roundMode; var method = roundMode;
if (method === 0) if (method === 0)
return ceilf(value, precision); return ceilf(value, precision);
else if (method === 1) else if (method === 1)
return floorf(value, precision); return floorf(value, precision);
precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision);
return Math.round(value * precisionFactor) / precisionFactor; return Math.round(value * precisionFactor) / precisionFactor;
} }
@@ -43,9 +43,9 @@ function ceilf(value, precision)
{ {
if (typeof(precision) === 'undefined') if (typeof(precision) === 'undefined')
precision = 0; precision = 0;
precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision);
tmp = value * precisionFactor; var tmp = value * precisionFactor;
tmp2 = tmp.toString(); var tmp2 = tmp.toString();
if (tmp2[tmp2.length - 1] === 0) if (tmp2[tmp2.length - 1] === 0)
return value; return value;
return Math.ceil(value * precisionFactor) / precisionFactor; return Math.ceil(value * precisionFactor) / precisionFactor;
@@ -55,9 +55,9 @@ function floorf(value, precision)
{ {
if (typeof(precision) === 'undefined') if (typeof(precision) === 'undefined')
precision = 0; precision = 0;
precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision);
tmp = value * precisionFactor; var tmp = value * precisionFactor;
tmp2 = tmp.toString(); var tmp2 = tmp.toString();
if (tmp2[tmp2.length - 1] === 0) if (tmp2[tmp2.length - 1] === 0)
return value; return value;
return Math.floor(value * precisionFactor) / precisionFactor; return Math.floor(value * precisionFactor) / precisionFactor;
@@ -81,7 +81,7 @@ function formatedNumberToFloat(price, currencyFormat, currencySign)
function formatCurrency(price, currencyFormat, currencySign, currencyBlank) function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
{ {
// if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class)
blank = ''; var blank = '';
price = parseFloat(price.toFixed(6)); price = parseFloat(price.toFixed(6));
price = ps_round(price, priceDisplayPrecision); price = ps_round(price, priceDisplayPrecision);
if (currencyBlank > 0) if (currencyBlank > 0)
@@ -212,7 +212,7 @@ function in_array(value, array)
function resizeAddressesBox(nameBox) function resizeAddressesBox(nameBox)
{ {
maxHeight = 0; var maxHeight = 0;
if (typeof(nameBox) === 'undefined') if (typeof(nameBox) === 'undefined')
nameBox = '.address'; nameBox = '.address';