Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts: admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl 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/filters.tpl admin-dev/themes/default/template/controllers/modules/list.tpl admin-dev/themes/default/template/controllers/orders/form.tpl admin-dev/themes/default/template/helpers/form/form.tpl classes/Category.php classes/controller/AdminController.php controllers/admin/AdminAttributesGroupsController.php controllers/admin/AdminFeaturesController.php controllers/admin/AdminImportController.php controllers/admin/AdminLogsController.php install-dev/install_version.php install-dev/langs/ru/data/tab.xml js/admin_carrier_wizard.js modules/loyalty/loyalty.php
This commit is contained in:
@@ -73,26 +73,26 @@ class ProductCommentsDefaultModuleFrontController extends ModuleFrontController
|
||||
$errors = array();
|
||||
// Validation
|
||||
if (!Validate::isInt(Tools::getValue('id_product')))
|
||||
$errors[] = $module_instance->l('ID product is incorrect');
|
||||
$errors[] = $module_instance->l('ID product is incorrect', 'default');
|
||||
if (!Tools::getValue('title') || !Validate::isGenericName(Tools::getValue('title')))
|
||||
$errors[] = $module_instance->l('Title is incorrect');
|
||||
$errors[] = $module_instance->l('Title is incorrect', 'default');
|
||||
if (!Tools::getValue('content') || !Validate::isMessage(Tools::getValue('content')))
|
||||
$errors[] = $module_instance->l('Comment is incorrect');
|
||||
$errors[] = $module_instance->l('Comment is incorrect', 'default');
|
||||
if (!$id_customer && (!Tools::isSubmit('customer_name') || !Tools::getValue('customer_name') || !Validate::isGenericName(Tools::getValue('customer_name'))))
|
||||
$errors[] = $module_instance->l('Customer name is incorrect');
|
||||
$errors[] = $module_instance->l('Customer name is incorrect', 'default');
|
||||
if (!$this->context->customer->id && !Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'))
|
||||
$errors[] = $module_instance->l('You must be logged in order to send a comment');
|
||||
$errors[] = $module_instance->l('You must be logged in order to send a comment', 'default');
|
||||
if (!count(Tools::getValue('criterion')))
|
||||
$errors[] = $module_instance->l('You must give a rating');
|
||||
$errors[] = $module_instance->l('You must give a rating', 'default');
|
||||
|
||||
$product = new Product(Tools::getValue('id_product'));
|
||||
if (!$product->id)
|
||||
$errors[] = $module_instance->l('Product not found');
|
||||
$errors[] = $module_instance->l('Product not found', 'default');
|
||||
|
||||
if (!count($errors))
|
||||
{
|
||||
$customer_comment = ProductComment::getByCustomer(Tools::getValue('id_product'), $id_customer, true, $id_guest);
|
||||
if (!$customer_comment || ($customer_comment && (strtotime($customer_comment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) < time()))
|
||||
if (!$customer_comment || ($customer_comment && (strtotime($customer_comment['date_add']) + (int)Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) < time()))
|
||||
{
|
||||
|
||||
$comment = new ProductComment();
|
||||
|
||||
@@ -713,7 +713,7 @@ class ProductComments extends Module
|
||||
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
|
||||
'criterions' => ProductCommentCriterion::getByProduct((int)Tools::getValue('id_product'), $this->context->language->id),
|
||||
'action_url' => '',
|
||||
'averageTotal' => (int)$average['grade'],
|
||||
'averageTotal' => round($average['grade']),
|
||||
'too_early' => ($customerComment && (strtotime($customerComment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) > time()),
|
||||
'nbComments' => (int)(ProductComment::getCommentNumber((int)Tools::getValue('id_product')))
|
||||
));
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
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 confirm_report_message = '{l s='Are you sure you want report this comment?' mod='productcomments' js=1}';
|
||||
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 productcomment_added = '{l s='Your comment has been added!' mod='productcomments' js=1}';
|
||||
var productcomment_added_moderation = '{l s='Your comment has been added and will be available once approved by a moderator' mod='productcomments' js=1}';
|
||||
var productcomment_title = '{l s='New comment' mod='productcomments' js=1}';
|
||||
var productcomment_ok = '{l s='OK' mod='productcomments' js=1}';
|
||||
var moderation_active = {$moderation_active};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user