--- loncom/interface/lonpickstudent.pm 2006/03/16 21:15:16 1.12
+++ loncom/interface/lonpickstudent.pm 2013/07/15 16:13:22 1.32
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a student from the classlist
#
-# $Id: lonpickstudent.pm,v 1.12 2006/03/16 21:15:16 raeburn Exp $
+# $Id: lonpickstudent.pm,v 1.32 2013/07/15 16:13:22 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,6 +34,8 @@ use Apache::loncommon;
use Apache::loncoursedata;
use Apache::lonnet;
use Apache::lonlocal;
+use Apache::longroup;
+use LONCAPA;
sub handler {
my $r = shift;
@@ -42,12 +44,13 @@ sub handler {
return OK if $r->header_only;
# ------------------------------------------------------------ Print the screen
- $r->print(&Apache::loncommon::start_page("Selecting a User"));
+ $r->print(&Apache::loncommon::start_page("Selecting a User",undef,
+ {'no_nav_bar' => 1}));
&Apache::loncommon::get_unprocessed_cgi
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement',
- 'roles']);
+ 'roles','courseadvonly','clicker']);
# Allowed?
my $allowed;
my $scope = $env{'request.course.id'};
@@ -65,29 +68,37 @@ sub handler {
}
# See if filter present
-
my $filter=$env{'form.filter'};
- $filter=~s/\W//g;
- unless ($filter) { $filter='.'; }
-
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
- my $classlist=&Apache::loncoursedata::get_classlist();
- my %grouplist=&Apache::lonnet::get_group_membership($cdom,$cnum);
- my $now = time;
- my %allgroups;
- my @coursegroups = ();
- if (&Apache::loncommon::coursegroups(\%allgroups,$cdom,$cnum)) {
- @coursegroups = keys(%allgroups);
+ my $filtermsg;
+ my $encoded_filter = &HTML::Entities::encode($filter,'<>&"');
+ $filter = quotemeta($filter);
+ my $change = &mt('Change');
+ my $filterbutton =<
'.
+ &mt('Showing users with a name starting with [_1]',
+ $filterbutton).'
';
+ }
+ if ($filter eq '') {
+ $filter = '.'
}
# --------------------------------------- There is such a user, get environment
$r->print(<
'. + ' | '. + ''.$uname.' | '.$udom. + ' | '. + &Apache::loncommon::aboutmewrapper($fullname, + $uname,$udom). + ' | '.$id.' | '.$section. + ' | '.$grouplist.' | '. + ($clicker?''.$markedupclicker.' | ':''). + &Apache::loncommon::end_data_table_row(); + } + } + } + if (!$result) { + $r->print(''. + ' | '.&mt('username').' | '. + ''.&mt('domain').' | '. + ''.&mt('Name').' | '. + ''.&mt('ID').' | '. + ''.&mt('section').' | '. + ''.&mt('active group(s)').' | '. + ($clicker?''.&mt('clicker').' | ':''). + &Apache::loncommon::end_data_table_header_row(). + $result. + &Apache::loncommon::end_data_table()); + } + } + } else { + $r->print('
---|---|---|---|---|---|
'. - ' | '. - ''.$uname.' | '.$udom. - ' | '. - &Apache::loncommon::aboutmewrapper( - $fullname, - $uname,$udom).' | '. - &Apache::lonnet::plaintext($urole). - ' | '. + ' | '. + ''.$uname.' | '. + ''.$udom.' | '. + &Apache::loncommon::aboutmewrapper($users{$user}{'fullname'}, + $uname,$udom).' | '. + ''. + join(', ',sort(map {&Apache::lonnet::plaintext($_)} + (@{$users{$user}{'roles'}}))). + ' | '. + &Apache::loncommon::end_data_table_row()); + } + $r->print(&Apache::loncommon::end_data_table().''); } - $r->print('