--- loncom/interface/lonfeedback.pm 2006/12/08 20:09:29 1.232
+++ loncom/interface/lonfeedback.pm 2006/12/11 04:10:35 1.235
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.232 2006/12/08 20:09:29 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.235 2006/12/11 04:10:35 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -90,8 +90,8 @@ sub list_discussion {
}
if (not &discussion_visible($status)) {
if ($mode ne 'board') {
- my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
- return &send_message_link($encsymb);
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ return &send_message_link($ressymb);
}
}
if ($group ne '' && $mode eq 'board') {
@@ -100,12 +100,14 @@ sub list_discussion {
}
}
- my ($blocked,$blocktext) = &blocking_posts('boards',1);
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
if ($blocked) {
+ &Apache::lonenc::check_encrypt(\$ressymb);
if ($mode ne 'board') {
- my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
- return $blocktext.'
'.&send_message_link($encsymb);
+ $blocktext.='
'.&send_message_link($ressymb);
}
+ return $blocktext;
}
my @bgcols = ("#cccccc","#eeeeee");
@@ -822,25 +824,6 @@ sub action_links_bar {
return $discussion;
}
-sub blocking_posts {
- my ($type,$showstatus) = @_;
- my %setters;
- my ($blocked,$output);
- my ($startblock,$endblock) =
- &Apache::loncommon::blockcheck(\%setters,$type);
- if ($startblock && $endblock) {
- $blocked = 1;
- if ($showstatus) {
- my $showstart = &Apache::lonlocal::locallocaltime($startblock);
- my $showend = &Apache::lonlocal::locallocaltime($endblock);
- $output = &mt('Discussion postings will not be viewable for resources in this course between [_1] and [_2] because communication is being blocked.',$showstart, $showend).'
'.
- &Apache::loncommon::build_block_table($startblock,$endblock,
- \%setters);
- }
- }
- return ($blocked,$output);
-}
-
sub postingform_display {
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
$currnewattach,$currdelold,$group) = @_;
@@ -877,7 +860,7 @@ ENDDISCUSS
if ($group ne '') {
$postingform .='';
}
- my ($blockblog) = &blocking_posts('blogs');
+ my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
$postingform .= &add_blog_checkbox();
}
@@ -1755,6 +1738,7 @@ END
if ($env{'form.editdisc'} || $env{'form.replydisc'}) {
my $now = time;
my $ressymb = $symb;
+ &Apache::lonenc::check_encrypt(\$ressymb);
my $postidx = '';
if ($env{'form.editdisc'}) {
$postidx = $idx;
@@ -1762,7 +1746,7 @@ END
if (@currnewattach > 0) {
$attachnum += @currnewattach;
}
- my ($blockblog) = &blocking_posts('blogs');
+ my $blockblog = &Apache::loncommon::blocking_status('blogs');
$r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver,'',$blockblog));
if ($attachnum > 0) {
if (@currnewattach > 0) {
@@ -2498,7 +2482,7 @@ sub redirect_back {
$feedurl .= '?group='.$group.$refarg;
}
}
- $feedurl=&Apache::lonenc::check_encrypt($feedurl);
+ &Apache::lonenc::check_encrypt(\$feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
my %onload;
if ($env{'environment.remote'} ne 'off') {
@@ -2555,7 +2539,7 @@ sub no_redirect_back {
my $end_page = &Apache::loncommon::end_page();
- $feedurl=&Apache::lonenc::check_encrypt($feedurl);
+ &Apache::lonenc::check_encrypt(\$feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
$r->print (< '.
- &mt('Contribution to course discussion of resource');
+ $discussoptions='
'.
- ''.&mt('Change Screenname').'';
- }
+ &mt('Anonymous contribution to course discussion of resource').
+ ' ('.&mt('name only visible to course faculty').') '.
+ ''.&mt('Change Screenname').'';
}
- my ($blockblog) = &blocking_posts('blogs');
+ my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
$discussoptions.= &add_blog_checkbox();
}
@@ -3782,13 +3763,23 @@ ENDREDIR
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
# Unable to give feedback
+ &Apache::lonenc::check_encrypt(\$feedurl);
&no_redirect_back($r,$feedurl);
return OK;
}
# --------------------------------------------------- Print login screen header
unless ($env{'form.sendit'}) {
+ &Apache::lonenc::check_encrypt(\$feedurl);
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
+ if (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
+ if ($blocked) {
+ $r->print(&blocked_reply_or_edit($blocktext));
+ return OK;
+ }
+ }
my $options=&screen_header($feedurl,$symb);
if ($options) {
&mail_screen($r,$feedurl,$options);
@@ -3880,6 +3871,15 @@ ENDREDIR
&redirect_back($r,$feedurl,$typestyle,$numsent,$numpost,$blog,$status,$env{'form.previous'},undef,undef,undef,undef,undef,undef,$group);
}
return OK;
+}
+
+sub blocked_reply_or_edit {
+ my ($blocktext) = @_;
+ return
+ &Apache::loncommon::start_page('Resource Feedback and Discussion').
+ $blocktext.'
'.
+ &mt('Back to previous page').
+ &Apache::loncommon::end_page();
}
sub wrap_symb {