--- loncom/interface/lonmsg.pm 2003/12/31 02:33:27 1.77
+++ loncom/interface/lonmsg.pm 2004/09/28 14:12:40 1.109
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.77 2003/12/31 02:33:27 www Exp $
+# $Id: lonmsg.pm,v 1.109 2004/09/28 14:12:40 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,6 +74,18 @@ email program, so they have full access
interface, or other features they may wish to use in response to the
student's query.
+=item * B: LON-CAPA can block display of e-mails that are
+sent to a student during an online exam. A course coordinator or
+instructor can set an open and close date/time for scheduled online
+exams in a course. If a user uses the LON-CAPA internal messaging
+system to display e-mails during the scheduled blocking event,
+display of all e-mail sent during the blocking period will be
+suppressed, and a message of explanation, including details of the
+currently active blocking periods will be displayed instead. A user
+who has a course coordinator or instructor role in a course will be
+unaffected by any blocking periods for the course, unless the user
+also has a student role in the course, AND has selected the student role.
+
=back
Users can ask LON-CAPA to forward messages to conventional e-mail
@@ -101,23 +113,27 @@ use Apache::lontexconvert();
use HTML::Entities();
use Mail::Send;
use Apache::lonlocal;
+use Apache::loncommunicate;
# Querystring component with sorting type
my $sqs;
+my $startdis;
+my $interdis;
# ===================================================================== Package
sub packagemsg {
- my ($subject,$message,$citation,$baseurl,$attachmenturl)=@_;
- $message =&HTML::Entities::encode($message);
- $citation=&HTML::Entities::encode($citation);
- $subject =&HTML::Entities::encode($subject);
+ my ($subject,$message,$citation,$baseurl,$attachmenturl,
+ $recuser,$recdomain)=@_;
+ $message =&HTML::Entities::encode($message,'<>&"');
+ $citation=&HTML::Entities::encode($citation,'<>&"');
+ $subject =&HTML::Entities::encode($subject,'<>&"');
#remove machine specification
$baseurl =~ s|^http://[^/]+/|/|;
- $baseurl =&HTML::Entities::encode($baseurl);
+ $baseurl =&HTML::Entities::encode($baseurl,'<>&"');
#remove machine specification
$attachmenturl =~ s|^http://[^/]+/|/|;
- $attachmenturl =&HTML::Entities::encode($attachmenturl);
+ $attachmenturl =&HTML::Entities::encode($attachmenturl,'<>&"');
my $now=time;
$msgcount++;
@@ -139,9 +155,12 @@ sub packagemsg {
''.$ENV{'browser.mathml'}.''.
''.$ENV{'HTTP_USER_AGENT'}.''.
''.$ENV{'request.course.id'}.''.
+ ''.$ENV{'request.course.sec'}.''.
''.$ENV{'request.role'}.''.
''.$ENV{'request.filename'}.''.
''.$msgid.''.
+ ''.$recuser.''.
+ ''.$recdomain.''.
''.$message.'';
if (defined($citation)) {
$result.=''.$citation.'';
@@ -170,13 +189,15 @@ sub unpackagemsg {
}
}
if ($content{'attachmenturl'}) {
- my ($fname,$ft)=($content{'attachmenturl'}=~/\/(\w+)\.(\w+)$/);
+ my ($fname)=($content{'attachmenturl'}=~m|/([^/]+)$|);
if ($notoken) {
- $content{'message'}.='
'.
+&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox').
+ ' '.
''.
'';
@@ -607,70 +705,35 @@ $content{'sendername'}.'@'.
# Check to see if there were any messages.
if ($result eq '') {
$result = "
".&mt('You have no critical messages.')."
".
- ''.&mt('Select a course').'';
+ ''.&mt('Select a course').' '.
+ ''.&mt('Communicate').'';
} else {
$r->print($header);
}
$r->print($result);
- $r->print('');
-}
-
-# =============================================================== Compose reply
-
-sub comprep {
- my ($r,$msgid)=@_;
- my %message=&Apache::lonnet::get('nohist_email',[$msgid]);
- my %content=&unpackagemsg($message{$msgid},1);
- my $quotemsg='> '.$content{'message'};
- $quotemsg=~s/\r/\n/g;
- $quotemsg=~s/\f/\n/g;
- $quotemsg=~s/\n+/\n\> /g;
- my $torepl=&Apache::loncommon::aboutmewrapper(
- &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('.
-$content{'sendername'}.'@'.
- $content{'senderdomain'}.')';
- my $subject=&mt('Re').': '.$content{'subject'};
- my $dispcrit='';
- if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
- my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
- $dispcrit=
- ' '.&mt('Send as critical message').' ' . $crithelp .
- ' '.
- ' '.&mt('Send as critical message').' ' .
- &mt('and return receipt') . $crithelp . '