1: # The LearningOnline Network
2: # Communicate
3: #
4: # (Internal Server Error Handler
5: #
6: # (Login Screen
7: # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
8: # 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
9: #
10: # 3/1/1 Gerd Kortemeyer)
11: #
12: # 3/1,2/6,7/27 Gerd Kortemeyer
13: #
14: package Apache::loncommunicate;
15:
16: use strict;
17: use Apache::Constants qw(:common);
18: use Apache::lonmsg();
19:
20: sub handler {
21: my $r = shift;
22: $r->content_type('text/html');
23: $r->send_http_header;
24: return OK if $r->header_only;
25: #
26: # Start document
27: #
28: $r->print(<<ENDDOCUMENT);
29: <html>
30: <head>
31: <title>The LearningOnline Network with CAPA</title>
32: </head>
33: <body bgcolor="#FFFFFF">
34: <img align=right src=/adm/lonIcons/lonlogos.gif>
35: <h1>Communicate</h1>
36: <h3>New Messages</h3>
37: <table border=2><tr><th> </th>
38: <th>Date</th><th>Username</th><th>Domain</th><th>Subject</th></tr>
39: ENDDOCUMENT
40: map {
41: my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
42: &Apache::lonmsg::unpackmsgid($_);
43: if ($status eq 'new') {
44: $r->print(
45: '<tr bgcolor="#FFBB77"><td><a href="/adm/email?display='.$_.
46: '">Open</a></td><td>'.localtime($sendtime).'</td><td>'.
47: $fromname.'</td><td>'.$fromdomain.'</td><td>'.
48: &Apache::lonnet::unescape($shortsubj).'</td></tr>');
49: }
50: } sort split(/\&/,&Apache::lonnet::reply('keys:'.
51: $ENV{'user.domain'}.':'.
52: $ENV{'user.name'}.':nohist_email',
53: $ENV{'user.home'}));
54: $r->print(
55: '</table><p><a href="/adm/email/">All Messages</a>'.
56: '<p><a href="/adm/email?compose=individual">Send message to user(s)</a>');
57: if (($ENV{'request.course.id'}) &&
58: (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
59: $r->print(
60: '<p><a href="/adm/email?compose=group">Broadcast message to course</a>');
61: }
62: $r->print('</body></html>');
63: return OK;
64: }
65:
66: 1;
67: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>