version 1.13, 2001/08/03 14:54:52
|
version 1.14, 2001/08/03 17:16:48
|
Line 201 sub statuschange {
|
Line 201 sub statuschange {
|
($status{$msgid} eq 'forwarded')) { |
($status{$msgid} eq 'forwarded')) { |
&Apache::lonnet::put('email_status',{$msgid => $newstatus}); |
&Apache::lonnet::put('email_status',{$msgid => $newstatus}); |
} |
} |
|
if (($newstatus eq 'deleted') || ($newstatus eq 'new')) { |
|
&Apache::lonnet::put('email_status',{$msgid => $newstatus}); |
|
} |
} |
} |
|
|
# ==================================================== Display Critical Message |
# ==================================================== Display Critical Message |
|
|
sub discrit { |
sub discrit { |
Line 251 $dispcrit
|
Line 255 $dispcrit
|
ENDREPLY |
ENDREPLY |
} |
} |
|
|
|
sub disall { |
|
my $r=shift; |
|
$r->print('<h1>Display All Messages</h1>'. |
|
'<table border=2><tr><th colspan=2> </th><th>Date</th>'. |
|
'<th>Username</th><th>Domain</th><th>Subject</th><th>Status</th></tr>'); |
|
map { |
|
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= |
|
&Apache::lonmsg::unpackmsgid($_); |
|
unless ($status eq 'deleted') { |
|
if ($status eq 'new') { |
|
$r->print('<tr bgcolor="#FFBB77">'); |
|
} elsif ($status eq 'read') { |
|
$r->print('<tr bgcolor="#BBBB77">'); |
|
} elsif ($status eq 'replied') { |
|
$r->print('<tr bgcolor="#AAAA88">'); |
|
} else { |
|
$r->print('<tr bgcolor="#99BBBB">'); |
|
} |
|
$r->print('<td><a href="/adm/email?display='.$_. |
|
'">Open</a></td><td><a href="/adm/email?markdel='.$_. |
|
'">Delete</a></td><td>'.localtime($sendtime).'</td><td>'. |
|
$fromname.'</td><td>'.$fromdomain.'</td><td>'. |
|
&Apache::lonnet::unescape($shortsubj).'</td><td>'. |
|
$status.'</td></tr>'); |
|
} |
|
} sort split(/\&/,&Apache::lonnet::reply('keys:'. |
|
$ENV{'user.domain'}.':'. |
|
$ENV{'user.name'}.':nohist_email', |
|
$ENV{'user.home'})); |
|
$r->print('</table></body></html>'); |
|
} |
|
|
# ===================================================================== Handler |
# ===================================================================== Handler |
|
|
sub handler { |
sub handler { |
Line 270 sub handler {
|
Line 306 sub handler {
|
$value =~ tr/+/ /; |
$value =~ tr/+/ /; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
if (($name eq 'display') || ($name eq 'replyto') || |
if (($name eq 'display') || ($name eq 'replyto') || |
($name eq 'forward') || ($name eq 'mark') || |
($name eq 'forward') || ($name eq 'markread') || |
|
($name eq 'markdel') || ($name eq 'markunread') || |
($name eq 'sendreply') || ($name eq 'compose') || |
($name eq 'sendreply') || ($name eq 'compose') || |
($name eq 'sendmail') || ($name eq 'critical')) { |
($name eq 'sendmail') || ($name eq 'critical')) { |
unless ($ENV{'form.'.$name}) { |
unless ($ENV{'form.'.$name}) { |
Line 293 sub handler {
|
Line 330 sub handler {
|
$r->print('<b>Subject:</b> '.$content{'subject'}. |
$r->print('<b>Subject:</b> '.$content{'subject'}. |
'<br><b>From:</b> '.$content{'sendername'}.' at '. |
'<br><b>From:</b> '.$content{'sendername'}.' at '. |
$content{'senderdomain'}. |
$content{'senderdomain'}. |
'<br><b>Time:</b> '.$content{'time'}.'<hr>Functions: '. |
'<br><b>Time:</b> '.$content{'time'}.'<p>'. |
'<a href="/adm/email?replyto='.&Apache::lonnet::escape($msgid). |
'<table border=2><tr bgcolor="#FFFFAA"><td>Functions:</td>'. |
'"><b>Reply</b></a><hr><pre>'. |
'<td><a href="/adm/email?replyto='.&Apache::lonnet::escape($msgid). |
|
'"><b>Reply</b></a></td>'. |
|
'<td><a href="/adm/email?replyto='.&Apache::lonnet::escape($msgid). |
|
'"><b>Forward</b></a></td>'. |
|
'</tr></table><p><pre>'. |
$content{'message'}.'</pre><hr>'.$content{'citation'}); |
$content{'message'}.'</pre><hr>'.$content{'citation'}); |
} elsif ($ENV{'form.replyto'}) { |
} elsif ($ENV{'form.replyto'}) { |
&comprep($r,$ENV{'form.replyto'}); |
&comprep($r,$ENV{'form.replyto'}); |
Line 317 sub handler {
|
Line 358 sub handler {
|
$ENV{'form.subject'}, |
$ENV{'form.subject'}, |
$ENV{'form.message'})); |
$ENV{'form.message'})); |
} |
} |
|
if ($ENV{'form.displayedcrit'}) { |
|
&discrit($r); |
|
} else { |
|
&disall($r); |
|
} |
} elsif ($ENV{'form.confirm'}) { |
} elsif ($ENV{'form.confirm'}) { |
map { |
map { |
if ($_=~/^form\.rec\_(.*)$/) { |
if ($_=~/^form\.rec\_(.*)$/) { |
Line 334 sub handler {
|
Line 380 sub handler {
|
} elsif ($ENV{'form.critical'}) { |
} elsif ($ENV{'form.critical'}) { |
&discrit($r); |
&discrit($r); |
} elsif ($ENV{'form.forward'}) { |
} elsif ($ENV{'form.forward'}) { |
} elsif ($ENV{'form.mark'}) { |
} elsif ($ENV{'form.markread'}) { |
|
} elsif ($ENV{'form.markdel'}) { |
|
&statuschange($ENV{'form.markdel'},'deleted'); |
|
&disall($r); |
|
} elsif ($ENV{'form.markunread'}) { |
} elsif ($ENV{'form.compose'}) { |
} elsif ($ENV{'form.compose'}) { |
my $dispcrit=''; |
my $dispcrit=''; |
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { |
Line 353 $dispcrit
|
Line 403 $dispcrit
|
ENDCOMP |
ENDCOMP |
} elsif ($ENV{'form.sendmail'}) { |
} elsif ($ENV{'form.sendmail'}) { |
} else { |
} else { |
$r->print('<table border=2><tr><th> </th><th>Date</th>'. |
&disall($r); |
'<th>Username</th><th>Domain</th><th>Subject</th><th>Status</th></tr>'); |
|
map { |
|
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= |
|
&Apache::lonmsg::unpackmsgid($_); |
|
if ($status eq 'new') { |
|
$r->print('<tr bgcolor="#FFBB77">'); |
|
} elsif ($status eq 'read') { |
|
$r->print('<tr bgcolor="#BBBB77">'); |
|
} elsif ($status eq 'replied') { |
|
$r->print('<tr bgcolor="#AAAA88">'); |
|
} else { |
|
$r->print('<tr bgcolor="#99BBBB">'); |
|
} |
|
$r->print('<td><a href="/adm/email?display='.$_. |
|
'">Open</a></td><td>'.localtime($sendtime).'</td><td>'. |
|
$fromname.'</td><td>'.$fromdomain.'</td><td>'. |
|
&Apache::lonnet::unescape($shortsubj).'</td><td>'. |
|
$status.'</td></tr>'); |
|
} sort split(/\&/,&Apache::lonnet::reply('keys:'. |
|
$ENV{'user.domain'}.':'. |
|
$ENV{'user.name'}.':nohist_email', |
|
$ENV{'user.home'})); |
|
$r->print('</table></body></html>'); |
|
|
|
} |
} |
$r->print('</body></html>'); |
$r->print('</body></html>'); |
return OK; |
return OK; |