--- loncom/interface/lonmsg.pm	2002/05/07 15:24:34	1.32
+++ loncom/interface/lonmsg.pm	2002/07/29 22:17:05	1.36
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.32 2002/05/07 15:24:34 matthew Exp $
+# $Id: lonmsg.pm,v 1.36 2002/07/29 22:17:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,6 +49,8 @@ use Apache::lonnet();
 use vars qw($msgcount);
 use HTML::TokeParser;
 use Apache::Constants qw(:common);
+use Apache::loncommon;
+use Apache::lontexconvert;
 
 # ===================================================================== Package
 
@@ -314,7 +316,10 @@ sub discrit {
         $content{'message'}=~s/\n/\<br\>/g;
         $result.='<hr>From: <b>'.$content{'sendername'}.'@'.
             $content{'senderdomain'}.'</b> ('.$content{'time'}.
-            ')<br><blockquote>'.$content{'message'}.'</blockquote>'.
+            ')<br>Subject: '.$content{'subject'}.
+            '<br><blockquote>'.
+              &Apache::lontexconvert::msgtexconverted($content{'message'}).
+            '</blockquote>'.
             '<input type=submit name="rec_'.$_.'" value="Confirm Receipt">'.
             '<input type=submit name="reprec_'.$_.'" '.
                   'value="Confirm Receipt and Reply">';
@@ -342,10 +347,12 @@ sub comprep {
       my $subject='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=
- '<input type=checkbox name=critmsg> Send as critical message<br>'.
- '<input type=checkbox name=sendbck> Send as critical message'.
- ' and return receipt<p>';
+ '<input type=checkbox name=critmsg> Send as critical message ' . $crithelp . 
+ '<br>'.
+ '<input type=checkbox name=sendbck> Send as critical message ' .
+ ' and return receipt' . $crithelp . '<p>';
       }
       $r->print(<<"ENDREPLY");
 <form action="/adm/email" method=post>
@@ -396,7 +403,7 @@ ENDDISHEADER
                                         $ENV{'user.home'}))) {
         my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
 	    &Apache::lonmsg::unpackmsgid($_);
-       unless ($status eq 'deleted') {
+       unless (($status eq 'deleted') || ($sendtime=~/error/)) {
         if ($status eq 'new') {
 	    $r->print('<tr bgcolor="#FFBB77">');
         } elsif ($status eq 'read') {
@@ -431,10 +438,12 @@ sub compout {
     my $dismsg='';
     my $func='Send New';
       if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
+	 my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
          $dispcrit=
- '<input type=checkbox name=critmsg> Send as critical message<br>'.
- '<input type=checkbox name=sendbck> Send as critical message'.
- ' and return receipt<p>';
+ '<input type=checkbox name=critmsg> Send as critical message ' . $crithelp . 
+ '<br>'.
+ '<input type=checkbox name=sendbck> Send as critical message ' .
+ ' and return receipt' . $crithelp . '<p>';
       }
     if ($forwarding) {
        $dispcrit.='<input type=hidden name=forwid value="'.
@@ -549,7 +558,8 @@ sub handler {
              '"><b>Mark Unread</b></a></td>'.
         '<td><a href="/adm/email"><b>Display all Messages</b></a></td>'.
              '</tr></table><p><pre>'.
-             $content{'message'}.'</pre><hr>'.$content{'citation'});
+             &Apache::lontexconvert::msgtexconverted($content{'message'}).
+             '</pre><hr>'.$content{'citation'});
   } elsif ($ENV{'form.replyto'}) {
       &comprep($r,$ENV{'form.replyto'});
   } elsif ($ENV{'form.sendreply'}) {