Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
commit
716b79b8c6
12 files changed
+42
-20
No files matched your search
@@ -1055,6 +1055,9 @@ class ValidateCore
|
|||||||
{
|
{
|
||||||
return (bool)(is_string($name) && preg_match('/^[0-9a-zA-Z-_]*$/u', $name));
|
return (bool)(is_string($name) && preg_match('/^[0-9a-zA-Z-_]*$/u', $name));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public static function isPrestaShopVersion($version)
|
||||||
|
{
|
||||||
|
return (preg_match('/^[0-1]\.[0-9]{1,2}(\.[0-9]{1,2}){0,2}$/', $version) && ip2long($version));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -209,7 +209,7 @@ class AdminCartsControllerCore extends AdminController
|
|||||||
|
|
||||||
if (!$this->context->cart->id_customer)
|
if (!$this->context->cart->id_customer)
|
||||||
$this->context->cart->id_customer = $id_customer;
|
$this->context->cart->id_customer = $id_customer;
|
||||||
if ($this->context->cart->OrderExists())
|
if (Validate::isLoadedObject($this->context->cart) && $this->context->cart->OrderExists())
|
||||||
return;
|
return;
|
||||||
if (!$this->context->cart->secure_key)
|
if (!$this->context->cart->secure_key)
|
||||||
$this->context->cart->secure_key = $this->context->customer->secure_key;
|
$this->context->cart->secure_key = $this->context->customer->secure_key;
|
||||||
|
|||||||
@@ -475,19 +475,21 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
public function ajaxProcessCheckLangPack()
|
public function ajaxProcessCheckLangPack()
|
||||||
{
|
{
|
||||||
$this->json = true;
|
$this->json = true;
|
||||||
if (empty($_GET['iso_lang']))
|
if (!Tools::getValue('iso_lang') || !Validate::isLanguageIsoCode(Tools::getValue('iso_lang')))
|
||||||
{
|
{
|
||||||
$this->status = 'error';
|
$this->status = 'error';
|
||||||
$this->errors[] = '[TECHNICAL ERROR] iso_lang not set or empty';
|
$this->errors[] = $this->l('Iso code is not valid');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (empty($_GET['ps_version']))
|
if (!Tools::getValue('ps_version') || !Validate::isPrestaShopVersion(Tools::getValue('ps_version')))
|
||||||
{
|
{
|
||||||
$this->status = 'error';
|
$this->status = 'error';
|
||||||
$this->errors[] = '[TECHNICAL ERROR] ps_version not set or empty';
|
$this->errors[] = $this->l('Technical Error: ps_version is not valid');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all iso code available
|
// Get all iso code available
|
||||||
if($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']))
|
if ($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.Tools::getValue('ps_version').'&iso_lang='.Tools::getValue('iso_lang')))
|
||||||
{
|
{
|
||||||
$result = Tools::jsonDecode($lang_packs);
|
$result = Tools::jsonDecode($lang_packs);
|
||||||
if ($lang_packs !== '' && $result && !isset($result->error))
|
if ($lang_packs !== '' && $result && !isset($result->error))
|
||||||
@@ -498,16 +500,13 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->status = 'error';
|
$this->status = 'error';
|
||||||
$msg = $this->l('Wrong ISO code, or the selected language pack is unavailable.');
|
$this->errors[] = $this->l('Wrong ISO code, or the selected language pack is unavailable.');
|
||||||
if ($result)
|
|
||||||
$msg = $result->msg;
|
|
||||||
$this->errors[] = $msg;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->status = 'error';
|
$this->status = 'error';
|
||||||
$this->errors[] = '[TECHNICAL ERROR] Server unreachable';
|
$this->errors[] = $this->l('Technical Error: translation server unreachable');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1454,6 +1454,8 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
$path = $arr_mail_path[$group_name];
|
$path = $arr_mail_path[$group_name];
|
||||||
if ($module_name)
|
if ($module_name)
|
||||||
$path = str_replace('{module}', $module_name, $path);
|
$path = str_replace('{module}', $module_name, $path);
|
||||||
|
if (!file_exists($path) && !mkdir($path, 0777, true))
|
||||||
|
throw new PrestaShopException(sprintf(Tools::displayError('Directory "%s" cannot be created'), dirname($file_path)));
|
||||||
file_put_contents($path.$mail_name.'.'.$type_content, $content);
|
file_put_contents($path.$mail_name.'.'.$type_content, $content);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2453,6 +2455,9 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
|
|
||||||
protected function writeSubjectTranslationFile($sub, $path)
|
protected function writeSubjectTranslationFile($sub, $path)
|
||||||
{
|
{
|
||||||
|
if (!Tools::file_exists_cache(dirname(path)))
|
||||||
|
if (!mkdir(dirname(path), 0700))
|
||||||
|
throw new PrestaShopException('Directory '.dirname(path).' cannot be created.');
|
||||||
if ($fd = @fopen($path, 'w'))
|
if ($fd = @fopen($path, 'w'))
|
||||||
{
|
{
|
||||||
$tab = 'LANGMAIL';
|
$tab = 'LANGMAIL';
|
||||||
|
|||||||
+1
-1
@@ -498,7 +498,7 @@ select optgroup option {
|
|||||||
background: #FFBABA url(../img/admin/icon-cancel.png) no-repeat scroll 6px 6px;
|
background: #FFBABA url(../img/admin/icon-cancel.png) no-repeat scroll 6px 6px;
|
||||||
border: 1px solid #CC0000;
|
border: 1px solid #CC0000;
|
||||||
color:#D8000C;
|
color:#D8000C;
|
||||||
padding:20px;
|
padding:20px 40px;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
bottom:0;
|
bottom:0;
|
||||||
width:100%;
|
width:100%;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|addslashes|replace:'\\\'':'\''}",
|
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|addslashes|replace:'\\\'':'\''}",
|
||||||
"quantity": {$product.cart_quantity},
|
"quantity": {$product.cart_quantity},
|
||||||
"priceByLine": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
|
"priceByLine": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
|
||||||
"name": "{$product.name|html_entity_decode:2:'UTF-8'|escape:'htmlall'|truncate:15:'...':true}",
|
"name": "{$product.name|html_entity_decode:2:'UTF-8'|truncate:15:'...':true|escape:'htmlall'}",
|
||||||
"price": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
|
"price": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
|
||||||
"price_float": "{$product.total}",
|
"price_float": "{$product.total}",
|
||||||
"idCombination": {if isset($product.attributes_small)}{$productAttributeId}{else}0{/if},
|
"idCombination": {if isset($product.attributes_small)}{$productAttributeId}{else}0{/if},
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
|
|||||||
<li name="customization">
|
<li name="customization">
|
||||||
<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}", true)}" rel="nofollow"> </a></div>
|
<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}", true)}" rel="nofollow"> </a></div>
|
||||||
<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
|
<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
|
||||||
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|escape:html:'UTF-8'|replace:"<br />":" "|truncate:28}
|
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" "|truncate:28:'...'|escape:html:'UTF-8'}
|
||||||
{else}
|
{else}
|
||||||
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
|
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
$('#center_column').attr('id', 'old_center_column');
|
$('#center_column').attr('id', 'old_center_column');
|
||||||
$('#old_center_column').after('<div id="center_column" class="' + $('#old_center_column').attr('class') + '">'+data+'</div>');
|
$('#old_center_column').after('<div id="center_column" class="' + $('#old_center_column').attr('class') + '">'+data+'</div>');
|
||||||
$('#old_center_column').hide();
|
$('#old_center_column').hide();
|
||||||
|
// Button override
|
||||||
|
ajaxCart.overrideButtonsInThePage();
|
||||||
$("#instant_search_results a.close").click(function() {
|
$("#instant_search_results a.close").click(function() {
|
||||||
$("#search_query_{$blocksearch_type}").val('');
|
$("#search_query_{$blocksearch_type}").val('');
|
||||||
return tryToCloseInstantSearch();
|
return tryToCloseInstantSearch();
|
||||||
|
|||||||
@@ -57,6 +57,19 @@ class BlockSupplier extends Module
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function uninstall()
|
||||||
|
{
|
||||||
|
if (!parent::uninstall())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* remove the configuration variable */
|
||||||
|
$result = Configuration::deleteByName('SUPPLIER_DISPLAY_TEXT');
|
||||||
|
$result &= Configuration::deleteByName('SUPPLIER_DISPLAY_TEXT_NB');
|
||||||
|
$result &= Configuration::deleteByName('SUPPLIER_DISPLAY_FORM');
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
function hookDisplayLeftColumn($params)
|
function hookDisplayLeftColumn($params)
|
||||||
{
|
{
|
||||||
$id_lang = (int)Context::getContext()->language->id;
|
$id_lang = (int)Context::getContext()->language->id;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
|
|||||||
<li name="customization">
|
<li name="customization">
|
||||||
<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}", true)}" rel="nofollow"> </a></div>
|
<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}", true)}" rel="nofollow"> </a></div>
|
||||||
<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
|
<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
|
||||||
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|escape:html:'UTF-8'|replace:"<br />":" "|truncate:28}
|
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" "|truncate:28:'...'|escape:html:'UTF-8'}
|
||||||
{else}
|
{else}
|
||||||
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
|
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
<td class="price" id="total_shipping">{l s='Free Shipping!'}</td>
|
<td class="price" id="total_shipping">{l s='Free Shipping!'}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{else}
|
{else}
|
||||||
{if $use_taxes}
|
{if $use_taxes && $total_shipping_tax_exc != $total_shipping}
|
||||||
{if $priceDisplay}
|
{if $priceDisplay}
|
||||||
<tr class="cart_total_delivery" {if $shippingCost <= 0} style="display:none"{/if}>
|
<tr class="cart_total_delivery" {if $shippingCost <= 0} style="display:none"{/if}>
|
||||||
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if}</td>
|
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if}</td>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
<td colspan="2" class="price" id="total_shipping">{l s='Free Shipping!'}</td>
|
<td colspan="2" class="price" id="total_shipping">{l s='Free Shipping!'}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{else}
|
{else}
|
||||||
{if $use_taxes}
|
{if $use_taxes && $total_shipping_tax_exc != $total_shipping}
|
||||||
{if $priceDisplay}
|
{if $priceDisplay}
|
||||||
<tr class="cart_total_delivery" {if $total_shipping_tax_exc <= 0} style="display:none;"{/if}>
|
<tr class="cart_total_delivery" {if $total_shipping_tax_exc <= 0} style="display:none;"{/if}>
|
||||||
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if}</td>
|
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if}</td>
|
||||||
|
|||||||
Reference in new issue
Block a user