version 1.1, 2001/01/03 16:20:59
|
version 1.6, 2001/11/05 20:36:43
|
Line 9
|
Line 9
|
# |
# |
# 3/1/1 Gerd Kortemeyer) |
# 3/1/1 Gerd Kortemeyer) |
# |
# |
# 3/1 Gerd Kortemeyer |
# 3/1,2/6,7/27,8/3,8/15, |
|
# 11/5/01 Gerd Kortemeyer |
# |
# |
package Apache::loncommunicate; |
package Apache::loncommunicate; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
|
use Apache::lonmsg(); |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
|
# |
# --------------------------------------------------- Print login screen header |
# Start document |
|
# |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
<html> |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
</head> |
</head> |
<body bgcolor="#FFFFFF"> |
<body bgcolor="#FFFFFF"> |
|
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<h1>Communicate</h1> |
<h1>Communicate</h1> |
<img src="/adm/lonKaputt/lonconstruct.gif"> |
|
</body> |
|
</html> |
|
ENDDOCUMENT |
ENDDOCUMENT |
|
my $st='<table><tr><td bgcolor="#FFFFAA"><b>'; |
|
my $en='</b></td><tr></table>'; |
|
$r->print('<p>'. |
|
$st.'<a href="/adm/email/">All Messages</a>'.$en.'<p>'. |
|
$st.'<a href="/adm/email?critical=display">Critical Messages</a>'.$en.'<p>'. |
|
$st.'<a href="/adm/email?compose=individual">Send message to user(s)</a>'.$en |
|
); |
|
if (($ENV{'request.course.id'}) && |
|
(&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { |
|
$r->print( |
|
'<p>'.$st. |
|
'<a href="/adm/email?compose=group">Broadcast message to course</a>'.$en. |
|
'<p>'.$st. |
|
'<a href="/adm/email?compose=upload">Upload messages to course</a>'.$en); |
|
} |
|
$r->print(<<ENDTABLE); |
|
<h3>New Messages</h3> |
|
<table border=2><tr><th> </th> |
|
<th>Date</th><th>Username</th><th>Domain</th><th>Subject</th></tr> |
|
ENDTABLE |
|
map { |
|
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= |
|
&Apache::lonmsg::unpackmsgid($_); |
|
if ($status eq 'new') { |
|
$r->print( |
|
'<tr bgcolor="#FFBB77"><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></tr>'); |
|
} |
|
} sort split(/\&/,&Apache::lonnet::reply('keys:'. |
|
$ENV{'user.domain'}.':'. |
|
$ENV{'user.name'}.':nohist_email', |
|
$ENV{'user.home'})); |
|
$r->print('</table></body></html>'); |
return OK; |
return OK; |
} |
} |
|
|
1; |
1; |
__END__ |
__END__ |