--- loncom/interface/lonfeedback.pm 2004/07/21 23:57:24 1.101
+++ loncom/interface/lonfeedback.pm 2004/07/23 16:56:29 1.103
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.101 2004/07/21 23:57:24 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.103 2004/07/23 16:56:29 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -222,8 +222,10 @@ sub list_discussion {
$newpostsflag = 1;
}
my $hidden=($contrib{'hidden'}=~/\.$idx\./);
+ my $studenthidden=($contrib{'studenthidden'}=~/\.$idx\./);
my $deleted=($contrib{'deleted'}=~/\.$idx\./);
my $origindex='0.';
+ my $numoldver=0;
if ($contrib{$idx.':replyto'}) {
if ( (($ENV{'environment.threadeddiscussion'}) && (($sortposts eq '') || ($sortposts eq 'ascdate'))) || ($sortposts eq 'thread')) {
# this is a follow-up message
@@ -247,13 +249,21 @@ sub list_discussion {
}
unless ((($hidden) && (!$seeid)) || ($deleted)) {
$visible++;
+ if ($contrib{$idx.':history'}) {
+ if ($contrib{$idx.':history'} =~ /:/) {
+ my @oldversions = split/:/,$contrib{$idx.':history'};
+ $numoldver = @oldversions;
+ } else {
+ $numoldver = 1;
+ }
+ }
my $message=$contrib{$idx.':message'};
$message=~s/\n/\
/g;
- $message=&Apache::lontexconvert::msgtexconverted($message);
+ $message=&Apache::lontexconvert::msgtexconverted($message,undef,$numoldver);
my $subject=$contrib{$idx.':subject'};
if (defined($subject)) {
$subject=~s/\n/\
/g;
- $subject=&Apache::lontexconvert::msgtexconverted($subject);
+ $subject=&Apache::lontexconvert::msgtexconverted($subject,undef,$numoldver);
}
if ($contrib{$idx.':attachmenturl'}) {
my ($fname)
@@ -267,6 +277,9 @@ sub list_discussion {
if ($message) {
if ($hidden) {
$message=''.$message.'';
+ if ($studenthidden) {
+ $message .='
Deleted by poster (student).';
+ }
}
my $screenname=&Apache::loncommon::screenname(
$contrib{$idx.':sendername'},
@@ -329,14 +342,29 @@ sub list_discussion {
} else {
@{$namesort{$lastname}{$firstname}} = ("$idx");
}
- if ($seeid) {
- if ($hidden) {
- $sender.=' '.&mt('Make Visible').'';
+ $sender .= '" '.$target.'>'.&mt('Edit').''; unless ($seeid) {
+ $sender.=" ';
+ }
+ }
+ }
+ if ($seeid) {
+ if ($hidden) {
+ unless ($studenthidden) {
+ $sender.=' '.&mt('Make Visible').'';
+ }
} else {
$sender.=' '.&mt('Hide').'';
}
$sender.=' - '.&Apache::lonlocal::locallocaltime($postversions[$i]).' ';
+ }
+ $discussionitems[$idx] .= '
';
+ }
}
}
}
@@ -520,6 +562,20 @@ sub list_discussion {
# Print the discusssion
if ($outputtarget ne 'tex') {
my $colspan=$maxdepth+1;
+ $discussion.= qq|
+
+ |;
$discussion.='