[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm
www
lon-capa-cvs@mail.lon-capa.org
Sat, 18 Oct 2003 16:33:44 -0000
www Sat Oct 18 12:33:44 2003 EDT
Modified files:
/loncom/interface lonmsg.pm
Log:
Bug #2298: now whines louder if it cannot deliver a message.
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.69 loncom/interface/lonmsg.pm:1.70
--- loncom/interface/lonmsg.pm:1.69 Wed Oct 15 17:10:24 2003
+++ loncom/interface/lonmsg.pm Sat Oct 18 12:33:44 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.69 2003/10/15 21:10:24 www Exp $
+# $Id: lonmsg.pm,v 1.70 2003/10/18 16:33:44 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1060,7 +1060,7 @@
&statuschange($msgid,'replied');
if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) &&
(&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
- $r->print(&mt('Sending critical').': '.
+ $r->print(&mt('Sending critical message').': '.
&user_crit_msg($content{'sendername'},
$content{'senderdomain'},
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}),
@@ -1118,6 +1118,7 @@
} elsif ($ENV{'form.recordftf'}) {
&facetoface($r,$ENV{'form.recordftf'});
} elsif ($ENV{'form.sendmail'}) {
+ my $sendstatus='';
if ($ENV{'form.send'}) {
my %content=();
undef %content;
@@ -1160,24 +1161,32 @@
if ($toaddr{$_}) { $msgtxt.='<hr>'.$toaddr{$_}; }
if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) &&
(&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
- $r->print('Sending critical: '.
- &user_crit_msg($recuname,$recdomain,
+ $r->print(&mt('Sending critical message').' ...');
+ $sendstatus.=' '.&user_crit_msg($recuname,$recdomain,
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}),
$msgtxt,
- $ENV{'form.sendbck'}));
+ $ENV{'form.sendbck'});
} else {
- $r->print('Sending: '.&user_normal_msg($recuname,$recdomain,
- &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}),
+ $r->print(&mt('Sending').' ...');
+ $sendstatus.=' '.&user_normal_msg($recuname,$recdomain,
+ &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}),
$msgtxt,
- $content{'citation'}));
+ $content{'citation'});
}
$r->print('<br />');
}
}
- if ($ENV{'form.displayedcrit'}) {
- &discrit($r);
+ if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) {
+ if ($ENV{'form.displayedcrit'}) {
+ &discrit($r);
+ } else {
+ &disall($r);
+ }
} else {
- &disall($r);
+ $r->print(
+ '<h2><font color="red">'.&mt('Could not deliver message').'</font></h2>'.
+ &mt('Please use the browser "Back" button and correct the recipient addresses')
+ );
}
} else {
&disall($r);