Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -724,7 +724,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isTrackingNumber($tracking_number)
|
||||
{
|
||||
return preg_match('/^[~:#,%&_=\(\)\.\? \+\-@\/a-zA-Z0-9]+$/', $tracking_number);
|
||||
return preg_match('/^[~:#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9]+$/', $tracking_number);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -747,7 +747,7 @@ class ValidateCore
|
||||
public static function isAbsoluteUrl($url)
|
||||
{
|
||||
if (!empty($url))
|
||||
return preg_match('/^https?:\/\/[,:#%&_=\(\)\.\? \+\-@\/a-zA-Z0-9]+$/', $url);
|
||||
return preg_match('/^https?:\/\/[~:#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9]+$/', $url);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ abstract class ModuleCore
|
||||
}
|
||||
|
||||
// Check if module is installed
|
||||
$result = Db::getInstance()->getRow('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($this->name).'\'');
|
||||
$result = Module::isInstalled($this->name);
|
||||
if ($result)
|
||||
{
|
||||
$this->_errors[] = $this->l('This module has already been installed.');
|
||||
@@ -1543,7 +1543,7 @@ abstract class ModuleCore
|
||||
{
|
||||
if (!Cache::isStored('Module::isInstalled'.$module_name))
|
||||
{
|
||||
$id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\'');
|
||||
$id_module = Module::getModuleIdByName($module_name);
|
||||
Cache::store('Module::isInstalled'.$module_name, (bool)$id_module);
|
||||
}
|
||||
return Cache::retrieve('Module::isInstalled'.$module_name);
|
||||
@@ -1554,7 +1554,7 @@ abstract class ModuleCore
|
||||
if (!Cache::isStored('Module::isEnabled'.$module_name))
|
||||
{
|
||||
$active = false;
|
||||
$id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\'');
|
||||
$id_module = Module::getModuleIdByName($module_name);
|
||||
if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$id_module.' AND `id_shop` = '.(int)Context::getContext()->shop->id))
|
||||
$active = true;
|
||||
Cache::store('Module::isEnabled'.$module_name, (bool)$active);
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
define('_PS_MODE_DEV_', true);
|
||||
if (_PS_MODE_DEV_)
|
||||
{
|
||||
@ini_set('display_errors', 'on');
|
||||
@ini_set('display_errors', 'on');
|
||||
@error_reporting(E_ALL | E_STRICT);
|
||||
define('_PS_DEBUG_SQL_', true);
|
||||
/* Compatibility warning */
|
||||
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
|
||||
|
||||
@@ -669,7 +669,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'count_better_customers' => $count_better_customers,
|
||||
'shop_is_feature_active' => Shop::isFeatureActive(),
|
||||
'name_shop' => $shop->name,
|
||||
'customer_birthday' => Tools::displayDate($customer->birthday, $this->default_form_language),
|
||||
'customer_birthday' => Tools::displayDate($customer->birthday),
|
||||
'last_update' => Tools::displayDate($customer->date_upd,null , true),
|
||||
'customer_exists' => Customer::customerExists($customer->email),
|
||||
'id_lang' => $customer->id_lang,
|
||||
|
||||
@@ -139,6 +139,9 @@ class AuthControllerCore extends FrontController
|
||||
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')
|
||||
));
|
||||
|
||||
// Just set $this->template value here in case it's used by Ajax
|
||||
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
|
||||
|
||||
if ($this->ajax)
|
||||
{
|
||||
// Call a hook to display more information on form
|
||||
@@ -150,12 +153,11 @@ class AuthControllerCore extends FrontController
|
||||
$return = array(
|
||||
'hasError' => !empty($this->errors),
|
||||
'errors' => $this->errors,
|
||||
'page' => $this->context->smarty->fetch(_PS_THEME_DIR_.'authentication.tpl'),
|
||||
'page' => $this->context->smarty->fetch($this->template),
|
||||
'token' => Tools::getToken(false)
|
||||
);
|
||||
die(Tools::jsonEncode($return));
|
||||
}
|
||||
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -281,7 +281,7 @@ class ContactControllerCore extends FrontController
|
||||
$tmp = $order->getProducts();
|
||||
foreach ($tmp as $key => $val)
|
||||
$products[$row['id_order']][$val['product_id']] = array('value' => $val['product_id'], 'label' => $val['product_name']);
|
||||
$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0],null , 'selected' => (int)Tools::getValue('id_order') == $order->id);
|
||||
$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0],null) , 'selected' => (int)Tools::getValue('id_order') == $order->id);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('orderList', $orders);
|
||||
|
||||
@@ -29,7 +29,7 @@ abstract class InstallControllerHttp
|
||||
/**
|
||||
* @var array List of installer steps
|
||||
*/
|
||||
protected static $steps = array('welcome', 'license', 'system', 'database', 'configure', 'process');
|
||||
protected static $steps = array('welcome', 'license', 'system', 'configure', 'database', 'process');
|
||||
|
||||
protected static $instances = array();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
return array(
|
||||
'informations' => array(
|
||||
'phone' => '+1 888.947.6543',
|
||||
'support' => 'http://support.prestashop.com/en/',
|
||||
'support' => 'https://www.prestashop.com/pt/support',
|
||||
),
|
||||
'translations' => array(
|
||||
'menu_welcome' => 'Escolha seu idioma',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
return array(
|
||||
'informations' => array(
|
||||
'phone' => '+33 (0)1.40.18.30.04',
|
||||
'support' => 'https://www.prestashop.com/de/support',
|
||||
),
|
||||
'translations' => array(
|
||||
'menu_welcome' => 'Sprachauswahl',
|
||||
|
||||
@@ -6,7 +6,7 @@ return array(
|
||||
'documentation_upgrade' => 'http://docs.prestashop.com/display/PS15/Updating+PrestaShop',
|
||||
'forum' => 'http://www.prestashop.com/forums/',
|
||||
'blog' => 'http://www.prestashop.com/blog/',
|
||||
'support' => 'http://support.prestashop.com/en/',
|
||||
'support' => 'https://www.prestashop.com/en/support',
|
||||
),
|
||||
'translations' => array(
|
||||
'menu_welcome' => 'Choose your language',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
return array(
|
||||
'informations' => array(
|
||||
'phone' => '+1 (888) 947-6543',
|
||||
'support' => 'https://www.prestashop.com/es/support',
|
||||
),
|
||||
'translations' => array(
|
||||
'menu_welcome' => 'Elegir el idioma',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
return array(
|
||||
'informations' => array(
|
||||
'phone' => '+33 (0)1.40.18.30.04',
|
||||
'support' => 'https://www.prestashop.com/it/support',
|
||||
),
|
||||
'translations' => array(
|
||||
'menu_welcome' => 'Scelta della lingua',
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
return array(
|
||||
'informations' => array(
|
||||
'phone' => '+33 (0)1.40.18.30.04',
|
||||
'support' => 'https://www.prestashop.com/pl/wsparcie-techniczne',
|
||||
),
|
||||
'translations' => array(
|
||||
'An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>' => 'Wystąpił błąd SQL w rekordzie <i>%1$s</i>: <i>%2$s</i>',
|
||||
'Cannot create image "%1$s" for entity "%2$s"' => 'Nie można utworzyć obrazu "%1$s" dla rekordu "%2$s"',
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
return array(
|
||||
'informations' => array(
|
||||
'phone' => '+33 (0)1.40.18.30.04',
|
||||
'support' => 'https://www.prestashop.com/en/support',
|
||||
),
|
||||
'translations' => array(
|
||||
'An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>' => 'В SQL произошла ошибка для значения <i>%1$s</i>: <i>%2$s</i>',
|
||||
'Cannot create image "%1$s" for entity "%2$s"' => 'Невозможно создать изображение "%1$s" для значения "%2$s"',
|
||||
@@ -183,7 +187,7 @@ return array(
|
||||
'menu_license' => 'Лицензионное соглашение',
|
||||
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'Ядро PrestaShop разработано на OSL 3.0, а модули и шаблоны PrestaShop разработаны на AFL 3.0.',
|
||||
'I agree to the above terms and conditions.' => 'Я принимаю правила и условия.',
|
||||
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Внесите свой вклад в улучшение программного обеспечения, отравив анонимное сообщене о Вашей конфгурации.',
|
||||
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Внесите свой вклад в улучшение программного обеспечения, отправив анонимное сообщение о Вашей конфигурации.',
|
||||
'PHP 5.1.2 or later is not enabled' => 'PHP 5.1.2 или более поздняя версия не активирована',
|
||||
'Cannot upload files' => 'Невозможно загрузить файлы',
|
||||
'Cannot create new files and folders' => 'Невозможно создать новые файлы и папки',
|
||||
|
||||
@@ -7,4 +7,10 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VAL
|
||||
ALTER TABLE `PREFIX_webservice_account` CHANGE `class_name` `class_name` VARCHAR(64) NOT NULL DEFAULT 'WebserviceRequest',
|
||||
CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL;
|
||||
|
||||
/* PHP:add_module_to_hook(blockcart, actionCartListOverride); */;
|
||||
/* PHP:add_module_to_hook(blockcart, actionCartListOverride); */;
|
||||
/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerDeleteAfter); */;
|
||||
/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerAddAfter); */;
|
||||
/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerUpdateAfter); */;
|
||||
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierDeleteAfter); */;
|
||||
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierAddAfter); */;
|
||||
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierUpdateAfter); */;
|
||||
|
||||
@@ -232,6 +232,7 @@ var ajaxCart = {
|
||||
.animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000)
|
||||
.fadeOut(100, function() {
|
||||
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -443,7 +444,7 @@ var ajaxCart = {
|
||||
var content = '<dt class="hidden" id="cart_block_product_' + domIdProduct + '">';
|
||||
content += '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span>x</span>';
|
||||
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name);
|
||||
content += '<a href="' + this.link + '" title="' + this.name + '">' + name + '</a>';
|
||||
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>';
|
||||
|
||||
if (parseFloat(this.price_float) > 0)
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
|
||||
@@ -48,19 +48,25 @@ class BlockManufacturer extends Module
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true);
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5);
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true);
|
||||
return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header');
|
||||
return parent::install() &&
|
||||
$this->registerHook('leftColumn') &&
|
||||
$this->registerHook('header') &&
|
||||
$this->registerHook('actionObjectManufacturerDeleteAfter') &&
|
||||
$this->registerHook('actionObjectManufacturerAddAfter') &&
|
||||
$this->registerHook('actionObjectManufacturerUpdateAfter');
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
$this->smarty->assign(array(
|
||||
'manufacturers' => Manufacturer::getManufacturers(),
|
||||
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
|
||||
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
|
||||
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
|
||||
'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
|
||||
));
|
||||
return $this->display(__FILE__, 'blockmanufacturer.tpl');
|
||||
if (!$this->isCached('blockmanufacturer.tpl', $this->getCacheId()))
|
||||
$this->smarty->assign(array(
|
||||
'manufacturers' => Manufacturer::getManufacturers(),
|
||||
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
|
||||
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
|
||||
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
|
||||
'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
|
||||
));
|
||||
return $this->display(__FILE__, 'blockmanufacturer.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
@@ -85,6 +91,7 @@ class BlockManufacturer extends Module
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', $text_list);
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb);
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list);
|
||||
$this->_clearCache('blockmanufacturer.tpl');
|
||||
}
|
||||
if (isset($errors) && count($errors))
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
@@ -126,4 +133,19 @@ class BlockManufacturer extends Module
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all');
|
||||
}
|
||||
|
||||
public function hookActionObjectManufacturerUpdateAfter($params)
|
||||
{
|
||||
$this->_clearCache('blockmanufacturer.tpl');
|
||||
}
|
||||
|
||||
public function hookActionObjectManufacturerAddAfter($params)
|
||||
{
|
||||
$this->_clearCache('blockmanufacturer.tpl');
|
||||
}
|
||||
|
||||
public function hookActionObjectManufacturerDeleteAfter($params)
|
||||
{
|
||||
$this->_clearCache('blockmanufacturer.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,9 +47,12 @@ class BlockSupplier extends Module
|
||||
{
|
||||
if (!parent::install())
|
||||
return false;
|
||||
if (!$this->registerHook('displayLeftColumn'))
|
||||
return false;
|
||||
if (!$this->registerHook('displayHeader'))
|
||||
if (!$this->registerHook('displayLeftColumn') ||
|
||||
!$this->registerHook('displayHeader') ||
|
||||
!$this->registerHook('actionObjectSupplierDeleteAfter') ||
|
||||
!$this->registerHook('actionObjectSupplierAddAfter') ||
|
||||
!$this->registerHook('actionObjectSupplierUpdateAfter')
|
||||
)
|
||||
return false;
|
||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', true);
|
||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', 5);
|
||||
@@ -73,16 +76,16 @@ class BlockSupplier extends Module
|
||||
function hookDisplayLeftColumn($params)
|
||||
{
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'suppliers' => Supplier::getSuppliers(false, $id_lang),
|
||||
'link' => $this->context->link,
|
||||
'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'),
|
||||
'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'),
|
||||
'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'),
|
||||
'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')
|
||||
));
|
||||
return $this->display(__FILE__, 'blocksupplier.tpl');
|
||||
if (!$this->isCached('blocksupplier.tpl', $this->getCacheId()))
|
||||
$this->smarty->assign(array(
|
||||
'suppliers' => Supplier::getSuppliers(false, $id_lang),
|
||||
'link' => $this->context->link,
|
||||
'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'),
|
||||
'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'),
|
||||
'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'),
|
||||
'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')
|
||||
));
|
||||
return $this->display(__FILE__, 'blocksupplier.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
function getContent()
|
||||
@@ -102,6 +105,7 @@ class BlockSupplier extends Module
|
||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', $text_list);
|
||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', $text_nb);
|
||||
Configuration::updateValue('SUPPLIER_DISPLAY_FORM', $form_list);
|
||||
$this->_clearCache('blocksupplier.tpl');
|
||||
}
|
||||
if (isset($errors) AND sizeof($errors))
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
@@ -139,14 +143,29 @@ class BlockSupplier extends Module
|
||||
return $output;
|
||||
}
|
||||
|
||||
function hookDisplayRightColumn($params)
|
||||
public function hookDisplayRightColumn($params)
|
||||
{
|
||||
return $this->hookDisplayLeftColumn($params);
|
||||
}
|
||||
|
||||
function hookDisplayHeader($params)
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blocksupplier.css', 'all');
|
||||
}
|
||||
|
||||
public function hookActionObjectSupplierUpdateAfter($params)
|
||||
{
|
||||
$this->_clearCache('blocksupplier.tpl');
|
||||
}
|
||||
|
||||
public function hookActionObjectSupplierAddAfter($params)
|
||||
{
|
||||
$this->_clearCache('blocksupplier.tpl');
|
||||
}
|
||||
|
||||
public function hookActionObjectSupplierDeleteAfter($params)
|
||||
{
|
||||
$this->_clearCache('blocksupplier.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user