--- loncom/interface/lonfeedback.pm 2004/07/28 18:50:26 1.108 +++ loncom/interface/lonfeedback.pm 2004/07/29 18:21:44 1.109 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.108 2004/07/28 18:50:26 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.109 2004/07/29 18:21:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -508,11 +508,15 @@ sub list_discussion { $discussionitems[$idx] .= '  '. ''.$subject.'  '. $sender.' '.$vgrlink.' ('. - localtime($posttime).')'. + &Apache::lonlocal::locallocaltime($posttime).')'. '
'.$message.'

'; if ($contrib{$idx.':history'}) { my @postversions = (); - $discussionitems[$idx] .= '
'.&mt('This post has been edited by the author.').'
'.&mt('Earlier version(s) were posted on: '); + $discussionitems[$idx] .= '
'.&mt('This post has been edited by the author.'); + if ($seeid) { + $discussionitems[$idx] .= '  '.&mt('Display all versions').''; + } + $discussionitems[$idx].='
'.&mt('Earlier version(s) were posted on: '); if ($contrib{$idx.':history'} =~ m/:/) { @postversions = split/:/,$contrib{$idx.':history'}; } else { @@ -522,7 +526,6 @@ sub list_discussion { my $version = $i+1; $discussionitems[$idx] .= ''.$version.'. - '.&Apache::lonlocal::locallocaltime($postversions[$i]).' '; } - $discussionitems[$idx] .= '
'; } } } @@ -2254,7 +2257,97 @@ sub handler { # --------------------------- Get query string for limited number of parameters &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','threadedon','threadedoff','onlyunread','allposts','previous','markread','markonread','markondisp','modifydisp','changes','navmaps','navurl','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold']); + ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','threadedon','threadedoff','onlyunread','allposts','previous','markread','markonread','markondisp','modifydisp','changes','navmaps','navurl','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions']); + if ($ENV{'form.allversions'}) { + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + my $bodytag=&Apache::loncommon::bodytag('Discussion Post Versions', + '',''); + $r->print (< + +Post Versions + + +$bodytag +END + my $crs='/'.$ENV{'request.course.id'}; + if ($ENV{'request.course.sec'}) { + $crs.='_'.$ENV{'request.course.sec'}; + } + $crs=~s/\_/\//g; + my $seeid=&Apache::lonnet::allowed('rin',$crs); + my ($symb,$idx)=split(/\:\:\:/,$ENV{'form.allversions'}); + my $ressymb=$symb; + unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) { + $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|; + } + if ($idx > 0) { + my %contrib=&Apache::lonnet::restore($ressymb,$ENV{'request.course.id'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + if ($contrib{$idx.':history'}) { + my $attachmenturls = $contrib{$idx.':attachmenturl'}; + my @postversions = (); + if ($contrib{$idx.':history'} =~ m/:/) { + @postversions = split/:/,$contrib{$idx.':history'}; + } else { + @postversions = ("$contrib{$idx.':history'}"); + } + if (@postversions > 0) { + push @postversions,$contrib{$idx.':timestamp'}; + my $screenname=&Apache::loncommon::screenname( + $contrib{$idx.':sendername'}, + $contrib{$idx.':senderdomain'}); + my $plainname=&Apache::loncommon::nickname( + $contrib{$idx.':sendername'}, + $contrib{$idx.':senderdomain'}); + my $sender=&Apache::loncommon::aboutmewrapper( + $plainname, + $contrib{$idx.':sendername'}, + $contrib{$idx.':senderdomain'}).' ('. + $contrib{$idx.':sendername'}.' at '. + $contrib{$idx.':senderdomain'}.')'; + if ($contrib{$idx.':anonymous'}) { + $sender.=' ['.&mt('anonymous').'] '.$screenname; + } + $r->print(''.$sender.'
'); + } + } + } + return OK; + } if ($ENV{'form.posterlist'}) { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header;