diff --git a/classes/Attribute.php b/classes/Attribute.php index 93391bc6c..3f694958d 100644 --- a/classes/Attribute.php +++ b/classes/Attribute.php @@ -139,7 +139,7 @@ class AttributeCore extends ObjectModel ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.') '.Shop::addSqlAssociation('attribute_group', 'ag').' '.Shop::addSqlAssociation('attribute', 'a').' - '.($not_null ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL' : '').' + '.($not_null ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL AND agl.`id_attribute_group` IS NOT NULL' : '').' ORDER BY agl.`name` ASC, a.`position` ASC '); } @@ -343,4 +343,4 @@ class AttributeCore extends ObjectModel return (is_numeric($position)) ? $position : -1; } -} \ No newline at end of file +} diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index 007bd38b0..e3758c249 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -30,6 +30,7 @@ class AdminGroupsControllerCore extends AdminController { $this->table = 'group'; $this->className = 'Group'; + $this->list_id = 'group'; $this->lang = true; $this->addRowAction('edit'); $this->addRowAction('view'); @@ -153,6 +154,16 @@ class AdminGroupsControllerCore extends AdminController if (Tools::isSubmit('changeShowPricesVal') && $this->id_object) $this->action = 'change_show_prices_val'; + if (Tools::getIsset('viewgroup')) + { + $this->list_id = 'customer_group'; + + if (isset($_POST['submitReset'.$this->list_id])) + $this->processResetFilters(); + } + else + $this->list_id = 'group'; + parent::initProcess(); } @@ -181,30 +192,29 @@ class AdminGroupsControllerCore extends AdminController $genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg'; $genders[$gender->id] = $gender->name; } - $customer_fields_display = (array( - 'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center'), + $this->table = 'customer_group'; + $this->lang = false; + $this->list_id = 'customer_group'; + $this->actions = array(); + $this->bulk_actions = false; + $this->list_no_link = true; + $this->fields_list = (array( + 'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center', 'filter_key' => 'c!id_customer'), 'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'width' => 50,'icon' => $genders_icon, 'list' => $genders), - 'firstname' => array('title' => $this->l('Name'), 'align' => 'center'), - 'lastname' => array('title' => $this->l('Name'), 'align' => 'center'), - 'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center'), + 'firstname' => array('title' => $this->l('First name'), 'align' => 'center'), + 'lastname' => array('title' => $this->l('Last name'), 'align' => 'center'), + 'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center', 'filter_key' => 'c!email', 'orderby' => true), 'birthday' => array('title' => $this->l('Birth date'), 'width' => 150, 'align' => 'right', 'type' => 'date'), 'date_add' => array('title' => $this->l('Register date'), 'width' => 150, 'align' => 'right', 'type' => 'date'), - 'orders' => array('title' => $this->l('Orders'), 'align' => 'center'), 'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool') )); - $customer_list = $group->getCustomers(false, 0, 100, true); - - $helper = new HelperList(); - $helper->currentIndex = Context::getContext()->link->getAdminLink('AdminCustomers', false); - $helper->token = Tools::getAdminTokenLite('AdminCustomers'); - $helper->shopLinkType = ''; - $helper->table = 'customer'; - $helper->identifier = 'id_customer'; - $helper->actions = array('edit', 'view'); - $helper->show_toolbar = false; - - return $helper->generateList($customer_list, $customer_fields_display); + $this->_select = 'c.*'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)'; + $this->_where = 'AND a.`id_group` = '.(int)$group->id.' AND c.`deleted` != 1'; + self::$currentIndex = self::$currentIndex.'&viewgroup'; + $this->processFilter(); + return parent::renderList(); } public function renderForm() diff --git a/controllers/admin/AdminInvoicesController.php b/controllers/admin/AdminInvoicesController.php index 4eee707a4..834f3e329 100644 --- a/controllers/admin/AdminInvoicesController.php +++ b/controllers/admin/AdminInvoicesController.php @@ -58,10 +58,8 @@ class AdminInvoicesControllerCore extends AdminController 'PS_INVOICE_FREE_TEXT' => array( 'title' => $this->l('Footer text:'), 'desc' => $this->l('This text will appear at the bottom of the invoice'), - 'size' => 6, - 'type' => 'textareaLang', - 'cols' => 40, - 'rows' => 8 + 'size' => 50, + 'type' => 'textLang', ), 'PS_INVOICE_MODEL' => array( 'title' => $this->l('Invoice model:'), diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 03764fe67..cbc235f59 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2023,7 +2023,7 @@ class AdminProductsControllerCore extends AdminController // Check multilingual fields validity foreach ($rules['validateLang'] as $fieldLang => $function) foreach ($languages as $language) - if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']))) + if ($this->isProductFieldUpdated($fieldLang, $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']))) if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) $this->errors[] = sprintf( Tools::displayError('The %1$s field (%2$s) is invalid.'), diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php index 10e17bb85..3a02dd9dd 100644 --- a/controllers/front/ParentOrderController.php +++ b/controllers/front/ParentOrderController.php @@ -372,6 +372,7 @@ class ParentOrderControllerCore extends FrontController 'currencyFormat' => $this->context->currency->format, 'currencyBlank' => $this->context->currency->blank, 'show_option_allow_separate_package' => $show_option_allow_separate_package, + 'smallSize' => Image::getSize(ImageType::getFormatedName('small')), )); diff --git a/modules/productcomments/productcomments.tpl b/modules/productcomments/productcomments.tpl index f8fe9f111..0c5c3aecb 100644 --- a/modules/productcomments/productcomments.tpl +++ b/modules/productcomments/productcomments.tpl @@ -76,11 +76,13 @@ var moderation_active = {$moderation_active}; {/if} {/foreach} + {if (!$too_early AND ($logged OR $allow_guests))}
{l s='Write your review' mod='productcomments'} !
+ {/if} {else} - {if ($too_early == false AND ($logged OR $allow_guests))} + {if (!$too_early AND ($logged OR $allow_guests))}{l s='Be the first to write your review' mod='productcomments'} !
diff --git a/modules/sendtoafriend/sendtoafriend-extra.tpl b/modules/sendtoafriend/sendtoafriend-extra.tpl index b438a4ad5..4b3c9e597 100755 --- a/modules/sendtoafriend/sendtoafriend-extra.tpl +++ b/modules/sendtoafriend/sendtoafriend-extra.tpl @@ -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(); diff --git a/modules/sendtoafriend/sendtoafriend_ajax.php b/modules/sendtoafriend/sendtoafriend_ajax.php index 415b62298..a08e2ef77 100644 --- a/modules/sendtoafriend/sendtoafriend_ajax.php +++ b/modules/sendtoafriend/sendtoafriend_ajax.php @@ -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'); diff --git a/themes/default/modules/productcomments/productcomments.tpl b/themes/default/modules/productcomments/productcomments.tpl index 3cb407777..bbd737670 100644 --- a/themes/default/modules/productcomments/productcomments.tpl +++ b/themes/default/modules/productcomments/productcomments.tpl @@ -76,11 +76,13 @@ var moderation_active = {$moderation_active}; {/if} {/foreach} + {if (!$too_early AND ($logged OR $allow_guests))}{l s='Write your review' mod='productcomments'} !
+ {/if} {else} - {if ($too_early == false AND ($logged OR $allow_guests))} + {if (!$too_early AND ($logged OR $allow_guests))}{l s='Be the first to write your review' mod='productcomments'} !
@@ -141,7 +143,7 @@ var moderation_active = {$moderation_active}; {/if}