Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.31 and 1.35

version 1.31, 2006/06/12 22:55:23 version 1.35, 2006/06/29 13:52:19
Line 217  sub movemsg { Line 217  sub movemsg {
 # Copy message  # Copy message
     my %message=&Apache::lonnet::get('nohist_email'.$srcsuffix,[$msgid]);      my %message=&Apache::lonnet::get('nohist_email'.$srcsuffix,[$msgid]);
     if (!exists($message{$msgid}) || $message{$msgid} eq '') {      if (!exists($message{$msgid}) || $message{$msgid} eq '') {
  if (&Apache::slotrequest::network_error(%message)) {   if (&Apache::lonnet::error(%message)) {
     return (0,&mt('Message not moved, A network error occurred.'));      return (0,&mt('Message not moved, A network error occurred.'));
  } else {   } else {
     return (0,&mt('Message not moved as the message is no longer in the source folder.'));      return (0,&mt('Message not moved as the message is no longer in the source folder.'));
Line 226  sub movemsg { Line 226  sub movemsg {
   
     my $result =&Apache::lonnet::put('nohist_email'.$trgsuffix,      my $result =&Apache::lonnet::put('nohist_email'.$trgsuffix,
      {$msgid => $message{$msgid}});       {$msgid => $message{$msgid}});
     if (&Apache::slotrequest::network_error($result)) {      if (&Apache::lonnet::error($result)) {
  return (0,&mt('Message not moved, A network error occurred.'));   return (0,&mt('Message not moved, A network error occurred.'));
     }      }
   
Line 234  sub movemsg { Line 234  sub movemsg {
     unless ($trgfolder eq 'trash') {      unless ($trgfolder eq 'trash') {
         my %status=&Apache::lonnet::get('email_status'.$srcsuffix,[$msgid]);          my %status=&Apache::lonnet::get('email_status'.$srcsuffix,[$msgid]);
  # a non-existant status is the mark of an unread msg   # a non-existant status is the mark of an unread msg
  if (&Apache::slotrequest::network_error(%status)) {   if (&Apache::lonnet::error(%status)) {
     return (0,&mt('Message copied to new folder but status was not, A network error occurred.'));      return (0,&mt('Message copied to new folder but status was not, A network error occurred.'));
  }   }
  my $result=&Apache::lonnet::put('email_status'.$trgsuffix,   my $result=&Apache::lonnet::put('email_status'.$trgsuffix,
  {$msgid => $status{$msgid}});   {$msgid => $status{$msgid}});
  if (&Apache::slotrequest::network_error($result)) {   if (&Apache::lonnet::error($result)) {
     return (0,&mt('Message copied to new folder but status was not, A network error occurred.'));      return (0,&mt('Message copied to new folder but status was not, A network error occurred.'));
  }   }
     }      }
Line 249  sub movemsg { Line 249  sub movemsg {
  &Apache::lonnet::del('nohist_email'.$srcsuffix,[$msgid]);   &Apache::lonnet::del('nohist_email'.$srcsuffix,[$msgid]);
     my $result_del_stat =      my $result_del_stat =
  &Apache::lonnet::del('email_status'.$srcsuffix,[$msgid]);   &Apache::lonnet::del('email_status'.$srcsuffix,[$msgid]);
     if (&Apache::slotrequest::network_error($result_del_msg)) {      if (&Apache::lonnet::error($result_del_msg)) {
  return (0,&mt('Message copied, but unable to delete the original from the source folder.'));   return (0,&mt('Message copied, but unable to delete the original from the source folder.'));
     }      }
     if (&Apache::slotrequest::network_error($result_del_stat)) {      if (&Apache::lonnet::error($result_del_stat)) {
  return (0,&mt('Message copied, but unable to delete the original status from the source folder.'));   return (0,&mt('Message copied, but unable to delete the original status from the source folder.'));
     }      }
   
Line 976  $content{'sendername'}.':'. Line 976  $content{'sendername'}.':'.
      }       }
     # Check to see if there were any messages.      # Check to see if there were any messages.
     if ($result eq '') {      if ($result eq '') {
         my $lctype = 'course';          my $lctype = lc(&Apache::loncommon::course_type());
         if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {  
             $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});  
         }  
  if ($target ne 'tex') {    if ($target ne 'tex') { 
     $r->print("<p><b>".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."</b></p>");      $r->print("<p><b>".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."</b></p>");
  } else {   } else {
Line 1012  sub facetoface { Line 1009  sub facetoface {
  $r->print('Not allowed');   $r->print('Not allowed');
  return;   return;
     }      }
     my $crstype = 'Course';      my $crstype = &Apache::loncommon::course_type();
     my $leaders = 'faculty and staff';      my $leaders = ($crstype eq 'Group') ? 'coordinators and leaders'
     if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {                                          : 'faculty and staff';
         $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};  
         $leaders = 'coordinators and leaders';  
     }  
     &printheader($r,      &printheader($r,
  '/adm/email?recordftf=query',   '/adm/email?recordftf=query',
  "User Notes, Face-to-Face, Critical Messages, Broadcast Messages");   "User Notes, Face-to-Face, Critical Messages, Broadcast Messages");
Line 1092  sub examblock { Line 1086  sub examblock {
  $r->print('Not allowed');   $r->print('Not allowed');
  return;   return;
     }      }
     my $usertype = 'students';      my $usertype = (&Apache::loncommon::course_type() eq 'Group') ? 'members'
     if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Group') {                                                            : 'students';
         $usertype = 'members';  
     }  
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
             'comb' => 'Communication Blocking',              'comb' => 'Communication Blocking',
             'cbds' => 'Communication blocking during scheduled exams',              'cbds' => 'Communication blocking during scheduled exams',
Line 1431  sub displaymessage { Line 1423  sub displaymessage {
     my $startblock = 0;      my $startblock = 0;
     my $endblock = 0;      my $endblock = 0;
     my $numblocked = 0;      my $numblocked = 0;
     my $crstype = 'Course';      my $crstype = &Apache::loncommon::course_type();
     if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {  
         $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};  
     }  
   
 # info to generate "next" and "previous" buttons and check if message is blocked  # info to generate "next" and "previous" buttons and check if message is blocked
     &blockcheck(\%setters,\$startblock,\$endblock);      &blockcheck(\%setters,\$startblock,\$endblock);
Line 1652  sub sendoffmail { Line 1641  sub sendoffmail {
     &statuschange($msgid,'replied',$folder);      &statuschange($msgid,'replied',$folder);
  }   }
   
  my $to = $env{'form.selectedusers.forminput'};   my @to =
       &Apache::loncommon::get_env_multiple('form.selectedusers.forminput');
  my $mode = $env{'form.sendmode'};   my $mode = $env{'form.sendmode'};
   
  my %toaddr;   my %toaddr;
  if ($to) {   if (@to) {
     foreach my $dest (@$to) {      foreach my $dest (@to) {
  my ($user,$domain) = split(/:/, $dest);   my ($user,$domain) = split(/:/, $dest);
  if (($user ne '') && ($domain ne '')) {   if (($user ne '') && ($domain ne '')) {
     my $address = $user.":".$domain; # How the code below expects it.      my $address = $user.":".$domain; # How the code below expects it.

Removed from v.1.31  
changed lines
  Added in v.1.35


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