[Codestriker-commits] CVS update: codestriker/lib/Codestriker/Http Response.pm
Brought to you by:
sits
|
From: <si...@us...> - 2006-06-11 08:29:13
|
User: sits
Date: 06/06/11 01:29:11
Modified: . CHANGELOG
lib/Codestriker/Action SubmitNewComment.pm
lib/Codestriker/Http Response.pm
Log:
* Closed topics could still have comments added to them, by hovering
over an existing comment in the topic text view, and then clicking
the "Add Comment" link in the tooltip window. This link has now
been removed if the topic is closed.
Contributed by ed....@si....
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -r1.190 -r1.191
--- CHANGELOG 10 Jun 2006 02:58:32 -0000 1.190
+++ CHANGELOG 11 Jun 2006 08:29:11 -0000 1.191
@@ -83,6 +83,12 @@
such as Subversion.
Contributed by "Vladimir Vysotsky" <vvy...@av...>.
+* Closed topics could still have comments added to them, by hovering
+ over an existing comment in the topic text view, and then clicking
+ the "Add Comment" link in the tooltip window. This link has now
+ been removed if the topic is closed.
+ Contributed by ed....@si....
+
Version 1.9.1
* Correct problem introduced in 1.9.0 release where the email address
Index: SubmitNewComment.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewComment.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SubmitNewComment.pm 22 May 2006 23:19:05 -0000 1.11
+++ SubmitNewComment.pm 11 Jun 2006 08:29:11 -0000 1.12
@@ -61,6 +61,11 @@
# Retrieve the appropriate topic details.
my $topic = Codestriker::Model::Topic->new($topicid);
+ # Don't accept any new comments if the topic state is read only.
+ if (Codestriker::topic_readonly($topic->{topic_state})) {
+ $http_response->error("Topic state is read only");
+ }
+
# Fire the topic listener to indicate that the user has viewed the topic.
Codestriker::TopicListeners::Manager::topic_viewed($email, $topic);
Index: Response.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- Response.pm 19 May 2006 00:40:15 -0000 1.37
+++ Response.pm 11 Jun 2006 08:29:11 -0000 1.38
@@ -372,8 +372,10 @@
# Add an add comment link.
my $key = $comment_locations[$index];
$key =~ /^(\-?\d+)\|(\-?\d+)\|(\d+)$/o;
- $overlib_html .= "<a href=\"javascript:add_comment_tooltip($1,$2,$3)" .
- "; void(0);\">Add Comment<\\/a> | ";
+ if (!Codestriker::topic_readonly($topic->{topic_state})) {
+ $overlib_html .= "<a href=\"javascript:add_comment_tooltip($1,$2,$3)" .
+ "; void(0);\">Add Comment<\\/a> | ";
+ }
# Add a close link.
$overlib_html .= "<a href=\"javascript:hideElt(getElt(\\'overDiv\\')); void(0);\">Close<\\/a><p>";
|