--- loncom/interface/lonfeedback.pm 2010/08/07 19:23:50 1.297
+++ loncom/interface/lonfeedback.pm 2010/08/14 17:48:13 1.299
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.297 2010/08/07 19:23:50 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.299 2010/08/14 17:48:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -722,7 +722,7 @@ END
$attachnum += @{$currnewattach};
}
}
- if (&discussion_open($status)) {
+ if ((&discussion_open($status)) && ($outputtarget ne 'tex')) {
if (($group ne '') && ($mode eq 'board')) {
if (&check_group_priv($group,'pgd') eq 'ok') {
$discussion .=
@@ -738,24 +738,24 @@ END
$currnewattach,$currdelold,'',$crstype);
}
}
- } else {
+ } elsif ($outputtarget ne 'tex') {
$discussion.='
';
if (&discussion_open($status) &&
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- if ($outputtarget ne 'tex') {
- $discussion.= &send_feedback_link($ressymb,$target);
+ $discussion.= &send_feedback_link($ressymb,$target);
+ if ($env{'request.role.adv'}) {
+ my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
+ if (defined($close) && $close ne '' && $close < time) {
+ $discussion .= ' '.&mt('(Closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
+ }
}
} else {
- if ($outputtarget ne 'tex') {
- $discussion.= &mt('This discussion is closed.');
- }
- }
- if ($outputtarget ne 'tex') {
- $discussion.= &send_message_link($ressymb);
+ $discussion.= ''.&mt('This discussion is closed.').'';
}
- $discussion.='
';
+ $discussion.= &send_message_link($ressymb).'';
}
return $discussion;
}
@@ -835,7 +835,6 @@ sub action_links_bar {
sub postingform_display {
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
$currnewattach,$currdelold,$group,$crstype) = @_;
- if ($outputtarget eq 'tex') { return ''; }
my $newattachmsg;
my %lt = &Apache::lonlocal::texthash(
'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
@@ -1063,48 +1062,50 @@ sub build_posting_display {
} else {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
- if ((&editing_allowed($escsymb.':::'.$idx,$group)) && ($outputtarget ne 'tex')) {
- if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
- $sender.=' '.&mt('Edit').'';
+ if ($outputtarget ne 'tex') {
+ if (&editing_allowed($escsymb.':::'.$idx,$group)) {
+ if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
+ $sender.=' '.&mt('Edit').'';
- unless ($seeid) {
- my $grpargs = &group_args($group);
- $sender.=" ';
+ unless ($seeid) {
+ my $grpargs = &group_args($group);
+ $sender.=" ';
+ }
}
}
- }
- if (($seeid) && ($outputtarget ne 'tex')) {
- if ($hidden) {
- unless ($studenthidden) {
- $sender.=' ';
+ }
+ } else {
+ $sender.=' '.&mt('Make Visible').'';
- }
- } else {
- $sender.=' '.&mt('Hide').'';
- }
- my $grpargs = &group_args($group);
- $sender.=
- " ";
- $sender .= &mt('Delete').'';
+ $sender .= &group_args($group);
+ $sender .= '">'.&mt('Hide').'';
+ }
+ my $grpargs = &group_args($group);
+ $sender.=
+ " ";
+ $sender .= &mt('Delete').'';
+ }
}
- } else {
+ } else {
if ($screenname) {
$sender=''.$screenname.'';
} else {
@@ -1130,36 +1131,38 @@ sub build_posting_display {
@{$$namesort{'__anon'}{'__anon'}} = ("$idx");
}
}
- if ((&discussion_open($status)) && ($outputtarget ne 'tex')) {
- if (($group ne '') &&
- (&check_group_priv($group,'pgd') eq 'ok')) {
- $sender.=' '.&mt('Reply').'';
- } elsif (&Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.
- $env{'request.course.sec'}:''))) {
- $sender.=' '.&mt('Reply').'';
+ } elsif (&Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.
+ $env{'request.course.sec'}:''))) {
+ $sender.=' '.&mt('Reply').'';
}
- $sender .= '" '.$target.'>'.&mt('Reply').'';
}
- }
- if (($viewgrades) && ($outputtarget ne 'tex')) {
+ if ($viewgrades) {
$vgrlink=&Apache::loncommon::submlink(&mt('Submissions'),
- $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
- }
- if (($$dischash{$readkey}=~/\.$idx\./) && ($outputtarget ne 'tex')) {
- $ctlink = '';
- } else {
- $ctlink = '';
+ $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
+ }
+ if ($$dischash{$readkey}=~/\.$idx\./) {
+ $ctlink = '';
+ } else {
+ $ctlink = '';
+ }
}
}
#figure out at what position this needs to print