--- loncom/interface/lonmsg.pm 2001/08/15 16:05:04 1.21 +++ loncom/interface/lonmsg.pm 2001/08/16 01:42:07 1.22 @@ -380,9 +380,11 @@ sub compout { $content{'sendername'}.' at '.$content{'senderdomain'}; } my $defdom=$ENV{'user.domain'}; - $r->print('
'. + $r->print( + ''. ''); - unless ($broadcast eq 'group') { + unless (($broadcast eq 'group') || ($broadcast eq 'upload')) { $r->print(<<"ENDREC");
@@ -390,7 +392,8 @@ sub compout { ENDREC } - $r->print(<<"ENDCOMP"); + unless ($broadcast eq 'upload') { + $r->print(<<"ENDCOMP"); @@ -401,6 +404,27 @@ ENDREC $dispcrit ENDCOMP + } + if ($broadcast eq 'upload') { + $r->print(< +

Generate messages from a file

+Subject: +
+username1\@domain1: text
+username2\@domain2: text
+username1\@domain1: text
+
+The messages will be assembled from all lines with the respective +username\@domain, and appended to the general message text.

+

+General message text:

+

+$dispcrit + +ENDUPLOAD + } if ($broadcast eq 'group') { &discourse; } @@ -529,31 +553,41 @@ sub handler { if ($ENV{'form.sendmode'} eq 'group') { map { if ($_=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) { - $toaddr{$1}=1; + $toaddr{$1}=''; } } keys %ENV; + } elsif ($ENV{'form.sendmode'} eq 'upload') { + map { + my ($rec,$txt)=split(/\s*\:\s*/,$_); + if ($txt) { + $rec=~s/\@/\:/; + $toaddr{$rec}.=$txt."\n"; + } + } split(/[\n\r\f]+/,$ENV{'form.upfile'}); } else { - $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}=1; + $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}=''; } if ($ENV{'form.additionalrec'}) { map { my ($auname,$audom)=split(/\@/,$_); - $toaddr{$auname.':'.$audom}=1; + $toaddr{$auname.':'.$audom}=''; } split(/\,/,$ENV{'form.additionalrec'}); } map { my ($recuname,$recdomain)=split(/\:/,$_); + my $msgtxt=$ENV{'form.message'}; + if ($toaddr{$_}) { $msgtxt.='


'.$toaddr{$_}; } if (($ENV{'form.critmsg'}) && (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { $r->print('Sending critical: '. &user_crit_msg($recuname,$recdomain, $ENV{'form.subject'}, - $ENV{'form.message'}, + $msgtxt, $content{'citation'})); } else { $r->print('Sending: '.&user_normal_msg($recuname,$recdomain, $ENV{'form.subject'}, - $ENV{'form.message'}, + $msgtxt, $content{'citation'})); } $r->print('
');
Username:
Additional Recipients
username\@domain,username\@domain, ...