Diff for /loncom/interface/lonmsg.pm between versions 1.62 and 1.63

version 1.62, 2003/08/15 17:57:57 version 1.63, 2003/08/17 19:13:32
Line 638  sub disall { Line 638  sub disall {
     }      }
 </script>  </script>
 ENDDISHEADER  ENDDISHEADER
    $r->print('<h1>Display All Messages</h1><form method=post name=disall '.      $r->print('<h1>Display All Messages</h1><form method=post name=disall '.
              'action="/adm/email">'.        'action="/adm/email">'.
      '<table border=2><tr><th colspan=2>&nbsp</th><th>');        '<table border=2><tr><th colspan=2>&nbsp</th><th>');
     if ($ENV{'form.sortedby'} eq "revdate") {      if ($ENV{'form.sortedby'} eq "revdate") {
  $r->print('<a href = "?sortedby=date">Date</a></th>');   $r->print('<a href = "?sortedby=date">Date</a></th>');
     } else {      } else {
        $r->print('<a href = "?sortedby=revdate">Date</a></th>');   $r->print('<a href = "?sortedby=revdate">Date</a></th>');
     }      }
     $r->print('<th>');      $r->print('<th>');
     if ($ENV{'form.sortedby'} eq "revuser") {      if ($ENV{'form.sortedby'} eq "revuser") {
Line 671  ENDDISHEADER Line 671  ENDDISHEADER
       $r->print('<a href = "?sortedby=revstatus">Status</th>');        $r->print('<a href = "?sortedby=revstatus">Status</th>');
     }      }
     $r->print('</tr>');      $r->print('</tr>');
 my @messages = split(/\&/,&Apache::lonnet::reply('keys:'.$ENV{'user.domain'}.':'.$ENV{'user.name'}.':nohist_email',$ENV{'user.home'}));      my @messages = split(/\&/,&Apache::lonnet::reply('keys:'.$ENV{'user.domain'}.':'.$ENV{'user.name'}.':nohist_email',$ENV{'user.home'}));
 #unpack the varibles and repack into temp for sorting      #unpack the varibles and repack into temp for sorting
 my @temp;      my @temp;
 foreach (@messages)      foreach (@messages) {
 {   my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
  my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=  
     &Apache::lonmsg::unpackmsgid($_);      &Apache::lonmsg::unpackmsgid($_);
 my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status);   my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status);
  push @temp ,\@temp1;   push @temp ,\@temp1;
 }      }
 #default sort      #default sort
  @temp = sort  {$a->[0] <=> $b->[0]} @temp;          @temp = sort  {$a->[0] <=> $b->[0]} @temp;    
 if ($ENV{'form.sortedby'} eq "date"){      if ($ENV{'form.sortedby'} eq "date"){
         @temp = sort  {$a->[0] <=> $b->[0]} @temp;              @temp = sort  {$a->[0] <=> $b->[0]} @temp;    
 }      }
 if ($ENV{'form.sortedby'} eq "revdate"){      if ($ENV{'form.sortedby'} eq "revdate"){
     @temp = sort  {$b->[0] <=> $a->[0]} @temp;       @temp = sort  {$b->[0] <=> $a->[0]} @temp; 
 }      }
 if ($ENV{'form.sortedby'} eq "user"){      if ($ENV{'form.sortedby'} eq "user"){
  @temp = sort  {lc($a->[2]) cmp lc($b->[2])} @temp;   @temp = sort  {lc($a->[2]) cmp lc($b->[2])} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "revuser"){      if ($ENV{'form.sortedby'} eq "revuser"){
  @temp = sort  {lc($b->[2]) cmp lc($a->[2])} @temp;   @temp = sort  {lc($b->[2]) cmp lc($a->[2])} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "domain"){      if ($ENV{'form.sortedby'} eq "domain"){
         @temp = sort  {$a->[3] cmp $b->[3]} @temp;          @temp = sort  {$a->[3] cmp $b->[3]} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "revdomain"){      if ($ENV{'form.sortedby'} eq "revdomain"){
         @temp = sort  {$b->[3] cmp $a->[3]} @temp;          @temp = sort  {$b->[3] cmp $a->[3]} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "subject"){      if ($ENV{'form.sortedby'} eq "subject"){
         @temp = sort  {lc($a->[1]) cmp lc($b->[1])} @temp;          @temp = sort  {lc($a->[1]) cmp lc($b->[1])} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "revsubject"){      if ($ENV{'form.sortedby'} eq "revsubject"){
         @temp = sort  {lc($b->[1]) cmp lc($a->[1])} @temp;          @temp = sort  {lc($b->[1]) cmp lc($a->[1])} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "status"){      if ($ENV{'form.sortedby'} eq "status"){
         @temp = sort  {$a->[4] cmp $b->[4]} @temp;          @temp = sort  {$a->[4] cmp $b->[4]} @temp;
 }      }
 if ($ENV{'form.sortedby'} eq "revstatus"){      if ($ENV{'form.sortedby'} eq "revstatus"){
         @temp = sort  {$b->[4] cmp $a->[4]} @temp;          @temp = sort  {$b->[4] cmp $a->[4]} @temp;
 }      }
  foreach (@temp){      foreach (@temp){
     my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= @$_;   my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= @$_;
  if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {   if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
     if ($status eq 'new') {      if ($status eq 'new') {
  $r->print('<tr bgcolor="#FFBB77">');   $r->print('<tr bgcolor="#FFBB77">');
     } elsif ($status eq 'read') {      } elsif ($status eq 'read') {
  $r->print('<tr bgcolor="#BBBB77">');   $r->print('<tr bgcolor="#BBBB77">');
     } elsif ($status eq 'replied') {      } elsif ($status eq 'replied') {
  $r->print('<tr bgcolor="#AAAA88">');    $r->print('<tr bgcolor="#AAAA88">'); 
   
     } else {      } else {
  $r->print('<tr bgcolor="#99BBBB">');   $r->print('<tr bgcolor="#99BBBB">');
     }      }
Line 733  if ($ENV{'form.sortedby'} eq "revstatus" Line 731  if ($ENV{'form.sortedby'} eq "revstatus"
       $fromname.'</td><td>'.$fromdomain.'</td><td>'.        $fromname.'</td><td>'.$fromdomain.'</td><td>'.
       &Apache::lonnet::unescape($shortsubj).'</td><td>'.        &Apache::lonnet::unescape($shortsubj).'</td><td>'.
                       $status.'</td></tr>');                        $status.'</td></tr>');
  }   }
  }         }   
  $r->print('</table><p>'.      $r->print('</table><p>'.
               '<a href="javascript:checkall()">Check All</a>&nbsp;'.                '<a href="javascript:checkall()">Check All</a>&nbsp;'.
               '<a href="javascript:uncheckall()">Uncheck All</a><p>'.                '<a href="javascript:uncheckall()">Uncheck All</a><p>'.
               '<input type=submit name="markeddel" value="Delete Checked">'.                '<input type=submit name="markeddel" value="Delete Checked">'.

Removed from v.1.62  
changed lines
  Added in v.1.63


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