[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 17 Aug 2003 19:13:32 -0000


albertel		Sun Aug 17 15:13:32 2003 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  - retabination
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.62 loncom/interface/lonmsg.pm:1.63
--- loncom/interface/lonmsg.pm:1.62	Fri Aug 15 13:57:57 2003
+++ loncom/interface/lonmsg.pm	Sun Aug 17 15:13:32 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.62 2003/08/15 17:57:57 www Exp $
+# $Id: lonmsg.pm,v 1.63 2003/08/17 19:13:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -638,13 +638,13 @@
     }
 </script>
 ENDDISHEADER
-   $r->print('<h1>Display All Messages</h1><form method=post name=disall '.
-             'action="/adm/email">'.
-	     '<table border=2><tr><th colspan=2>&nbsp</th><th>');
+    $r->print('<h1>Display All Messages</h1><form method=post name=disall '.
+	      'action="/adm/email">'.
+	      '<table border=2><tr><th colspan=2>&nbsp</th><th>');
     if ($ENV{'form.sortedby'} eq "revdate") {
 	$r->print('<a href = "?sortedby=date">Date</a></th>');
     } else {
-       $r->print('<a href = "?sortedby=revdate">Date</a></th>');
+	$r->print('<a href = "?sortedby=revdate">Date</a></th>');
     }
     $r->print('<th>');
     if ($ENV{'form.sortedby'} eq "revuser") {
@@ -671,58 +671,56 @@
      	$r->print('<a href = "?sortedby=revstatus">Status</th>');
     }
     $r->print('</tr>');
-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
-my @temp;
-foreach (@messages)
-{
- my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
+    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
+    my @temp;
+    foreach (@messages) {
+	my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
 	    &Apache::lonmsg::unpackmsgid($_);
-my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status);
- push @temp ,\@temp1;
-}
-#default sort
- @temp = sort  {$a->[0] <=> $b->[0]} @temp;    
-if ($ENV{'form.sortedby'} eq "date"){
+	my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status);
+	push @temp ,\@temp1;
+    }
+    #default sort
+    @temp = sort  {$a->[0] <=> $b->[0]} @temp;    
+    if ($ENV{'form.sortedby'} eq "date"){
         @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; 
-}
-if ($ENV{'form.sortedby'} eq "user"){
+    }
+    if ($ENV{'form.sortedby'} eq "user"){
 	@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;
-}
-if ($ENV{'form.sortedby'} eq "domain"){
+    }
+    if ($ENV{'form.sortedby'} eq "domain"){
         @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;
-}
-if ($ENV{'form.sortedby'} eq "subject"){
+    }
+    if ($ENV{'form.sortedby'} eq "subject"){
         @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;
-}
-if ($ENV{'form.sortedby'} eq "status"){
+    }
+    if ($ENV{'form.sortedby'} eq "status"){
         @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;
-}
-	foreach (@temp){
-	    my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= @$_;
-	 if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
+    }
+    foreach (@temp){
+	my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= @$_;
+	if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
 	    if ($status eq 'new') {
 		$r->print('<tr bgcolor="#FFBB77">');
 	    } elsif ($status eq 'read') {
 		$r->print('<tr bgcolor="#BBBB77">');
 	    } elsif ($status eq 'replied') {
 		$r->print('<tr bgcolor="#AAAA88">'); 
-
 	    } else {
 		$r->print('<tr bgcolor="#99BBBB">');
 	    }
@@ -733,9 +731,9 @@
 		      $fromname.'</td><td>'.$fromdomain.'</td><td>'.
 		      &Apache::lonnet::unescape($shortsubj).'</td><td>'.
                       $status.'</td></tr>');
-	 }
-	}   
- $r->print('</table><p>'.
+	}
+    }   
+    $r->print('</table><p>'.
               '<a href="javascript:checkall()">Check All</a>&nbsp;'.
               '<a href="javascript:uncheckall()">Uncheck All</a><p>'.
               '<input type=submit name="markeddel" value="Delete Checked">'.