Diff for /loncom/interface/lonmsg.pm between versions 1.166 and 1.167

version 1.166, 2006/01/03 03:18:58 version 1.167, 2006/01/03 04:17:02
Line 268  sub buildmsgid { Line 268  sub buildmsgid {
 sub unpackmsgid {  sub unpackmsgid {
     my ($msgid,$folder,$skipstatus)=@_;      my ($msgid,$folder,$skipstatus)=@_;
     $msgid=&Apache::lonnet::unescape($msgid);      $msgid=&Apache::lonnet::unescape($msgid);
     my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid)=split(/\:/,      my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid,
                           &Apache::lonnet::unescape($msgid));                       $processid)=split(/\:/,&Apache::lonnet::unescape($msgid));
       if (!defined($processid)) { $fromcid = ''; }
     my %status=();      my %status=();
     unless ($skipstatus) {      unless ($skipstatus) {
         my $suffix=&foldersuffix($folder);          my $suffix=&foldersuffix($folder);
Line 856  sub sortedmessages { Line 857  sub sortedmessages {
     my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix);      my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix);
     #unpack the varibles and repack into temp for sorting      #unpack the varibles and repack into temp for sorting
     my @temp;      my @temp;
       my %descriptions;
     foreach (@messages) {      foreach (@messages) {
  my $msgid=&Apache::lonnet::escape($_);   my $msgid=&Apache::lonnet::escape($_);
  my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=   my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=
     &Apache::lonmsg::unpackmsgid($msgid,$folder);      &Apache::lonmsg::unpackmsgid($msgid,$folder);
         my $description;          my $description = &get_course_desc($fromcid,\%descriptions);
         if ($fromcid) {  
             $description = &get_course_desc($fromcid);  
         }  
  my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status,   my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status,
      $msgid,$description);       $msgid,$description);
         # Check whether message was sent during blocking period.          # Check whether message was sent during blocking period.
Line 917  sub sortedmessages { Line 916  sub sortedmessages {
 }  }
   
 sub get_course_desc {  sub get_course_desc {
     my ($fromcid) = @_;      my ($fromcid,$descriptions) = @_;
     my $description;      my $description;
     if ($fromcid =~ /^\d+$/) { return $description; }       if (!$fromcid) {
     if (defined($env{'course.'.$fromcid.'.description'})) {          return $description;
        $description = $env{'course.'.$fromcid.'.description'};  
     } else {      } else {
        my %courseinfo=&Apache::lonnet::coursedescription($fromcid);          if (defined($$descriptions{$fromcid})) {
         $description = $courseinfo{'description'};              $description = $$descriptions{$fromcid};
           } else {
               if (defined($env{'course.'.$fromcid.'.description'})) {
                   $description = $env{'course.'.$fromcid.'.description'};
               } else {
                   my %courseinfo=&Apache::lonnet::coursedescription($fromcid);                $description = $courseinfo{'description'};
                   $description = $courseinfo{'description'};
               }
               $$descriptions{$fromcid} = $description;
           }
           return $description;
     }      }
     return $description;  
 }  }
   
 # ======================================================== Display new messages  # ======================================================== Display new messages
Line 955  sub disnew { Line 962  sub disnew {
     my $numblocked = 0;      my $numblocked = 0;
     # Check for blocking of display because of scheduled online exams.      # Check for blocking of display because of scheduled online exams.
     &blockcheck(\%setters,\$startblock,\$endblock);      &blockcheck(\%setters,\$startblock,\$endblock);
       my %descriptions;
     foreach (@msgids) {      foreach (@msgids) {
         my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=          my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=
     &Apache::lonmsg::unpackmsgid($_);      &Apache::lonmsg::unpackmsgid($_);
         if (defined($sendtime) && $sendtime!~/error/) {          if (defined($sendtime) && $sendtime!~/error/) {
             my $description;              my $description = &get_course_desc($fromcid,\%descriptions);
             if ($fromcid) {  
                 $description = &get_course_desc($fromcid);  
             }  
             my $numsendtime = $sendtime;              my $numsendtime = $sendtime;
             $sendtime = &Apache::lonlocal::locallocaltime($sendtime);              $sendtime = &Apache::lonlocal::locallocaltime($sendtime);
             if ($status eq 'new') {              if ($status eq 'new') {

Removed from v.1.166  
changed lines
  Added in v.1.167


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