Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.30 and 1.35.2.2

version 1.30, 2006/05/30 20:09:25 version 1.35.2.2, 2006/06/30 02:06:15
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 453  sub disnew { Line 453  sub disnew {
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
        'nm' => 'New Messages',         'nm' => 'New Messages',
        'su' => 'Subject',         'su' => 'Subject',
                                        'co' => 'Course/Group',                                         'co' => 'Course',
        'da' => 'Date',         'da' => 'Date',
        'us' => 'Username',         'us' => 'Username',
        'op' => 'Open',         'op' => 'Open',
Line 622  ENDDISHEADER Line 622  ENDDISHEADER
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revcourse") {      if ($env{'form.sortedby'} eq "revcourse") {
         $r->print('<a href = "?sortedby=course'.$fsqs.'">'.&mt('Course/Group').'</a>');          $r->print('<a href = "?sortedby=course'.$fsqs.'">'.&mt('Course').'</a>');
     } else {      } else {
         $r->print('<a href = "?sortedby=revcourse'.$fsqs.'">'.&mt('Course/Group').'</a>');          $r->print('<a href = "?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revstatus") {      if ($env{'form.sortedby'} eq "revstatus") {
Line 883  ENDUPLOAD Line 883  ENDUPLOAD
        my $studentsel = &discourse();         my $studentsel = &discourse();
        $r->print($studentsel);         $r->print($studentsel);
     }      }
       if ($env{'form.displayedcrit'}) {
    $r->print('<input type="hidden" name="displayedcrit" value="true" />');
       }
     $r->print('</form>'.      $r->print('</form>'.
       &Apache::lonfeedback::generate_preview_button('compemail','message').        &Apache::lonfeedback::generate_preview_button('compemail','message').
       &Apache::lonhtmlcommon::htmlareaselectactive('message'));        &Apache::lonhtmlcommon::htmlareaselectactive('message'));
Line 976  $content{'sendername'}.':'. Line 979  $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 1012  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 1058  ENDTREC Line 1055  ENDTREC
         ($env{'form.recdomain'}) && ($env{'form.recuname'})) {          ($env{'form.recdomain'}) && ($env{'form.recuname'})) {
         chomp($env{'form.newrecord'});          chomp($env{'form.newrecord'});
         if ($env{'form.newrecord'}) {          if ($env{'form.newrecord'}) {
            my $recordtxt = $env{'form.newrecord'};      &Apache::lonmsg::store_instructor_comment($env{'form.newrecord'},
            &Apache::lonmsg::user_normal_msg_raw(        $env{'form.recuname'},
             $env{'course.'.$env{'request.course.id'}.'.num'},        $env{'form.recdomain'});
             $env{'course.'.$env{'request.course.id'}.'.domain'},  
             &mt('Record').  
      ' ['.$env{'form.recuname'}.':'.$env{'form.recdomain'}.']',  
     $recordtxt);  
         }          }
         $r->print('<h3>'.&Apache::loncommon::plainname($env{'form.recuname'},          $r->print('<h3>'.&Apache::loncommon::plainname($env{'form.recuname'},
      $env{'form.recdomain'}).'</h3>');       $env{'form.recdomain'}).'</h3>');
Line 1096  sub examblock { Line 1089  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 1391  sub build_block_table { Line 1382  sub build_block_table {
     my ($r,$startblock,$endblock,$setters) = @_;      my ($r,$startblock,$endblock,$setters) = @_;
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
         'cacb' => 'Currently active communication blocks',          'cacb' => 'Currently active communication blocks',
         'cour' => 'Course/Group',          'cour' => 'Course',
         'dura' => 'Duration',          'dura' => 'Duration',
         'blse' => 'Block set by'          'blse' => 'Block set by'
     );      );
Line 1435  sub displaymessage { Line 1426  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 1656  sub sendoffmail { Line 1644  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.
Line 1910  sub handler { Line 1899  sub handler {
  &compout($r,'',$env{'form.replyto'},undef,undef,$folder,$dismode);   &compout($r,'',$env{'form.replyto'},undef,undef,$folder,$dismode);
     } elsif ($env{'form.confirm'}) {      } elsif ($env{'form.confirm'}) {
  &printheader($r,'','Confirmed Receipt');   &printheader($r,'','Confirmed Receipt');
    my $replying = 0;
  foreach (keys %env) {   foreach (keys %env) {
     if ($_=~/^form\.rec\_(.*)$/) {      if ($_=~/^form\.rec\_(.*)$/) {
  $r->print('<b>'.&mt('Confirming Receipt').':</b> '.   $r->print('<b>'.&mt('Confirming Receipt').':</b> '.
Line 1920  sub handler { Line 1910  sub handler {
  $r->print('<b>'.&mt('Confirming Receipt').':</b> '.   $r->print('<b>'.&mt('Confirming Receipt').':</b> '.
   &Apache::lonmsg::user_crit_received($msgid).'<br>');    &Apache::lonmsg::user_crit_received($msgid).'<br>');
  &compout($r,'','','',$msgid);   &compout($r,'','','',$msgid);
    $replying = 1;
     }      }
  }   }
  &discrit($r);   if (!$replying) {
       &discrit($r);
    }
     } elsif ($env{'form.critical'}) {      } elsif ($env{'form.critical'}) {
  &printheader($r,'','Displaying Critical Messages');   &printheader($r,'','Displaying Critical Messages');
  &discrit($r);   &discrit($r);
Line 2016  sub handler { Line 2009  sub handler {
       $env{'form.subject'},        $env{'form.subject'},
       $env{'form.message'},'/adm/communicate','public');        $env{'form.message'},'/adm/communicate','public');
  }   }
  &disall($r,($folder?$folder:$dismode));   if (!$env{'form.displayedcrit'}) {
       &disall($r,($folder?$folder:$dismode));
    }
     } elsif ($env{'form.newfolder'}) {      } elsif ($env{'form.newfolder'}) {
  &printheader($r,'','New Folder');   &printheader($r,'','New Folder');
  &makefolder($env{'form.newfolder'});   &makefolder($env{'form.newfolder'});

Removed from v.1.30  
changed lines
  Added in v.1.35.2.2


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