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

Conflicts:
	admin-dev/themes/default/template/controllers/customer_threads/message.tpl
	admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/modules/favorites.tpl
	admin-dev/themes/default/template/controllers/modules/list.tpl
	admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl
	admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl
	admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl
	admin-dev/themes/default/template/controllers/orders/form.tpl
	admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/products/associations.tpl
	admin-dev/themes/default/template/controllers/products/combinations.tpl
	admin-dev/themes/default/template/controllers/products/images.tpl
	admin-dev/themes/default/template/controllers/products/informations.tpl
	admin-dev/themes/default/template/controllers/products/prices.tpl
	admin-dev/themes/default/template/controllers/referrers/helpers/view/view.tpl
	admin-dev/themes/default/template/header.tpl
	admin-dev/themes/default/template/helpers/form/form.tpl
	admin-dev/themes/default/template/helpers/list/list_header.tpl
	classes/ProductSale.php
	classes/helper/HelperList.php
	controllers/admin/AdminCmsController.php
	controllers/admin/AdminCustomersController.php
	controllers/admin/AdminMetaController.php
	controllers/admin/AdminModulesController.php
	controllers/admin/AdminPerformanceController.php
	controllers/admin/AdminProductsController.php
	controllers/front/ParentOrderController.php
	install-dev/theme/views/welcome.phtml
	modules/blocknewproducts/blocknewproducts.php
	modules/blocktopmenu/blocktopmenu.php
	modules/importerosc/importerosc.php
	modules/mailalerts/mailalerts.php
	modules/shopimporter/shopimporter.php
	modules/statsstock/statsstock.php
	themes/default/css/product_list.css
This commit is contained in:
Kevin Granger
2013-11-04 14:43:01 +01:00
169 changed files with 2783 additions and 1759 deletions
+25 -7
View File
@@ -180,7 +180,7 @@ class AdminProductsControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'shop` shop ON (shop.id_shop = '.$id_shop.')
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop = '.$id_shop.')';
$this->_select .= 'shop.name as shopname, ';
$this->_select .= 'shop.name as shopname, a.id_shop_default, ';
$this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`';
if ($join_category)
@@ -331,12 +331,17 @@ class AdminProductsControllerCore extends AdminController
$nb = count($this->_list);
if ($this->_list)
{
$context = $this->context->cloneContext();
$context->shop = clone($context->shop);
/* update product final price */
for ($i = 0; $i < $nb; $i++)
{
if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP)
$context->shop = new Shop((int)$this->_list[$i]['id_shop_default']);
// convert price with the currency from context
$this->_list[$i]['price'] = Tools::convertPrice($this->_list[$i]['price'], $this->context->currency, true, $this->context);
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, 2, null, false, true, 1, true);
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, 2, null, false, true, 1, true, null, null, null, $nothing, true, true, $context);
}
}
@@ -367,9 +372,9 @@ class AdminProductsControllerCore extends AdminController
{
if (is_array($default_product->$field_name))
foreach ($default_product->$field_name as $key => $value)
$this->object->{$field_name}[$key] = ObjectModel::formatValue($value, $def['fields'][$field_name]['type']);
$this->object->{$field_name}[$key] = $value;
else
$this->object->$field_name = ObjectModel::formatValue($default_product->$field_name, $def['fields'][$field_name]['type']);
$this->object->$field_name = $default_product->$field_name;
}
}
$this->object->loadStockData();
@@ -1337,7 +1342,6 @@ class AdminProductsControllerCore extends AdminController
if (isset($result['success']))
{
$obj = new Image((int)$result['success']['id_image']);
// Associate image to shop from context
$shops = Shop::getContextListShopID();
$obj->associateTo($shops);
@@ -1351,6 +1355,7 @@ class AdminProductsControllerCore extends AdminController
'id'=>$obj->id,
'path' => $obj->getExistingImgPath(),
'position' => $obj->position,
'legend' => $obj->legend,
'cover' => $obj->cover,
'shops' => $json_shops,
);
@@ -3676,6 +3681,7 @@ class AdminProductsControllerCore extends AdminController
foreach ($images as $k => $image)
$images[$k] = new Image($image['id_image']);
if ($this->context->shop->getContext() == Shop::CONTEXT_SHOP)
$current_shop_id = (int)$this->context->shop->id;
else
@@ -3694,8 +3700,16 @@ class AdminProductsControllerCore extends AdminController
'max_image_size' => $this->max_image_size / 1024 / 1024,
'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'),
'currency' => $this->context->currency,
'current_shop_id' => $current_shop_id
'current_shop_id' => $current_shop_id,
'languages' => $this->_languages,
'default_language' => (int)Configuration::get('PS_LANG_DEFAULT')
));
$type = ImageType::getByNameNType('%', 'products', 'height');
if (isset($type['name']))
$data->assign('imageType', $type['name']);
else
$data->assign('imageType', 'small_default');
}
else
$this->displayWarning($this->l('You must save the product in this shop before adding images.'));
@@ -3752,7 +3766,11 @@ class AdminProductsControllerCore extends AdminController
$data->assign('available_date', ($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities($this->getFieldValue($product, 'available_date'), $this->context->language->id)) : '0000-00-00');
$i = 0;
$data->assign('imageType', ImageType::getByNameNType('small_default', 'products'));
$type = ImageType::getByNameNType('%', 'products', 'height');
if (isset($type['name']))
$data->assign('imageType', $type['name']);
else
$data->assign('imageType', 'small_default');
$data->assign('imageWidth', (isset($image_type['width']) ? (int)($image_type['width']) : 64) + 25);
foreach ($images as $k => $image)
{