--- loncom/interface/lonmsg.pm 2003/08/13 15:57:51 1.61
+++ 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.61 2003/08/13 15:57:51 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,10 @@ use Apache::loncommon();
use Apache::lontexconvert();
use HTML::Entities();
use Mail::Send;
+use Apache::lonlocal;
+
+# Querystring component with sorting type
+my $sqs;
# ===================================================================== Package
@@ -140,7 +144,7 @@ sub packagemsg {
my $result='
Attachment: '.$fname.'.'.$ft.''; + $content{'message'}.='
'.&mt('Attachment').': '.$fname.'.'.$ft.''; } else { - $content{'message'}.='
Attachment: '.$fname.'.'.$ft.''; } @@ -209,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 @@ -279,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= @@ -542,7 +582,7 @@ ENDDISHEADER sub discrit { my $r=shift; - my $header = '
  | Date | '. - 'Username | Domain | Subject | Status |
---|
  | '); + if ($ENV{'form.sortedby'} eq "revdate") { + $r->print(''.&mt('Date').' | '); + } else { + $r->print(''.&mt('Date').''); + } + $r->print(''); + if ($ENV{'form.sortedby'} eq "revuser") { + $r->print(''.&mt('Username').''); + } else { + $r->print(''.&mt('Username').''); + } + $r->print(' | '); + if ($ENV{'form.sortedby'} eq "revdomain") { + $r->print(''.&mt('Domain').''); + } else { + $r->print(''.&mt('Domain').''); + } + $r->print(' | '); + if ($ENV{'form.sortedby'} eq "revsubject") { + $r->print(''.&mt('Subject').''); + } else { + $r->print(''.&mt('Subject').''); + } + $r->print(' | '); + if ($ENV{'form.sortedby'} eq "revstatus") { + $r->print(''.&mt('Status').' | '); + } else { + $r->print(''.&mt('Status').''); + } + $r->print('|||||
---|---|---|---|---|---|---|---|---|---|---|
Open | Delete | '. - ''.localtime($sendtime).' | '. + $r->print(' | '.&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').'
'. + ''. + ''. '