--- loncom/interface/lonmsg.pm 2001/08/03 17:16:48 1.14 +++ loncom/interface/lonmsg.pm 2001/08/03 18:47:18 1.15 @@ -255,6 +255,8 @@ $dispcrit ENDREPLY } +# ======================================================== Display all messages + sub disall { my $r=shift; $r->print('

Display All Messages

'. @@ -287,6 +289,47 @@ sub disall { $r->print(''); } +# ============================================================== Compose output + +sub compout { + my ($r,$forwarding)=@_; + my $dispcrit=''; + my $dissub=''; + my $dismsg=''; + my $func='Send New'; + if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + $dispcrit= + ' Send as critical message

'; + } + if ($forwarding) { + $dispcrit.=''; + $func='Forward'; + my %message=&Apache::lonnet::get('nohist_email',[$forwarding]); + my %content=&unpackagemsg($message{$forwarding}); + + $dissub='Forwarding: '.$content{'subject'}; + $dismsg='Forwarded message from '. + $content{'sendername'}.' at '.$content{'senderdomain'}; + } + my $defdom=$ENV{'user.domain'}; + $r->print(<<"ENDCOMP"); +

+ + + + + +
Username:
Domain:
Subject: +
+

+$dispcrit + +

+ENDCOMP +} + # ===================================================================== Handler sub handler { @@ -334,8 +377,11 @@ sub handler { ''. ''. - ''. + ''. + ''. '
Functions:ReplyForwardMark UnreadDisplay all Messages

'.
              $content{'message'}.'

'.$content{'citation'}); } elsif ($ENV{'form.replyto'}) { @@ -380,27 +426,16 @@ sub handler { } elsif ($ENV{'form.critical'}) { &discrit($r); } elsif ($ENV{'form.forward'}) { + &compout($r,$ENV{'form.forward'}); } elsif ($ENV{'form.markread'}) { } elsif ($ENV{'form.markdel'}) { &statuschange($ENV{'form.markdel'},'deleted'); &disall($r); } elsif ($ENV{'form.markunread'}) { + &statuschange($ENV{'form.markunread'},'new'); + &disall($r); } elsif ($ENV{'form.compose'}) { - my $dispcrit=''; - if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { - $dispcrit= - ' Send as critical message

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

- -Subject:

-

-$dispcrit - -

-ENDCOMP + &compout($r); } elsif ($ENV{'form.sendmail'}) { } else { &disall($r);