--- loncom/interface/lonfeedback.pm 2003/09/03 18:09:50 1.51 +++ loncom/interface/lonfeedback.pm 2003/10/15 20:01:48 1.62 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.51 2003/09/03 18:09:50 albertel Exp $ +# $Id: lonfeedback.pm,v 1.62 2003/10/15 20:01:48 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,6 +51,124 @@ use Apache::Constants qw(:common); use Apache::lonmsg(); use Apache::loncommon(); use Apache::lontexconvert(); +use Apache::lonlocal; + +sub list_discussion { + my ($mode,$status,$symb)=@_; + my $discussiononly=0; + if ($mode eq 'board') { $discussiononly=1; } + unless ($ENV{'request.course.id'}) { return ''; } + my $crs='/'.$ENV{'request.course.id'}; + if ($ENV{'request.course.sec'}) { + $crs.='_'.$ENV{'request.course.sec'}; + } + $crs=~s/\_/\//g; + unless ($symb) { + $symb=&Apache::lonnet::symbread(); + } + unless ($symb) { return ''; } + my $seeid=&Apache::lonnet::allowed('rin',$crs); + my $viewgrades=&Apache::lonnet::allowed('vgr',$crs); + my $discussion=''; + my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + if ($contrib{'version'}) { + unless ($discussiononly) { + $discussion.= + '
'.&mt('Attachment').': '.$fname.'.'.$ft.''; + } + if ($message) { + if ($hidden) { + $message=''.$message.''; + } + my $screenname=&Apache::loncommon::screenname( + $contrib{$idx.':sendername'}, + $contrib{$idx.':senderdomain'}); + my $plainname=&Apache::loncommon::nickname( + $contrib{$idx.':sendername'}, + $contrib{$idx.':senderdomain'}); + + my $sender=&mt('Anonymous'); + if ((!$contrib{$idx.':anonymous'}) || ($seeid)) { + $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; + } + if ($seeid) { + if ($hidden) { + $sender.=' '.&mt('Make Visible').''; + } else { + $sender.=' '.&mt('Hide').''; + } + $sender.=' '.&mt('Delete').''; + } + } else { + if ($screenname) { + $sender=''.$screenname.''; + } + } + my $vgrlink; + if ($viewgrades) { + $vgrlink=&Apache::loncommon::submlink('Submissions', + $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$symb); + } + $discussion.='
'.$sender.' '.$vgrlink.' ('. + localtime($contrib{$idx.':timestamp'}). + '):
'.$message. + ''; + } + } + } + unless ($discussiononly) { + $discussion.=''; + } + } + if ($discussiononly) { + $discussion.=(<
+Attachment (128 KB max size): +
+ +ENDDISCUSS + $discussion.=&generate_preview_button(); + } + return $discussion; +} sub mail_screen { my ($r,$feedurl,$options) = @_; @@ -193,21 +311,23 @@ sub screen_header { my $discussoptions=''; if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) { $msgoptions= - 'Feedback to resource author'; + '
'.
+ &mt('Feedback to resource author');
}
if (&feedback_available(1)) {
$msgoptions.=
- '
Question about resource content';
+ '
'.
+ &mt('Question about resource content');
}
if (&feedback_available(0,1)) {
$msgoptions.=
'
'.
- 'Question/Comment/Feedback about course content';
+ &mt('Question/Comment/Feedback about course content');
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'
'.
- 'Question/Comment/Feedback about course policy';
+ &mt('Question/Comment/Feedback about course policy');
}
if ($ENV{'request.course.id'}) {
@@ -215,15 +335,15 @@ sub screen_header {
$ENV{'request.course.id'}.
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
$discussoptions=' '.
- 'Contribution to course discussion of resource';
+ &mt('Contribution to course discussion of resource');
$discussoptions.='
'.
- 'Anonymous contribution to course discussion of resource'.
- ' (name only visible to course faculty)';
+ &mt('Anonymous contribution to course discussion of resource').
+ ' ('.&mt('name only visible to course faculty').')';
}
}
- if ($msgoptions) { $msgoptions='