Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
commit
00c1860d22
23 files changed
+101
-64
No files matched your search
@@ -30,6 +30,7 @@ select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disab
|
|||||||
|
|
||||||
/*BUTTON*/
|
/*BUTTON*/
|
||||||
.button{
|
.button{
|
||||||
|
cursor: pointer;
|
||||||
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top;
|
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top;
|
||||||
background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent;
|
background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent;
|
||||||
background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent;
|
background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent;
|
||||||
@@ -673,4 +674,4 @@ ul.listForm li {padding-bottom:3px;}
|
|||||||
|
|
||||||
/************** SCENE *****************/
|
/************** SCENE *****************/
|
||||||
|
|
||||||
#large_scene_image{clear:both;border:1px solid transparent;}
|
#large_scene_image{clear:both;border:1px solid transparent;}
|
||||||
@@ -24,9 +24,9 @@
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
<div class="width4">
|
<div class="width4">
|
||||||
{$localization_form}
|
{if isset($localization_form)}{$localization_form}{/if}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="width4">
|
<div class="width4">
|
||||||
{$localization_options}
|
{if isset($localization_options)}{$localization_options}{/if}
|
||||||
</div>
|
</div>
|
||||||
+13
-7
@@ -120,16 +120,22 @@ class ImageCore extends ObjectModel
|
|||||||
*
|
*
|
||||||
* @param integer $id_lang Language ID
|
* @param integer $id_lang Language ID
|
||||||
* @param integer $id_product Product ID
|
* @param integer $id_product Product ID
|
||||||
|
* @param integer $id_product_attribute Product Attribute ID
|
||||||
* @return array Images
|
* @return array Images
|
||||||
*/
|
*/
|
||||||
public static function getImages($id_lang, $id_product)
|
public static function getImages($id_lang, $id_product, $id_product_attribute = NULL)
|
||||||
{
|
{
|
||||||
return Db::getInstance()->executeS('
|
$attribute_filter = ($id_product_attribute ? ' AND ai.`id_product_attribute` = '.(int)$id_product_attribute : '');
|
||||||
SELECT *
|
$sql = 'SELECT *
|
||||||
FROM `'._DB_PREFIX_.'image` i
|
FROM `'._DB_PREFIX_.'image` i
|
||||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)
|
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)';
|
||||||
WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang.'
|
|
||||||
ORDER BY i.`position` ASC');
|
if ($id_product_attribute)
|
||||||
|
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` ai ON (i.`id_image` = ai.`id_image`)';
|
||||||
|
|
||||||
|
$sql .= ' WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang . $attribute_filter.'
|
||||||
|
ORDER BY i.`position` ASC';
|
||||||
|
return Db::getInstance()->executeS($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+19
-5
@@ -111,18 +111,22 @@ class LanguageCore extends ObjectModel
|
|||||||
$iso_code = $newIso ? $newIso : $this->iso_code;
|
$iso_code = $newIso ? $newIso : $this->iso_code;
|
||||||
|
|
||||||
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||||
mkdir(_PS_TRANSLATIONS_DIR_.$iso_code);
|
{
|
||||||
|
if (@mkdir(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||||
|
@chmod(_PS_TRANSLATIONS_DIR_.$iso_code, 0777);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->translationsFilesAndVars as $file => $var)
|
foreach ($this->translationsFilesAndVars as $file => $var)
|
||||||
{
|
{
|
||||||
$path_file = _PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php';
|
$path_file = _PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php';
|
||||||
if (!file_exists($path_file))
|
if (!file_exists($path_file))
|
||||||
if ($file != 'tabs')
|
if ($file != 'tabs')
|
||||||
file_put_contents($path_file, '<?php
|
@file_put_contents($path_file, '<?php
|
||||||
global $'.$var.';
|
global $'.$var.';
|
||||||
$'.$var.' = array();
|
$'.$var.' = array();
|
||||||
?>');
|
?>');
|
||||||
else
|
else
|
||||||
file_put_contents($path_file, '<?php
|
@file_put_contents($path_file, '<?php
|
||||||
$'.$var.' = array();
|
$'.$var.' = array();
|
||||||
return $'.$var.';
|
return $'.$var.';
|
||||||
?>');
|
?>');
|
||||||
@@ -460,7 +464,8 @@ class LanguageCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
rmdir($dir);
|
if (is_writable($dir))
|
||||||
|
rmdir($dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete()
|
public function delete()
|
||||||
@@ -783,13 +788,22 @@ class LanguageCore extends ObjectModel
|
|||||||
$lang_pack_ok = false;
|
$lang_pack_ok = false;
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip';
|
$file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip';
|
||||||
|
|
||||||
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso)))
|
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso)))
|
||||||
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
||||||
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
|
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
|
||||||
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
||||||
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))
|
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))
|
||||||
if (!@file_put_contents($file, $content))
|
if (!@file_put_contents($file, $content))
|
||||||
$errors[] = Tools::displayError('Server does not have permissions for writing.');
|
{
|
||||||
|
if (is_writable(dirname($file)))
|
||||||
|
{
|
||||||
|
@unlink($file);
|
||||||
|
@file_put_contents($file, $content);
|
||||||
|
}
|
||||||
|
elseif (!is_writable($file))
|
||||||
|
$errors[] = Tools::displayError('Server does not have permissions for writing.').' ('.$file.')';
|
||||||
|
}
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$gz = new Archive_Tar($file, true);
|
$gz = new Archive_Tar($file, true);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class ManufacturerCore extends ObjectModel
|
|||||||
|
|
||||||
// Lang fields
|
// Lang fields
|
||||||
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||||
'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 254),
|
'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class SupplierCore extends ObjectModel
|
|||||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||||
|
|
||||||
// Lang fields
|
// Lang fields
|
||||||
'description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
|
|||||||
@@ -726,6 +726,8 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public function processAdd()
|
public function processAdd()
|
||||||
{
|
{
|
||||||
|
if (!isset($this->className) || empty($this->className))
|
||||||
|
return false;
|
||||||
/* Checking fields validity */
|
/* Checking fields validity */
|
||||||
$this->validateRules();
|
$this->validateRules();
|
||||||
if (count($this->errors) <= 0)
|
if (count($this->errors) <= 0)
|
||||||
@@ -1142,6 +1144,8 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
protected function loadObject($opt = false)
|
protected function loadObject($opt = false)
|
||||||
{
|
{
|
||||||
|
if (!isset($this->className) || empty($this->className))
|
||||||
|
return true;
|
||||||
$id = (int)Tools::getValue($this->identifier);
|
$id = (int)Tools::getValue($this->identifier);
|
||||||
if ($id && Validate::isUnsignedId($id))
|
if ($id && Validate::isUnsignedId($id))
|
||||||
{
|
{
|
||||||
@@ -1540,10 +1544,13 @@ class AdminControllerCore extends Controller
|
|||||||
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
|
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
|
||||||
|
|
||||||
$country_module_list_xml = simplexml_load_file(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
|
$country_module_list_xml = simplexml_load_file(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
|
||||||
|
if($country_module_list_xml === TRUE)
|
||||||
|
{
|
||||||
$country_module_list = array();
|
$country_module_list = array();
|
||||||
foreach ($country_module_list_xml->module as $k => $m)
|
foreach ($country_module_list_xml->module as $k => $m)
|
||||||
$country_module_list[] = (string)$m->name;
|
$country_module_list[] = (string)$m->name;
|
||||||
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list);
|
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
||||||
$this->toolbar_btn['modules-list'] = array(
|
$this->toolbar_btn['modules-list'] = array(
|
||||||
@@ -2400,7 +2407,7 @@ class AdminControllerCore extends Controller
|
|||||||
public function getFieldValue($obj, $key, $id_lang = null)
|
public function getFieldValue($obj, $key, $id_lang = null)
|
||||||
{
|
{
|
||||||
if ($id_lang)
|
if ($id_lang)
|
||||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
$default_value = (isset($obj->id) && $obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
||||||
else
|
else
|
||||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
||||||
|
|
||||||
|
|||||||
@@ -1726,7 +1726,15 @@ abstract class ModuleCore
|
|||||||
<need_instance>'.(int)$this->need_instance.'</need_instance>'.(isset($this->limited_countries) ? "\n\t".'<limited_countries>'.(count($this->limited_countries) == 1 ? $this->limited_countries[0] : '').'</limited_countries>' : '').'
|
<need_instance>'.(int)$this->need_instance.'</need_instance>'.(isset($this->limited_countries) ? "\n\t".'<limited_countries>'.(count($this->limited_countries) == 1 ? $this->limited_countries[0] : '').'</limited_countries>' : '').'
|
||||||
</module>';
|
</module>';
|
||||||
if (is_writable(_PS_MODULE_DIR_.$this->name.'/'))
|
if (is_writable(_PS_MODULE_DIR_.$this->name.'/'))
|
||||||
file_put_contents(_PS_MODULE_DIR_.$this->name.'/config.xml', $xml);
|
{
|
||||||
|
$file = _PS_MODULE_DIR_.$this->name.'/config.xml';
|
||||||
|
if (!@file_put_contents($file, $xml))
|
||||||
|
if (!is_writable($file))
|
||||||
|
{
|
||||||
|
@unlink($file);
|
||||||
|
@file_put_contents($file, $xml);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -712,11 +712,10 @@ class OrderCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getCartRules()
|
public function getCartRules()
|
||||||
{
|
{
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM `'._DB_PREFIX_.'order_cart_rule` ocr
|
FROM `'._DB_PREFIX_.'order_cart_rule` ocr
|
||||||
LEFT JOIN `'._DB_PREFIX_.'cart_rule` cr ON cr.`id_cart_rule` = ocr.`id_cart_rule`
|
|
||||||
WHERE ocr.`id_order` = '.(int)$this->id);
|
WHERE ocr.`id_order` = '.(int)$this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ class OrderCartRuleCore extends ObjectModel
|
|||||||
|
|
||||||
/** @var float value (tax excl.) of voucher */
|
/** @var float value (tax excl.) of voucher */
|
||||||
public $value_tax_excl;
|
public $value_tax_excl;
|
||||||
|
|
||||||
|
/** @var boolean value : voucher gives free shipping or not */
|
||||||
|
public $free_shipping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ObjectModel::$definition
|
* @see ObjectModel::$definition
|
||||||
@@ -59,7 +62,8 @@ class OrderCartRuleCore extends ObjectModel
|
|||||||
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true),
|
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true),
|
||||||
'value' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
'value' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||||
'value_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true)
|
'value_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||||
|
'free_shipping' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -129,19 +129,6 @@ class OrderSlipCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$products[$key] = $product;
|
$products[$key] = $product;
|
||||||
$products[$key]['product_quantity'] = $slip_quantity[$product['id_order_detail']];
|
$products[$key]['product_quantity'] = $slip_quantity[$product['id_order_detail']];
|
||||||
if (count($cart_rules))
|
|
||||||
{
|
|
||||||
$order->setProductPrices($product);
|
|
||||||
$realProductPrice = $products[$key]['product_price'];
|
|
||||||
// Todo : must be updated to use the cart rules
|
|
||||||
foreach ($cart_rules as $cart_rule)
|
|
||||||
{
|
|
||||||
if ($cart_rule['reduction_percent'])
|
|
||||||
$products[$key]['product_price'] -= $realProductPrice * ($cart_rule['reduction_percent'] / 100);
|
|
||||||
elseif ($cart_rule['reduction_amount'])
|
|
||||||
$products[$key]['product_price'] -= (($cart_rule['reduction_amount'] * ($product['product_price_wt'] / $order->total_products_wt)) / (1.00 + ($product['tax_rate'] / 100)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $order->getProducts($products);
|
return $order->getProducts($products);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2435,17 +2435,12 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$discount_rate = (float)$info['discount_rate'];
|
$discount_rate = (float)$info['discount_rate'];
|
||||||
$tax_rate = (float)$info['tax_rate'];
|
$tax_rate = (float)$info['tax_rate'];
|
||||||
|
|
||||||
// checks if one product is there only once
|
// checks if one product/attribute is there only once
|
||||||
if (isset($product['id_product']))
|
if (isset($products[$id_product][$id_product_attribute]))
|
||||||
{
|
$this->errors[] = sprintf($this->l('Product/Attribute (%d/%d) cannot be added twice (at line %d).'), $id_product,
|
||||||
if ($product['id_product'] == $id_product_attribute)
|
$id_product_attribute, $current_line + 1);
|
||||||
$this->errors[] = sprintf($this->l('Product (%d/%D) cannot be added twice (at line %d).'), $id_product,
|
|
||||||
$id_product_attribute, $current_line + 1);
|
|
||||||
else
|
|
||||||
$product['id_product'] = $id_product_attribute;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
$product['id_product'] = 0;
|
$products[$id_product][$id_product_attribute] = $quantity_expected;
|
||||||
|
|
||||||
// checks parameters
|
// checks parameters
|
||||||
if (false === ($supplier_reference = ProductSupplier::getProductSupplierReference($id_product, $id_product_attribute, $supply_order->id_supplier)))
|
if (false === ($supplier_reference = ProductSupplier::getProductSupplierReference($id_product, $id_product_attribute, $supply_order->id_supplier)))
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ class AdminLocalizationControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->className = 'Configuration';
|
|
||||||
$this->table = 'configuration';
|
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->fields_options = array(
|
$this->fields_options = array(
|
||||||
|
|||||||
@@ -131,8 +131,13 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
|||||||
|
|
||||||
$modules = $this->getModules();
|
$modules = $this->getModules();
|
||||||
$module_instance = array();
|
$module_instance = array();
|
||||||
foreach ($modules as $module)
|
foreach ($modules as $m => $module)
|
||||||
|
{
|
||||||
$module_instance[$module['name']] = Module::getInstanceByName($module['name']);
|
$module_instance[$module['name']] = Module::getInstanceByName($module['name']);
|
||||||
|
$modules[$m]['displayName'] = $module_instance[$module['name']]->displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
uasort($modules, array($this, 'checkModulesNames'));
|
||||||
|
|
||||||
$tpl->assign(array(
|
$tpl->assign(array(
|
||||||
'current' => self::$currentIndex,
|
'current' => self::$currentIndex,
|
||||||
@@ -143,6 +148,11 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
|||||||
|
|
||||||
return $tpl->fetch();
|
return $tpl->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkModulesNames($a, $b)
|
||||||
|
{
|
||||||
|
return (bool)($a['displayName'] > $b['displayName']);
|
||||||
|
}
|
||||||
|
|
||||||
protected function getModules()
|
protected function getModules()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -754,7 +754,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
|||||||
'orderby' => false,
|
'orderby' => false,
|
||||||
'filter' => false,
|
'filter' => false,
|
||||||
'search' => false,
|
'search' => false,
|
||||||
'hint' => 'Note that you can see details on the receptions - per products',
|
'hint' => $this->l('Note that you can see details on the receptions - per products'),
|
||||||
),
|
),
|
||||||
'quantity_expected' => array(
|
'quantity_expected' => array(
|
||||||
'title' => $this->l('Quantity expected'),
|
'title' => $this->l('Quantity expected'),
|
||||||
|
|||||||
@@ -460,7 +460,9 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
if (!$default_language || !Validate::isLanguageIsoCode($default_language))
|
if (!$default_language || !Validate::isLanguageIsoCode($default_language))
|
||||||
return false;
|
return false;
|
||||||
// 1 - Scan mails files
|
// 1 - Scan mails files
|
||||||
$mails = scandir(_PS_MAIL_DIR_.$default_language.'/');
|
$mails = array();
|
||||||
|
if (Tools::file_exists_cache(_PS_MAIL_DIR_.$default_language.'/'))
|
||||||
|
$mails = scandir(_PS_MAIL_DIR_.$default_language.'/');
|
||||||
|
|
||||||
$mails_new_lang = array();
|
$mails_new_lang = array();
|
||||||
|
|
||||||
@@ -579,7 +581,9 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
if (preg_match('#^translations\/'.$iso_code.'\/tabs.php#Ui', $file['filename'], $matches) && Validate::isLanguageIsoCode($iso_code))
|
if (preg_match('#^translations\/'.$iso_code.'\/tabs.php#Ui', $file['filename'], $matches) && Validate::isLanguageIsoCode($iso_code))
|
||||||
{
|
{
|
||||||
// Include array width new translations tabs
|
// Include array width new translations tabs
|
||||||
$tabs = include _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename'];
|
$tabs = array();
|
||||||
|
if (Tools::file_exists_cache(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename']))
|
||||||
|
$tabs = include_once(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename']);
|
||||||
|
|
||||||
foreach ($tabs as $class_name => $translations)
|
foreach ($tabs as $class_name => $translations)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -936,7 +936,7 @@ CREATE TABLE `PREFIX_manufacturer_lang` (
|
|||||||
`id_manufacturer` int(10) unsigned NOT NULL,
|
`id_manufacturer` int(10) unsigned NOT NULL,
|
||||||
`id_lang` int(10) unsigned NOT NULL,
|
`id_lang` int(10) unsigned NOT NULL,
|
||||||
`description` text,
|
`description` text,
|
||||||
`short_description` varchar(254) default NULL,
|
`short_description` text,
|
||||||
`meta_title` varchar(128) default NULL,
|
`meta_title` varchar(128) default NULL,
|
||||||
`meta_keywords` varchar(255) default NULL,
|
`meta_keywords` varchar(255) default NULL,
|
||||||
`meta_description` varchar(255) default NULL,
|
`meta_description` varchar(255) default NULL,
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
function block_category_1521()
|
function block_category_1521()
|
||||||
{
|
{
|
||||||
if (!Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' '))
|
if (!Db::getInstance()->getValue('SELECT value FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' '))
|
||||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration`
|
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration`
|
||||||
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
|
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
|
||||||
VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())');
|
VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())');
|
||||||
else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0'))
|
else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT value FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0 AND `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\''))
|
||||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\'');
|
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\'');
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,17 +29,18 @@ function update_order_messages()
|
|||||||
$step = 3000;
|
$step = 3000;
|
||||||
$count_messages = Db::getInstance()->getValue('SELECT count(id_message) FROM '._DB_PREFIX_.'message');
|
$count_messages = Db::getInstance()->getValue('SELECT count(id_message) FROM '._DB_PREFIX_.'message');
|
||||||
$nb_loop = $start = 0;
|
$nb_loop = $start = 0;
|
||||||
|
$pattern = '<br|&[a-zA-Z]{1,8};';
|
||||||
if($count_messages > 0)
|
if($count_messages > 0)
|
||||||
$nb_loop = ceil($count_messages / $step);
|
$nb_loop = ceil($count_messages / $step);
|
||||||
for($i = 0; $i < $nb_loop; $i++)
|
for($i = 0; $i < $nb_loop; $i++)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \'<br|&[^;]{1,8}\' LIMIT '.(int)$start.', '.(int)$step;
|
$sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \''.pSQL($pattern, true).'\' LIMIT '.(int)$start.', '.(int)$step;
|
||||||
if ($messages = Db::getInstance()->query($sql))
|
if ($messages = Db::getInstance()->query($sql))
|
||||||
while ($message = Db::getInstance()->nextRow($messages))
|
while ($message = Db::getInstance()->nextRow($messages))
|
||||||
{
|
{
|
||||||
if(is_array($message))
|
if(is_array($message))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\'
|
$sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(preg_replace('/'.$pattern.'/', '', Tools::htmlentitiesDecodeUTF8(br2nl($message['message'])))).'\'
|
||||||
WHERE id_message = '.(int)$message['id_message'];
|
WHERE id_message = '.(int)$message['id_message'];
|
||||||
$result = Db::getInstance()->execute($sql);
|
$result = Db::getInstance()->execute($sql);
|
||||||
}
|
}
|
||||||
@@ -50,13 +51,13 @@ function update_order_messages()
|
|||||||
$nb_loop = ceil($count_messages / $step);
|
$nb_loop = ceil($count_messages / $step);
|
||||||
for($i = 0; $i < $nb_loop; $i++)
|
for($i = 0; $i < $nb_loop; $i++)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \'<br|&[^;]{1,8}\' LIMIT '.(int)$start.', '.(int)$step;
|
$sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \''.pSQL($pattern, true).'\' LIMIT '.(int)$start.', '.(int)$step;
|
||||||
if ($messages = Db::getInstance()->query($sql))
|
if ($messages = Db::getInstance()->query($sql))
|
||||||
while ($message = Db::getInstance()->nextRow($messages))
|
while ($message = Db::getInstance()->nextRow($messages))
|
||||||
{
|
{
|
||||||
if(is_array($message))
|
if(is_array($message))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message']))).'\'
|
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(preg_replace('/'.$pattern.'/', '', Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message'])))).'\'
|
||||||
WHERE id_customer_message = '.(int)$message['id_customer_message'];
|
WHERE id_customer_message = '.(int)$message['id_customer_message'];
|
||||||
Db::getInstance()->execute($sql);
|
Db::getInstance()->execute($sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ ALTER TABLE `PREFIX_product_shop` DROP INDEX `date_add`, ADD INDEX `date_add` (`
|
|||||||
|
|
||||||
UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `name` LIKE 'leftcolumn';
|
UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `name` LIKE 'leftcolumn';
|
||||||
|
|
||||||
UPDATE `PREFIX_configuration` SET `name` = '0' WHERE `name` LIKE 'PS_LEGACY_IMAGES' AND `value` LIKE '1';
|
UPDATE `PREFIX_configuration` SET `value` = '0' WHERE `name` LIKE 'PS_LEGACY_IMAGES' AND `value` = 1;
|
||||||
|
|
||||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_SMARTY_CONSOLE_KEY', 'SMARTY_DEBUG', NOW(), NOW());
|
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_SMARTY_CONSOLE_KEY', 'SMARTY_DEBUG', NOW(), NOW());
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `PREFIX_manufacturer_lang` CHANGE `short_description` `short_description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
|
||||||
@@ -111,7 +111,10 @@ class BlockNewProducts extends Module
|
|||||||
{
|
{
|
||||||
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY') && !($newProducts = Product::getNewProducts((int)$params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'))))
|
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
|
||||||
|
return;
|
||||||
|
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR'));
|
||||||
|
if (!$newProducts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->smarty->assign(array(
|
$this->smarty->assign(array(
|
||||||
@@ -151,4 +154,4 @@ class BlockNewProducts extends Module
|
|||||||
{
|
{
|
||||||
$this->_clearCache('blocknewproducts.tpl');
|
$this->_clearCache('blocknewproducts.tpl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -434,7 +434,7 @@ class shopimporter extends ImportModule
|
|||||||
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')))
|
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')))
|
||||||
{
|
{
|
||||||
$moduleName = Tools::getValue('moduleName');
|
$moduleName = Tools::getValue('moduleName');
|
||||||
if (Validate::isModuleName($moduleName) && Validate::file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
if (Validate::isModuleName($moduleName) && file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
||||||
{
|
{
|
||||||
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
|
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
|
||||||
$importModule = new $moduleName();
|
$importModule = new $moduleName();
|
||||||
|
|||||||
Reference in new issue
Block a user