--- loncom/interface/lonfeedback.pm 2010/11/20 01:33:04 1.273.4.12
+++ loncom/interface/lonfeedback.pm 2009/11/26 05:21:43 1.280
@@ -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.280 2009/11/26 05:21:43 faziophi 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 '
- $lt{'cuse'}: | + $lt{'cuse'}:END @@ -598,7 +591,7 @@ END | - $lt{'chgt'}? + $lt{'chgt'}? |
'.&mt('NEW').' | '; } else { $$newitem{$idx} = 0; $$discussionitems[$idx] .= ' -
'; } $$discussionitems[$idx] .= ' | '. ''.$subject.' '. - $sender.' '.$vgrlink.' ('. + $sender.' '.$vgrlink.' ('. &Apache::lonlocal::locallocaltime($posttime).') | '; if ($$dischash{$toggkey}) { $$discussionitems[$idx].=''. $ctlink.' | '; } $$discussionitems[$idx].= '
'. - $message.''; + $message.''; if ($contrib{$idx.':history'}) { my @postversions = (); $$discussionitems[$idx] .= &mt('This post has been edited by the author.'); @@ -1426,9 +1397,7 @@ sub get_post_contents { my ($timesent,$attachmsg); my %currattach = (); $timesent = &Apache::lonlocal::locallocaltime($postversions[$i]); - unless (&contains_block_html($messages->{$i})) { - &newline_to_br(\$messages->{$i}); - } + &newline_to_br(\$messages->{$i}); $$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i}); $$subjects{$i}=~s/\n/\
'.&Apache::lontexconvert::msgtexconverted($quote).''; } @@ -1737,8 +1708,9 @@ $latexHelp
$lt{'title'}:
-
+
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
if ($env{'form.origpage'}) {
@@ -1760,7 +1732,6 @@ END
}
} else {
$r->print(<
$lt{'soor'} | -- | $lt{'sprs'} | -- | $lt{'spur'} | -- | $lt{'spse'} | -- | $lt{'spgr'} | -- | $lt{'psub'} | +$lt{'soor'} | ++ | $lt{'sprs'} | ++ | $lt{'spur'} | ++ | $lt{'spse'} | ++ | $lt{'spgr'} | ++ | $lt{'psub'} |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -2230,7 +2201,7 @@ $start_page
- + END if (exists($env{'form.group'})) { $r->print(''); @@ -2264,7 +2235,7 @@ sub print_showposters { my $group = $env{'form.group'}; my $ressymb = &wrap_symb($symb); if (($group ne '') && - ($ressymb =~ m|^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) { + ($ressymb =~ m|^bulletin___ \d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) { if (&check_group_priv($group,'dgp') eq 'ok') { $seeid = 1; } @@ -2353,7 +2324,7 @@ END - + $end_page END @@ -2456,7 +2427,7 @@ sub redirect_back { if ($previous > 0) { $qrystr = 'previous='.$previous; if ($feedurl =~ /\?register=1/) { - $feedurl .= '&'.$qrystr; + $feedurl .= '&'.$qrystr; } else { $feedurl .= '?'.$qrystr; } @@ -2465,14 +2436,14 @@ sub redirect_back { if (defined($sort)) { my $sortqry = 'sortposts='.$sort; if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) { - $feedurl .= '&'.$sortqry; + $feedurl .= '&'.$sortqry; } else { $feedurl .= '?'.$sortqry; } $sorttag = ''; if (defined($numpicks)) { my $userpickqry = 'totposters='.$numpicks; - $feedurl .= '&'.$userpickqry; + $feedurl .= '&'.$userpickqry; $userpicktag = ''; } else { if (ref($sectionpick) eq 'ARRAY') { @@ -2486,7 +2457,7 @@ sub redirect_back { $sectag =~ s/,$//; $sectag .= '" />'; } else { - $feedurl .= '§ionpick='.$sectionpick; + $feedurl .= '§ionpick='.$sectionpick; $sectag = ''; } if (ref($grouppick) eq 'ARRAY') { @@ -2500,7 +2471,7 @@ sub redirect_back { $grptag =~ s/,$//; $grptag .= '" />'; } else { - $feedurl .= '&grouppick='.$grouppick; + $feedurl .= '&grouppick='.$grouppick; $grptag = ''; } if (ref($rolefilter) eq 'ARRAY') { @@ -2517,7 +2488,7 @@ sub redirect_back { $feedurl .= '&rolefilter='.$rolefilter; $roletag = ''; } - $feedurl .= '&statusfilter='.$statusfilter; + $feedurl .= '&statusfilter='.$statusfilter; $statustag =''; } } @@ -2605,7 +2576,7 @@ ENDNOREDIRTWO } sub screen_header { - my ($feedurl,$symb,$group) = @_; + my ($feedurl,$symb) = @_; my $crscontent = &mt('Question/Comment/Feedback about course content'); my $crspolicy = &mt('Question/Comment/Feedback about course policy'); my $contribdisc = &mt('Contribution to course discussion of resource'); @@ -2654,25 +2625,15 @@ sub screen_header { } if (($env{'request.course.id'}) && (!$env{'form.sendmessageonly'})) { my ($blocked,$blocktext) = &Apache::loncommon::blocking_status('boards'); - my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; - my $realsymb = $symb; - if ($symb=~/^bulletin___/) { - my $filename=(&Apache::lonnet::decode_symb($symb))[2]; - $filename=~s|^adm/wrapper/||; - $realsymb=&Apache::lonnet::symbread($filename); - } - if (!$blocked && &discussion_open(undef,$realsymb) && - (&Apache::lonnet::allowed('pch', - $env{'request.course.id'}. - ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) || - (($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) { + if (!$blocked && &discussion_open(undef,$symb) && + &Apache::lonnet::allowed('pch', + $env{'request.course.id'}. + ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { $discussoptions=' '. - + $contribdisc. + ' '. ''.&mt('Change Screenname').''; my $blockblog = &Apache::loncommon::blocking_status('blogs'); if (!$blockblog) { @@ -2686,7 +2647,7 @@ sub screen_header { .$msgoptions; } if ($discussoptions) { - $discussoptions=' '
+ $discussoptions=' |