Diff for /loncom/interface/loncommunicate.pm between versions 1.14 and 1.19

version 1.14, 2002/12/27 16:33:36 version 1.19, 2004/01/15 03:53:12
Line 42  use strict; Line 42  use strict;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::lonmsg();  use Apache::lonmsg();
 use Apache::loncommon;  use Apache::loncommon;
   use Apache::lonlocal;
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
     $r->content_type('text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
 #  #
Line 57  sub handler { Line 58  sub handler {
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
 </head>  </head>
 END  END
    $r->print(&Apache::loncommon::bodytag("Communication and Messages"));     my %lt=&Apache::lonlocal::texthash(
   'vam' => 'View All Messages',
   'vcm' => 'View Critical Messages',
   'smu' => 'Send Message to User(s)',
   'bmc' => 'Broadcast Message to Course',
   'dmu' => 'Distribute Messages from Uploaded File to Course',
   'unr' => 
        'User Notes, Records of Face-to-Face Discussions, and Critical Messages',
   'nm' => 'New Messages',
   'su' => 'Subject',
   'da' => 'Date',
   'us' => 'Username',
   'op' => 'Open',
   'do' => 'Domain'
   );
       my %help=();
       foreach ('Course_Face_To_Face_Records,Course_Critical_Message',
        'Course_Broadcast_Message') {
    $help{$_}=&Apache::loncommon::help_open_topic($_);
       }
   
      $r->print(&Apache::loncommon::bodytag("Communication and Messages").
        &Apache::loncommon::help_open_faq(12).
        &Apache::loncommon::help_open_bug('Communication Tools'));
    $r->print(<<END);     $r->print(<<END);
 <table cellspacing="10" cellpadding="2">  <table cellspacing="10" cellpadding="2">
 <tr><td bgcolor="#FFFFAA">  <tr><td bgcolor="#FFFFAA">
   <b><a href="/adm/email/">View All Messages</a></b>    <b><a href="/adm/email/">$lt{'vam'}</a></b>
 </td></tr>  </td></tr>
 <tr><td bgcolor="#FFFFAA">  <tr><td bgcolor="#FFFFAA">
   <b><a href="/adm/email?critical=display">View Critical Messages</a></b>    <b><a href="/adm/email?critical=display">$lt{'vcm'}</a></b>
 </td></tr>  </td></tr>
 <tr><td bgcolor="#FFFFAA">  <tr><td bgcolor="#FFFFAA">
   <b><a href="/adm/email?compose=individual">Send message to user(s)</a></b>    <b><a href="/adm/email?compose=individual">$lt{'smu'}</a></b>
 </td></tr>  </td></tr>
 END  END
     if (($ENV{'request.course.id'}) &&       if (($ENV{'request.course.id'}) && 
         (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {          (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
         $r->print(<<END);          $r->print(<<END);
 <tr><td bgcolor="#FFFFAA">  <tr><td bgcolor="#FFFFAA">
   <b><a href="/adm/email?compose=group">Broadcast message to course</a></b>      <b><a href="/adm/email?compose=group">$lt{'bmc'}</a></b>$help{'Course_Broadcast_Message'}
 </td></tr>  </td></tr>
 <tr><td bgcolor="#FFFFAA">  <tr><td bgcolor="#FFFFAA">
   <b><a href="/adm/email?compose=upload">Distribute messages from uploaded file to course</a></b>    <b><a href="/adm/email?compose=upload">$lt{'dmu'}</a></b>
 </td></tr>  </td></tr>
 <tr><td bgcolor="#FFFFAA">  <tr><td bgcolor="#FFFFAA">
   <b><a href="/adm/email?recordftf=query">User records of face-to-face discussions and critical messages</a></b>  <b><a href="/adm/email?recordftf=query">$lt{'unr'}</a></b>$help{'Course_Face_To_Face_Records,Course_Critical_Message'}
 </td></tr>  </td></tr>
   
 END  END
Line 95  END Line 119  END
         my ($sendtime,$shortsubj,$fromname,$fromdom,$status)=          my ($sendtime,$shortsubj,$fromname,$fromdom,$status)=
     &Apache::lonmsg::unpackmsgid($_);      &Apache::lonmsg::unpackmsgid($_);
        if (defined($sendtime) && $sendtime!~/error/) {         if (defined($sendtime) && $sendtime!~/error/) {
         $sendtime = localtime($sendtime);          $sendtime = &Apache::lonlocal::locallocaltime($sendtime);
         if ($status eq 'new') {          if ($status eq 'new') {
             push @newmsgs, {               push @newmsgs, { 
                 msgid    => $_,                  msgid    => $_,
Line 109  END Line 133  END
     }      }
     if ($#newmsgs >= 0) {      if ($#newmsgs >= 0) {
         $r->print(<<TABLEHEAD);          $r->print(<<TABLEHEAD);
 <h3>New Messages</h3>  <h3>$lt{'nm'}</h3>
 <table border=2><tr><th>&nbsp</th>  <table border=2><tr><th>&nbsp</th>
 <th>Date</th><th>Username</th><th>Domain</th><th>Subject</th></tr>  <th>$lt{'da'}</th><th>$lt{'us'}</th><th>$lt{'do'}</th><th>$lt{'su'}</th></tr>
 TABLEHEAD  TABLEHEAD
         foreach my $msg (@newmsgs) {          foreach my $msg (@newmsgs) {
             $r->print(<<"ENDLINK");              $r->print(<<"ENDLINK");
 <tr bgcolor="#FFBB77">  <tr bgcolor="#FFBB77">
 <td><a href="/adm/email?display=$msg->{'msgid'}">Open</a></td>  <td><a href="/adm/email?display=$msg->{'msgid'}">$lt{'op'}</a></td>
 ENDLINK  ENDLINK
             foreach ('sendtime','from','fromdom','shortsub') {              foreach ('sendtime','from','fromdom','shortsub') {
                 $r->print("<td>$msg->{$_}</td>");                  $r->print("<td>$msg->{$_}</td>");
Line 125  ENDLINK Line 149  ENDLINK
         }          }
         $r->print('</table></body></html>');          $r->print('</table></body></html>');
     } else {      } else {
         $r->print("<h3>You have no unread messages</h3>");          $r->print("<h3>".&mt('You have no unread messages')."</h3>");
     }      }
     return OK;      return OK;
 }  }

Removed from v.1.14  
changed lines
  Added in v.1.19


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