--- loncom/interface/lonmsg.pm 2001/10/01 19:24:49 1.23 +++ loncom/interface/lonmsg.pm 2001/12/19 17:17:46 1.26 @@ -1,7 +1,31 @@ # The LearningOnline Network with CAPA -# # Routines for messaging # +# $Id: lonmsg.pm,v 1.26 2001/12/19 17:17:46 albertel Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# +# # (Routines to control the menu # # (TeX Conversion Module @@ -14,7 +38,7 @@ # 02/06/01 Gerd Kortemeyer # 07/27 Guy Albertelli # 07/27,07/28,07/30,08/03,08/06,08/08,08/09,08/10,8/13,8/15, -# 10/1 Gerd Kortemeyer +# 10/1,11/5 Gerd Kortemeyer package Apache::lonmsg; @@ -115,7 +139,7 @@ sub author_res_msg { # ================================================== Critical message to a user sub user_crit_msg { - my ($user,$domain,$subject,$message)=@_; + my ($user,$domain,$subject,$message,$sendback)=@_; # Check if allowed missing my $status=''; my $msgid='undefined'; @@ -123,6 +147,7 @@ sub user_crit_msg { my $homeserver=&Apache::lonnet::homeserver($user,$domain); if ($homeserver ne 'no_host') { ($msgid,$message)=&packagemsg($subject,$message); + if ($sendback) { $message.='true'; } $status=&Apache::lonnet::critical( 'put:'.$domain.':'.$user.':critical:'. &Apache::lonnet::escape($msgid).'='. @@ -146,13 +171,13 @@ sub user_crit_received { my $msgid=shift; my %message=&Apache::lonnet::get('critical',[$msgid]); my %contents=&unpackagemsg($message{$msgid}); - my $status='rec: '. + my $status='rec: '.($contents{'sendback'}? &user_normal_msg($contents{'sendername'},$contents{'senderdomain'}, 'Receipt: '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}, 'User '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}. ' acknowledged receipt of message "'. $contents{'subject'}.'" dated '.$contents{'time'}.".\n\n" - .'Message ID: '.$contents{'msgid'}); + .'Message ID: '.$contents{'msgid'}):'no msg req'); $status.=' trans: '. &Apache::lonnet::put( 'nohist_email',{$contents{'msgid'} => $message{$msgid}}); @@ -308,7 +333,9 @@ sub comprep { my $dispcrit=''; if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { $dispcrit= - ' Send as critical message

'; + ' Send as critical message
'. + ' Send as critical message'. + ' and return receipt

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

@@ -327,7 +354,8 @@ ENDREPLY sub disall { my $r=shift; - $r->print('

Display All Messages

'. + $r->print( + '

Display All Messages

'. ''. ''); map { @@ -345,7 +373,8 @@ sub disall { } $r->print(''. + ''); @@ -354,7 +383,9 @@ sub disall { $ENV{'user.domain'}.':'. $ENV{'user.name'}.':nohist_email', $ENV{'user.home'})); - $r->print('
 DateUsernameDomainSubjectStatus
OpenDelete'.localtime($sendtime).''. + '">Delete'.localtime($sendtime).''. $fromname.''.$fromdomain.''. &Apache::lonnet::unescape($shortsubj).''. $status.'
'); + $r->print('

'. + ''. + '

'); } # ============================================================== Compose output @@ -367,7 +398,9 @@ sub compout { my $func='Send New'; if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { $dispcrit= - ' Send as critical message

'; + ' Send as critical message
'. + ' Send as critical message'. + ' and return receipt

'; } if ($forwarding) { $dispcrit.='