--- loncom/interface/lonmsg.pm 2003/10/04 20:49:40 1.66
+++ loncom/interface/lonmsg.pm 2003/12/30 22:45:59 1.76
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.66 2003/10/04 20:49:40 www Exp $
+# $Id: lonmsg.pm,v 1.76 2003/12/30 22:45:59 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,23 +25,8 @@
#
# http://www.lon-capa.org/
#
-#
-# (Routines to control the menu
-#
-# (TeX Conversion Module
-#
-# 05/29/00,05/30 Gerd Kortemeyer)
-#
-# 10/05 Gerd Kortemeyer)
-#
-# 10/19,10/20,10/30,
-# 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,11/5 Gerd Kortemeyer
-# YEAR=2002
-# 1/1,3/18 Gerd Kortemeyer
-#
+
+
package Apache::lonmsg;
=pod
@@ -115,6 +100,7 @@ use Apache::loncommon();
use Apache::lontexconvert();
use HTML::Entities();
use Mail::Send;
+use Apache::lonlocal;
# Querystring component with sorting type
my $sqs;
@@ -143,7 +129,7 @@ sub packagemsg {
my $result='
Attachment: '.$fname.'.'.$ft.''; + $content{'message'}.='
'.&mt('Attachment').': '.$fname.'.'.$ft.''; } else { - $content{'message'}.='
Attachment: '.$fname.'.'.$ft.''; } @@ -212,14 +198,15 @@ sub unpackmsgid { sub sendemail { my ($to,$subject,$body)=@_; $body= - "*** This is an automatic message generated by the LON-CAPA system.\n". - "*** Please do not reply to this address.\n\n".$body; + "*** ".&mt('This is an automatic message generated by the LON-CAPA system.')."\n". + "*** ".&mt('Please do not reply to this address.')."\n\n".$body; my $msg = new Mail::Send; $msg->to($to); $msg->subject('[LON-CAPA] '.$subject); - my $fh = $msg->open('smtp',Server => 'localhost'); - print $fh $body; - $fh->close; + if (my $fh = $msg->open('smtp',Server => 'localhost')) { + print $fh $body; + $fh->close; + } } # ==================================================== Send notification emails @@ -282,6 +269,45 @@ sub author_res_msg { return 'no_host'; } +# =========================================== Retrieve author resource messages + +sub retrieve_author_res_msg { + my $url=shift; + $url=&Apache::lonnet::declutter($url); + my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//); + my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$domain,$author); + my $msgs=''; + foreach (keys %errormsgs) { + if ($_=~/^\Q$url\E\_\d+$/) { + my %content=&unpackagemsg($errormsgs{$_}); + $msgs.='
'.
+ $content{'time'}.': '.$content{'message'}.
+ '
ENDDISHEADER my %coursepersonnel= @@ -545,7 +574,7 @@ ENDDISHEADER sub discrit { my $r=shift; - my $header = '
  | '); if ($ENV{'form.sortedby'} eq "revdate") { - $r->print('Date | '); + $r->print(''.&mt('Date').''); } else { - $r->print('Date'); + $r->print(''.&mt('Date').''); } $r->print(''); if ($ENV{'form.sortedby'} eq "revuser") { - $r->print('Username'); + $r->print(''.&mt('Username').''); } else { - $r->print('Username'); + $r->print(''.&mt('Username').''); } $r->print(' | '); if ($ENV{'form.sortedby'} eq "revdomain") { - $r->print('Domain'); + $r->print(''.&mt('Domain').''); } else { - $r->print('Domain'); + $r->print(''.&mt('Domain').''); } $r->print(' | '); if ($ENV{'form.sortedby'} eq "revsubject") { - $r->print('Subject'); + $r->print(''.&mt('Subject').''); } else { - $r->print('Subject'); + $r->print(''.&mt('Subject').''); } $r->print(' | '); if ($ENV{'form.sortedby'} eq "revstatus") { - $r->print('Status | '); + $r->print(''.&mt('Status').''); } else { - $r->print('Status'); + $r->print(''.&mt('Status').''); } $r->print('||
---|---|---|---|---|---|---|---|
Open | Delete | '. + '">'.&mt('Open').''.&mt('Delete').' | '. ''.&Apache::lonlocal::locallocaltime($sendtime).' | '. $fromname.' | '.$fromdomain.' | '. &Apache::lonnet::unescape($shortsubj).' | '. @@ -744,10 +780,10 @@ ENDDISHEADER } } $r->print(' |
'. - 'Check All '. - 'Uncheck All
'. + ''.&mt('Check All').' '. + ''.&mt('Uncheck All').'
'. ''. - ''. + ''. '