--- loncom/interface/lonmsg.pm 2003/10/15 20:34:37 1.68 +++ loncom/interface/lonmsg.pm 2003/10/15 21:10:24 1.69 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.68 2003/10/15 20:34:37 www Exp $ +# $Id: lonmsg.pm,v 1.69 2003/10/15 21:10:24 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -607,16 +607,23 @@ $content{'sendername'}.'@'. ' '.&mt('Send as critical message').' ' . &mt('and return receipt') . $crithelp . '

'; } + my %lt=&Apache::lonlocal::texthash( + 'to' => 'To', + 'sb' => 'Subject', + 'sr' => 'Send Reply', + 'ca' => 'Cancel' + ); $r->print(<<"ENDREPLY"); -

- -To: $torepl
-Subject:

-

+


$dispcrit - + +
ENDREPLY } @@ -764,16 +771,23 @@ sub compout { my $dissub=''; my $dismsg=''; my $func=&mt('Send New'); - if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + my %lt=&Apache::lonlocal::texthash('us' => 'Username', + 'do' => 'Domain', + 'ad' => 'Additional Recipients', + 'sb' => 'Subject', + 'ca' => 'Cancel', + 'ma' => 'Mail'); + + if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message"); $dispcrit= - ' '.&mt('Send as critical message').' ' . $crithelp . + ' '.&mt('Send as critical message').' ' . $crithelp . '
'. - ' '.&mt('Send as critical message').' ' . + ' '.&mt('Send as critical message').' ' . &mt('and return receipt') . $crithelp . '

'; } if ($forwarding) { - $dispcrit.=''; $func=&mt('Forward'); my %message=&Apache::lonnet::get('nohist_email',[$forwarding]); @@ -796,24 +810,25 @@ sub compout { ('compemail','recuname','recdomain'); $r->print(<<"ENDREC"); - - + + ENDREC } my $latexHelp = Apache::loncommon::helpLatexCheatsheet(); if ($broadcast ne 'upload') { $r->print(<<"ENDCOMP"); - - +
Username:$selectlink
Domain:
$lt{'us'}:$selectlink
$lt{'do'}: $domform
Additional Recipients
username\@domain,username\@domain, ... +
$lt{'ad'}
username\@domain,username\@domain, ...
-
Subject: +
$lt{'sb'}:
$latexHelp -

+


$dispcrit - + + ENDCOMP } else { # $broadcast is 'upload' $r->print(</g; if ($content{'subject'}=~/^Record/) { - $result.='

Record

'; + $result.='

'.&mt('Record').'

'; } else { - $result.='

Sent Message

'; + $result.='

'.&mt('Sent Message').'

'; %content=&unpackagemsg($content{'message'}); $content{'message'}= 'Subject: '.$content{'subject'}.'
'. $content{'message'}; } - $result.='By: '. + $result.=&mt('By').': '. &Apache::loncommon::aboutmewrapper( &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('. $content{'sendername'}.'@'. @@ -1038,23 +1053,25 @@ $content{'sendername'},$content{'senderd } elsif ($ENV{'form.replyto'}) { &comprep($r,$ENV{'form.replyto'}); } elsif ($ENV{'form.sendreply'}) { - my $msgid=$ENV{'form.sendreply'}; - my %message=&Apache::lonnet::get('nohist_email',[$msgid]); - my %content=&unpackagemsg($message{$msgid},1); - &statuschange($msgid,'replied'); - if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) && - (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { - $r->print(&mt('Sending critical').': '. - &user_crit_msg($content{'sendername'}, - $content{'senderdomain'}, - &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), - &Apache::lonfeedback::clear_out_html($ENV{'form.message'}), - $ENV{'form.sendbck'})); - } else { - $r->print(&mt('Sending').': '.&user_normal_msg($content{'sendername'}, - $content{'senderdomain'}, - &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), - &Apache::lonfeedback::clear_out_html($ENV{'form.message'}))); + if ($ENV{'form.send'}) { + my $msgid=$ENV{'form.sendreply'}; + my %message=&Apache::lonnet::get('nohist_email',[$msgid]); + my %content=&unpackagemsg($message{$msgid},1); + &statuschange($msgid,'replied'); + if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) && + (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { + $r->print(&mt('Sending critical').': '. + &user_crit_msg($content{'sendername'}, + $content{'senderdomain'}, + &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), + &Apache::lonfeedback::clear_out_html($ENV{'form.message'}), + $ENV{'form.sendbck'})); + } else { + $r->print(&mt('Sending').': '.&user_normal_msg($content{'sendername'}, + $content{'senderdomain'}, + &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), + &Apache::lonfeedback::clear_out_html($ENV{'form.message'}))); + } } if ($ENV{'form.displayedcrit'}) { &discrit($r); @@ -1101,60 +1118,62 @@ $content{'sendername'},$content{'senderd } elsif ($ENV{'form.recordftf'}) { &facetoface($r,$ENV{'form.recordftf'}); } elsif ($ENV{'form.sendmail'}) { - my %content=(); - undef %content; - if ($ENV{'form.forwid'}) { - my $msgid=$ENV{'form.forwid'}; - my %message=&Apache::lonnet::get('nohist_email',[$msgid]); - %content=&unpackagemsg($message{$msgid},1); - &statuschange($msgid,'forwarded'); - $ENV{'form.message'}.="\n\n-- Forwarded message --\n\n". - $content{'message'}; - } - my %toaddr=(); - undef %toaddr; - if ($ENV{'form.sendmode'} eq 'group') { - foreach (keys %ENV) { - if ($_=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) { - $toaddr{$1}=''; - } - } - } elsif ($ENV{'form.sendmode'} eq 'upload') { - foreach (split(/[\n\r\f]+/,$ENV{'form.upfile'})) { - my ($rec,$txt)=split(/\s*\:\s*/,$_); - if ($txt) { - $rec=~s/\@/\:/; - $toaddr{$rec}.=$txt."\n"; - } - } - } else { - $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}=''; - } - if ($ENV{'form.additionalrec'}) { - foreach (split(/\,/,$ENV{'form.additionalrec'})) { - my ($auname,$audom)=split(/\@/,$_); - $toaddr{$auname.':'.$audom}=''; - } - } - foreach (keys %toaddr) { - my ($recuname,$recdomain)=split(/\:/,$_); - my $msgtxt=&Apache::lonfeedback::clear_out_html($ENV{'form.message'}); - if ($toaddr{$_}) { $msgtxt.='
'.$toaddr{$_}; } - if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) && - (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { - $r->print('Sending critical: '. - &user_crit_msg($recuname,$recdomain, - &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), - $msgtxt, - $ENV{'form.sendbck'})); - } else { - $r->print('Sending: '.&user_normal_msg($recuname,$recdomain, - &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), - $msgtxt, - $content{'citation'})); + if ($ENV{'form.send'}) { + my %content=(); + undef %content; + if ($ENV{'form.forwid'}) { + my $msgid=$ENV{'form.forwid'}; + my %message=&Apache::lonnet::get('nohist_email',[$msgid]); + %content=&unpackagemsg($message{$msgid},1); + &statuschange($msgid,'forwarded'); + $ENV{'form.message'}.="\n\n-- Forwarded message --\n\n". + $content{'message'}; + } + my %toaddr=(); + undef %toaddr; + if ($ENV{'form.sendmode'} eq 'group') { + foreach (keys %ENV) { + if ($_=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) { + $toaddr{$1}=''; + } + } + } elsif ($ENV{'form.sendmode'} eq 'upload') { + foreach (split(/[\n\r\f]+/,$ENV{'form.upfile'})) { + my ($rec,$txt)=split(/\s*\:\s*/,$_); + if ($txt) { + $rec=~s/\@/\:/; + $toaddr{$rec}.=$txt."\n"; + } + } + } else { + $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}=''; + } + if ($ENV{'form.additionalrec'}) { + foreach (split(/\,/,$ENV{'form.additionalrec'})) { + my ($auname,$audom)=split(/\@/,$_); + $toaddr{$auname.':'.$audom}=''; + } + } + foreach (keys %toaddr) { + my ($recuname,$recdomain)=split(/\:/,$_); + my $msgtxt=&Apache::lonfeedback::clear_out_html($ENV{'form.message'}); + if ($toaddr{$_}) { $msgtxt.='
'.$toaddr{$_}; } + if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) && + (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { + $r->print('Sending critical: '. + &user_crit_msg($recuname,$recdomain, + &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), + $msgtxt, + $ENV{'form.sendbck'})); + } else { + $r->print('Sending: '.&user_normal_msg($recuname,$recdomain, + &Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), + $msgtxt, + $content{'citation'})); + } + $r->print('
'); + } } - $r->print('
'); - } if ($ENV{'form.displayedcrit'}) { &discrit($r); } else {