Bug 8617 - Problem with display of comments waiting for moderation in OPAC
authorOwen Leonard <oleonard@myacpl.org>
Thu, 16 Aug 2012 19:19:04 +0000 (15:19 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Sat, 15 Sep 2012 05:38:18 +0000 (07:38 +0200)
This patch addresses on aspect of Bug 8617: The behavior where
live previews of edited comments are displaying on opac-detail
as a duplicate comment. We must pass the review id back to the
script when submitting so that the check for it will evaluate
as true when it should.

This patch also corrects some JavaScript for translatability.

To test, submit a comment on a title and approve it. Return to
the title and edit the comment. When you submit your revised
comment the comment pop-up window should close and your revised
comment should appear on opac-detail as "pending approval."

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt

index 6e2b974..6845f6b 100644 (file)
@@ -11,7 +11,7 @@
                        [% IF ( cgi_debug ) %]alert(_('injecting OLD comment: ')+comment);[% END %]
             parent.opener.$('#c[% reviewid %] p').prev("small").prev("h5").html(_("Your edited comment (preview, pending approval)"));
                        parent.opener.$('#c[% reviewid %] p').html(comment);
-                       parent.opener.$('#c[% reviewid %] p').append("<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&amp;reviewid=[% reviewid | uri%]\');\">Edit<\/a>");
+            parent.opener.$('#c[% reviewid %] p').append(" <a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&amp;reviewid=[% reviewid | uri%]\');\">"+_("Edit")+"<\/a>");
                        [% END %]
                        return 1;
                };
@@ -21,7 +21,7 @@
                        parent.opener.$('#newcomment').html(
                 "<h5>" + _("Your comment (preview, pending approval)") + "<\/h5>" +
                                "<p>"+comment+"<\/p>" +
-                               "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">Edit<\/a><\/p>"
+                "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">"+_("Edit")+"<\/a><\/p>"
                        );
                        parent.opener.$("#addcomment").prev("p").remove();
                        parent.opener.$("#addcomment").remove();
@@ -41,7 +41,6 @@
                                window.close();
                        [% END %]
                [% END %]
-               // $('#reviewf').submit(function() {});
        });
 //]]>
 </script>
@@ -67,6 +66,7 @@
 [% END %]
 <form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
     <input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
+    [% IF ( reviewid ) %]<input type="hidden" name="reviewid" value="[% reviewid | html%]" />[% END %]
        <fieldset class="brief">
        <legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author %][% END %]</legend>
             <ol><li><textarea id="review" name="review" cols="60" rows="8">[% review %]</textarea></li></ol>