--- loncom/interface/lonmsg.pm 2003/08/29 20:38:12 1.65
+++ loncom/interface/lonmsg.pm 2003/12/30 20:39:30 1.74
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.65 2003/08/29 20:38:12 www Exp $
+# $Id: lonmsg.pm,v 1.74 2003/12/30 20:39:30 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -115,6 +115,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 +144,7 @@ sub packagemsg {
my $result='
Attachment: '.$fname.'.'.$ft.''; + $content{'message'}.='
'.&mt('Attachment').': '.$fname.'.'.$ft.''; } else { - $content{'message'}.='
Attachment: '.$fname.'.'.$ft.''; } @@ -212,14 +213,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 +284,38 @@ sub author_res_msg { return 'no_host'; } +# =========================================== Retrieve author resource messages + +sub retrieve_author_res_msg { + my ($author,$domain,$url)=@_; + $url=&Apache::lonnet::declutter($url); + my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2); + my $msgs=''; + foreach (keys %errormsgs) { + if ($_=~/^\Q$url\E\_\d+$/) { + my %content=&unpackagemsg($errormsgs{$_}); + $msgs.='
'.
+ $content{'time'}.': '.$content{'message'}.
+ '
ENDDISHEADER my %coursepersonnel= @@ -545,7 +582,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 | '. - ''.localtime($sendtime).' | '. + '">'.&mt('Open').' | '.&mt('Delete').' | '. + ''.&Apache::lonlocal::locallocaltime($sendtime).' | '. $fromname.' | '.$fromdomain.' | '. &Apache::lonnet::unescape($shortsubj).' | '. $status.' |
'. - 'Check All '. - 'Uncheck All
'. + ''.&mt('Check All').' '. + ''.&mt('Uncheck All').'
'. ''. - ''. + ''. '