--- loncom/interface/loncreateuser.pm 2024/12/29 17:15:45 1.406.2.22
+++ loncom/interface/loncreateuser.pm 2017/08/11 00:24:53 1.446
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.406.2.22 2024/12/29 17:15:45 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.446 2017/08/11 00:24:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -71,7 +71,6 @@ use Apache::longroup;
use Apache::lonuserutils;
use Apache::loncoursequeueadmin;
use LONCAPA qw(:DEFAULT :match);
-use HTML::Entities;
my $loginscript; # piece of javascript used in two separate instances
my $authformnop;
@@ -253,13 +252,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();
@@ -334,6 +335,7 @@ sub build_tools_display {
'
'.$lt{$item}.' '."\n".
' '."\n".
&Apache::loncommon::start_data_table_row()."\n";
+
if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
my ($curroption,$currlimit);
my $envkey = $context.'.'.$item;
@@ -452,12 +454,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);
@@ -538,6 +542,7 @@ sub courserequest_titles {
unofficial => 'Unofficial',
community => 'Communities',
textbook => 'Textbook',
+ placement => 'Placement Tests',
norequest => 'Not allowed',
approval => 'Approval by Dom. Coord.',
validate => 'With validation',
@@ -881,7 +886,15 @@ ENDBLOCK
(!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') &&
(!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) {
my $defdom=$env{'request.role.domain'};
- my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
+ my ($trusted,$untrusted);
+ if ($context eq 'course') {
+ ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom);
+ } elsif ($context eq 'author') {
+ ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
+ } elsif ($context eq 'domain') {
+ ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('domroles',$defdom);
+ }
+ my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain',undef,undef,undef,$trusted,$untrusted);
my %lt=&Apache::lonlocal::texthash(
'enro' => 'Enroll one student',
'enrm' => 'Enroll one member',
@@ -1276,7 +1289,6 @@ sub print_user_modification_page {
'bread_crumbs_component' => 'User Management'};
if ($env{'form.popup'}) {
$args->{'no_nav_bar'} = 1;
- $args->{'add_modal'} = 1;
}
my $start_page =
&Apache::loncommon::start_page('User Management',$js,$args);
@@ -1472,8 +1484,10 @@ ENDAUTH
if ($env{'request.role.domain'} eq $ccdomain) {
$r->print(&build_tools_display($ccuname,$ccdomain,'requestcourses'));
} else {
- $r->print(&coursereq_externaluser($ccuname,$ccdomain,
- $env{'request.role.domain'}));
+ if (&Apache::lonnet::will_trust('reqcrs',$ccdomain,$env{'request.role.domain'})) {
+ $r->print(&coursereq_externaluser($ccuname,$ccdomain,
+ $env{'request.role.domain'}));
+ }
}
$r->print(&Apache::loncommon::end_data_table());
}
@@ -1488,7 +1502,7 @@ ENDAUTH
($env{'request.role.domain'} eq $ccdomain)) {
$user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
}
- $user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname,$crstype,$permission);
+ $user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname);
if ((&Apache::lonnet::allowed('mpq',$ccdomain)) ||
(&Apache::lonnet::allowed('mut',$ccdomain)) ||
(&Apache::lonnet::allowed('udp',$ccdomain))) {
@@ -2131,11 +2145,20 @@ sub new_domain_roles {
''.&mt('Start').' '.&mt('End').' '.
&Apache::loncommon::end_data_table_header_row();
my @allroles = &Apache::lonuserutils::roles_by_context('domain');
+ my $uprimary = &Apache::lonnet::domain($env{'request.role.domain'},'primary');
+ my $uintdom = &Apache::lonnet::internet_dom($uprimary);
foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) {
foreach my $role (@allroles) {
next if ($role eq 'ad');
next if (($role eq 'au') && ($ccdomain ne $thisdomain));
if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) {
+ if ($role eq 'dc') {
+ unless ($thisdomain eq $env{'request.role.domain'}) {
+ my $domprim = &Apache::lonnet::domain($thisdomain,'primary');
+ my $intdom = &Apache::lonnet::internet_dom($domprim);
+ next unless ($uintdom eq $intdom);
+ }
+ }
my $plrole=&Apache::lonnet::plaintext($role);
my %lt=&Apache::lonlocal::texthash(
'ssd' => "Set Start Date",
@@ -2166,7 +2189,7 @@ sub new_domain_roles {
}
sub user_authentication {
- my ($ccuname,$ccdomain,$formname,$crstype,$permission) = @_;
+ my ($ccuname,$ccdomain,$formname) = @_;
my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);
my $outcome;
my %lt=&Apache::lonlocal::texthash(
@@ -2204,6 +2227,7 @@ $lt{'uuas'} ($currentauth). $lt{'adcs'}.
ENDBADAUTH
}
} else { # Authentication type is valid
+
&initialize_authen_forms($ccdomain,$formname,$currentauth,'modifyuser');
my ($authformcurrent,$can_modify,@authform_others) =
&modify_login_block($ccdomain,$currentauth);
@@ -2238,43 +2262,6 @@ ENDBADAUTH
}
$outcome .= &Apache::loncommon::end_data_table();
} else {
- if (($currentauth =~ /^internal:/) &&
- (&Apache::lonuserutils::can_change_internalpass($ccuname,$ccdomain,$crstype,$permission))) {
- $outcome = <<"ENDJS";
-
-ENDJS
-
- $outcome .= ''.$lt{'ld'}.' '.
- &Apache::loncommon::start_data_table().
- &Apache::loncommon::start_data_table_row().
- ''.&mt('Internally authenticated').' '.&mt("Change user's password?").
- ' '.
- &mt('No').' '.(' 'x2).
- ' '.&mt('Yes').' '.
- ''.
- ' '.&mt('Password').' '.
- ' '.&mt('Visible input').'
'.
- &Apache::loncommon::end_data_table_row().
- &Apache::loncommon::end_data_table();
- }
if (&Apache::lonnet::allowed('udp',$ccdomain)) {
# Current user has rights to view domain preferences for user's domain
my $result;
@@ -2383,8 +2370,8 @@ sub modify_login_block {
}
sub personal_data_display {
- my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,$now,
- $captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded,$showsubmit) = @_;
+ my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,
+ $now,$captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded) = @_;
my ($output,%userenv,%canmodify,%canmodify_status);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
@@ -2467,7 +2454,7 @@ sub personal_data_display {
} else {
undef($condition);
}
- }
+ }
if ($excluded) {
unless ($excluded =~ /^\@[^\@]+$/) {
undef($condition);
@@ -2507,13 +2494,12 @@ sub personal_data_display {
$upasstwo.
&Apache::lonhtmlcommon::row_closure()."\n";
if ($usernameset eq 'free') {
- my $onclick = "toggleUsernameDisp(this,'selfcreateusername');";
+ my $onclick = "toggleUsernameDisp(this,'selfcreateusername');";
$output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n".
- ''.&mt('Use e-mail address: ').
- ' '.
- &mt('Yes').' '.(' 'x2).
- ' '.
- &mt('No').' '."\n".
+ &mt('Use e-mail address: ').
+ ' '.&mt('Yes').' '."\n".
+ (' 'x2).
+ ' '.&mt('No').' '."\n".
''.
''.&mt('Preferred username').
' '.
@@ -2621,16 +2607,12 @@ sub personal_data_display {
&Apache::lonhtmlcommon::row_closure(1);
$rowcount ++;
}
- if ($showsubmit) {
- my $submit_text = &mt('Create account');
- $output .= &Apache::lonhtmlcommon::row_title()."\n".
- ' ';
- if ($usertype ne '') {
- $output .= ' '.
- &Apache::lonhtmlcommon::row_closure(1);
- }
- }
+ my $submit_text = &mt('Create account');
+ $output .= &Apache::lonhtmlcommon::row_title()."\n".
+ ' '.
+ ' '.
+ &Apache::lonhtmlcommon::row_closure(1);
}
$output .= &Apache::lonhtmlcommon::end_pick_box();
if (wantarray) {
@@ -2714,7 +2696,7 @@ sub get_inststatuses {
# ================================================================= Phase Three
sub update_user_data {
- my ($r,$context,$crstype,$brcrum,$showcredits,$permission) = @_;
+ my ($r,$context,$crstype,$brcrum,$showcredits) = @_;
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
# Error messages
@@ -2851,7 +2833,7 @@ sub update_user_data {
my (%alerts,%rulematch,%inst_results,%curr_rules);
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
my @usertools = ('aboutme','blog','webdav','portfolio');
- my @requestcourses = ('official','unofficial','community','textbook');
+ my @requestcourses = ('official','unofficial','community','textbook','placement');
my @requestauthor = ('requestauthor');
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
@@ -2980,7 +2962,7 @@ sub update_user_data {
$env{'form.ccdomain'},$env{'form.ccuname'});
}
}
- $r->print(' '.&mt('Home Server').': '.$uhome.' '.
+ $r->print(' '.&mt('Home server').': '.$uhome.' '.
&Apache::lonnet::hostname($uhome));
} elsif (($env{'form.login'} ne 'nochange') &&
($env{'form.login'} ne '' )) {
@@ -2995,19 +2977,12 @@ sub update_user_data {
&Apache::lonnet::modifyuserauth(
$env{'form.ccdomain'},$env{'form.ccuname'},
$amode,$genpwd));
- $r->print(' '.&mt('Home Server').': '.&Apache::lonnet::homeserver
+ $r->print(' '.&mt('Home server').': '.&Apache::lonnet::homeserver
($env{'form.ccuname'},$env{'form.ccdomain'}));
} else {
# Okay, this is a non-fatal error.
- $r->print($error.&mt('You do not have privileges to modify the authentication configuration for this user.').$end);
+ $r->print($error.&mt('You do not have the authority to modify this users authentication information.').$end);
}
- } elsif (($env{'form.intarg'} ne '') &&
- (&Apache::lonnet::queryauthenticate($env{'form.ccuname'},$env{'form.ccdomain'}) =~ /^internal:/) &&
- (&Apache::lonuserutils::can_change_internalpass($env{'form.ccuname'},$env{'form.ccdomain'},$crstype,$permission))) {
- $r->print('Modifying authentication: '.
- &Apache::lonnet::modifyuserauth(
- $env{'form.ccdomain'},$env{'form.ccuname'},
- 'internal',$env{'form.intarg'}));
}
$r->rflush(); # Finish display of header before time consuming actions start
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state);
@@ -3031,7 +3006,7 @@ sub update_user_data {
'requestcourses.community','requestcourses.textbook',
'reqcrsotherdom.official','reqcrsotherdom.unofficial',
'reqcrsotherdom.community','reqcrsotherdom.textbook',
- 'requestauthor'],
+ 'reqcrsotherdom.placement','requestauthor'],
$env{'form.ccdomain'},$env{'form.ccuname'});
my ($tmp) = keys(%userenv);
if ($tmp =~ /^(con_lost|error)/i) {
@@ -3322,8 +3297,9 @@ sub update_user_data {
($env{'user.domain'} eq $env{'form.ccdomain'})) {
my %newenvhash;
foreach my $key (keys(%changed)) {
- if (($key eq 'official') || ($key eq 'unofficial')
- || ($key eq 'community') || ($key eq 'textbook')) {
+ if (($key eq 'official') || ($key eq 'unofficial') ||
+ ($key eq 'community') || ($key eq 'textbook') ||
+ ($key eq 'placement')) {
$newenvhash{'environment.requestcourses.'.$key} =
$changeHash{'requestcourses.'.$key};
if ($changeHash{'requestcourses.'.$key}) {
@@ -3389,7 +3365,7 @@ sub update_user_data {
\%newsettingstext);
if ($env{'form.cid'} ne $userenv{'id'}) {
&Apache::lonnet::idput($env{'form.ccdomain'},
- {$env{'form.ccuname'} => $env{'form.cid'}});
+ {$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids');
if (($recurseid) &&
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
my $idresult =
@@ -3532,6 +3508,7 @@ sub display_userinfo {
'unofficial' => 'Can Request Unofficial Courses',
'community' => 'Can Request Communities',
'textbook' => 'Can Request Textbook Courses',
+ 'placement' => 'Can Request Placement Tests',
'requestauthor' => 'Can Request Author Role',
'inststatus' => "Affiliation",
'prvs' => 'Previous Value:',
@@ -4671,7 +4648,7 @@ sub handler {
if (&Apache::lonnet::auto_run($cnum,$cdom) && (($permission->{'cusr'}) || ($permission->{'view'}))) {
push(@allhelp,'Course_Automated_Enrollment');
}
- if (($permission->{'selfenrolladmin'}) || ($permission->{'selfenrollview'})) {
+ if ($permission->{'selfenrolladmin'}) {
push(@allhelp,'Course_Approve_Selfenroll');
}
}
@@ -4773,41 +4750,16 @@ sub handler {
if (! exists($env{'form.state'})) {
&Apache::lonuserutils::print_first_users_upload_form($r,$context);
} elsif ($env{'form.state'} eq 'got_file') {
- my $result =
- &Apache::lonuserutils::print_upload_manager_form($r,$context,
- $permission,
- $crstype,$showcredits);
- if ($result eq 'missingdata') {
- delete($env{'form.state'});
- &Apache::lonuserutils::print_first_users_upload_form($r,$context);
- }
+ &Apache::lonuserutils::print_upload_manager_form($r,$context,$permission,
+ $crstype,$showcredits);
} elsif ($env{'form.state'} eq 'enrolling') {
if ($env{'form.datatoken'}) {
- my $result = &Apache::lonuserutils::upfile_drop_add($r,$context,
- $permission,
- $showcredits);
- if ($result eq 'missingdata') {
- delete($env{'form.state'});
- &Apache::lonuserutils::print_first_users_upload_form($r,$context);
- } elsif ($result eq 'invalidhome') {
- $env{'form.state'} = 'got_file';
- delete($env{'form.lcserver'});
- my $result =
- &Apache::lonuserutils::print_upload_manager_form($r,$context,$permission,
- $crstype,$showcredits);
- if ($result eq 'missingdata') {
- delete($env{'form.state'});
- &Apache::lonuserutils::print_first_users_upload_form($r,$context);
- }
- }
- } else {
- delete($env{'form.state'});
- &Apache::lonuserutils::print_first_users_upload_form($r,$context);
+ &Apache::lonuserutils::upfile_drop_add($r,$context,$permission,
+ $showcredits);
}
} else {
&Apache::lonuserutils::print_first_users_upload_form($r,$context);
}
- $r->print('');
} elsif (((($env{'form.action'} eq 'singleuser') || ($env{'form.action'}
eq 'singlestudent')) && ($permission->{'cusr'})) ||
(($env{'form.action'} eq 'singleuser') && ($permission->{'view'})) ||
@@ -4913,7 +4865,7 @@ sub handler {
&print_useraccesslogs_display($r,$ccuname,$ccdomain,$permission,$brcrum);
}
} elsif ($env{'form.phase'} eq 'update_user_data') {
- &update_user_data($r,$context,$crstype,$brcrum,$showcredits,$permission);
+ &update_user_data($r,$context,$crstype,$brcrum,$showcredits);
} else {
&print_username_entry_form($r,$context,undef,$srch,undef,$crstype,
$brcrum,$permission);
@@ -5087,7 +5039,7 @@ sub handler {
&Apache::lonhtmlcommon::row_closure(1));
}
}
- if ($pickstart) {
+ if ($pickstart) {
$r->print(&Apache::lonhtmlcommon::end_pick_box().'
');
} else {
$r->print(''.&mt('No information to display for this account request.').'
');
@@ -5211,9 +5163,8 @@ sub handler {
''.&mt('You do not have permission to modify dates or sections for users').' ');
}
} elsif ($env{'form.action'} eq 'selfenroll') {
- my %currsettings;
- if ($permission->{selfenrolladmin} || $permission->{selfenrollview}) {
- %currsettings = (
+ if ($permission->{selfenrolladmin}) {
+ my %currsettings = (
selfenroll_types => $env{'course.'.$cid.'.internal.selfenroll_types'},
selfenroll_registered => $env{'course.'.$cid.'.internal.selfenroll_registered'},
selfenroll_section => $env{'course.'.$cid.'.internal.selfenroll_section'},
@@ -5229,8 +5180,6 @@ sub handler {
default_enrollment_end_date => $env{'course.'.$cid.'.default_enrollment_end_date'},
uniquecode => $env{'course.'.$cid.'.internal.uniquecode'},
);
- }
- if ($permission->{selfenrolladmin}) {
push(@{$brcrum},
{href => '/adm/createuser?action=selfenroll',
text => "Configure Self-enrollment",
@@ -5251,16 +5200,6 @@ sub handler {
$r->print(''.&mt('Self-enrollment with a student role').' '."\n");
&update_selfenroll_config($r,$cid,$cdom,$cnum,$context,$crstype,\%currsettings);
}
- } elsif ($permission->{selfenrollview}) {
- push(@{$brcrum},
- {href => '/adm/createuser?action=selfenroll',
- text => "View Self-enrollment configuration",
- help => 'Course_Self_Enrollment'});
- $args = { bread_crumbs => $brcrum,
- bread_crumbs_component => 'Self-enrollment Settings'};
- $r->print(&header(undef,$args));
- $r->print(''.&mt('Self-enrollment with a student role').' '."\n");
- &print_selfenroll_menu($r,'course',$cid,$cdom,$cnum,\%currsettings,'',1);
} else {
$r->print(&header(undef,{'no_nav_bar' => 1}).
''.&mt('You do not have permission to configure self-enrollment').' ');
@@ -5690,6 +5629,7 @@ sub print_main_menu {
groups => 'Community Groups',
},
);
+ $linktext{'Placement'} = $linktext{'Course'};
my %linktitle = (
'Course' => {
@@ -5704,6 +5644,8 @@ sub print_main_menu {
},
);
+ $linktitle{'Placement'} = $linktitle{'Course'};
+
push(@{ $menu[0]->{items} }, #Category: Single Users
{
linktext => $linktext{$crstype}{'single'},
@@ -5766,7 +5708,7 @@ sub print_main_menu {
icon => 'selfenrl-queue.png',
#help => 'Course_Approve_Selfenroll',
url => '/adm/createuser?action=selfenrollqueue',
- permission => $permission->{'selfenrolladmin'} || $permission->{'selfenrollview'},
+ permission => $permission->{'selfenrolladmin'},
linktitle =>'Approve or reject enrollment requests.',
},
);
@@ -5793,7 +5735,7 @@ sub print_main_menu {
icon => 'self_enroll.png',
#help => 'Course_Self_Enrollment',
url => '/adm/createuser?action=selfenroll',
- permission => $permission->{'selfenrolladmin'} || $permission->{'selfenrollview'},
+ permission => $permission->{'selfenrolladmin'},
linktitle => 'Configure user self-enrollment.',
},
);
@@ -6042,7 +5984,8 @@ ENDSCRIPT
'// ]]>'."\n".
''."\n".
''.$lt->{'selfenroll'}.' '."\n";
- my $visactions = &cat_visibility($cdom);
+
+ my $visactions = &cat_visibility();
my ($cathash,%cattype);
my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
if (ref($domconfig{'coursecategories'}) eq 'HASH') {
@@ -6205,10 +6148,11 @@ ENDSCRIPT
} elsif ($curr_types eq '') {
$add_domtitle = &mt('Users in other domain:');
}
+ my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$cdom);
$output .= &Apache::loncommon::start_data_table_row()
.''.$add_domtitle.' '
.&Apache::loncommon::select_dom_form('','selfenroll_newdom',
- $includeempty,$showdomdesc,'','','',$readonly)
+ $includeempty,$showdomdesc,'',$trusted,$untrusted,$readonly)
.' '
.' '.&Apache::loncommon::end_data_table_row()
.&Apache::loncommon::end_data_table();
@@ -6587,7 +6531,6 @@ sub visible_in_stdcat {
}
sub cat_visibility {
- my ($cdom) = @_;
my %visactions = &Apache::lonlocal::texthash(
vis => 'This course/community currently appears in the Course/Community Catalog for this domain.',
gen => 'Courses can be both self-cataloging, based on an institutional code (e.g., fs08phy231), or can be assigned categories from a hierarchy defined for the domain.',
@@ -6600,24 +6543,13 @@ sub cat_visibility {
dc_chgconf => 'Ask a domain coordinator to change the Catalog type for this domain.',
dc_setcode => 'Ask a domain coordinator to assign a six character code to the course',
dc_unhide => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',
- dc_addinst => 'Ask a domain coordinator to enable catalog display of "Official courses (with institutional codes)".',
+ dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',
dc_instcode => 'Ask a domain coordinator to assign an institutional code (if this is an official course).',
dc_catalog => 'Ask a domain coordinator to enable or create at least one course category in the domain.',
dc_categories => 'Ask a domain coordinator to create a hierarchy of categories and sub categories for courses in the domain.',
dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
);
- if ($env{'request.role'} eq "dc./$cdom/") {
- $visactions{'dc_chgconf'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to change the Catalog type for this domain.','»');
- $visactions{'dc_setcode'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to assign a six character code to the course.','»');
- $visactions{'dc_unhide'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to change the "Exclude from course catalog" setting.','»');
- $visactions{'dc_addinst'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to enable catalog display of "Official courses (with institutional codes)".','»');
- $visactions{'dc_instcode'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify course owner, institutional code ... " to assign an institutional code (if this is an official course).','»');
- $visactions{'dc_catalog'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to enable or create at least one course category in the domain.','»');
- $visactions{'dc_categories'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to create a hierarchy of categories and sub categories for courses in the domain.','»');
- $visactions{'dc_chgcat'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify catalog settings for course" to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','»');
- $visactions{'dc_addcat'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify catalog settings for course" to assign a category to the course.','»');
- }
$visactions{'unhide'} = &mt('Use [_1]Categorize course[_2] to change the "Exclude from course catalog" setting.','',' "');
$visactions{'chgcat'} = &mt('Use [_1]Categorize course[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"',' "');
$visactions{'addcat'} = &mt('Use [_1]Categorize course[_2] to assign a category to the course.','"',' "');
@@ -7108,10 +7040,9 @@ ENDSCRIPT
my ($nav_script,$nav_links);
# table header
- my $heading = ''.
+ my $tableheader = ''.
&mt('User access logs for: [_1]',
- &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).' ';
- my $tableheader = $heading
+ &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).' '
.&Apache::loncommon::start_data_table_header_row()
.' '
.''.&mt('When').' '
@@ -7229,7 +7160,7 @@ ENDSCRIPT
$r->print(&Apache::loncommon::end_data_table().
&userlogdisplay_navlinks(\%curr,$more_records));
} else { # No content displayed above
- $r->print($heading.''
+ $r->print('
'
.&mt('There are no records to display.')
.'
');
}
@@ -7418,12 +7349,12 @@ sub role_display_filter {
&mt('Context:').'';
my @posscontexts;
if ($context eq 'course') {
- @posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses','chgtype');
+ @posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses');
} elsif ($context eq 'domain') {
@posscontexts = ('any','domain','requestauthor','domconfig','server');
} else {
@posscontexts = ('any','author','domain');
- }
+ }
foreach my $chgtype (@posscontexts) {
my $selstr = '';
if ($curr->{'chgcontext'} eq $chgtype) {
@@ -7467,7 +7398,6 @@ sub rolechg_contexts {
%lt = &Apache::lonlocal::texthash (
any => 'Any',
automated => 'Automated Enrollment',
- chgtype => 'Enrollment Type/Lock Change',
updatenow => 'Roster Update',
createcourse => 'Course Creation',
course => 'User Management in course',
@@ -8532,7 +8462,7 @@ sub user_search_result {
my $domd_chk = &domdirectorysrch_check($srch);
$response .= ''.$instd_chk.' ';
if ($domd_chk eq 'ok') {
- $response .= &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.');
+ $response .= &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.');
}
$response .= ' ';
}
@@ -8543,7 +8473,7 @@ sub user_search_result {
my $instd_chk = &instdirectorysrch_check($srch);
$response .= ''.$domd_chk.' ';
if ($instd_chk eq 'ok') {
- $response .= &mt('You may want to search in the institutional directory instead of the LON-CAPA domain.');
+ $response .= &mt('You may want to search in the institutional directory instead of in the LON-CAPA domain.');
}
$response .= ' ';
}
@@ -8644,7 +8574,7 @@ sub user_search_result {
$response = ''.
&mt('Institutional directory search is not available in domain: [_1]',$showdom).
' '.
- &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.').
+ &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.').
' ';
}
}
@@ -8717,7 +8647,7 @@ sub user_search_result {
$response = ''.
&mt('Institutional directory search is not available in domain: [_1]',$showdom).
' '.
- &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.').
+ &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.').
' ';
}
}
@@ -9573,7 +9503,7 @@ sub update_selfenroll_config {
} else {
$r->print(&mt('No changes were made to the existing self-enrollment settings in this course.'));
}
- my $visactions = &cat_visibility($cdom);
+ my $visactions = &cat_visibility();
my ($cathash,%cattype);
my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
if (ref($domconfig{'coursecategories'}) eq 'HASH') {