--- loncom/interface/loncreateuser.pm 2016/10/22 17:57:54 1.406.2.5
+++ loncom/interface/loncreateuser.pm 2016/10/10 02:53:02 1.415
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.406.2.5 2016/10/22 17:57:54 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.415 2016/10/10 02:53:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -251,13 +251,15 @@ sub build_tools_display {
'unofficial' => 'Can request creation of unofficial courses',
'community' => 'Can request creation of communities',
'textbook' => 'Can request creation of textbook courses',
+ 'placement' => 'Can request creation of placement tests',
'requestauthor' => 'Can request author space',
);
if ($context eq 'requestcourses') {
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
'requestcourses.official','requestcourses.unofficial',
- 'requestcourses.community','requestcourses.textbook');
- @usertools = ('official','unofficial','community','textbook');
+ 'requestcourses.community','requestcourses.textbook',
+ 'requestcourses.placement');
+ @usertools = ('official','unofficial','community','textbook','placement');
@options =('norequest','approval','autolimit','validate');
%validations = &Apache::lonnet::auto_courserequest_checks($ccdomain);
%reqtitles = &courserequest_titles();
@@ -447,12 +449,14 @@ sub coursereq_externaluser {
'unofficial' => 'Can request creation of unofficial courses',
'community' => 'Can request creation of communities',
'textbook' => 'Can request creation of textbook courses',
+ 'placement' => 'Can request creation of placement tests',
);
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
'reqcrsotherdom.official','reqcrsotherdom.unofficial',
- 'reqcrsotherdom.community','reqcrsotherdom.textbook');
- @usertools = ('official','unofficial','community','textbook');
+ 'reqcrsotherdom.community','reqcrsotherdom.textbook',
+ 'reqcrsotherdom.placement');
+ @usertools = ('official','unofficial','community','textbook','placement');
@options = ('approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($cdom);
my $optregex = join('|',@options);
@@ -529,13 +533,13 @@ sub domainrole_req {
sub domadhocroles {
my ($ccuname,$ccdomain) = @_;
- my $confname = &Apache::lonnet::get_domainconfiguser($env{'request.role.domain'});
+ my $confname = &Apache::lonnet::get_domainconfiguser($env{'request.role.domain'});
my %existing=&Apache::lonnet::dump('roles',$env{'request.role.domain'},
$confname,'rolesdef_');
my $output;
if (keys(%existing) > 0) {
my @current;
- my $curradhoc = 'adhocroles.'.$env{'request.role.domain'};
+ my $curradhoc = 'adhocroles.'.$env{'request.role.domain'};
my %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,$curradhoc);
if ($userenv{$curradhoc}) {
@current = split(/,/,$userenv{$curradhoc});
@@ -556,7 +560,7 @@ sub domadhocroles {
&Apache::loncommon::start_data_table_header_row().
'
'.&mt('Action').'
'.&mt('Role').'
'.
'
'.&mt('Privileges in Course').'
'.
- &Apache::loncommon::end_data_table_header_row();
+ &Apache::loncommon::end_data_table_header_row();
foreach my $key (sort(keys(%customroles))) {
$output .= &Apache::loncommon::start_data_table_row();
if (grep(/^\Q$key\E$/,@current)) {
@@ -579,7 +583,7 @@ sub domadhocroles {
}
my @privs = split(/:/,$customroles{$key}{$level});
foreach my $item (@privs) {
- next if ($item eq '');
+ next if ($item eq '');
my ($priv,$cond) = split(/\&/,$item);
$output .= &Apache::lonnet::plaintext($priv,'Course').$suffix.' ';
}
@@ -599,6 +603,7 @@ sub courserequest_titles {
unofficial => 'Unofficial',
community => 'Communities',
textbook => 'Textbook',
+ placement => 'Placement Tests',
norequest => 'Not allowed',
approval => 'Approval by Dom. Coord.',
validate => 'With validation',
@@ -732,8 +737,6 @@ sub print_username_entry_form {
$helpitem = 'Course_Editing_Custom_Roles';
} elsif ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
- } elsif ($env{'form.action'} eq 'accesslogs') {
- $helpitem = 'Domain_User_Access_Logs';
}
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
if ($env{'form.action'} eq 'custom') {
@@ -763,7 +766,6 @@ sub print_username_entry_form {
'srst' => 'Search for a user and enroll as a student',
'srme' => 'Search for a user and enroll as a member',
'srad' => 'Search for a user and modify/add user information or roles',
- 'srva' => 'Search for a user and view access log information',
'usr' => "Username",
'dom' => "Domain",
'ecrp' => "Define or Edit Custom Role",
@@ -816,8 +818,6 @@ sub print_username_entry_form {
} else {
$actiontext = $lt{'srst'};
}
- } elsif ($env{'form.action'} eq 'accesslogs') {
- $actiontext = $lt{'srva'};
}
$r->print("
$actiontext
");
if ($env{'form.origform'} ne 'crtusername') {
@@ -826,7 +826,7 @@ sub print_username_entry_form {
' ');
}
}
- $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,1));
+ $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype));
}
}
@@ -869,7 +869,7 @@ END
}
sub entry_form {
- my ($dom,$srch,$forcenewuser,$context,$responsemsg,$crstype,$fixeddom) = @_;
+ my ($dom,$srch,$forcenewuser,$context,$responsemsg,$crstype) = @_;
my ($usertype,$inexact);
if (ref($srch) eq 'HASH') {
if (($srch->{'srchin'} eq 'dom') &&
@@ -889,12 +889,10 @@ sub entry_form {
&Apache::lonuserutils::can_create_user($dom,$context,$usertype);
my ($userpicker,$cansearch) =
&Apache::loncommon::user_picker($dom,$srch,$forcenewuser,
- 'document.crtuser',$cancreate,$usertype,$context,$fixeddom);
+ 'document.crtuser',$cancreate,$usertype);
my $srchbutton = &mt('Search');
if ($env{'form.action'} eq 'singlestudent') {
$srchbutton = &mt('Search and Enroll');
- } elsif ($env{'form.action'} eq 'accesslogs') {
- $srchbutton = &mt('Search');
} elsif ($cancreate && $responsemsg ne '' && $inexact) {
$srchbutton = &mt('Search or Add New User');
}
@@ -911,7 +909,7 @@ ENDBLOCK
} else {
$output = '
'.$userpicker.'
';
}
- if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs')) {
+ if ($env{'form.phase'} eq '') {
my $defdom=$env{'request.role.domain'};
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
my %lt=&Apache::lonlocal::texthash(
@@ -1027,11 +1025,9 @@ ENDSCRIPT
'usrch' => "User Search to add/modify roles",
'stusrch' => "User Search to enroll student",
'memsrch' => "User Search to enroll member",
- 'srcva' => "Search for a user and view access log information",
'usel' => "Select a user to add/modify roles",
'stusel' => "Select a user to enroll as a student",
'memsel' => "Select a user to enroll as a member",
- 'vacsel' => "Select a user to view access log",
'username' => "username",
'domain' => "domain",
'lastname' => "last name",
@@ -1080,10 +1076,6 @@ ENDSCRIPT
$r->print($lt{'stusel'});
}
$r->print('');
- } elsif ($env{'form.action'} eq 'accesslogs') {
- $r->print("$lt{'srcva'} ");
- $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,'accesslogs',undef,undef,1));
- $r->print('