[-] MO productcomments :
- Module was broken and works now - A message is displayed to indicate when a comment has been added. - Error li are correctly indented #PNM-753 #PNM-1601 #PNM-1660 #PNM-1609 #PNM-1491 #PNM-1311 #PNM-1233 #PNM-1232 #PNM-937 #PNM-775
This commit is contained in:
@@ -322,6 +322,7 @@ function fancyChooseBox(question, title, buttons, otherParams)
|
|||||||
for (var caption in buttons) {
|
for (var caption in buttons) {
|
||||||
if (!buttons.hasOwnProperty(caption)) continue;
|
if (!buttons.hasOwnProperty(caption)) continue;
|
||||||
funcName = buttons[caption];
|
funcName = buttons[caption];
|
||||||
|
if (typeof otherParams == 'undefined') otherParams = 0;
|
||||||
otherParams = escape(JSON.stringify(otherParams));
|
otherParams = escape(JSON.stringify(otherParams));
|
||||||
action = funcName ? "$.fancybox.close();window['" + funcName + "'](JSON.parse(unescape('" + otherParams + "')), " + i + ")" : "$.fancybox.close()";
|
action = funcName ? "$.fancybox.close();window['" + funcName + "'](JSON.parse(unescape('" + otherParams + "')), " + i + ")" : "$.fancybox.close()";
|
||||||
msg += '<input class="button" style="margin-right: 5px" type="button" value="' + caption + '" onclick="' + action + '" />';
|
msg += '<input class="button" style="margin-right: 5px" type="button" value="' + caption + '" onclick="' + action + '" />';
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// Form element
|
// Form element
|
||||||
|
|
||||||
url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
|
url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
|
url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
|
||||||
data: $('#fancybox-content form').serialize(),
|
data: $('#id_new_comment_form').serialize(),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
headers: { "cache-control": "no-cache" },
|
headers: { "cache-control": "no-cache" },
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@@ -68,7 +68,9 @@ $(function() {
|
|||||||
if (data.result)
|
if (data.result)
|
||||||
{
|
{
|
||||||
$.fancybox.close();
|
$.fancybox.close();
|
||||||
document.location.href = document.location.href;
|
var buttons = {};
|
||||||
|
buttons[productcomment_ok] = "productcommentRefreshPage";
|
||||||
|
fancyChooseBox(productcomment_added, productcomment_title, buttons);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -83,3 +85,7 @@ $(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function productcommentRefreshPage() {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
@@ -89,7 +89,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
<!-- Fancybox -->
|
<!-- Fancybox -->
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
<div id="new_comment_form">
|
<div id="new_comment_form">
|
||||||
<form action="#">
|
<form id="id_new_comment_form" action="#">
|
||||||
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
||||||
<div class="product clearfix">
|
<div class="product clearfix">
|
||||||
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
|
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
|
||||||
@@ -102,7 +102,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
<div class="new_comment_form_content">
|
<div class="new_comment_form_content">
|
||||||
<h2>{l s='Write your review' mod='productcomments'}</h2>
|
<h2>{l s='Write your review' mod='productcomments'}</h2>
|
||||||
|
|
||||||
<div id="new_comment_form_error" class="error" style="display: none;">
|
<div id="new_comment_form_error" class="error" style="display: none; padding: 15px 25px">
|
||||||
<ul></ul>
|
<ul></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div id="new_comment_form_footer">
|
<div id="new_comment_form_footer">
|
||||||
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}'></input>
|
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}' />
|
||||||
<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>
|
<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>
|
||||||
<p class="fr">
|
<p class="fr">
|
||||||
<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>
|
<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ var productcomments_controller_url = '{$productcomments_controller_url}';
|
|||||||
var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}";
|
var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}";
|
||||||
var secure_key = "{$secure_key}";
|
var secure_key = "{$secure_key}";
|
||||||
var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
||||||
|
var productcomment_added = '{l s='Your comment has been added !' mod='productcomments'}';
|
||||||
|
var productcomment_title = '{l s='New comment' mod='productcomments'}';
|
||||||
|
var productcomment_ok = '{l s='OK' mod='productcomments'}';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="idTab5">
|
<div id="idTab5">
|
||||||
@@ -89,7 +92,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
<!-- Fancybox -->
|
<!-- Fancybox -->
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
<div id="new_comment_form">
|
<div id="new_comment_form">
|
||||||
<form action="#">
|
<form id="id_new_comment_form" action="#">
|
||||||
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
||||||
<div class="product clearfix">
|
<div class="product clearfix">
|
||||||
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
|
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
|
||||||
|
|||||||
Reference in New Issue
Block a user