--- loncom/interface/lonfeedback.pm 2006/11/29 03:55:15 1.221
+++ loncom/interface/lonfeedback.pm 2009/03/18 02:49:39 1.255.2.6
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.221 2006/11/29 03:55:15 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.255.2.6 2009/03/18 02:49:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,7 +44,6 @@ use HTML::LCParser();
use Apache::lonspeller();
use Apache::longroup;
use Cwd;
-use lib '/home/httpd/lib/perl/';
use LONCAPA;
sub discussion_open {
@@ -75,6 +74,9 @@ sub discussion_visible {
sub list_discussion {
my ($mode,$status,$ressymb,$imsextras,$group)=@_;
+ unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); }
+ unless ($ressymb) { return ''; }
+ $ressymb=&wrap_symb($ressymb);
my $outputtarget=$env{'form.grade_target'};
if (defined($env{'form.export'})) {
if($env{'form.export'}) {
@@ -86,13 +88,28 @@ sub list_discussion {
$outputtarget = 'export';
}
}
- if (not &discussion_visible($status)) { return ''; }
+ if (not &discussion_visible($status)) {
+ if ($mode ne 'board') {
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ return '
'.&send_message_link($ressymb);
+ }
+ }
if ($group ne '' && $mode eq 'board') {
if (&check_group_priv($group,'vgb') ne 'ok') {
return '';
}
}
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
+ if ($blocked) {
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ if ($mode ne 'board') {
+ $blocktext.='
'.&send_message_link($ressymb);
+ }
+ return $blocktext;
+ }
+
my @bgcols = ("#cccccc","#eeeeee");
my $discussiononly=0;
if ($mode eq 'board') { $discussiononly=1; }
@@ -103,9 +120,6 @@ sub list_discussion {
$crs.='_'.$env{'request.course.sec'};
}
$crs=~s/\_/\//g;
- unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); }
- unless ($ressymb) { return ''; }
- $ressymb=&wrap_symb($ressymb);
my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
&& ($ressymb=~/\.(problem|exam|quiz|assess|survey|form|task)$/));
@@ -421,55 +435,10 @@ imscp_v1p1.xsd http://www.imsglobal.org/
|;
$discussion.='
';
+ $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.=''.
- ''.
- &mt('Post Discussion').' '; + $discussion.= &send_feedback_link($ressymb,$target); } } - $discussion.=''. - &mt('Send Message').' |
'. + ''.&mt('Threaded View').' '. + ''.&mt('Chronological View').' + '.&mt('Sorting/Filtering options').''.(' ' x2); + } else { + $discussion .= ' | '; + } + $discussion .=''.&mt('Export').'? | '; + if ($newpostsflag) { + if (!$markondisp) { + $discussion .=''.
+ &mt('Preferences on what is marked as NEW').
+ ' '.&mt('Mark NEW posts no longer new').''; + } else { + $discussion .= ' | '; + } + } else { + $discussion .= ' | '; + } + $discussion .= ' |
NEW | '; +
'.&mt('NEW').' | '; } else { $$newitem{$idx} = 0; $$discussionitems[$idx] .= ' @@ -1418,7 +1472,7 @@ sub replicate_attachments { } sub mail_screen { - my ($r,$feedurl,$options) = @_; + my ($r,$feedurl,$options,$caller_symb,$attachmaxtext) = @_; if (exists($env{'form.origpage'})) { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']); } @@ -1428,10 +1482,9 @@ sub mail_screen { 'myqu' => 'My question/comment/feedback:', 'title' => 'Title', 'reta' => 'Retained attachments', - 'atta' => 'Attachment (128 KB max size)', - ); - my $title=&Apache::lonnet::gettitle($feedurl); - if (!$title) { $title = $feedurl; } + 'atta' => 'Attachment', + ); + my $restitle = &get_resource_title($caller_symb,$feedurl); my $quote=''; my $subject = ''; my $comment = ''; @@ -1520,7 +1573,7 @@ END if ($idx > 0) { my %subversions = (); &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); - $subject = &mt('Re: ')..$subversions{$numoldver}; + $subject = &mt('Re: ').$subversions{$numoldver}; } $subject = &HTML::Entities::encode($subject,'<>&"'); } else { @@ -1565,7 +1618,7 @@ END $comment = &unescape($env{'form.comment'}); &process_attachments(\@currnewattach,\@currdelold,\@keepold); } - my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); + my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(undef,undef,1); my $send=&mt('Send'); my $alert = &mt('Please select a feedback type.'); my $js= <