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

Conflicts:
	admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/modules/list.tpl
	admin-dev/themes/default/template/controllers/orders/helpers/view/view.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/products/suppliers.tpl
	admin-dev/themes/default/template/helpers/form/form.tpl
	admin-dev/themes/default/template/toolbar.tpl
	classes/helper/HelperList.php
	controllers/admin/AdminGroupsController.php
	controllers/admin/AdminManufacturersController.php
This commit is contained in:
Kevin Granger
2013-09-30 11:01:23 +02:00
84 changed files with 741 additions and 17517 deletions
+2 -1
View File
@@ -464,7 +464,8 @@ var ajaxCart = {
var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0);
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);
var min = this.name.indexOf(';', 10);
var name = (this.name.length > 12 ? this.name.substring(0, ((min - 10) <= 7) ? min : 10) + '...' : this.name);
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>';
if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0)
+1 -1
View File
@@ -53,7 +53,7 @@ class BlockCurrencies extends Module
if (Configuration::get('PS_CATALOG_MODE'))
return false;
if (!count(Currency::getCurrencies()))
if (!Currency::isMultiCurrencyActivated())
return false;
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
+2 -2
View File
@@ -230,11 +230,11 @@ function initLayered()
function paginationButton() {
$('#pagination a').not(':hidden').each(function () {
if ($(this).attr('href').search('&p=') == -1) {
if ($(this).attr('href').search(/&|\?p=/) == -1) {
var page = 1;
}
else {
var page = $(this).attr('href').replace(/^.*&p=(\d+).*$/, '$1');
var page = $(this).attr('href').replace(/^.*[&|\?]p=(\d+).*$/, '$1');
}
var location = window.location.href.replace(/#.*$/, '');
$(this).attr('href', location+current_friendly_url.replace(/\/page-(\d+)/, '')+'/page-'+page);
+2 -2
View File
@@ -1771,7 +1771,7 @@ class BlockLayered extends Module
$root_category = array('id_category' => '0', 'name' => $this->l('Root'));
$helper = new Helper();
$html .= $helper->renderCategoryTree(null, $selected_cat, 'categoryBox');
$html .= $helper->renderCategoryTree(null, $selected_cat, 'categoryBox', false, false, array(), true);
$html .= '
<br />
@@ -1930,7 +1930,7 @@ class BlockLayered extends Module
$(\'label a#inline\').fancybox({
\'hideOnContentClick\': false,
\'onClosed\': function() {
\'beforeClose\': function() {
lock_treeview_hidding = false;
$(\'#categories-treeview\').parent().parent().hide();
updCatCounter();
@@ -110,6 +110,11 @@ class BlockNewProducts extends Module
{
return $this->hookRightColumn($params);
}
public function hookHome($params)
{
return $this->hookRightColumn($params);
}
public function hookHeader($params)
{
@@ -198,4 +203,4 @@ class BlockNewProducts extends Module
'NEW_PRODUCTS_NBR' => Tools::getValue('NEW_PRODUCTS_NBR', Configuration::get('NEW_PRODUCTS_NBR')),
);
}
}
}
+3 -3
View File
@@ -218,9 +218,9 @@ class Editorial extends Module
if ($input['name'] != 'body_homepage_logo')
$helper->fields_value[$input['name']] = $editorial->{$input['name']};
$helper->fields_value['image'] = (file_exists(dirname(__FILE__).'/homepage_logo_'.(int)$id_shop.'.jpg') ? '<img src="'.$this->_path.'homepage_logo_'.(int)$id_shop.'.jpg">' : '');
if ($helper->fields_value['image'])
$helper->fields_value['size'] = filesize(dirname(__FILE__).'/homepage_logo_'.(int)$id_shop.'.jpg') / 1000;
$helper->fields_value['body_homepage_logo']['image'] = (file_exists(dirname(__FILE__).'/homepage_logo_'.(int)$id_shop.'.jpg') ? '<img src="'.$this->_path.'homepage_logo_'.(int)$id_shop.'.jpg">' : '');
if ($helper->fields_value['body_homepage_logo'])
$helper->fields_value['body_homepage_logo']['size'] = filesize(dirname(__FILE__).'/homepage_logo_'.(int)$id_shop.'.jpg') / 1000;
$this->_html .= $helper->generateForm($this->fields_form);
return $this->_html;
+2 -1
View File
@@ -85,7 +85,8 @@ class LoyaltyModule extends ObjectModel
$total = 0;
if (Validate::isLoadedObject($cart))
{
$context = Context::getContext();
$currentContext = Context::getContext();
$context = clone $currentContext;
$context->cart = $cart;
$context->customer = new Customer($context->cart->id_customer);
$context->language = new Language($context->cart->id_lang);
+7 -3
View File
@@ -54,7 +54,7 @@ class MailAlert extends ObjectModel
),
);
public static function customerHasNotification($id_customer, $id_product, $id_product_attribute, $id_shop = null, $id_lang = null)
public static function customerHasNotification($id_customer, $id_product, $id_product_attribute, $id_shop = null, $id_lang = null, $guest_email = '')
{
if ($id_shop == null)
$id_shop = Context::getContext()->shop->id;
@@ -64,11 +64,15 @@ class MailAlert extends ObjectModel
$customer = new Customer($id_customer);
$customer_email = $customer->email;
$guest_email = pSQL($guest_email);
$id_customer = (int)$id_customer;
$customer_email = pSQL($customer_email);
$where = $id_customer == 0 ? "customer_email = '$guest_email'" : "(id_customer=$id_customer OR customer_email='$customer_email')";
$sql = '
SELECT *
FROM `'._DB_PREFIX_.self::$definition['table'].'`
WHERE (`id_customer` = '.(int)$id_customer.' OR `customer_email` = \''.pSQL($customer_email).'\')
WHERE '.$where.'
AND `id_product` = '.(int)$id_product.'
AND `id_product_attribute` = '.(int)$id_product_attribute.'
AND `id_shop` = '.(int)$id_shop;
@@ -97,7 +97,7 @@ class MailalertsActionsModuleFrontController extends ModuleFrontController
$id_lang = (int)$context->language->id;
$product = new Product($id_product, false, $id_lang, $id_shop, $context);
$mailAlert = MailAlert::customerHasNotification($id_customer, $id_product, $id_product_attribute, $id_shop);
$mailAlert = MailAlert::customerHasNotification($id_customer, $id_product, $id_product_attribute, $id_shop, null, $customer_email);
if ($mailAlert)
die('2');
@@ -70,7 +70,7 @@ $(function() {
$.fancybox.close();
var buttons = {};
buttons[productcomment_ok] = "productcommentRefreshPage";
fancyChooseBox(productcomment_added, productcomment_title, buttons);
fancyChooseBox(moderation_active ? productcomment_added_moderation : productcomment_added, productcomment_title, buttons);
}
else
{
+2 -1
View File
@@ -755,7 +755,8 @@ class ProductComments extends Module
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'nbComments' => (int)ProductComment::getCommentNumber((int)Tools::getValue('id_product')),
'productcomments_controller_url' => $this->context->link->getModuleLink('productcomments'),
'productcomments_url_rewriting_activated' => Configuration::get('PS_REWRITING_SETTINGS', 0)
'productcomments_url_rewriting_activated' => Configuration::get('PS_REWRITING_SETTINGS', 0),
'moderation_active' => (int)Configuration::get('PRODUCT_COMMENTS_MODERATE')
));
$this->context->controller->pagination((int)ProductComment::getCommentNumber((int)Tools::getValue('id_product')));
+8 -1
View File
@@ -27,6 +27,11 @@ var productcomments_controller_url = '{$productcomments_controller_url}';
var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}";
var secure_key = "{$secure_key}";
var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
var productcomment_added = '{l s='Your comment has been added!' mod='productcomments'}';
var productcomment_added_moderation = '{l s='Your comment has been added and will be available once approved by a moderator' mod='productcomments'}';
var productcomment_title = '{l s='New comment' mod='productcomments'}';
var productcomment_ok = '{l s='OK' mod='productcomments'}';
var moderation_active = {$moderation_active};
</script>
<div id="idTab5">
@@ -71,11 +76,13 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
</div>
{/if}
{/foreach}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Write your review' mod='productcomments'} !</a>
</p>
{/if}
{else}
{if ($too_early == false AND ($logged OR $allow_guests))}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Be the first to write your review' mod='productcomments'} !</a>
</p>
+6 -12
View File
@@ -31,23 +31,17 @@ $('document').ready(function(){
});
$('#sendEmail').click(function(){
var datas = [];
$('#send_friend_form_content').find(':input').each(function(index){
var o = {};
o.key = $(this).attr('name');
o.value = $(this).val();
if (o.value != '')
datas.push(o);
});
if (datas.length >= 3)
var name = $('#friend_name').val();
var email = $('#friend_email').val();
var id_product = $('#id_product_comment_send').val();
if (name && email && !isNaN(id_product))
{
$.ajax({
{/literal}url: "{$module_dir}sendtoafriend_ajax.php",{literal}
type: "POST",
headers: {"cache-control": "no-cache"},
data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/\\u/g, '%u'))},{/literal}{literal}
data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', name: name, email: email, id_product: id_product},{/literal}{literal}
dataType: "json",
success: function(result) {
$.fancybox.close();
+3 -13
View File
@@ -33,19 +33,9 @@ $module = new SendToAFriend();
if (Tools::getValue('action') == 'sendToMyFriend' && Tools::getValue('secure_key') == $module->secure_key)
{
$friend_infos = Tools::jsonDecode(Tools::getValue('friend'));
$friendName = "";
$friendMail = "";
$id_product = null;
foreach ($friend_infos as $entry)
{
if ($entry->key == "friend_name")
$friendName = $entry->value;
else if ($entry->key == "friend_email")
$friendMail = $entry->value;
else if ($entry->key == "id_product")
$id_product = $entry->value;
}
$friendName = Tools::getValue('name');
$friendMail = Tools::getValue('email');
$id_product = Tools::getValue('id_product');
if (!$friendName || !$friendMail || !$id_product)
die('0');