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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 17 Feb 2005 03:36:06 -0000


albertel		Wed Feb 16 22:36:06 2005 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  - showing the list of students in has order doesn't seem like a good idea, how about name order instead
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.133 loncom/interface/lonmsg.pm:1.134
--- loncom/interface/lonmsg.pm:1.133	Wed Feb  2 16:35:16 2005
+++ loncom/interface/lonmsg.pm	Wed Feb 16 22:36:05 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.133 2005/02/02 21:35:16 www Exp $
+# $Id: lonmsg.pm,v 1.134 2005/02/17 03:36:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -693,7 +693,15 @@
         }
     }
     $r->print('</table><table>');
-    while (my ($student,$info) = each(%$classlist)) {
+    my $sort = sub {
+	my $aname=lc($classlist->{$a}[&Apache::loncoursedata::CL_FULLNAME()]);
+	if (!$aname) { $aname=$a; }
+	my $bname=lc($classlist->{$b}[&Apache::loncoursedata::CL_FULLNAME()]);
+	if (!$bname) { $bname=$b; }
+	return $aname cmp $bname;
+    };
+    foreach my $student (sort $sort (keys(%{$classlist}))) {
+	my $info=$classlist->{$student};
         my ($sname,$sdom,$status,$fullname,$section) =
             (@{$info}[&Apache::loncoursedata::CL_SNAME(),
                       &Apache::loncoursedata::CL_SDOM(),