--- loncom/interface/lonselstudent.pm 2006/06/30 01:43:06 1.8 +++ loncom/interface/lonselstudent.pm 2007/11/01 20:04:17 1.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # lonselstudent.pm : Reusable subs for student selection. # -# $Id: lonselstudent.pm,v 1.8 2006/06/30 01:43:06 albertel Exp $ +# $Id: lonselstudent.pm,v 1.11 2007/11/01 20:04:17 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -28,8 +28,9 @@ package Apache::lonselstudent; use Apache::lonnet; -use Apache::loncoursedata; -use HTML::Entities; +use Apache::lonlocal; +use Apache::loncoursedata(); +use HTML::Entities(); # # Utility function used when rendering tags. @@ -110,9 +111,8 @@ sub get_people_in_class { my $classlist = &Apache::loncoursedata::get_classlist(); my @keys = keys(%{$classlist}); - # Sort by: Section, name + # Sort by: fullname, username @keys = sort { - lc($classlist->{$a}[$section]) cmp lc($classlist->{$b}[$section]) || lc($classlist->{$a}[$fullname]) cmp lc($classlist->{$b}[$fullname]) || lc($a) cmp lc($b) } (@keys); @@ -271,12 +271,12 @@ sub render_student_list { if (elem != null) { for (k = 0; k < elem.length; k++) { if (elem.options[k].selected) { - what = elem.options[k].text; - if (what == 'All Students') { + what = elem.options[k].value; + if (what == 'allstudents') { setAllStudents(value, which); - } else if (what == 'All Course Personnel') { + } else if (what == 'allpersonnel') { setAllCoursePersonnel(value, which); - } else if (what == 'No Section') { + } else if (what == 'nosection') { setSection('',value, which); } else { setSection(what, value, which); @@ -323,18 +323,18 @@ SCRIPT } $result .= ''; $result .= ''; } @@ -345,11 +345,11 @@ SCRIPT $result .= &Apache::loncommon::start_data_table(); $result .= &Apache::loncommon::start_data_table_header_row(); - $result .= 'Name'."\n"; - $result .= ' Section'."\n"; - $result .= ' Status'."\n"; - $result .= ' Role'."\n"; - $result .= ' Username : Domain'."\n"; + $result .= ''.&mt('Name').''."\n"; + $result .= ' '.&mt('Section').''."\n"; + $result .= ' '.&mt('Status').''."\n"; + $result .= ' '.&mt('Role').''."\n"; + $result .= ' '.&mt('Username : Domain').''."\n"; $result .= &Apache::loncommon::end_data_table_header_row(); my $input_type; @@ -363,7 +363,7 @@ SCRIPT for my $student (@$students) { $result .= &Apache::loncommon::start_data_table_row(). '[0]; # Figure out which students are checked by default...