--- loncom/interface/lonfeedback.pm 2012/01/07 03:01:11 1.327
+++ loncom/interface/lonfeedback.pm 2012/01/10 20:06:07 1.334
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.327 2012/01/07 03:01:11 www Exp $
+# $Id: lonfeedback.pm,v 1.334 2012/01/10 20:06:07 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -759,7 +759,7 @@ END
sub discussion_link {
- my ($ressymb,$linktext,$cmd,$item,$flag,$prev,$adds)=@_;
+ my ($ressymb,$linktext,$cmd,$item,$flag,$prev,$adds,$title)=@_;
my $link='/adm/feedback?inhibitmenu=yes&modal=yes&'.$cmd.'='.&escape($ressymb).':::'.$item;
if ($flag) { $link .= '&previous='.$prev; }
if ($adds) { $link .= $adds; }
@@ -769,7 +769,7 @@ sub discussion_link {
$width=300;
$height=200;
}
- return &Apache::loncommon::modal_link($link,$linktext,$width,$height);
+ return &Apache::loncommon::modal_link($link,$linktext,$width,$height,undef,undef,$title);
}
@@ -787,10 +787,12 @@ sub send_feedback_link {
sub send_message_link {
my ($ressymb) = @_;
my $output = '
+
$lt{'note'}
-$lt{'title'}:
+$lt{'title'}:
ENDDISCUSS
if ($env{'form.origpage'}) {
@@ -1017,7 +1019,6 @@ sub build_posting_display {
my $twoplus=$ave+2.*$stddev;
my $oneminus=$ave-$stddev;
my $twominus=$ave-2.*$stddev;
-# &Apache::lonnet::logthis(join(',',@theselikes)." Ave $ave StdDev $stddev $twominus $oneminus $oneplus $twoplus");
#
# This is now the real loop. Go through all entries, pick up what we need
#
@@ -1154,18 +1155,12 @@ sub build_posting_display {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
if ($outputtarget ne 'tex') {
- unless ($likes{$symb.':'.$idx.':likers'}=~/\,\Q$thisuser\E\,/) {
- $sender.=' '.&discussion_link($symb,&mt('Like'),'like',$idx,$$newpostsflag,$prevread,&group_args($group));
- }
- unless ($likes{$symb.':'.$idx.':unlikers'}=~/\,\Q$thisuser\E\,/) {
- $sender.=' '.&discussion_link($symb,&mt('Unlike'),'unlike',$idx,$$newpostsflag,$prevread,&group_args($group));
- }
- my $thislikes=$likes{$symb.':'.$idx.':likes'};
- if ($thislikes>0) {
- $sender.=' ('.&mt("[_1] likes",$thislikes).')';
- } elsif ($thislikes<0) {
- $sender.=' ('.&mt("[_1] unlikes",abs($thislikes)).')';
+# Add karma stars
+ my $karma=&userkarma($contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'});
+ for (my $i=1;$i<=$karma;$i++) {
+ $sender.='';
}
+# Can people edit this?
if (&editing_allowed($escsymb.':::'.$idx,$group)) {
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
$sender.=' '.
@@ -1361,13 +1356,32 @@ sub build_posting_display {
} elsif ($thislikes<$oneminus) {
$likesize="75";
}
+# Actually glue in the message itself
$$discussionitems[$idx].= '
'. "'; +# Put in the like and unlike buttons + unless ($likes{$symb.':'.$idx.':likers'}=~/\,\Q$thisuser\E\,/) { + $$discussionitems[$idx].=' '.&discussion_link($symb,'','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting")); + } else { + $$discussionitems[$idx].=''; + } + unless ($likes{$symb.':'.$idx.':unlikers'}=~/\,\Q$thisuser\E\,/) { + $$discussionitems[$idx].=' '.&discussion_link($symb,'',,'unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting")); + } else { + $$discussionitems[$idx].=''; + } + my $thislikes=$likes{$symb.':'.$idx.':likes'}; + if ($thislikes>0) { + $$discussionitems[$idx].=' ('.&mt("[_1] likes",$thislikes).')'; + } elsif ($thislikes<0) { + $$discussionitems[$idx].=' ('.&mt("[_1] unlikes",abs($thislikes)).')'; + } +# If there is any history to this post, inform the reader if ($contrib{$idx.':history'}) { my @postversions = (); - $$discussionitems[$idx] .= &mt('This post has been edited by the author.'); + $$discussionitems[$idx] .= ' '.&mt('This post has been edited by the author.'); if ($seeid) { $$discussionitems[$idx] .= ' '. &discussion_link($symb,&mt('Display all versions'),'allversions',$idx,$$newpostsflag,$prevread,&group_args($group)); @@ -2681,7 +2695,7 @@ sub no_redirect_back { 'add_entries' => \%onload,); if ($feedurl !~ m{^/adm/feedback}) { - $body_options{'rediect'} = [2,$feedurl]; + $body_options{'redirect'} = [2,$feedurl]; } my $start_page= &Apache::loncommon::start_page('Feedback not sent',undef, @@ -2723,8 +2737,8 @@ sub screen_header { unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) { $msgoptions= - ''; + '". $message. '