--- loncom/interface/lonfeedback.pm 2010/11/20 01:33:04 1.273.4.12
+++ loncom/interface/lonfeedback.pm 2009/12/07 15:46:16 1.281
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.273.4.12 2010/11/20 01:33:04 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.281 2009/12/07 15:46:16 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,22 +48,13 @@ use LONCAPA;
sub discussion_open {
my ($status,$symb)=@_;
-# Advanced roles can always discuss
if ($env{'request.role.adv'}) { return 1; }
-# Get discussion closing date
- my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb);
-# If it is defined and in the future, the instructor wants this discussion to be open
- if (defined($close) && $close ne '' && $close > time) {
- return 1;
- }
-# It was not explicitly open, check if the problem is available.
-# If the problem is not available, close the discussion
if (defined($status) &&
!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
|| $status eq 'OPEN')) {
return 0;
}
-# The problem is available, but check if the instructor explictly closed discussion
+ my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb);
if (defined($close) && $close ne '' && $close < time) {
return 0;
}
@@ -100,7 +91,7 @@ sub list_discussion {
if (not &discussion_visible($status)) {
if ($mode ne 'board') {
&Apache::lonenc::check_encrypt(\$ressymb);
- return ' '.&send_message_link($ressymb);
+ return '
'.&send_message_link($ressymb)."
";
}
}
if ($group ne '' && $mode eq 'board') {
@@ -112,9 +103,12 @@ sub list_discussion {
my ($blocked,$blocktext) =
&Apache::loncommon::blocking_status('boards');
if ($blocked) {
+ $blocktext = '
'.$blocktext."";
&Apache::lonenc::check_encrypt(\$ressymb);
if ($mode ne 'board') {
- $blocktext.=' '.&send_message_link($ressymb);
+ $blocktext.=&send_message_link($ressymb).'
';
+ }else{
+ $blocktext.="";
}
return $blocktext;
}
@@ -180,7 +174,6 @@ sub list_discussion {
my $cnum = $env{'course.'.$cid.'.num'};
my $crstype = &Apache::loncommon::course_type();
-
# Get information about students and non-students in course for filtering display of posts
my %roleshash = ();
my %roleinfo = ();
@@ -363,10 +356,10 @@ sub list_discussion {
$togglink = 'toggoff';
}
- $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink;
+ $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink;
if ($newpostsflag) {
- $chglink .= '&previous='.$prevread;
+ $chglink .= '&previous='.$prevread;
}
$chglink.=&group_args($group);
@@ -409,8 +402,8 @@ sub list_discussion {
my $manifestfilename = $tempexport.$manifest;
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
$manifestok=1;
- print $manifestfile qq|
-
+ print $manifestfile qq|
+
'.
''.&mt('Show all posts').' '.&mt('to display').' '.
@@ -537,11 +530,11 @@ imscp_v1p1.xsd http://www.imsglobal.org/
print $manifestfile "\n".
''.
- ''.$imsitems{$alldiscussion{$post}}{'title'}.'';
+ ''.$imsitems{$alldiscussion{$post}}{'title'}.'';
$imsresources .= "\n".
''."\n".
''."\n".
- $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}.''."\n".
+ $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}."\n".
'';
}
my $postingfile;
@@ -727,10 +720,9 @@ END
$attachnum += @{$currnewattach};
}
}
- if ((&discussion_open($status)) && ($outputtarget ne 'tex')) {
+ if (&discussion_open($status)) {
if (($group ne '') && ($mode eq 'board')) {
- if ((&check_group_priv($group,'pgd') eq 'ok') &&
- ($ressymb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$})) {
+ if (&check_group_priv($group,'pgd') eq 'ok') {
$discussion .=
&postingform_display($mode,$ressymb,$now,$subject,
$comment,$outputtarget,$attachnum,
@@ -738,23 +730,12 @@ END
$group,$crstype);
}
} else {
- if (&Apache::lonnet::allowed('pch',$env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
-
- $discussion.=
- &postingform_display($mode,$ressymb,$now,$subject,
- $comment,$outputtarget,$attachnum,
- $currnewattach,$currdelold,'',$crstype);
- } else {
- $discussion.= ''.
- &mt('This discussion is closed.').'';
- }
+ $discussion.=
+ &postingform_display($mode,$ressymb,$now,$subject,
+ $comment,$outputtarget,$attachnum,
+ $currnewattach,$currdelold,'',$crstype);
}
}
- if (!(&discussion_open($status)) && ($outputtarget ne 'tex')) {
- $discussion.= ''.
- &mt('This discussion is closed.').'';
- }
} else {
$discussion.='
';
if (&discussion_open($status) &&
@@ -762,21 +743,13 @@ END
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
if ($outputtarget ne 'tex') {
- $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.').'';
+ $discussion.= &send_feedback_link($ressymb,$target);
}
+ }
+ if ($outputtarget ne 'tex') {
+ $discussion.= &send_message_link($ressymb);
}
- $discussion.=&send_message_link($ressymb).'