--- loncom/interface/lonmsg.pm 2002/02/16 19:59:10 1.28 +++ loncom/interface/lonmsg.pm 2002/04/23 21:06:07 1.31 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.28 2002/02/16 19:59:10 harris41 Exp $ +# $Id: lonmsg.pm,v 1.31 2002/04/23 21:06:07 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,7 +40,7 @@ # 07/27,07/28,07/30,08/03,08/06,08/08,08/09,08/10,8/13,8/15, # 10/1,11/5 Gerd Kortemeyer # YEAR=2002 -# 1/1 Gerd Kortemeyer +# 1/1,3/18 Gerd Kortemeyer # package Apache::lonmsg; @@ -303,21 +303,30 @@ ENDDISHEADER sub discrit { my $r=shift; - $r->print('

Critical Messages

'. - '
'. - ''); - my %what=&Apache::lonnet::dump('critical'); - foreach (sort keys %what) { - my %content=&unpackagemsg($what{$_}); - $content{'message'}=~s/\n/\/g; - $r->print('
From: '.$content{'sendername'}.'@'. - $content{'senderdomain'}.' ('.$content{'time'}. - ')
'.$content{'message'}.'
'. - ''. - ''); - } - $r->print( - ''); + my $header = '

Critical Messages

'. + '
'. + ''; + my %what=&Apache::lonnet::dump('critical'); + my $result = ''; + foreach (sort keys %what) { + my %content=&unpackagemsg($what{$_}); + next if ($content{'senderdomain'} eq ''); + $content{'message'}=~s/\n/\/g; + $result.='
From: '.$content{'sendername'}.'@'. + $content{'senderdomain'}.' ('.$content{'time'}. + ')
'.$content{'message'}.'
'. + ''. + ''; + } + # Check to see if there were any messages. + if ($result eq '') { + $result = "

You have no critical messages.

"; + } else { + $r->print($header); + } + $r->print($result); + $r->print(''); } # =============================================================== Compose reply @@ -355,8 +364,30 @@ ENDREPLY sub disall { my $r=shift; - $r->print( - '

Display All Messages

'. + $r->print(< + function checkall() { + for (i=0; i +ENDDISHEADER + $r->print( + '

Display All Messages

'. ''. ''); foreach (sort split(/\&/,&Apache::lonnet::reply('keys:'. @@ -385,6 +416,8 @@ sub disall { } } $r->print('
 DateUsernameDomainSubjectStatus

'. + 'Check All '. + 'Uncheck All

'. ''. '

'); } @@ -416,18 +449,21 @@ sub compout { } my $defdom=$ENV{'user.domain'}; $r->print( - '
'. - ''); + ''."\n". + ''."\n". + '
'); unless (($broadcast eq 'group') || ($broadcast eq 'upload')) { + my $domform = &Apache::loncommon::select_dom_form($defdom,'recdomain'); + $r->print(<<"ENDREC");
- + ENDREC } - unless ($broadcast eq 'upload') { + if ($broadcast ne 'upload') { $r->print(<<"ENDCOMP");
Username:
Domain:
$domform
Additional Recipients
username\@domain,username\@domain, ...
@@ -439,23 +475,29 @@ ENDREC $dispcrit ENDCOMP - } - if ($broadcast eq 'upload') { + } else { # $broadcast is 'upload' $r->print(<

Generate messages from a file

+

Subject: +

+

General message text
+

+

+The file format for the uploaded portion of the message is:

 username1\@domain1: text
 username2\@domain2: text
-username1\@domain1: text
+username3\@domain1: text
 
+

+

The messages will be assembled from all lines with the respective -username\@domain, and appended to the general message text.

+username\@domain, and appended to the general message text.

+

-General message text:

-

$dispcrit ENDUPLOAD