--- loncom/interface/lonmsg.pm 2003/12/30 22:45:59 1.76 +++ loncom/interface/lonmsg.pm 2004/03/01 01:06:10 1.86 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.76 2003/12/30 22:45:59 www Exp $ +# $Id: lonmsg.pm,v 1.86 2004/03/01 01:06:10 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -139,6 +139,7 @@ sub packagemsg { ''.$ENV{'browser.mathml'}.''. ''.$ENV{'HTTP_USER_AGENT'}.''. ''.$ENV{'request.course.id'}.''. + ''.$ENV{'request.course.sec'}.''. ''.$ENV{'request.role'}.''. ''.$ENV{'request.filename'}.''. ''.$msgid.''. @@ -294,6 +295,14 @@ sub retrieve_author_res_msg { sub del_url_author_res_msg { my $url=shift; $url=&Apache::lonnet::declutter($url); + my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//); + my @delmsgs=(); + foreach (&Apache::lonnet::getkeys('nohist_res_msgs',$domain,$author)) { + if ($_=~/^\Q$url\E\_\d+$/) { + push (@delmsgs,$_); + } + } + return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author); } # ================= Return hash with URLs for which there is a resource message @@ -388,7 +397,7 @@ sub user_crit_received { my %contents=&unpackagemsg($message{$msgid},1); my $status='rec: '.($contents{'sendback'}? &user_normal_msg($contents{'sendername'},$contents{'senderdomain'}, - &mt('Receipt').': '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}, + &mt('Receipt').': '.$ENV{'user.name'}.' '.&mt('at').' '.$ENV{'user.domain'}.', '.$contents{'subject'}, &mt('User').' '.$ENV{'user.name'}.' '.&mt('at').' '.$ENV{'user.domain'}. ' acknowledged receipt of message'."\n".' "'. $contents{'subject'}.'"'."\n".&mt('dated').' '. @@ -591,7 +600,9 @@ $content{'sendername'}.'@'. '
'.&mt('Subject').': '.$content{'subject'}. '
'. &Apache::lontexconvert::msgtexconverted($content{'message'}). - '
'. + ''. +&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox'). + '
'. ''. ''; @@ -857,6 +868,7 @@ ENDCOMP } else { # $broadcast is 'upload' $r->print(< +

Generate messages from a file

Subject: @@ -1016,7 +1028,9 @@ sub handler { if (!$ENV{'form.display'}) { $r->print('EMail and Messaging'. &Apache::loncommon::studentbrowser_javascript().''. - &Apache::loncommon::bodytag('EMail and Messages')); + &Apache::loncommon::bodytag('EMail and Messages'). + &Apache::loncommon::help_open_faq(12). + &Apache::loncommon::help_open_bug('Communication Tools')); } if ($ENV{'form.display'}) { my $msgid=$ENV{'form.display'}; @@ -1043,15 +1057,21 @@ sub handler { } $r->print(&Apache::loncommon::studentbrowser_javascript(). ''. - &Apache::loncommon::bodytag('EMail and Messages')); - $r->print(''.&mt('Subject').': '.$content{'subject'}. - '
'.&mt('From').': '. + &Apache::loncommon::bodytag('EMail and Messages'). + &Apache::loncommon::help_open_faq(12). + &Apache::loncommon::help_open_bug('Communication Tools')); + my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); + + $r->print('
'.&mt('Subject').': '.$content{'subject'}. + '
'.&mt('From').': '. &Apache::loncommon::aboutmewrapper( &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}), $content{'sendername'},$content{'senderdomain'}).' ('. $content{'sendername'}.' at '. $content{'senderdomain'}.') '. - '
'.&mt('Time').': '.$content{'time'}.'

'. + ($content{'courseid'}?'
'.&mt('Course').': '.$courseinfo{'description'}. +($content{'coursesec'}?' ('.&mt('Group/Section').': '.$content{'coursesec'}.')':''):''). + '
'.&mt('Time').': '.$content{'time'}.'

'. ''. ''. @@ -1072,7 +1092,7 @@ $content{'sendername'},$content{'senderd '">'.&mt('Next').''); } $r->print('
'.&mt('Functions').':'.&mt('Reply').'

'.
-             &Apache::lontexconvert::msgtexconverted($content{'message'}).
+             &Apache::lontexconvert::msgtexconverted($content{'message'},1).
              '

'.$content{'citation'}); } elsif ($ENV{'form.replyto'}) { &comprep($r,$ENV{'form.replyto'}); @@ -1201,6 +1221,7 @@ $content{'sendername'},$content{'senderd } } if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) { + $r->print('
'.&mt('Completed.').''); if ($ENV{'form.displayedcrit'}) { &discrit($r); } else {