File:  [LON-CAPA] / loncom / interface / loncommunicate.pm
Revision 1.5: download - view: text, annotated - select for diffs
Thu Aug 16 01:42:07 2001 UTC (22 years, 10 months ago) by www
Branches: MAIN
CVS tags: stable_2001_fall, HEAD
Mail from uploaded file

    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,8/3,8/15 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: ENDDOCUMENT
   37:     my $st='<table><tr><td bgcolor="#FFFFAA"><b>';
   38:     my $en='</b></td><tr></table>';
   39:    $r->print('<p>'.$st.'<a href="/adm/email/">All Messages</a>'.$en.'<p>'.$st.
   40:    '<a href="/adm/email?compose=individual">Send message to user(s)</a>'.
   41:      $en);
   42:     if (($ENV{'request.course.id'}) && 
   43:         (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
   44:        $r->print(
   45:     '<p>'.$st.
   46:   '<a href="/adm/email?compose=group">Broadcast message to course</a>'.$en.
   47:     '<p>'.$st.
   48:   '<a href="/adm/email?compose=upload">Upload messages to course</a>'.$en);
   49:     }
   50:     $r->print(<<ENDTABLE);
   51: <h3>New Messages</h3>
   52: <table border=2><tr><th>&nbsp</th>
   53: <th>Date</th><th>Username</th><th>Domain</th><th>Subject</th></tr>
   54: ENDTABLE
   55:     map {
   56:         my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
   57: 	    &Apache::lonmsg::unpackmsgid($_);
   58:         if ($status eq 'new') {
   59:             $r->print(
   60:               '<tr bgcolor="#FFBB77"><td><a href="/adm/email?display='.$_.
   61:                   '">Open</a></td><td>'.localtime($sendtime).'</td><td>'.
   62:                   $fromname.'</td><td>'.$fromdomain.'</td><td>'.
   63: 		      &Apache::lonnet::unescape($shortsubj).'</td></tr>');
   64:         }
   65:     } sort split(/\&/,&Apache::lonnet::reply('keys:'.
   66: 					$ENV{'user.domain'}.':'.
   67:                                         $ENV{'user.name'}.':nohist_email',
   68:                                         $ENV{'user.home'}));
   69:     $r->print('</table></body></html>');
   70:     return OK;
   71: }
   72: 
   73: 1;
   74: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>