--- loncom/interface/lonfeedback.pm 2012/01/06 19:18:11 1.325
+++ loncom/interface/lonfeedback.pm 2012/01/10 14:52:57 1.333
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.325 2012/01/06 19:18:11 www Exp $
+# $Id: lonfeedback.pm,v 1.333 2012/01/10 14:52:57 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 = ''.
- ' '.&mt('Send Feedback').'';
+ &discussion_link($ressymb,
+ ''.&mt('Send Feedback').'',
+ 'sendmessageonly').
+ '';
return $output;
}
@@ -827,7 +829,17 @@ sub action_links_bar {
$discussion .= '&previous='.$prevread;
}
$discussion .= &group_args($group);
- $discussion .= '">'.&mt('Export').'';
+ $discussion .= '">'.&mt('Export').'';
+ if (&Apache::lonnet::allowed('rin',$env{'request.course.id'})) {
+ $discussion .= ' ';
+ $discussion .=''.&mt('Undelete all deleted entries').'';
+ }
+ $discussion.='';
if ($newpostsflag) {
if (!$markondisp) {
$discussion .='
-
+
$lt{'note'}
-$lt{'title'}:
+$lt{'title'}:
ENDDISCUSS
if ($env{'form.origpage'}) {
@@ -1002,7 +1014,11 @@ sub build_posting_display {
$stddev=sqrt($sumsq/$num);
}
# Now we know the average likes $ave and the standard deviation $stddev
-# &Apache::lonnet::logthis(join(',',@theselikes)." Ave $ave StdDev $stddev");
+# Get the boundaries for markup
+ my $oneplus=$ave+$stddev;
+ my $twoplus=$ave+2.*$stddev;
+ my $oneminus=$ave-$stddev;
+ my $twominus=$ave-2.*$stddev;
#
# This is now the real loop. Go through all entries, pick up what we need
#
@@ -1139,11 +1155,15 @@ sub build_posting_display {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
if ($outputtarget ne 'tex') {
+ my $karma=&userkarma($contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'});
+ for (my $i=1;$i<=$karma;$i++) {
+ $sender.='';
+ }
unless ($likes{$symb.':'.$idx.':likers'}=~/\,\Q$thisuser\E\,/) {
- $sender.=' '.&discussion_link($symb,&mt('Like'),'like',$idx,$$newpostsflag,$prevread,&group_args($group));
+ $sender.=' '.&discussion_link($symb,'','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting"));
}
unless ($likes{$symb.':'.$idx.':unlikers'}=~/\,\Q$thisuser\E\,/) {
- $sender.=' '.&discussion_link($symb,&mt('Unlike'),'unlike',$idx,$$newpostsflag,$prevread,&group_args($group));
+ $sender.=' '.&discussion_link($symb,'',,'unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting"));
}
my $thislikes=$likes{$symb.':'.$idx.':likes'};
if ($thislikes>0) {
@@ -1333,8 +1353,23 @@ sub build_posting_display {
if ($$dischash{$toggkey}) {
$$discussionitems[$idx].=' '.$ctlink;
}
+# Figure out size based on likes
+ my $thislikes=$likes{$symb.':'.$idx.':likes'};
+ my $likesize="100";
+ if ($thislikes>$twoplus) {
+ $likesize="200";
+ } elsif ($thislikes>$oneplus) {
+ $likesize="150";
+ }
+ if ($thislikes<$twominus) {
+ $likesize="50";
+ } elsif ($thislikes<$oneminus) {
+ $likesize="75";
+ }
$$discussionitems[$idx].= '
'.
- $message.'
';
+ "
".
+ $message.
+ '
';
if ($contrib{$idx.':history'}) {
my @postversions = ();
$$discussionitems[$idx] .= &mt('This post has been edited by the author.');
@@ -2651,7 +2686,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,
@@ -2693,8 +2728,8 @@ sub screen_header {
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) {
$msgoptions=
- '';
+ ' ';
}
my %optionhash=();
foreach my $type ('question','comment','policy') {
@@ -2702,20 +2737,20 @@ sub screen_header {
}
if (&feedback_available(1)) {
$msgoptions.=
- '';
+ ' ';
}
if (&feedback_available(0,1)) {
$msgoptions.=
- '';
+ ' ';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
- '