--- loncom/interface/lonmsgdisplay.pm 2006/12/24 22:13:19 1.59
+++ loncom/interface/lonmsgdisplay.pm 2008/10/08 14:56:50 1.93
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.59 2006/12/24 22:13:19 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.93 2008/10/08 14:56:50 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,12 +33,13 @@ package Apache::lonmsgdisplay;
=head1 NAME
-Apache::lonmsg: supports internal messaging
+Apache::lonmsgdisplay: supports internal messaging
=head1 SYNOPSIS
-lonmsg provides routines for sending messages, receiving messages, and
-a handler to allow users to read, send, and delete messages.
+lonmsgdisplay provides a handler to allow users to read, send,
+and delete messages, and to create and delete message folders,
+and to move messages between folders.
=head1 OVERVIEW
@@ -93,25 +94,6 @@ addresses on their B'.&mt('Course members with current access').'
';
+ $result .= $tmptext;
+ }
+ if ($tmptext = &Apache::lonselstudent::render_student_list($expired_members,
+ "compemail",
+ "expired",
+ \%defaultUsers,
+ 1, "selectedusers",0)
+ ) {
+ $result .= ''.&mt('Course members with expired access').'
';
+ $result .= $tmptext;
+ }
+ if ($tmptext = &Apache::lonselstudent::render_student_list($future_members,
+ "compemail",
+ "future",
+ \%defaultUsers,
+ 1, "selectedusers", 0)
+ ) {
+ $result .= ''.&mt('Course members with future access').'
';
+ $result .= $tmptext;
+ }
return $result;
}
@@ -569,7 +567,7 @@ sub disgroup {
'recipients to select.');
return $result;
} else {
- $result = &mt('Select message recipients from the group members listed below.
');
+ $result = &mt('Select message recipients from the group members listed below.').'
';
my %Sortby = (
active => {},
previous => {},
@@ -735,28 +733,59 @@ sub groupmail_sent {
sub discrit {
my $r=shift;
- my $header = ''.&mt('Critical Messages').'
'.
- '');
+ return;
+ }
+ $r->print(' ');
+
+ } else {
+ $r->print(&mt('The sender did not designate a reply to address for this message.').'');
+ return;
+ }
+ } else {
+ $r->print(&Apache::loncommon::aboutmewrapper(
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('.
$content{'sendername'}.':'.
- $content{'senderdomain'}.')'.
- ''.
- ''.
- '');
+ $content{'senderdomain'}.')');
+ $r->print(''.
+ '');
+ }
+ if ($content{'recipid'}) {
+ my @ccs = &retrieve_cc_recips('replying',%content);
+ if (@ccs > 0) {
+ my $replyall = qq|
+
+
+
+
+
+|;
+ my $cclist = join(' ',@ccs);
+ $r->print(''.&mt('Replying to').' ');
+ if ($content{'replytoaddr'}) {
+ my ($replytoname,$replytodom) = split(/:/,$content{'replytoaddr'});
+ if ($replytoname ne '' && $replytodom ne '') {
+ $r->print(&Apache::loncommon::plainname($replytoname,
+ $replytodom).' ('.$replytoname.':'.
+ $replytodom.')');
+ $r->print(''.
+ ' ');
+ }
+ }
} else {
$r->print(&recipient_input_row($defdom,%lt));
}
@@ -1337,12 +1445,20 @@ $latexHelp.
} elsif ($broadcast ne 'upload') {
$subj_size = '50';
$r->print(&additional_rec_row(\%lt));
+ if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
+ || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
+ '/'.$env{'request.course.sec'})) {
+ $r->print(&reply_to_row(\%lt));
+ }
$r->print(&msg_subject_row($dissub,\%lt,$subj_size));
$r->print(<<"ENDCOMP");
$latexHelp
'.&mt('Reply to other recipients').':
'.$replyall.''.$cclist.'
'); my $escmsgid=&escape($msgid); foreach (@messages) { if ($_->[5] eq $escmsgid){ @@ -1964,16 +2103,33 @@ sub displaymessage { } $counter++; } - $r->print(''); + + my $see_anonymous; + my $from_student = 0; + if ($env{'request.course.id'} eq $content{'courseid'}) { + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $username = $content{'sendername'}.':'.$content{'senderdomain'}; + my %classlist_entry = + &Apache::lonnet::get('classlist',[$username],$cdom,$cnum); + if (exists($classlist_entry{$username})) { + $from_student = 1; + $see_anonymous = &Apache::lonnet::allowed('rin',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); + } + } + + my $number_of_messages = scalar(@messages); #subtract 1 for last index # start output &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); # Functions - $r->print('