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

Conflicts:
	admin-dev/themes/default/css/admin.css
	admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl
	admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/home/content.tpl
	admin-dev/themes/default/template/controllers/localization/content.tpl
	admin-dev/themes/default/template/controllers/orders/_customized_data.tpl
	admin-dev/themes/default/template/controllers/orders/_new_product.tpl
	admin-dev/themes/default/template/controllers/orders/_product_line.tpl
	admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl
	admin-dev/themes/default/template/footer.tpl
	controllers/admin/AdminCarrierWizardController.php
	controllers/admin/AdminCarriersController.php
	controllers/admin/AdminCmsController.php
	controllers/admin/AdminLocalizationController.php
	controllers/admin/AdminManufacturersController.php
	controllers/admin/AdminSuppliersController.php
	css/admin.css
	js/admin-products.js
	js/admin_carrier_wizard.js
	translations/fr.gzip
This commit is contained in:
Kevin Granger
2013-09-13 11:41:14 +02:00
247 changed files with 7965 additions and 4936 deletions
@@ -26,11 +26,11 @@
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`
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
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'))
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\'');
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\'');
}
@@ -29,7 +29,8 @@ require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_new_tab.php');
function create_multistore()
{
$res = true;
if (!defined('_THEME_NAME_'))
define('_THEME_NAME_', 'default');
// @todo : use _PS_ROOT_DIR_
if (defined('__PS_BASE_URI__'))
$INSTALLER__PS_BASE_URI = __PS_BASE_URI__;
@@ -27,5 +27,5 @@
function fix_download_product_feature_active()
{
if (Db::getInstance()->getValue('SELECT COUNT(id_product_download) FROM `'._DB_PREFIX_.'product_download` WHERE `active` = 1 ;') > 0)
Configuration::updateGlobaleValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE');
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 1 WHERE `name` LIKE \'PS_VIRTUAL_PROD_FEATURE_ACTIVE\'');
}
+3 -2
View File
@@ -28,8 +28,9 @@ function generate_ntree()
{
$categories = Db::getInstance()->executeS('SELECT id_category, id_parent FROM '._DB_PREFIX_.'category ORDER BY id_parent ASC, position ASC');
$categoriesArray = array();
foreach ($categories AS $category)
$categoriesArray[(int)$category['id_parent']]['subcategories'][(int)$category['id_category']] = 1;
if (is_array($categories))
foreach ($categories AS $category)
$categoriesArray[(int)$category['id_parent']]['subcategories'][(int)$category['id_category']] = 1;
$n = 1;
generate_ntree_subTree($categoriesArray, 1, $n);
}
+8 -7
View File
@@ -95,7 +95,8 @@ function migrate_orders()
$reduction_amount_tax_incl = (float)$products['reduction_amount'];
// cart::getTaxesAverageUsed equivalent
$sum_total_products += $products['total_wt'];
$sum_total_products += $products['total_price'];
$sum_tax_amount += $products['total_wt'] - $products['total_price'];
$order_details['reduction_amount_tax_incl'] = $reduction_amount_tax_incl;
@@ -119,12 +120,13 @@ function migrate_orders()
$average_tax_used = 1;
if ($sum_total_products > 0)
$average_tax_used += ($sum_tax_amount / $sum_total_products) * 0.01;
$carrier_tax_rate = 1 + ((float)$order['carrier_tax_rate'] / 100);
$average_tax_used += $sum_tax_amount / $sum_total_products;
$average_tax_used = round($average_tax_used, 4);
$carrier_tax_rate = 1;
if (isset($order['carrier_tax_rate']))
$carrier_tax_rate + ((float)$order['carrier_tax_rate'] / 100);
$total_discount_tax_excl = $order['total_discounts'] / $average_tax_used;
$order['total_discounts_tax_incl'] = (float)$order['total_discounts'];
$order['total_discounts_tax_excl'] = (float)$total_discount_tax_excl;
@@ -321,5 +323,4 @@ function mo_setProductPrices($row, $tax_calculation_method)
$row['total_price'] = $row['product_quantity'] * $row['product_price'];
return $row;
}
}
@@ -44,14 +44,14 @@ function move_translations_module_file()
foreach ($modules as $module_name)
{
// Check if is a good module
if (in_array($module_name, array('.', '..', '.svn', '.htaccess', 'index.php', 'autoupgrade')))
if (in_array($module_name, array('.', '..', '.svn', '.htaccess', 'index.php', 'autoupgrade')) || !is_dir(_PS_MODULE_DIR_.'/'.$module_name))
continue;
foreach ($languages as $lang)
{
// Name for the old file and the new file
$old_file = _PS_MODULE_DIR_.$module_name.'/'.$lang['iso_code'].'.php';
if (!file_exists($old_file))
if (!@file_exists($old_file))
continue;
$dir_translations = _PS_MODULE_DIR_.$module_name.'/translations/';
@@ -61,7 +61,7 @@ function move_translations_module_file()
if (!is_dir($dir_translations))
$res &= mkdir($dir_translations, 0777);
if (!rename($old_file, $new_file))
if (!@rename($old_file, $new_file))
{
$error_list[] = $module_name.' - '.$lang['iso_code']."<br/>\r\n";
$res &= false;
@@ -30,8 +30,8 @@ function p15015_blockadvertising_extension()
define('_PS_ROOT_DIR_', realpath(INSTALL_PATH.'/../'));
// Try to update with the extension of the image that exists in the module directory
if (file_exists(_PS_ROOT_DIR_.'modules/blockadvertising'))
foreach (scandir(_PS_ROOT_DIR_.'modules/blockadvertising') as $file)
if (@file_exists(_PS_ROOT_DIR_.'/modules/blockadvertising'))
foreach (@scandir(_PS_ROOT_DIR_.'/modules/blockadvertising') as $file)
if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png')))
Db::getInstance()->execute('
REPLACE INTO `'._DB_PREFIX_.'configuration` (name, value)
@@ -41,7 +41,7 @@ function p15018_change_image_types()
)
);
$option = (bool)Db::getInstance()->getValue('SELECT id_theme FROM `'._DB_PREFIX_.'theme` WHERE directory != "default"');
$option = (bool)Db::getInstance()->getValue('SELECT id_theme FROM `'._DB_PREFIX_.'theme` WHERE directory != "default" AND directory != "prestashop"');
// If there is another theme than the default one, duplicate
if ($option)
@@ -26,12 +26,12 @@
function update_genders_images()
{
if (file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg'))
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg'))
@rename(_PS_ROOT_DIR_.'/img/genders/Mr.jpg', _PS_ROOT_DIR_.'/img/genders/1.jpg');
if (file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg'))
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg'))
@rename(_PS_ROOT_DIR_.'/img/genders/Ms.jpg', _PS_ROOT_DIR_.'/img/genders/2.jpg');
if (file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg'))
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg'))
@rename(_PS_ROOT_DIR_.'/img/genders/Miss.jpg', _PS_ROOT_DIR_.'/img/genders/3.jpg');
if (file_exists(_PS_ROOT_DIR_.'genders/unknown.jpg'))
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/unknown.jpg'))
@rename(_PS_ROOT_DIR_.'/img/genders/unknown.jpg', _PS_ROOT_DIR_.'/img/genders/Unknown.jpg');
}
@@ -57,6 +57,7 @@ function update_order_canada()
$default_price_display_method = Db::getInstance()->getValue('SELECT price_display_method
FROM `'._DB_PREFIX_.'group` WHERE id_group=1');
$values = '';
if (is_array($id_order_list))
foreach ($id_order_list as $order)
{
$amount = array();
@@ -29,17 +29,18 @@ function update_order_messages()
$step = 3000;
$count_messages = Db::getInstance()->getValue('SELECT count(id_message) FROM '._DB_PREFIX_.'message');
$nb_loop = $start = 0;
$pattern = '<br|&[a-zA-Z]{1,8};';
if($count_messages > 0)
$nb_loop = ceil($count_messages / $step);
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))
while ($message = Db::getInstance()->nextRow($messages))
{
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'];
$result = Db::getInstance()->execute($sql);
}
@@ -50,13 +51,13 @@ function update_order_messages()
$nb_loop = ceil($count_messages / $step);
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))
while ($message = Db::getInstance()->nextRow($messages))
{
if(is_array($message))
{
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&amp;', '&', $message['message']))).'\'
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(preg_replace('/'.$pattern.'/', '', Tools::htmlentitiesDecodeUTF8(str_replace('&amp;', '&', $message['message'])))).'\'
WHERE id_customer_message = '.(int)$message['id_customer_message'];
Db::getInstance()->execute($sql);
}
+3
View File
@@ -1,4 +1,7 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `PREFIX_group_shop`;
CREATE TABLE IF NOT EXISTS `PREFIX_group_shop` (
`id_group_shop` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) CHARACTER SET utf8 NOT NULL,
+2
View File
@@ -4,6 +4,8 @@
UPDATE `PREFIX_meta` SET `page` = 'contact' WHERE `page` = 'contact-form';
DROP TABLE IF EXISTS `PREFIX_shop_group`;
RENAME TABLE `PREFIX_group_shop` TO `PREFIX_shop_group`;
ALTER TABLE `PREFIX_shop_group` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREFIX_shop` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) UNSIGNED NOT NULL;
+2 -1
View File
@@ -22,6 +22,7 @@ CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL;
/* PHP:remove_tab(AdminRangePrice); */;
/* PHP:remove_tab(AdminRangeWeight); */;
ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `object_id`;
SET @id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1);
@@ -33,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_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());
+1
View File
@@ -0,0 +1 @@
ALTER TABLE `PREFIX_manufacturer_lang` CHANGE `short_description` `short_description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;