--- loncom/interface/lonmsg.pm 2001/08/03 14:00:07 1.12 +++ loncom/interface/lonmsg.pm 2001/08/03 14:54:52 1.13 @@ -202,7 +202,7 @@ sub statuschange { &Apache::lonnet::put('email_status',{$msgid => $newstatus}); } } -# ===================================================================== Handler +# ==================================================== Display Critical Message sub discrit { my $r=shift; @@ -216,11 +216,43 @@ sub discrit { $r->print('
From: '.$content{'sendername'}.'@'. $content{'senderdomain'}.' ('.$content{'time'}. ')
'.$content{'message'}.'
'. - ''); + ''. + ''); } sort keys %what; $r->print(''); } +# =============================================================== Compose reply + +sub comprep { + my ($r,$msgid)=@_; + my %message=&Apache::lonnet::get('nohist_email',[$msgid]); + my %content=&unpackagemsg($message{$msgid}); + my $quotemsg='> '.$content{'message'}; + $quotemsg=~s/\r/\n/g; + $quotemsg=~s/\f/\n/g; + $quotemsg=~s/\n+/\n\> /g; + my $subject='Re: '.$content{'subject'}; + my $dispcrit=''; + if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + $dispcrit= + ' Send as critical message

'; + } + $r->print(<<"ENDREPLY"); +

+ +Subject:

+

+$dispcrit + +

+ENDREPLY +} + +# ===================================================================== Handler + sub handler { my $r=shift; @@ -266,30 +298,7 @@ sub handler { '">Reply
'.
              $content{'message'}.'

'.$content{'citation'}); } elsif ($ENV{'form.replyto'}) { - my $msgid=$ENV{'form.replyto'}; - my %message=&Apache::lonnet::get('nohist_email',[$msgid]); - my %content=&unpackagemsg($message{$msgid}); - my $quotemsg='> '.$content{'message'}; - $quotemsg=~s/\r/\n/g; - $quotemsg=~s/\f/\n/g; - $quotemsg=~s/\n+/\n\> /g; - my $subject='Re: '.$content{'subject'}; - my $dispcrit=''; - if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { - $dispcrit= - ' Send as critical message

'; - } - $r->print(<<"ENDREPLY"); -

- -Subject:

-

-$dispcrit - -

-ENDREPLY + &comprep($r,$ENV{'form.replyto'}); } elsif ($ENV{'form.sendreply'}) { my $msgid=$ENV{'form.sendreply'}; my %message=&Apache::lonnet::get('nohist_email',[$msgid]); @@ -314,6 +323,12 @@ ENDREPLY $r->print('Confirming Receipt: '. &user_crit_received($1).'
'); } + if ($_=~/^form\.reprec\_(.*)$/) { + my $msgid=$1; + $r->print('Confirming Receipt: '. + &user_crit_received($msgid).'
'); + &comprep($r,$msgid); + } } keys %ENV; &discrit($r); } elsif ($ENV{'form.critical'}) {