@@ -1,260 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class ProductComment extends ObjectModel
|
||||
{
|
||||
public $id;
|
||||
|
||||
/** @var integer Product's id */
|
||||
public $id_product;
|
||||
|
||||
/** @var integer Customer's id */
|
||||
public $id_customer;
|
||||
|
||||
/** @var integer Guest's id */
|
||||
public $id_guest;
|
||||
|
||||
|
||||
/** @var integer Customer name */
|
||||
public $customer_name;
|
||||
|
||||
/** @var string Title */
|
||||
public $title;
|
||||
|
||||
/** @var string Content */
|
||||
public $content;
|
||||
|
||||
/** @var integer Grade */
|
||||
public $grade;
|
||||
|
||||
/** @var boolean Validate */
|
||||
public $validate = 0;
|
||||
|
||||
public $deleted = 0;
|
||||
|
||||
/** @var string Object creation date */
|
||||
public $date_add;
|
||||
|
||||
protected $fieldsRequired = array('id_product', 'id_customer', 'content');
|
||||
protected $fieldsSize = array('content' => 65535);
|
||||
protected $fieldsValidate = array('id_product' => 'isUnsignedId', 'id_customer' => 'isUnsignedId', 'content' => 'isMessage',
|
||||
'grade' => 'isFloat', 'validate' => 'isBool');
|
||||
|
||||
protected $table = 'product_comment';
|
||||
protected $identifier = 'id_product_comment';
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
parent::validateFields(false);
|
||||
$fields['id_product'] = (int)($this->id_product);
|
||||
$fields['id_customer'] = (int)($this->id_customer);
|
||||
$fields['id_guest'] = (int)($this->id_guest);
|
||||
$fields['customer_name'] = pSQL($this->customer_name);
|
||||
$fields['title'] = pSQL($this->title);
|
||||
$fields['content'] = pSQL($this->content);
|
||||
$fields['grade'] = (float)($this->grade);
|
||||
$fields['validate'] = (int)($this->validate);
|
||||
$fields['deleted'] = (int)($this->deleted);
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
return ($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get comments by IdProduct
|
||||
*
|
||||
* @return array Comments
|
||||
*/
|
||||
static public function getByProduct($id_product, $p = 1, $n = null)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
$validate = Configuration::get('PRODUCT_COMMENTS_MODERATE');
|
||||
$p = (int)($p);
|
||||
$n = (int)($n);
|
||||
if ($p <= 1)
|
||||
$p = 1;
|
||||
if ($n != null AND $n <= 0)
|
||||
$n = 5;
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT pc.`id_product_comment`, IF(c.id_customer, CONCAT(c.`firstname`, \' \', LEFT(c.`lastname`, 1)), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pc.title
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = pc.`id_customer`
|
||||
WHERE pc.`id_product` = '.(int)($id_product).($validate == '1' ? ' AND pc.`validate` = 1' : '').'
|
||||
ORDER BY pc.`date_add` DESC
|
||||
'.($n ? 'LIMIT '.(int)(($p - 1) * $n).', '.(int)($n) : ''));
|
||||
}
|
||||
|
||||
static public function getByCustomer($id_product, $id_customer, $last = false, $id_guest = false)
|
||||
{
|
||||
$results = Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE pc.`id_product` = '.(int)($id_product).' AND '.(!$id_guest ? 'pc.`id_customer` = '.(int)($id_customer) : 'pc.`id_guest` = '.(int)($id_guest)).'
|
||||
ORDER BY pc.`date_add` DESC '
|
||||
.($last ? 'LIMIT 1' : '')
|
||||
);
|
||||
|
||||
if ($last)
|
||||
return array_shift($results);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Grade By product
|
||||
*
|
||||
* @return array Grades
|
||||
*/
|
||||
static public function getGradeByProduct($id_product, $id_lang)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product) ||
|
||||
!Validate::isUnsignedId($id_lang))
|
||||
die(Tools::displayError());
|
||||
$validate = Configuration::get('PRODUCT_COMMENTS_MODERATE');
|
||||
|
||||
return (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT pc.`id_product_comment`, pcg.`grade`, pccl.`name`, pcc.`id_product_comment_criterion`
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_grade` pcg ON (pcg.`id_product_comment` = pc.`id_product_comment`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion` pcc ON (pcc.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pccl.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`)
|
||||
WHERE pc.`id_product` = '.(int)($id_product).'
|
||||
AND pccl.`id_lang` = '.(int)($id_lang).
|
||||
($validate == '1' ? ' AND pc.`validate` = 1' : '')));
|
||||
}
|
||||
|
||||
static public function getAveragesByProduct($id_product, $id_lang)
|
||||
{
|
||||
/* Get all grades */
|
||||
$grades = ProductComment::getGradeByProduct((int)($id_product), (int)($id_lang));
|
||||
$total = ProductComment::getGradedCommentNumber((int)($id_product));
|
||||
if (!sizeof($grades) OR (!$total))
|
||||
return array();
|
||||
|
||||
/* Addition grades for each criterion */
|
||||
$criterionsGradeTotal = array();
|
||||
for ($i = 0; $i < count($grades); ++$i)
|
||||
if (array_key_exists($grades[$i]['id_product_comment_criterion'], $criterionsGradeTotal) === false)
|
||||
$criterionsGradeTotal[$grades[$i]['id_product_comment_criterion']] = (int)($grades[$i]['grade']);
|
||||
else
|
||||
$criterionsGradeTotal[$grades[$i]['id_product_comment_criterion']] += (int)($grades[$i]['grade']);
|
||||
|
||||
/* Finally compute the averages */
|
||||
$averages = array();
|
||||
foreach ($criterionsGradeTotal AS $key => $criterionGradeTotal)
|
||||
$averages[(int)($key)] = (int)($total) ? ((int)($criterionGradeTotal) / (int)($total)) : 0;
|
||||
return $averages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of comments and average grade by products
|
||||
*
|
||||
* @return array Info
|
||||
*/
|
||||
static public function getCommentNumber($id_product)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
$validate = (int)(Configuration::get('PRODUCT_COMMENTS_MODERATE'));
|
||||
if (($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT COUNT(`id_product_comment`) AS "nbr"
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE `id_product` = '.(int)($id_product).($validate == '1' ? ' AND `validate` = 1' : ''))) === false)
|
||||
return false;
|
||||
return (int)($result['nbr']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of comments and average grade by products
|
||||
*
|
||||
* @return array Info
|
||||
*/
|
||||
static public function getGradedCommentNumber($id_product)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
$validate = (int)(Configuration::get('PRODUCT_COMMENTS_MODERATE'));
|
||||
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT COUNT(pc.`id_product`) AS nbr
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE `id_product` = '.(int)($id_product).($validate == '1' ? ' AND `validate` = 1' : '').'
|
||||
AND `grade` > 0');
|
||||
return (int)($result['nbr']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get comments by Validation
|
||||
*
|
||||
* @return array Comments
|
||||
*/
|
||||
static public function getByValidate($validate = '0', $deleted = false)
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
return (Db::getInstance()->ExecuteS('
|
||||
SELECT pc.`id_product_comment`, pc.`id_product`, IF(c.id_customer, CONCAT(c.`firstname`, \' \', c.`lastname`), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = pc.`id_customer`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = pc.`id_product`)
|
||||
WHERE pc.`validate` = '.(int)($validate).'
|
||||
AND pl.`id_lang` = '.(int)($cookie->id_lang).'
|
||||
ORDER BY pc.`date_add` DESC'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a comment
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
public function validate($validate = '1')
|
||||
{
|
||||
if (!Validate::isUnsignedId($this->id))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'product_comment` SET
|
||||
`validate` = '.(int)($validate).'
|
||||
WHERE `id_product_comment` = '.(int)($this->id)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Grades
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function deleteGrades($id_product_comment)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product_comment))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_comment_grade`
|
||||
WHERE `id_product_comment` = '.(int)($id_product_comment)));
|
||||
}
|
||||
};
|
||||
@@ -1,214 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class ProductCommentCriterion extends ObjectModel
|
||||
{
|
||||
public $id;
|
||||
public $id_product_comment_criterion_type;
|
||||
|
||||
public $name;
|
||||
public $active = 1;
|
||||
protected $fieldsRequiredLang = array('name');
|
||||
protected $fieldsSizeLang = array('name' => 128);
|
||||
protected $fieldsValidateLang = array('name' => 'isGenericName');
|
||||
|
||||
protected $table = 'product_comment_criterion';
|
||||
protected $identifier = 'id_product_comment_criterion';
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
parent::validateFields();
|
||||
return array('id_product_comment_criterion_type' => (int)$this->id_product_comment_criterion_type, 'active' => (int)$this->active);
|
||||
}
|
||||
|
||||
public function getTranslationsFieldsChild()
|
||||
{
|
||||
parent::validateFieldsLang();
|
||||
return parent::getTranslationsFields(array('name'));
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if (!parent::delete())
|
||||
return false;
|
||||
if ($this->id_product_comment_criterion_type == 2)
|
||||
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category
|
||||
WHERE id_product_comment_criterion='.(int)$this->id))
|
||||
return false;
|
||||
elseif ($this->id_product_comment_criterion_type == 3)
|
||||
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product
|
||||
WHERE id_product_comment_criterion='.(int)$this->id))
|
||||
return false;
|
||||
|
||||
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_grade`
|
||||
WHERE `id_product_comment_criterion` = '.(int)$this->id);
|
||||
}
|
||||
|
||||
public function update($nullValues = false)
|
||||
{
|
||||
$previousUpdate = new self((int)$this->id);
|
||||
if (!parent::update($nullValues))
|
||||
return false;
|
||||
if ($previousUpdate->id_product_comment_criterion_type != $this->id_product_comment_criterion_type)
|
||||
{
|
||||
if ($previousUpdate->id_product_comment_criterion_type == 2)
|
||||
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category
|
||||
WHERE id_product_comment_criterion='.(int)$previousUpdate->id);
|
||||
elseif ($previousUpdate->id_product_comment_criterion_type == 3)
|
||||
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product
|
||||
WHERE id_product_comment_criterion='.(int)$previousUpdate->id);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link a Comment Criterion to a product
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
public function addProduct($id_product)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`)
|
||||
VALUES('.(int)$this->id.','.(int)$id_product.')'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Link a Comment Criterion to a category
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
public function addCategory($id_category)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_category))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`)
|
||||
VALUES('.(int)$this->id.','.(int)$id_category.')'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add grade to a criterion
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
public function addGrade($id_product_comment, $grade)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product_comment))
|
||||
die(Tools::displayError());
|
||||
if ($grade < 0)
|
||||
$grade = 0;
|
||||
else if ($grade > 10)
|
||||
$grade = 10;
|
||||
return (Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'product_comment_grade`
|
||||
(`id_product_comment`, `id_product_comment_criterion`, `grade`) VALUES(
|
||||
'.(int)($id_product_comment).',
|
||||
'.(int)$this->id.',
|
||||
'.(int)($grade).')'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get criterion by Product
|
||||
*
|
||||
* @return array Criterion
|
||||
*/
|
||||
static public function getByProduct($id_product, $id_lang)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product) ||
|
||||
!Validate::isUnsignedId($id_lang))
|
||||
die(Tools::displayError());
|
||||
return Db::getInstance()->ExecuteS('
|
||||
SELECT pcc.`id_product_comment_criterion`, pccl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp ON (pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion` AND pccp.`id_product` = '.(int)$id_product.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_category` pccc ON (pcc.`id_product_comment_criterion` = pccc.`id_product_comment_criterion`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_category_default = pccc.id_category AND p.id_product = '.(int)$id_product.')
|
||||
WHERE pccl.`id_lang` = '.(int)($id_lang).' AND (pccp.id_product IS NOT NULL OR p.id_product IS NOT NULL OR pcc.id_product_comment_criterion_type = 1) AND pcc.active = 1
|
||||
GROUP BY pcc.id_product_comment_criterion');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Criterions
|
||||
*
|
||||
* @return array Criterions
|
||||
*/
|
||||
static public function getCriterions($id_lang, $type = false, $active = false)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_lang))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->ExecuteS('
|
||||
SELECT pcc.`id_product_comment_criterion`, pcc.id_product_comment_criterion_type, pccl.`name`, pcc.active
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
|
||||
JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion)
|
||||
WHERE pccl.`id_lang` = '.(int)$id_lang.($active ? ' AND active = 1' : '').($type ? ' AND id_product_comment_criterion_type = '.(int)$type : '').'
|
||||
ORDER BY pccl.`name` ASC'));
|
||||
}
|
||||
|
||||
public function getProducts()
|
||||
{
|
||||
$res = Db::getInstance()->ExecuteS('
|
||||
SELECT pccp.id_product, pccp.id_product_comment_criterion
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion_product` pccp
|
||||
WHERE pccp.id_product_comment_criterion = '.(int)$this->id);
|
||||
$products = array();
|
||||
if ($res)
|
||||
foreach ($res AS $row)
|
||||
$products[] = (int)$row['id_product'];
|
||||
return $products;
|
||||
}
|
||||
|
||||
public function getCategories()
|
||||
{
|
||||
$res = Db::getInstance()->ExecuteS('
|
||||
SELECT pccc.id_category, pccc.id_product_comment_criterion
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion_category` pccc
|
||||
WHERE pccc.id_product_comment_criterion = '.(int)$this->id);
|
||||
$criterions = array();
|
||||
if ($res)
|
||||
foreach ($res AS $row)
|
||||
$criterions[] = (int)$row['id_category'];
|
||||
return $criterions;
|
||||
}
|
||||
|
||||
public function deleteCategories()
|
||||
{
|
||||
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_category` WHERE `id_product_comment_criterion` = '.(int)$this->id);
|
||||
}
|
||||
|
||||
public function deleteProducts()
|
||||
{
|
||||
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product` WHERE `id_product_comment_criterion` = '.(int)$this->id);
|
||||
}
|
||||
|
||||
static public function getTypes()
|
||||
{
|
||||
return array(1 => Tools::displayError('Valid for the entire catalog'), 2 => Tools::displayError('Restricted to some categories'), 3 => Tools::displayError('Restricted to some products'));
|
||||
}
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class ProductCommentCriterion
|
||||
{
|
||||
/**
|
||||
* Add a Comment Criterion
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function add($id_lang, $name)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_lang) ||
|
||||
!Validate::isMessage($name))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'product_comment_criterion`
|
||||
(`id_lang`, `name`) VALUES(
|
||||
'.(int)($id_lang).',
|
||||
\''.pSQL($name).'\')'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Link a Comment Criterion to a product
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function addToProduct($id_product_comment_criterion, $id_product)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product_comment_criterion) ||
|
||||
!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_product`
|
||||
(`id_product_comment_criterion`, `id_product`) VALUES(
|
||||
'.(int)($id_product_comment_criterion).',
|
||||
'.(int)($id_product).')'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add grade to a criterion
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function addGrade($id_product_comment, $id_product_comment_criterion, $grade)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product_comment) ||
|
||||
!Validate::isUnsignedId($id_product_comment_criterion))
|
||||
die(Tools::displayError());
|
||||
if ($grade < 0)
|
||||
$grade = 0;
|
||||
else if ($grade > 10)
|
||||
$grade = 10;
|
||||
return (Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'product_comment_grade`
|
||||
(`id_product_comment`, `id_product_comment_criterion`, `grade`) VALUES(
|
||||
'.(int)($id_product_comment).',
|
||||
'.(int)($id_product_comment_criterion).',
|
||||
'.(int)($grade).')'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update criterion
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function update($id_product_comment_criterion, $id_lang, $name)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product_comment_criterion) ||
|
||||
!Validate::isUnsignedId($id_lang) ||
|
||||
!Validate::isMessage($name))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'product_comment_criterion` SET
|
||||
`name` = \''.pSQL($name).'\'
|
||||
WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion).' AND
|
||||
`id_lang` = '.(int)($id_lang)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get criterion by Product
|
||||
*
|
||||
* @return array Criterion
|
||||
*/
|
||||
static public function getByProduct($id_product, $id_lang)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product) ||
|
||||
!Validate::isUnsignedId($id_lang))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->ExecuteS('
|
||||
SELECT pcc.`id_product_comment_criterion`, pcc.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
|
||||
INNER JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp ON pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion`
|
||||
WHERE pccp.`id_product` = '.(int)($id_product).' AND
|
||||
pcc.`id_lang` = '.(int)($id_lang)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Criterions
|
||||
*
|
||||
* @return array Criterions
|
||||
*/
|
||||
static public function get($id_lang)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_lang))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->ExecuteS('
|
||||
SELECT pcc.`id_product_comment_criterion`, pcc.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
|
||||
WHERE pcc.`id_lang` = '.(int)($id_lang).'
|
||||
ORDER BY pcc.`name` ASC'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete product criterion by product
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function deleteByProduct($id_product)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
return (Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product`
|
||||
WHERE `id_product` = '.(int)($id_product)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all reference of a criterion
|
||||
*
|
||||
* @return boolean succeed
|
||||
*/
|
||||
static public function delete($id_product_comment_criterion)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_product_comment_criterion))
|
||||
die(Tools::displayError());
|
||||
$result = Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_comment_grade`
|
||||
WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion));
|
||||
if ($result === false)
|
||||
return ($result);
|
||||
$result = Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product`
|
||||
WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion));
|
||||
if ($result === false)
|
||||
return ($result);
|
||||
return (Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_comment_criterion`
|
||||
WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion)));
|
||||
}
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>productcomments</name>
|
||||
<displayName>Product Comments</displayName>
|
||||
<version>2.1</version>
|
||||
<description>Allow users to post comment about a product.</description>
|
||||
<author>PrestaShop</author>
|
||||
<tab>front_office_features</tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
</module>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Produkt-Kommentare';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Benutzern erlauben, einen Kommentar zu einem Produkt zu posten';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Kriterium gelöscht';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Kriterium aktualisiert';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Kriterium hinzugefügt';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Konfiguration';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Alle Kommentare müssen durch einen Mitarbeiter bestätigt werden';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Gastkommentare erlauben';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Minimale Zeit zwischen 2 Kommentaren vom selben Benutzer';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'Sekunden';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Kommentare moderieren';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Verfasser';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Kommentieren';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Produktname';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Handlungen';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Akzeptieren';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Auswahl:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Zur Zeit keine Kommentare zum Bestätigen.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Ein neues Kriterium hinzufügen';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'Sie können mehrere Kriterien definieren, um Ihren Kunden bei ihrem Beitrag zu helfen. Zum Beispiel: Effizienz, Leichtigkeit, Design.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'Sie können hier unten ein neues Kriterium hinzufügen:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Name';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Gilt für';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Aktiv';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Ändern Sie das Kriterium';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Fügen Sie dieses Kriterium hinzu';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Kriterium';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Typ';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Status';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Bearbeiten';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Bereich der Kriterien verwalten';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Nur Kriterien, die auf Kategorien oder Produkte beschränkt sind, können untenstehend konfiguriert werden:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Wählen Sie ein Kriterium';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Produkte';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Kategorien';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Name des Produkts';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Name der Kategorie ';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Bitte tragen Sie Ihren Namen ein';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'Ungültiger Kommentartext gepostet.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Ein Fehler bist eim Speichern Ihres Kommentars aufgetreten.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Kommentar erfolgreich geschrieben.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'Wartet aufBestätigung durch Moderator.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Kommentartext ist erforderlich.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Sie sollten ';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'Sekunden warten, bevor Sie einen neuen Kommentar posten';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Durchschnittsgrad';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Durchschnitt';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'Von';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Titel';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'Zur Zeit keine Kundenkommentare.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'Sekunde (n) vor dem Posten eines neuen Kommentars';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Kommentar hinzufügen';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Ihr Name:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titel:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Kommentar:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Senden';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Nur registrierte Benutzer können einen neuen Kommentar posten.';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Kommentare';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Durchschnitt';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'Kommentare ansehen';
|
||||
$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Kommentare';
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Comentario sobre el producto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Permitir a los usuarios registrar comentarios acerca del producto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Ajustes actualizados';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Criterio suprimido';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Criterio actualizado';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Creteria añadido';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Configuración';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Todos los comentarios deben estar validados por un empleado';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Autorizar los comentarios de visitantes que no están conectados.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Tiempo mínimo entre dos comentarios de un mismo usuario';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'segundos';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Moderar Comentarios';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Autor';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Comentario';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Nombre del producto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Acciones';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Aceptar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Eliminar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Selección:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Ningún comentario que validar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Añadir un nuevo criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'Puede definir varios criterios para guiar a sus clientes en su comentario. Por ejemplo: eficacia, diseño, etc...';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'Puede añadir un nuevo criterio a continuación:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Nombre';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Aplicar a ';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activo';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Modificar este criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Añadir este criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo ';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Estado';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Modificar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Administrar el';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Solo pueden configurarse a continuación los criterios que corresponden a categorías o productos:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Elija un criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Productos';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorías';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Nombre del producto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Nombre de la categoría';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Por favor, escriba su nombre';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'Comentario texto no válido para una publicación.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Se ha producido un error al guardar su comentario.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Comentario publicado con éxito.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'En espera de validación moderador';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Se necesita el texto del comentario.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Debe esperar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'segundos antes de escribir un nuevo comentario.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Grado medio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Promedio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'Desde';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Título';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'No hay comentarios de clientes por ahora.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'segundo(s) antes de escribir un nuevo comentario.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Añadir un comentario';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Su nombre:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Título:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Comentario:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Enviar';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Solamente los usuarios registrados pueden introducir comentarios.';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Comentarios';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Media';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'Ver las opiniones';
|
||||
$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Comentarios';
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Commentaires produits';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Autorise les utilisateurs à poster des commentaires sur les produits';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Critère supprimé';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Critère mis à jour';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Critère ajouté';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Configuration';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Les commentaires doivent être validés par un employé';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Autoriser les commentaires des visiteurs qui n\'ont pas de compte client';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Temps minimum entre 2 commentaires d\'un même utilisateur';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'secondes';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Modérer les commentaires';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Auteur';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Commentaire';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Nom du produit';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Accepter';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Sélection :';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Aucun commentaire à valider.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Ajouter un nouveau critère';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'Vous pouvez définir plusieurs critères afin de guider vos clients dans leur commentaire. Par exemple: performance, design etc ...';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'Vous pouvez ajouter un nouveau critère ci-dessous :';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Nom';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Appliquer à';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Actif';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Modifier ce critère';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Ajouter ce critère';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Critère';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Type';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Etat';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Modifier';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Gérer le champ d\'action des critères';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Seuls les critères correspondant à des catégories ou des produits peuvent être configurés ci-dessous:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Choisissez un critère';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Produits';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Nom du produit';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Nom de la catégorie';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Merci de saisir votre nom';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'Commentaire invalide.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Une erreur est survenue lors de l\'ajout du commentaire.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Commentaire ajouté avec succès.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'En attente d\'une validation modérateur';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Un texte est nécessaire pour publier un commentaire.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Vous devez attendre';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'secondes avant de poster un nouveau commentaire.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Note moyenne';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Moyenne';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'De';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Titre';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'Aucun commentaire n\'a été publié pour le moment.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'seconde(s) avant de poster un nouveau commentaire.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Ajouter un commentaire';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Votre nom :';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titre : ';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Commentaire :';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Envoyer';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Seuls les utilisateurs enregistrés peuvent poster des commentaires.';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commentaires';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Moyenne';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'Voir les avis';
|
||||
$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commentaires';
|
||||
|
Before Width: | Height: | Size: 781 B |
|
Before Width: | Height: | Size: 413 B |
|
Before Width: | Height: | Size: 670 B |
|
Before Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 500 B |
|
Before Width: | Height: | Size: 661 B |
|
Before Width: | Height: | Size: 815 B |
@@ -1,53 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`id_guest` int(10) unsigned NULL,
|
||||
`title` varchar(64) NULL,
|
||||
`content` text NOT NULL,
|
||||
`customer_name` varchar(64) NULL,
|
||||
`grade` float unsigned NOT NULL,
|
||||
`validate` tinyint(1) NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`),
|
||||
KEY `id_product` (`id_product`),
|
||||
KEY `id_customer` (`id_customer`),
|
||||
KEY `id_guest` (`id_product`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product_comment_criterion_type` tinyint(1) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_product` (
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_lang` (
|
||||
`id_product_comment_criterion` INT(11) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_category` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_grade` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`grade` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Commenti prodotto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Consenti agli utenti di inviare un commento su un prodotto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Criterio eliminato';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Criterio aggiornato';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Criterio aggiunto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Configurazione';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Tutti i commenti devono essere convalidati da un dipendente';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Permetti i commenti degli ospiti';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Tempo minimo tra 2 commenti dello stesso utente';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'secondi';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Salva';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Moderare i commenti';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Autore';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Commenta';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Nome del prodotto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Azioni';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Accettare';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Selezione:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Non ci sono commenti da convalidare ora.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Aggiungi un nuovo criterio di commento';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'È possibile definire criteri diversi, al fine di aiutare i clienti durante la loro opinione. Per esempio: efficienza, leggerezza, design.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'È possibile aggiungere un nuovo criterio di seguito:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Nome';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Applica a';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Attivo';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Modifica questo criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Aggiungi questo criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Status';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Modifica';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Gestire le applicazioni dei criteri';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Solo i criteri limitati a categorie o prodotti possono essere configurati qui sotto:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Scegli un criterio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Prodotti';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorie';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Nome del prodotto';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Nome categoria';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Inserisci il tuo nome';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'E\' stato postato un commento non valido.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Errore durante il salvataggio del tuo commento.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Commento pubblicato con successo.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'In attesa della convalida moderatore.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Testo commento richiesto.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Si deve attendere';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'secondi prima di pubblicare un nuovo commento';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Grado medio';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Media';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'Da';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Titolo';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'Non ci sono commenti dei clienti per il momento.';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'secondo/i prima di postare un nuovo commento';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Aggiungi un commento';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Il tuo nome:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titolo:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Commento:';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Invia';
|
||||
$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Solo gli utenti registrati possono inserire un nuovo commento.';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commenti';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Media';
|
||||
$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'visualizzare i commenti';
|
||||
$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commenti';
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
### jQuery Star Rating Plugin v2.0 - 2008-03-12 ###
|
||||
By Diego A, http://www.fyneworks.com, diego@fyneworks.com
|
||||
- v2 by Keith Wood, kbwood@virginbroadband.com.au
|
||||
|
||||
Project: http://plugins.jquery.com/project/MultipleFriendlyStarRating
|
||||
Website: http://www.fyneworks.com/jquery/star-rating/
|
||||
|
||||
This is a modified version of the star rating plugin from:
|
||||
http://www.phpletter.com/Demo/Jquery-Star-Rating-Plugin/
|
||||
*/
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';4(w)(3($){$.Y.T=3(c){c=$.15({m:\'X U\',E:\'\',B:z,8:z},c||{});o d={};o e={t:3(n,a,b){2.6(n);$(a).D(\'.j\').A().l(b||\'x\')},6:3(n){$(d[n].7).O(\'.j\').u(\'9\').u(\'x\')},h:3(n){4(!$(d[n].5).Z(\'.m\')){$(d[n].5).D(\'.j\').A().l(\'9\')}},g:3(n,a){d[n].5=a;o b=$(a).L(\'a\').K();$(d[n].7).J(b);e.6(n);e.h(n);4(c.I)c.I.W(d[n].7,[b,a])}};2.V(3(i){o n=2.G;4(!d[n])d[n]={r:0};i=d[n].r;d[n].r++;4(i==0){c.8=$(2).S(\'p\')||c.8;d[n].7=$(\'<R Q="P" G="\'+n+\'" q=""\'+(c.8?\' p="p"\':\'\')+\'>\');$(2).C(d[n].7);4(c.8||c.B){}F{$(2).C($(\'<k y="m"><a s="\'+c.m+\'">\'+c.E+\'</a></k>\').H(3(){e.6(n);$(2).l(\'9\')}).v(3(){e.h(n);$(2).u(\'9\')}).g(3(){e.g(n,2)}))}};f=$(\'<k y="j"><a s="\'+(2.s||2.q)+\'">\'+2.q+\'</a></k>\');$(2).N(f);4(c.8){$(f).l(\'M\')}F{$(f).H(3(){e.6(n);e.t(n,2)}).v(3(){e.6(n);e.h(n)}).g(3(){e.g(n,2)})};4(2.14)d[n].5=f;$(2).13();4(i+1==2.12)e.h(n)});11(n 10 d)4(d[n].5){e.t(n,d[n].5,\'9\');$(d[n].7).J($(d[n].5).L(\'a\').K())}16 2}})(w);',62,69,'||this|function|if|currentElem|drain|valueElem|readOnly|star_on||||||eStar|click|reset||star|div|addClass|cancel||var|disabled|value|count|title|fill|removeClass|mouseout|jQuery|star_hover|class|false|andSelf|required|before|prevAll|cancelValue|else|name|mouseover|callback|val|text|children|star_readonly|after|siblings|hidden|type|input|attr|rating|Rating|each|apply|Cancel|fn|is|in|for|length|remove|checked|extend|return'.split('|'),0,{}))
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function getCommentForm()
|
||||
{
|
||||
if (document.forms)
|
||||
return (document.forms['comment_form']);
|
||||
else
|
||||
return (document.comment_form);
|
||||
}
|
||||
|
||||
function acceptComment(id)
|
||||
{
|
||||
var form = getCommentForm();
|
||||
if (id)
|
||||
form.elements['id_product_comment'].value = id;
|
||||
form.elements['action'].value = 'accept';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
|
||||
function deleteComment(id)
|
||||
{
|
||||
var form = getCommentForm();
|
||||
if (id)
|
||||
form.elements['id_product_comment'].value = id;
|
||||
form.elements['action'].value = 'delete';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function getCriterionForm()
|
||||
{
|
||||
if (document.forms)
|
||||
return (document.forms['criterion_form']);
|
||||
else
|
||||
return (document.criterion_form);
|
||||
}
|
||||
|
||||
function editCriterion(id)
|
||||
{
|
||||
var form = getCriterionForm();
|
||||
form.elements['id_product_comment_criterion'].value = id;
|
||||
form.elements['criterion_name'].value = document.getElementById('criterion_name_' + id).value;
|
||||
form.elements['criterion_action'].value = 'edit';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function deleteCriterion(id)
|
||||
{
|
||||
var form = getCriterionForm();
|
||||
form.elements['id_product_comment_criterion'].value = id;
|
||||
form.elements['criterion_action'].value = 'delete';
|
||||
form.submit();
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function getProductCriterionForm()
|
||||
{
|
||||
if (document.forms)
|
||||
return (document.forms['product_criterion_form']);
|
||||
else
|
||||
return (document.product_criterion_form);
|
||||
}
|
||||
|
||||
function getProductCriterion(path, id_product, id_lang)
|
||||
{
|
||||
$.get(path + 'productcommentscriterion.php', { id_product: id_product, id_lang: id_lang },
|
||||
function(data){
|
||||
document.getElementById('product_criterions').innerHTML = data;
|
||||
});
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$(function () {
|
||||
$('a.cluetip')
|
||||
.cluetip({
|
||||
local:true,
|
||||
cursor: 'pointer',
|
||||
cluetipClass: 'comparison_comments',
|
||||
dropShadow: false,
|
||||
dropShadowSteps: 0,
|
||||
showTitle: false,
|
||||
tracking: true,
|
||||
sticky: false,
|
||||
mouseOutClose: true,
|
||||
width: 450,
|
||||
fx: {
|
||||
open: 'fadeIn',
|
||||
openSpeed: 'fast'
|
||||
}
|
||||
})
|
||||
.css('opacity', 0.8);
|
||||
});
|
||||
|
Before Width: | Height: | Size: 557 B |
@@ -1,629 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class ProductComments extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
private $_html = '';
|
||||
private $_postErrors = array();
|
||||
|
||||
private $_productCommentsCriterionTypes = array();
|
||||
private $_baseUrl;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'productcomments';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '2.1';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Product Comments');
|
||||
$this->description = $this->l('Allow users to post comment about a product.');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", trim($sql));
|
||||
|
||||
foreach ($sql AS $query)
|
||||
if (!Db::getInstance()->Execute(trim($query)))
|
||||
return false;
|
||||
if (parent::install() == false OR $this->registerHook('productTab') == false
|
||||
OR $this->registerHook('extraProductComparison') == false OR $this->registerHook('productTabContent') == false
|
||||
OR $this->registerHook('header') == false OR !Configuration::updateValue('PRODUCT_COMMENTS_MINIMAL_TIME', 30)
|
||||
OR !Configuration::updateValue('PRODUCT_COMMENTS_ALLOW_GUESTS', 0)
|
||||
OR !Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function uninstall()
|
||||
{
|
||||
if (!parent::uninstall() OR !Configuration::deleteByName('PRODUCT_COMMENTS_MODERATE') OR !Configuration::deleteByName('PRODUCT_COMMENTS_ALLOW_GUESTS') OR !Configuration::deleteByName('PRODUCT_COMMENTS_MINIMAL_TIME'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function _postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitModerate'))
|
||||
{
|
||||
Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', (int)Tools::getValue('moderate'));
|
||||
Configuration::updateValue('PRODUCT_COMMENTS_ALLOW_GUESTS', (int)Tools::getValue('allow_guest'));
|
||||
Configuration::updateValue('PRODUCT_COMMENTS_MINIMAL_TIME', (int)Tools::getValue('product_comments_minimal_time'));
|
||||
$this->_html .= '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.$this->l('Settings updated').'</div>';
|
||||
}
|
||||
if ($id_criterion = (int)Tools::getValue('deleteCriterion'))
|
||||
{
|
||||
$productCommentCriterion = new ProductCommentCriterion((int)$id_criterion);
|
||||
if ($productCommentCriterion->id)
|
||||
if ($productCommentCriterion->delete())
|
||||
$this->_html .= '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.$this->l('Criterion deleted').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
include_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
|
||||
$this->_setBaseUrl();
|
||||
$this->_productCommentsCriterionTypes = ProductCommentCriterion::getTypes();
|
||||
$this->_html = '<h2>'.$this->displayName.'</h2>';
|
||||
$this->_postProcess();
|
||||
$this->_checkModerateComment();
|
||||
$this->_checkCriterion();
|
||||
$this->_updateApplicationCriterion();
|
||||
|
||||
return $this->_html.$this->_displayForm();
|
||||
}
|
||||
|
||||
private function _setBaseUrl()
|
||||
{
|
||||
$this->_baseUrl = 'index.php?';
|
||||
foreach ($_GET AS $k => $value)
|
||||
if (!in_array($k, array('deleteCriterion', 'editCriterion')))
|
||||
$this->_baseUrl .= $k.'='.$value.'&';
|
||||
$this->_baseUrl = rtrim($this->_baseUrl, '&');
|
||||
}
|
||||
|
||||
private function _checkModerateComment()
|
||||
{
|
||||
$action = Tools::getValue('action');
|
||||
if (empty($action) === false &&
|
||||
(int)(Configuration::get('PRODUCT_COMMENTS_MODERATE')))
|
||||
{
|
||||
$product_comments = Tools::getValue('id_product_comment');
|
||||
if (sizeof($product_comments))
|
||||
{
|
||||
require_once(dirname(__FILE__).'/ProductComment.php');
|
||||
switch ($action)
|
||||
{
|
||||
case 'accept':
|
||||
foreach ($product_comments AS $id_product_comment)
|
||||
{
|
||||
if (!$id_product_comment)
|
||||
continue;
|
||||
$comment = new ProductComment((int)$id_product_comment);
|
||||
$comment->validate();
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
foreach ($product_comments AS $id_product_comment)
|
||||
{
|
||||
if (!$id_product_comment)
|
||||
continue;
|
||||
$comment = new ProductComment((int)$id_product_comment);
|
||||
$comment->delete();
|
||||
ProductComment::deleteGrades((int)$id_product_comment);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private function _checkCriterion()
|
||||
{
|
||||
$action_criterion = Tools::getValue('criterion_action');
|
||||
$name = Tools::getValue('criterion');
|
||||
if (Tools::isSubmit('submitAddCriterion'))
|
||||
{
|
||||
global $cookie;
|
||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
$languages = Language::getLanguages();
|
||||
$id_criterion = (int)Tools::getValue('id_product_comment_criterion');
|
||||
$productCommentCriterion = new ProductCommentCriterion((int)$id_criterion);
|
||||
foreach ($languages AS $lang)
|
||||
$productCommentCriterion->name[(int)$lang['id_lang']] = Tools::getValue('criterion_'.(int)$lang['id_lang']);
|
||||
|
||||
$productCommentCriterion->id_product_comment_criterion_type = (int)Tools::getValue('criterion_type');
|
||||
$productCommentCriterion->active = (int)Tools::getValue('criterion_active');
|
||||
|
||||
if ($productCommentCriterion->save())
|
||||
$this->_html .= '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.(Tools::getValue('editCriterion') ? $this->l('Criterion updated') : $this->l('Criterion added')).'</div>';
|
||||
}
|
||||
elseif (!empty($action_criterion) AND empty($name))
|
||||
{
|
||||
$id_product_comment_criterion = Tools::getValue('id_product_comment_criterion');
|
||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
switch ($action_criterion)
|
||||
{
|
||||
case 'edit':
|
||||
ProductCommentCriterion::update($id_product_comment_criterion,
|
||||
Tools::getValue('criterion_id_lang'),
|
||||
Tools::getValue('criterion_name'));
|
||||
break;
|
||||
case 'delete':
|
||||
ProductCommentCriterion::delete($id_product_comment_criterion);
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _updateApplicationCriterion()
|
||||
{
|
||||
if (Tools::isSubmit('submitApplicationCriterion'))
|
||||
{
|
||||
include_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
|
||||
$id_criterion = (int)Tools::getValue('id_criterion');
|
||||
$productCommentCriterion = new ProductCommentCriterion((int)$id_criterion);
|
||||
if ($productCommentCriterion->id)
|
||||
{
|
||||
if ($productCommentCriterion->id_product_comment_criterion_type == 2)
|
||||
{
|
||||
$productCommentCriterion->deleteCategories();
|
||||
if ($categories = Tools::getValue('id_product'))
|
||||
if (sizeof($categories))
|
||||
foreach ($categories AS $id_category)
|
||||
$productCommentCriterion->addCategory((int)$id_category);
|
||||
}
|
||||
elseif ($productCommentCriterion->id_product_comment_criterion_type == 3)
|
||||
{
|
||||
$productCommentCriterion->deleteProducts();
|
||||
if ($products = Tools::getValue('id_product'))
|
||||
if (sizeof($products))
|
||||
foreach ($products AS $product)
|
||||
$productCommentCriterion->addProduct((int)$product);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_html .= '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.$this->l('Settings updated').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
private function _displayForm()
|
||||
{
|
||||
$this->_displayFormModerate();
|
||||
$this->_displayFormConfigurationCriterion();
|
||||
$this->_displayFormApplicationCriterion();
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
private function _displayFormModerate()
|
||||
{
|
||||
$this->_html = '<script type="text/javascript" src="'.$this->_path.'js/moderate.js"></script>
|
||||
<fieldset class="width2">
|
||||
<legend><img src="../img/admin/cog.gif" alt="" title="" />'.$this->l('Configuration').'</legend>
|
||||
<form action="'.$this->_baseUrl.'" method="post" name="comment_configuration">
|
||||
<label style="padding-top: 0;">'.$this->l('All comments must be validated by an employee').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="moderate" id="moderate_on" value="1" '.(Configuration::get('PRODUCT_COMMENTS_MODERATE') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="moderate_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Enabled').'" /></label>
|
||||
<input type="radio" name="moderate" id="moderate_off" value="0" '.(!Configuration::get('PRODUCT_COMMENTS_MODERATE') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="moderate_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
</div>
|
||||
<div class="clear" style="height: 20px;"></div>
|
||||
<label style="padding-top: 0;">'.$this->l('Allow guest comments').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="allow_guest" id="allow_guest_on" value="1" '.(Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="allow_guest_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Enabled').'" /></label>
|
||||
<input type="radio" name="allow_guest" id="allow_guest_off" value="0" '.(!Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="allow_guest_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
</div>
|
||||
<div class="clear" style="height: 20px;"></div>
|
||||
<label style="padding-top: 0;">'.$this->l('Minimum time between 2 comments from the same user').'</label>
|
||||
<div class="margin-form">
|
||||
<input name="product_comments_minimal_time" type="text" class="text" value="'.Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME').'" style="width: 40px; text-align: right;" /> '.$this->l('seconds').'
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="margin-form clear">
|
||||
<input type="submit" name="submitModerate" value="'.$this->l('Save').'" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset class="width2">
|
||||
<legend><img src="'.$this->_path.'img/comments_delete.png" alt="" title="" />'.$this->l('Moderate Comments').'</legend>';
|
||||
if (Configuration::get('PRODUCT_COMMENTS_MODERATE'))
|
||||
{
|
||||
require_once(dirname(__FILE__).'/ProductComment.php');
|
||||
$comments = ProductComment::getByValidate();
|
||||
if (sizeof($comments))
|
||||
{
|
||||
$this->_html .= '
|
||||
<form action="'.$this->_baseUrl.'" method="post" name="comment_form">
|
||||
<input type="hidden" name="id_product_comment[]" id="id_product_comment" />
|
||||
<input type="hidden" name="action" id="action" />
|
||||
<br /><table class="table" border="0" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input class="noborder" type="checkbox" name="id_product_comment[]" onclick="checkDelBoxes(this.form, \'id_product_comment[]\', this.checked)" /></th>
|
||||
<th style="width:150px;">'.$this->l('Author').'</th>
|
||||
<th style="width:550px;">'.$this->l('Comment').'</th>
|
||||
<th style="width:150px;">'.$this->l('Product name').'</th>
|
||||
<th style="width:30px;">'.$this->l('Actions').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
foreach ($comments AS $comment)
|
||||
$this->_html .= '<tr>
|
||||
<td><input class="noborder" type="checkbox" value="'.$comment['id_product_comment'].'" name="id_product_comment[]" /></td>
|
||||
<td>'.htmlspecialchars($comment['customer_name'], ENT_COMPAT, 'UTF-8').'.</td>
|
||||
<td>'.htmlspecialchars($comment['content'], ENT_COMPAT, 'UTF-8').'</td>
|
||||
<td>'.$comment['id_product'].' - '.htmlspecialchars($comment['name'], ENT_COMPAT, 'UTF-8').'</td>
|
||||
<td><a href="javascript:;" onclick="acceptComment(\''.(int)($comment['id_product_comment']).'\');"><img src="'.$this->_path.'img/accept.png" alt="'.$this->l('Accept').'" title="'.$this->l('Accept').'" /></a>
|
||||
<a href="javascript:;" onclick="deleteComment(\''.(int)($comment['id_product_comment']).'\');"><img src="'.$this->_path.'img/delete.png" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a></td>
|
||||
</tr>';
|
||||
$this->_html .= '
|
||||
<tr>
|
||||
<td colspan="4" style="font-weight:bold;text-align:right">'.$this->l('Selection:').'</td>
|
||||
<td><a href="javascript:;" onclick="acceptComment(0);"><img src="'.$this->_path.'img/accept.png" alt="'.$this->l('Accept').'" title="'.$this->l('Accept').'" /></a>
|
||||
<a href="javascript:;" onclick="deleteComment(0);"><img src="'.$this->_path.'img/delete.png" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>';
|
||||
}
|
||||
else
|
||||
$this->_html .= $this->l('No comments to validate at this time.');
|
||||
}
|
||||
$this->_html .= '</fieldset><br />';
|
||||
}
|
||||
|
||||
private function _displayFormConfigurationCriterion()
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$langs = Language::getLanguages(false);
|
||||
$id_lang_default = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
|
||||
$id_criterion = (int)Tools::getValue('editCriterion');
|
||||
$criterion = new ProductCommentCriterion((int)$id_criterion);
|
||||
$languageIds = 'criterion';
|
||||
$this->_html .= '
|
||||
<fieldset class="width2">
|
||||
<legend><img src="'.$this->_path.'img/note.png" alt="" />'.$this->l('Add a new comment criterion').'</legend>
|
||||
<p style="margin-bottom: 20px;">'.$this->l('You can define several criterions to help your customers during their review. For instance: efficiency, lightness, design.').'<br />
|
||||
<br />'.$this->l('You can add a new criterion below:').'</p>
|
||||
<form action="'.$this->_baseUrl.'" method="post" name="criterion_form">
|
||||
<label>'.$this->l('Name').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="hidden" name="id_product_comment_criterion" value="'.(int)$criterion->id.'" />';
|
||||
foreach ($langs AS $lang)
|
||||
$this->_html .= '
|
||||
<div id="criterion_'.(int)$lang['id_lang'].'" style="display: '.($lang['id_lang'] == $id_lang_default ? 'block' : 'none').'; float: left;">
|
||||
<input value="'.$criterion->name[(int)$lang['id_lang']].'" type="text" class="text" name="criterion_'.(int)$lang['id_lang'].'" />
|
||||
</div>';
|
||||
$this->_html .= $this->displayFlags($langs, (int)$id_lang_default, $languageIds, 'criterion', true);
|
||||
$this->_html .= '
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
<label for="criterion_type">'.$this->l('Apply to').'</label>
|
||||
<div class="margin-form">
|
||||
<select name="criterion_type">';
|
||||
foreach ($this->_productCommentsCriterionTypes AS $k => $type)
|
||||
$this->_html.= '<option value="'.(int)$k.'" '.($k == $criterion->id_product_comment_criterion_type ? 'selected="selected"' : '').'>'.$type.'</option>';
|
||||
$this->_html .= '</select>
|
||||
</div>
|
||||
<label>'.$this->l('Active').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="criterion_active" id="active_on" value="1" '.($criterion->active ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Enabled').'" /></label>
|
||||
<input type="radio" name="criterion_active" id="active_off" value="0" '.(!$criterion->active ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
</div>
|
||||
<div class="margin-form">
|
||||
<input type="submit" name="submitAddCriterion" value="'.(Tools::getValue('editCriterion') ? $this->l('Modify this criterion') : $this->l('Add this criterion')).'" class="button" />
|
||||
</div>
|
||||
</form>';
|
||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
$criterions = ProductCommentCriterion::getCriterions((int)$cookie->id_lang);
|
||||
if (sizeof($criterions))
|
||||
{
|
||||
$this->_html.= '<br />
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:260px;">'.$this->l('Criterion').'</th>
|
||||
<th style="width:260px;">'.$this->l('Type').'</th>
|
||||
<th style="width:50px;">'.$this->l('Status').'</th>
|
||||
<th style="width:30px;">'.$this->l('Actions').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
foreach ($criterions AS $criterion)
|
||||
{
|
||||
$this->_html .= '<tr>
|
||||
<td>'.$criterion['name'].'</td>
|
||||
<td>'.$this->_productCommentsCriterionTypes[(int)$criterion['id_product_comment_criterion_type']].'</td>
|
||||
<td style="text-align:center;"><img src="../img/admin/'.($criterion['active'] ? 'enabled' : 'disabled').'.gif" /></td>
|
||||
<td><a href="'.$this->_baseUrl.'&editCriterion='.(int)$criterion['id_product_comment_criterion'].'"><img src="../img/admin/edit.gif" alt="'.$this->l('Edit').'" /></a>
|
||||
<a href="'.$this->_baseUrl.'&deleteCriterion='.(int)$criterion['id_product_comment_criterion'].'"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /></a></td><tr>';
|
||||
}
|
||||
$this->_html .= '</tbody></table>';
|
||||
}
|
||||
$this->_html .= '</fieldset><br />';
|
||||
}
|
||||
|
||||
private function _displayFormApplicationCriterion()
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
include_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
|
||||
$criterions = ProductCommentCriterion::getCriterions((int)$cookie->id_lang, false, true);
|
||||
$id_criterion = (int)Tools::getValue('updateCriterion');
|
||||
|
||||
if ($id_criterion)
|
||||
{
|
||||
$criterion = new ProductCommentCriterion((int)$id_criterion);
|
||||
if ($criterion->id_product_comment_criterion_type == 2)
|
||||
{
|
||||
$categories = Category::getSimpleCategories((int)$cookie->id_lang);
|
||||
$criterion_categories = $criterion->getCategories();
|
||||
}
|
||||
elseif ($criterion->id_product_comment_criterion_type == 3)
|
||||
{
|
||||
$criterion_products = $criterion->getProducts();
|
||||
$products = Product::getSimpleProducts((int)$cookie->id_lang);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($criterions AS $key => $foo)
|
||||
if ($foo['id_product_comment_criterion_type'] == 1)
|
||||
unset($criterions[$key]);
|
||||
|
||||
if (sizeof($criterions))
|
||||
{
|
||||
$this->_html .= '
|
||||
<fieldset class="width2">
|
||||
<legend><img src="'.$this->_path.'img/note_go.png" alt="" title="" />'.$this->l('Manage criterions scope').'</legend>
|
||||
<p style="margin-bottom: 15px;">'.$this->l('Only criterions restricted to categories or products can be configured below:').'</p>
|
||||
<form action="'.$this->_baseUrl.'" method="post" name="product_criterion_form">
|
||||
<label>'.$this->l('Criterion').'</label>
|
||||
<div class="margin-form">
|
||||
<select name="id_product_comment_criterion" id="id_product_comment_criterion" onchange="window.location=\''.$this->_baseUrl.'&updateCriterion=\'+$(\'#id_product_comment_criterion option:selected\').val()">
|
||||
<option value="--">-- '.$this->l('Choose a criterion').' --</option>';
|
||||
foreach ($criterions AS $foo)
|
||||
$this->_html .= '<option value="'.(int)($foo['id_product_comment_criterion']).'" '.($foo['id_product_comment_criterion'] == $id_criterion ? 'selected="selected"' : '').'>'.$foo['name'].'</option>';
|
||||
$this->_html .= '</select>
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
if ($id_criterion AND $criterion->id_product_comment_criterion_type != 1)
|
||||
{
|
||||
$this->_html .='<label for="id_product_comment_criterion">'.($criterion->id_product_comment_criterion_type == 3 ? $this->l('Products') : $this->l('Categories')).'</label>
|
||||
<form action="'.$this->_baseUrl.'" method="post" name="comment_form">
|
||||
<div id="product_criterions" class="margin-form">
|
||||
<input type="hidden" name="id_criterion" id="id_criterion" value="'.(int)$id_criterion.'" />
|
||||
<br /><table class="table" border="0" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input class="noborder" type="checkbox" name="id_product[]" onclick="checkDelBoxes(this.form, \'id_product[]\', this.checked);" /></th>
|
||||
<th style="width: 30px;">'.$this->l('ID').'</th>
|
||||
<th style="width: 550px;">'.($criterion->id_product_comment_criterion_type == 3 ? $this->l('Product Name') : $this->l('Category Name')).'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
if ($criterion->id_product_comment_criterion_type == 3)
|
||||
foreach ($products AS $product)
|
||||
$this->_html .='<tr><td><input class="noborder" type="checkbox" value="'.(int)$product['id_product'].'" name="id_product[]" '.(in_array($product['id_product'], $criterion_products) ? 'checked="checked"' : '').' /></td>
|
||||
<td>'.(int)$product['id_product'].'</td><td>'.$product['name'].'</td></tr>';
|
||||
elseif ($criterion->id_product_comment_criterion_type == 2)
|
||||
foreach ($categories AS $category)
|
||||
$this->_html .='<tr><td><input class="noborder" type="checkbox" value="'.(int)$category['id_category'].'" name="id_product[]" '.(in_array($category['id_category'], $criterion_categories) ? 'checked="checked"' : '').' /></td>
|
||||
<td>'.(int)$category['id_category'].'</td><td>'.$category['name'].'</td></tr>';
|
||||
$this->_html .='</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="margin-form clear">
|
||||
<input type="submit" name="submitApplicationCriterion" value="'.$this->l('Save').'" class="button" />
|
||||
</div>
|
||||
</form>';
|
||||
}
|
||||
|
||||
$this->_html .= '</fieldset>';
|
||||
}
|
||||
}
|
||||
|
||||
public function hookProductTab($params)
|
||||
{
|
||||
global $smarty, $cookie;
|
||||
|
||||
require_once(dirname(__FILE__).'/ProductComment.php');
|
||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
|
||||
$smarty->assign(array(
|
||||
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
|
||||
'comments' => ProductComment::getByProduct((int)($_GET['id_product'])),
|
||||
'criterions' => ProductCommentCriterion::getByProduct((int)($_GET['id_product']), (int)($cookie->id_lang)),
|
||||
'nbComments' => (int)(ProductComment::getCommentNumber((int)($_GET['id_product'])))));
|
||||
|
||||
return ($this->display(__FILE__, '/tab.tpl'));
|
||||
}
|
||||
|
||||
private function _frontOfficePostProcess()
|
||||
{
|
||||
global $smarty, $cookie, $errors;
|
||||
|
||||
require_once(dirname(__FILE__).'/ProductComment.php');
|
||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
|
||||
$allow_guests = (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS');
|
||||
if (Tools::isSubmit('submitMessage') AND (empty($cookie->id_customer) === false OR ($cookie->id_guest AND $allow_guests)))
|
||||
{
|
||||
$id_guest = (!$id_customer = (int)$cookie->id_customer) ? (int)$cookie->id_guest : false;
|
||||
$customerComment = ProductComment::getByCustomer((int)(Tools::getValue('id_product')), (int)$cookie->id_customer, true, (int)$id_guest);
|
||||
|
||||
if (!$customerComment OR ($customerComment AND (strtotime($customerComment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) < time()))
|
||||
{
|
||||
$customer_name = false;
|
||||
if ($id_guest AND (!$customer_name = Tools::getValue('customer_name')))
|
||||
$errors[] = $this->l('Please fill your name');
|
||||
if (!sizeof($errors) AND Tools::getValue('content'))
|
||||
{
|
||||
$comment = new ProductComment();
|
||||
$comment->content = strip_tags(Tools::getValue('content'));
|
||||
$comment->id_product = (int)$_GET['id_product'];
|
||||
$comment->id_customer = (int)$cookie->id_customer;
|
||||
$comment->id_guest = (int)$id_guest;
|
||||
$comment->customer_name = pSQL($customer_name);
|
||||
$comment->title = pSQL(Tools::getValue('title'));
|
||||
$comment->grade = 0;
|
||||
$comment->validate = 0;
|
||||
|
||||
if (!$comment->content)
|
||||
$errors[] = $this->l('Invalid comment text posted.');
|
||||
else
|
||||
{
|
||||
$comment->save();
|
||||
for ($i = 1, $grade = 0; isset($_POST[$i.'_grade']) === true; ++$i)
|
||||
{
|
||||
$cgrade = (int)Tools::getValue($i.'_grade');
|
||||
$grade += $cgrade;
|
||||
$productCommentCriterion = new ProductCommentCriterion((int)Tools::getValue('id_product_comment_criterion_'.$i));
|
||||
if ($productCommentCriterion->id)
|
||||
$productCommentCriterion->addGrade($comment->id, $cgrade);
|
||||
}
|
||||
if (($i - 1) > 0)
|
||||
$comment->grade = ($grade / ($i - 1));
|
||||
if (!$comment->save())
|
||||
$errors[] = $this->l('An error occurred while saving your comment.');
|
||||
else
|
||||
$smarty->assign('confirmation', $this->l('Comment posted.').((int)(Configuration::get('PRODUCT_COMMENTS_MODERATE')) ? ' '.$this->l('Awaiting moderator validation.') : ''));
|
||||
}
|
||||
}
|
||||
else
|
||||
$errors[] = $this->l('Comment text is required.');
|
||||
}
|
||||
else
|
||||
$errors[] = $this->l('You should wait').' '.Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME').' '.$this->l('seconds before posting a new comment');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookProductTabContent($params)
|
||||
{
|
||||
global $smarty, $cookie;
|
||||
|
||||
$id_guest = (!$id_customer = (int)$cookie->id_customer) ? (int)$cookie->id_guest : false;
|
||||
$customerComment = ProductComment::getByCustomer((int)(Tools::getValue('id_product')), (int)$cookie->id_customer, true, (int)$id_guest);
|
||||
|
||||
$averages = ProductComment::getAveragesByProduct((int)Tools::getValue('id_product'), (int)$cookie->id_lang);
|
||||
$averageTotal = 0;
|
||||
foreach ($averages AS $average)
|
||||
$averageTotal += (float)($average);
|
||||
$averageTotal = count($averages) ? ($averageTotal / count($averages)) : 0;
|
||||
|
||||
$smarty->assign(array(
|
||||
'logged' => (int)$cookie->id_customer,
|
||||
'action_url' => '',
|
||||
'comments' => ProductComment::getByProduct((int)Tools::getValue('id_product')),
|
||||
'criterions' => ProductCommentCriterion::getByProduct((int)Tools::getValue('id_product'), (int)$cookie->id_lang),
|
||||
'averages' => $averages,
|
||||
'product_comment_path' => $this->_path,
|
||||
'averageTotal' => $averageTotal,
|
||||
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
|
||||
'too_early' => ($customerComment AND (strtotime($customerComment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) > time()),
|
||||
'delay' => Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')));
|
||||
|
||||
$controller = new FrontController();
|
||||
$controller->pagination((int)ProductComment::getCommentNumber((int)Tools::getValue('id_product')));
|
||||
|
||||
return ($this->display(__FILE__, '/productcomments.tpl'));
|
||||
}
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
$this->_frontOfficePostProcess();
|
||||
}
|
||||
|
||||
public function hookExtraProductComparison($params)
|
||||
{
|
||||
global $smarty, $cookie;
|
||||
|
||||
$list_grades = array();
|
||||
$list_product_grades = array();
|
||||
$list_product_average = array();
|
||||
$list_product_comment = array();
|
||||
|
||||
foreach ($params['list_ids_product'] AS $id_product)
|
||||
{
|
||||
$grades = ProductComment::getAveragesByProduct((int)$id_product, (int)$cookie->id_lang);
|
||||
$criterions = ProductCommentCriterion::getByProduct((int)$id_product, (int)$cookie->id_lang);
|
||||
$grade_total = 0;
|
||||
if (sizeof($grades) > 0)
|
||||
{
|
||||
foreach ($criterions AS $criterion)
|
||||
{
|
||||
$list_product_grades[$criterion['id_product_comment_criterion']][$id_product] = $grades[$criterion['id_product_comment_criterion']];
|
||||
$grade_total += (float)($grades[$criterion['id_product_comment_criterion']]);
|
||||
|
||||
if (!array_key_exists($criterion['id_product_comment_criterion'], $list_grades))
|
||||
$list_grades[$criterion['id_product_comment_criterion']] = $criterion['name'];
|
||||
}
|
||||
|
||||
$list_product_average[$id_product] = $grade_total / sizeof($criterion);
|
||||
$list_product_comment[$id_product] = ProductComment::getByProduct($id_product, 0, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($list_grades) < 1)
|
||||
return false;
|
||||
|
||||
$smarty->assign(array('grades' => $list_grades, 'product_grades' => $list_product_grades, 'list_ids_product' => $params['list_ids_product'],
|
||||
'list_product_average' => $list_product_average, 'product_comments' => $list_product_comment));
|
||||
|
||||
return $this->display(__FILE__,'/products-comparison.tpl');
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<div id="idTab5">
|
||||
<script type="text/javascript" src="{$module_dir}js/jquery.rating.pack.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){literal}{{/literal} $('input[@type=radio].star').rating(); {literal}}{/literal});
|
||||
$(function(){literal}{{/literal}
|
||||
$('.auto-submit-star').rating({literal}{{/literal}
|
||||
callback: function(value, link){literal}{{/literal}
|
||||
{literal}}{/literal}
|
||||
{literal}}{/literal});
|
||||
{literal}}{/literal});
|
||||
|
||||
//close comment form
|
||||
function closeCommentForm(){ldelim}
|
||||
$('#sendComment').slideUp('fast');
|
||||
$('input#addCommentButton').fadeIn('slow');
|
||||
{rdelim}
|
||||
</script>
|
||||
{if $comments}
|
||||
{if $criterions|@count > 0}
|
||||
<h2>{l s='Average grade' mod='productcomments'}</h2>
|
||||
<div style="float: left">
|
||||
{l s='Average' mod='productcomments'}:<br />
|
||||
{section loop=6 step=1 start=1 name=average}
|
||||
<input class="auto-submit-star" disabled="disabled" type="radio" name="average" {if $averageTotal|round neq 0 and $smarty.section.average.index eq $averageTotal|round}checked="checked"{/if} />
|
||||
{/section}
|
||||
</div>
|
||||
<div style="float: left; margin-left: 40px; width: 400px">
|
||||
{foreach from=$criterions item=c}
|
||||
<div style="float: left; margin-left: 20px; margin-bottom: 10px;">
|
||||
{$c.name|escape:'html':'UTF-8'}<br />
|
||||
{section loop=6 step=1 start=1 name=average}
|
||||
<input class="auto-submit-star" disabled="disabled" type="radio" name="{$c.name|escape:'html':'UTF-8'}_{$smarty.section.average.index}" value="{$smarty.section.average.index}" {if isset($averages[$c.id_product_comment_criterion]) AND $averages[$c.id_product_comment_criterion]|round neq 0 AND $smarty.section.average.index eq $averages[$c.id_product_comment_criterion]|round}checked="checked"{/if} />
|
||||
{/section}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="clear table_block">
|
||||
<table class="std" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="first_item" style="width:80px;">{l s='From' mod='productcomments'}</th>
|
||||
<th class="item">{l s='Title' mod='productcomments'}</th>
|
||||
<th class="item">{l s='Comment' mod='productcomments'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$comments item=comment}
|
||||
{if $comment.content}
|
||||
<tr>
|
||||
<td style="vertical-align:top">
|
||||
{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}
|
||||
{$comment.customer_name|escape:'html':'UTF-8'}.
|
||||
</td>
|
||||
<td style="vertical-align:top">
|
||||
{$comment.title}
|
||||
</td>
|
||||
<td style="vertical-align: top">
|
||||
{$comment.content|escape:'html':'UTF-8'|nl2br}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{else}
|
||||
<p class="align_center">{l s='No customer comments for the moment.' mod='productcomments'}</p>
|
||||
{/if}
|
||||
|
||||
{if $too_early == true}
|
||||
<p class="align_center">{l s='You should wait' mod='productcomments'} {$delay} {l s='second(s) before posting a new comment' mod='productcomments'}</p>
|
||||
{elseif $cookie->isLogged() == true || $allow_guests == true}
|
||||
<p class="align_center"><input style="margin:auto;" class="button_large" type="button" id="addCommentButton" value="{l s='Add a comment' mod='productcomments'}" onclick="$('#sendComment').slideDown('slow');$(this).slideUp('slow');" /></p>
|
||||
<form action="{$action_url}" method="post" class="std" id="sendComment" style="display:none;">
|
||||
<fieldset>
|
||||
<p class="align_right"><a href="javascript:closeCommentForm()">X</a></p>
|
||||
<p class="bold">{l s='Add a comment' mod='productcomments'}</p>
|
||||
{if $criterions|@count > 0}
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
{section loop=$criterions name=i start=0 step=1}
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="hidden" name="id_product_comment_criterion_{$smarty.section.i.iteration}" value="{$criterions[i].id_product_comment_criterion|intval}" />
|
||||
{$criterions[i].name|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input class="star" type="radio" name="{$smarty.section.i.iteration}_grade" id="{$smarty.section.i.iteration}_grade" value="1" />
|
||||
<input class="star" type="radio" name="{$smarty.section.i.iteration}_grade" value="2" />
|
||||
<input class="star" type="radio" name="{$smarty.section.i.iteration}_grade" value="3" checked="checked" />
|
||||
<input class="star" type="radio" name="{$smarty.section.i.iteration}_grade" value="4" />
|
||||
<input class="star" type="radio" name="{$smarty.section.i.iteration}_grade" value="5" />
|
||||
</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
{/if}
|
||||
{if $allow_guests == true && $cookie->isLogged() == false}<p><label for="customer_name">{l s='Your name:' mod='productcomments'}</label><input type="text" name="customer_name" id="customer_name" /></p>{/if}
|
||||
<p><label for="comment_title">{l s='Title:' mod='productcomments'}</label><input type="text" name="title" id="comment_title" /></p>
|
||||
<p><label for="content">{l s='Comment:' mod='productcomments'}</label><textarea cols="46" rows="5" name="content" id="content"></textarea></p>
|
||||
<p class="submit">
|
||||
<input class="button" name="submitMessage" value="{l s='Send' mod='productcomments'}" type="submit" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
{else}
|
||||
<p class="align_center">{l s='Only registered users can post a new comment.' mod='productcomments'}</p>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../../classes/Validate.php');
|
||||
require_once(dirname(__FILE__).'/../../classes/Db.php');
|
||||
require_once(dirname(__FILE__).'/../../classes/Tools.php');
|
||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||
|
||||
if (empty($_GET['id_lang']) === false &&
|
||||
isset($_GET['id_product']) === true)
|
||||
{
|
||||
$criterions = ProductCommentCriterion::get($_GET['id_lang']);
|
||||
if ((int)($_GET['id_product']))
|
||||
$selects = ProductCommentCriterion::getByProduct($_GET['id_product'], $_GET['id_lang']);
|
||||
echo '<select name="id_product_comment_criterion[]" id="id_product_comment_criterion" multiple="true" style="height:100px;width:360px;">';
|
||||
foreach ($criterions as $criterion)
|
||||
{
|
||||
echo '<option value="'.(int)($criterion['id_product_comment_criterion']).'"';
|
||||
if (isset($selects) === true && sizeof($selects))
|
||||
{
|
||||
foreach ($selects as $select)
|
||||
if ($select['id_product_comment_criterion'] == $criterion['id_product_comment_criterion'])
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>'.htmlspecialchars($criterion['name'], ENT_COMPAT, 'UTF-8').'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript" src="{$module_dir}js/products-comparison.js"></script>
|
||||
<script type="text/javascript" src="{$module_dir}js/jquery.rating.pack.js"></script>
|
||||
<script type="text/javascript" src="{$smarty.const._PS_JS_DIR_}jquery/jquery.cluetip.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){literal}{{/literal} $('input[@type=radio].star').rating(); {literal}}{/literal});
|
||||
$(function(){literal}{{/literal}
|
||||
$('.auto-submit-star').rating({literal}{{/literal}
|
||||
callback: function(value, link){literal}{{/literal}
|
||||
{literal}}{/literal}
|
||||
{literal}}{/literal});
|
||||
{literal}}{/literal});
|
||||
|
||||
//close comment form
|
||||
function closeCommentForm(){ldelim}
|
||||
$('#sendComment').slideUp('fast');
|
||||
$('input#addCommentButton').fadeIn('slow');
|
||||
{rdelim}
|
||||
</script>
|
||||
|
||||
<tr class="comparison_header">
|
||||
<td>
|
||||
{l s='Comments' mod='productcomments'}
|
||||
</td>
|
||||
{section loop=$list_ids_product|count step=1 start=0 name=td}
|
||||
<td></td>
|
||||
{/section}
|
||||
</tr>
|
||||
|
||||
{foreach from=$grades item=grade key=grade_id}
|
||||
<tr>
|
||||
{cycle values='comparison_feature_odd,comparison_feature_even' assign='classname'}
|
||||
<td class="{$classname}">
|
||||
{$grade}
|
||||
</td>
|
||||
|
||||
{foreach from=$list_ids_product item=id_product}
|
||||
{assign var='tab_grade' value=$product_grades[$grade_id]}
|
||||
<td width="{$width}%" class="{$classname} comparison_infos ajax_block_product" align="center">
|
||||
{if isset($tab_grade[$id_product]) AND $tab_grade[$id_product]}
|
||||
{section loop=6 step=1 start=1 name=average}
|
||||
<input class="auto-submit-star" disabled="disabled" type="radio" name="{$grade_id}_{$product_id}_{$smarty.section.average.index}" {if isset($tab_grade[$id_product]) AND $tab_grade[$id_product]|round neq 0 and $smarty.section.average.index eq $tab_grade[$id_product]|round}checked="checked"{/if} />
|
||||
{/section}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
{cycle values='comparison_feature_odd,comparison_feature_even' assign='classname'}
|
||||
<tr>
|
||||
<td class="{$classname} comparison_infos">{l s='Average' mod='productcomments'}</td>
|
||||
{foreach from=$list_ids_product item=id_product}
|
||||
<td width="{$width}%" class="{$classname} comparison_infos" align="center" >
|
||||
{if isset($list_product_average[$id_product]) AND $list_product_average[$id_product]}
|
||||
{section loop=6 step=1 start=1 name=average}
|
||||
<input class="auto-submit-star" disabled="disabled" type="radio" name="average_{$id_product}" {if $list_product_average[$id_product]|round neq 0 and $smarty.section.average.index eq $list_product_average[$id_product]|round}checked="checked"{/if} />
|
||||
{/section}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="{$classname} comparison_infos"> </td>
|
||||
{foreach from=$list_ids_product item=id_product}
|
||||
<td width="{$width}%" class="{$classname} comparison_infos" align="center" >
|
||||
{if isset($product_comments[$id_product]) AND $product_comments[$id_product]}
|
||||
<a href="#" rel="#comments_{$id_product}" class="cluetip">{l s='view comments' mod='productcomments'}</a>
|
||||
<div style="display:none" id="comments_{$id_product}">
|
||||
{foreach from=$product_comments[$id_product] item=comment}
|
||||
<div class="comment">
|
||||
<div class="customer_name">
|
||||
{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}
|
||||
{$comment.firstname|escape:'html':'UTF-8'} {$comment.lastname|truncate:30:'...'|escape:'htmlall':'UTF-8'}.
|
||||
</div>
|
||||
{$comment.content|escape:'html':'UTF-8'|nl2br}
|
||||
</div>
|
||||
<br />
|
||||
{/foreach}
|
||||
</div>
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
@@ -1,27 +0,0 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<li><a href="#idTab5" class="idTabHrefShort">{l s='Comments' mod='productcomments'} ({$nbComments})</a></li>
|
||||