--- loncom/interface/lonpickstudent.pm 2006/12/06 20:54:13 1.20
+++ loncom/interface/lonpickstudent.pm 2007/08/02 01:39:26 1.22
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a student from the classlist
#
-# $Id: lonpickstudent.pm,v 1.20 2006/12/06 20:54:13 albertel Exp $
+# $Id: lonpickstudent.pm,v 1.22 2007/08/02 01:39:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -70,10 +70,23 @@ sub handler {
# See if filter present
my $filter=$env{'form.filter'};
my $filtermsg;
- if ($filter ne '') {
- $filtermsg = ' '.&mt('Name starting with').' "'.$filter.'" ';
- $filter = quotemeta($filter);
- } else {
+ my $encoded_filter = &HTML::Entities::encode($filter,'<>&"');
+ $filter = quotemeta($filter);
+ my $change = &mt('Change');
+ my $filterbutton =<
+
+FILTER
+ foreach my $name ('form','unameelement','udomelement','roles') {
+ my $value = &HTML::Entities::encode($env{"form.$name"},'<>&"');
+ $filterbutton .= <
+HIDDEN
+ }
+ $filtermsg = ' '.
+ &mt('Showing users with a name starting with [_1]',
+ $filterbutton).' ';
+ if ($filter eq '') {
$filter = '.'
}
@@ -125,19 +138,10 @@ ENDSCRIPT
$r->print($filtermsg);
- $r->print('
'.
- &Apache::loncommon::start_data_table().
- &Apache::loncommon::start_data_table_header_row().
- &Apache::loncommon::end_data_table_header_row().
- '
'.
- ''.&mt('username').' '.
- ''.&mt('domain').' '.
- ''.&mt('Name').' '.
- ''.&mt('ID').' '.
- ''.&mt('section').' '.
- ''.&mt('active group(s)').' '.
- &Apache::loncommon::end_data_table_header_row());
+ $r->print('');
+
# ------------------------------------------------------------------ Students
+ my $result;
foreach my $user (sort(keys(%$classlist))) {
# the following undefs are for 'domain', and 'username' respectively.
my (undef,undef,$end,$start,$id,$section,$fullname,$status)=
@@ -159,7 +163,7 @@ ENDSCRIPT
}
}
$grouplist =~ s/,$//;
- $r->print(&Apache::loncommon::start_data_table_row().
+ $result .=&Apache::loncommon::start_data_table_row().
''.
' '.
@@ -169,12 +173,27 @@ ENDSCRIPT
$uname,$udom).
''.$id.' '.$section.
' '.$grouplist.' '.
- &Apache::loncommon::end_data_table_row());
+ &Apache::loncommon::end_data_table_row();
}
}
}
-
- $r->print(&Apache::loncommon::end_data_table().'');
+ if (!$result) {
+ $r->print(''.&mt('No students found.').'
');
+ } else {
+ $r->print(&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ &Apache::loncommon::end_data_table_header_row().
+ ' '.
+ ''.&mt('username').' '.
+ ''.&mt('domain').' '.
+ ''.&mt('Name').' '.
+ ''.&mt('ID').' '.
+ ''.&mt('section').' '.
+ ''.&mt('active group(s)').' '.
+ &Apache::loncommon::end_data_table_header_row().
+ $result.
+ &Apache::loncommon::end_data_table());
+ }
} else {
$r->print(''.&mt('Users with Roles Assigned by').' '.
&Apache::loncommon::plainname($env{'user.name'},