--- loncom/interface/lonfeedback.pm 2012/03/13 05:37:49 1.339
+++ loncom/interface/lonfeedback.pm 2012/03/16 02:59:01 1.346
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.339 2012/03/13 05:37:49 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.346 2012/03/16 02:59:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1333,14 +1333,15 @@ sub build_posting_display {
} else {
if ($message) {
my $spansize = 2;
+ my ($uname,$udom);
if ($showonlyunread && $prevread > $posttime) {
$$notshown{$idx} = 1;
} elsif ($showunmark && $$dischash{$readkey}=~/\.$idx\./) {
$$notshown{$idx} = 1;
} else {
# apply filters
- my $uname = $contrib{$idx.':sendername'};
- my $udom = $contrib{$idx.':senderdomain'};
+ $uname = $contrib{$idx.':sendername'};
+ $udom = $contrib{$idx.':senderdomain'};
my $poster = $uname.':'.$udom;
if ($env{'form.totposters'} ne '') {
if ($totposters == 0) {
@@ -1424,15 +1425,23 @@ sub build_posting_display {
'';
if ($canvote) {
# Put in the like and unlike buttons
- if ($userlikes{$idx}) {
- $$discussionitems[$idx].='';
+ if (($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) {
+ my $novote = &mt('No voting for your own posts');
+ $$discussionitems[$idx].=
+ ''.
+ ' '.
+ '';
} else {
- $$discussionitems[$idx].=' '.&discussion_link($symb,'','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting"));
- }
- if ($userunlikes{$idx}) {
- $$discussionitems[$idx].='';
- } else {
- $$discussionitems[$idx].=' '.&discussion_link($symb,'','unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting"));
+ if ($userlikes{$idx}) {
+ $$discussionitems[$idx].='';
+ } else {
+ $$discussionitems[$idx].=' '.&discussion_link($symb,'','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting"));
+ }
+ if ($userunlikes{$idx}) {
+ $$discussionitems[$idx].='';
+ } else {
+ $$discussionitems[$idx].=' '.&discussion_link($symb,'','unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting"));
+ }
}
}
if ($seeid || $canvote) {
@@ -1680,11 +1689,16 @@ sub mail_screen {
}
my %lt = &Apache::lonlocal::texthash(
- 'myqu' => 'My question/comment/feedback:',
+ 'myqu' => 'Question/comment/feedback:',
'title' => 'Title',
'reta' => 'Retained attachments',
'atta' => 'Attachment',
);
+ if($env{'form.editdisc'} || $env{'form.replydisc'}){
+ %lt = &Apache::lonlocal::texthash(
+ 'myqu' => 'Post Discussion',
+ );
+ }
my $restitle = &get_resource_title($caller_symb,$feedurl);
my $quote='';
my $subject = '';
@@ -1895,6 +1909,7 @@ END
}
$r->print(<