'."\n".
+ &Apache::loncommon::end_data_table_row()."\n";
+ }
+ return $output;
+}
+
+sub coursereq_externaluser {
+ my ($ccuname,$ccdomain,$cdom) = @_;
+ my (@usertools,@options,%validations,%userenv,$output);
+ my %lt = &Apache::lonlocal::texthash (
+ 'official' => 'Can request creation of official courses',
+ 'unofficial' => 'Can request creation of unofficial courses',
+ 'community' => 'Can request creation of communities',
+ );
+
+ %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
+ 'reqcrsotherdom.official','reqcrsotherdom.unofficial',
+ 'reqcrsotherdom.community');
+ @usertools = ('official','unofficial','community');
+ @options = ('approve','validate','autolimit');
+ %validations = &Apache::lonnet::auto_courserequest_checks($cdom);
+ my $optregex = join('|',@options);
+ my %reqtitles = &courserequest_titles();
+ foreach my $item (@usertools) {
+ my ($curroption,$currlimit,$tooloff);
+ if ($userenv{'reqcrsotherdom.'.$item} ne '') {
+ my @curr = split(',',$userenv{'reqcrsotherdom.'.$item});
+ if (grep(/^\Q$cdom\E:($optregex)=?(\d*)$/,@curr)) {
+ $curroption = $1;
+ $currlimit = $2;
+ if (!$curroption) {
+ $curroption = 'norequest';
+ }
+ }
+ } else {
+ $curroption = 'norequest';
+ $tooloff = ' checked="checked"';
+ }
+ $output.= &Apache::loncommon::start_data_table_row()."\n".
+ '
'.$lt{$item}.': '.
+ ' ';
+ foreach my $option (@options) {
+ if ($option eq 'validate') {
+ my $canvalidate = 0;
+ if (ref($validations{$item}) eq 'HASH') {
+ if ($validations{$item}{'_external_'}) {
+ $canvalidate = 1;
+ }
+ }
+ next if (!$canvalidate);
+ }
+ my $checked = '';
+ if ($option eq $curroption) {
+ $checked = ' checked="checked"';
+ }
+ $output .= ' ';
+ if ($option eq 'autolimit') {
+ $output .= '';
+ }
+ $output .= ' '
+ }
+ $output .= '
'."\n".
+ &Apache::loncommon::end_data_table_row()."\n";
+ }
+ return $output;
+}
+
+sub courserequest_titles {
+ my %titles = &Apache::lonlocal::texthash (
+ official => 'Official', unofficial => 'Unofficial',
+ community => 'Communities', norequest => 'Not allowed',
+ approve => 'Approval by Dom. Coord.',
+ validate => 'With validation',
+ autolimit => 'Numerical limit',
+ );
+ return %titles;
+}
+
+sub courserequest_display {
+ my %titles = &Apache::lonlocal::texthash (
+ approve => 'Yes, need approval',
+ validate => 'Yes, with validation',
+ norequest => 'No',
+ );
+ return %titles;
+}
+
# =================================================================== Phase one
sub print_username_entry_form {
@@ -318,7 +425,7 @@ sub print_username_entry_form {
'dom' => "Domain",
'ecrp' => "Edit Custom Role Privileges",
'nr' => "Name of Role",
- 'cre' => "Custom Role Editor",
+ 'cre' => "Next",
);
$r->print($start_page."\n".$crumbs);
if ($env{'form.action'} eq 'custom') {
@@ -328,7 +435,7 @@ sub print_username_entry_form {
$lt{'ecrp'}
-$lt{'nr'}: $choice
+$choice $lt{'nr'}:
ENDCUSTOM
@@ -612,7 +719,7 @@ sub print_user_modification_page {
&Apache::lonuserutils::can_create_user($ccdomain,$context,
$usertype);
if (!$cancreate) {
- my $helplink = ' href="javascript:helpMenu('."'display'".')"';
+ my $helplink = 'javascript:helpMenu('."'display'".')';
my %usertypetext = (
official => 'institutional',
unofficial => 'non-institutional',
@@ -622,7 +729,12 @@ sub print_user_modification_page {
$response = ''.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).
' ';
}
- $response .= ''.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.").' '.&mt('Contact the helpdesk for assistance.',$helplink).'
';
+ $response .= '
'
+ .&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.")
+ .' '
+ .&mt('Please contact the [_1]helpdesk[_2] for assistance.'
+ ,'','')
+ .'
';
$env{'form.phase'} = '';
&print_username_entry_form($r,$context,$response);
return;
@@ -770,7 +882,7 @@ $lt{'hs'}: $home_server_pick
my $authtype = $rules->{$matchedrule}{'authtype'};
if ($authtype !~ /^(krb4|krb5|int|fsys|loc)$/) {
$r->print(&Apache::lonuserutils::set_login($ccdomain,$authformkrb,$authformint,$authformloc));
- } else {
+ } else {
my $authparm = $rules->{$matchedrule}{'authparm'};
$authmsg = $rules->{$matchedrule}{'authmsg'};
if ($authtype =~ /^krb(4|5)$/) {
@@ -848,9 +960,20 @@ ENDCHANGEUSER
if ($showforceid) {
$r->print(&Apache::lonuserutils::forceid_change($context));
}
+ if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
+ $r->print('
'.&mt('User Can Request Creation of Courses?').'
'.
+ &Apache::loncommon::start_data_table()).
+ 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'}));
+ }
+ $r->print(&Apache::loncommon::end_data_table());
+ }
$r->print('');
my $user_auth_text = &user_authentication($ccuname,$ccdomain,$formname);
- my ($user_quota_text,$user_tools_text);
+ my ($user_quota_text,$user_tools_text,$user_reqcrs_text);
if ((&Apache::lonnet::allowed('mpq',$ccdomain)) ||
(&Apache::lonnet::allowed('mut',$ccdomain))) {
# Current user has quota modification privileges
@@ -876,7 +999,7 @@ ENDNOPORTPRIV
if (&Apache::lonnet::allowed('mut',$env{'request.role.domain'})) {
my %lt=&Apache::lonlocal::texthash(
'utav' => "User Tools Availability",
- 'yodo' => "You do not have privileges to modify Portfolio, Blog or Home Page settings for this user.",
+ 'yodo' => "You do not have privileges to modify Portfolio, Blog or Personal Information Page settings for this user.",
'ifch' => "If a change is required, contact a domain coordinator for the domain",
);
$user_tools_text = <print('
\n");
@@ -2279,15 +2552,19 @@ END
$env{'form.ccdomain'}.' ');
}
} else { # End of if ($env ... ) logic
- # They did not want to change the users name, quota or tool availability,
+ # They did not want to change the users name, quota, tool availability,
+ # or ability to request creation of courses,
# but we can still tell them what the name and quota and availabilities are
my %lt=&Apache::lonlocal::texthash(
- 'id' => "Student/Employee ID",
- 'mail' => "Permanent e-mail",
- 'disk' => "Disk space allocated to user's portfolio files",
- 'blog' => "Blog Availability",
- 'aboutme' => "Home Page Availability",
- 'portfolio' => "Portfolio Availability",
+ 'id' => "Student/Employee ID",
+ 'mail' => "Permanent e-mail address",
+ 'disk' => "Disk space allocated to user's portfolio files",
+ 'blog' => "Blog Availability",
+ 'aboutme' => "Personal Information Page Availability",
+ 'portfolio' => "Portfolio Availability",
+ 'official' => "Can Request Official Courses",
+ 'unofficial' => "Can Request Unofficial Course",
+ 'inststatus' => "Affiliation",
);
$r->print(<<"END");
$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} $userenv{'generation'}
@@ -2296,6 +2573,20 @@ END
$r->print(' ['.$lt{'mail'}.': '.
$userenv{'permanentemail'}.']');
}
+ if ($showinststatus) {
+ $r->print(' ['.$lt{'inststatus'}.': '.$oldinststatuses.']');
+ }
+ if ($showrequestcourses) {
+ foreach my $item (@requestcourses) {
+ $r->print(' ['.$lt{$item}.': '.$newaccess{$item}.' '.
+ $newaccesstext{$item}.']'."\n");
+ }
+ } elsif ($showreqotherdom) {
+ foreach my $item (@requestcourses) {
+ $r->print(' ['.$lt{$item}.': '.$newaccess{$item}.' '.
+ $newaccesstext{$item}.']'."\n");
+ }
+ }
if ($showtools) {
foreach my $item (@usertools) {
$r->print(' ['.$lt{$item}.': '.$newaccess{$item}.' '.
@@ -2331,8 +2622,11 @@ END
} else {
$r->print(&mt("You do not have the authority to change these fields given the user's current set of active/future [_1] roles:",$contextname));
}
- $r->print(''.$rolestr.' '.
- &mt('Contact your helpdesk for more information.',"javascript:helpMenu('display')").' ');
+ my $helplink = 'javascript:helpMenu('."'display'".')';
+ $r->print(''.$rolestr.' '
+ .&mt('Please contact your [_1]helpdesk[_2] for more information.'
+ ,'','')
+ .' ');
}
$r->print(''
.$no_forceid_alert
@@ -2374,6 +2668,161 @@ END
$r->print(&Apache::loncommon::end_page());
}
+sub tool_changes {
+ my ($context,$usertools,$oldaccess,$oldaccesstext,$userenv,$changeHash,
+ $changed,$newaccess,$newaccesstext) = @_;
+ if (!((ref($usertools) eq 'ARRAY') && (ref($oldaccess) eq 'HASH') &&
+ (ref($oldaccesstext) eq 'HASH') && (ref($userenv) eq 'HASH') &&
+ (ref($changeHash) eq 'HASH') && (ref($changed) eq 'HASH') &&
+ (ref($newaccess) eq 'HASH') && (ref($newaccesstext) eq 'HASH'))) {
+ return;
+ }
+ if ($context eq 'reqcrsotherdom') {
+ my @options = ('approve','validate','autolimit');
+ my $optregex = join('|',@options);
+ my %reqdisplay = &courserequest_display();
+ my $cdom = $env{'request.role.domain'};
+ foreach my $tool (@{$usertools}) {
+ $oldaccesstext->{$tool} = &mt('no');
+ $changeHash->{$context.'.'.$tool} = $userenv->{$context.'.'.$tool
+};
+ if ($userenv->{$context.'.'.$tool} eq '') {
+ if ($env{'form.'.$context.'_'.$tool}) {
+ $changed->{$tool}=&tool_admin($tool,$cdom,
+ $changeHash,$context);
+ if ($changed->{$tool}) {
+ $newaccesstext->{$tool} = &mt('yes');
+ } else {
+ $newaccesstext->{$tool} = $oldaccesstext->{$tool}; }
+ }
+ } else {
+ my @curr = split(',',$userenv->{$context.'.'.$tool});
+ my @new;
+ my $changedoms;
+ my $newop = $env{'form.'.$context.'_'.$tool};
+ if ($newop eq 'autolimit') {
+ $newop .= '=';
+ unless ($env{'form.'.$context.'_'.$tool.'_limit'} =~ /\D/
+) {
+ $newop .= $env{'form.'.$context.'_'.$tool.'_limit'};
+ }
+ }
+ if (grep(/^\Q$cdom:($optregex\=?\d*)\E$/,@curr)) {
+ $oldaccesstext->{$tool} = &mt('yes');
+ my $oldop = $1;
+ if ($oldop ne $newop) {
+ $changedoms = 1;
+ foreach my $dom (@curr) {
+ unless ($dom eq $cdom) {
+ push(@new,$dom);
+ }
+ }
+ if ($newop) {
+ push(@new,$cdom.':'.$newop);
+ }
+ @new = sort(@new);
+ }
+ } elsif ($env{'form.'.$context.'_'.$tool}) {
+ $changedoms = 1;
+ $changedoms = 1;
+ @new = sort(@curr,$cdom.':'.$newop);
+ }
+ $newaccesstext->{$tool} = $oldaccesstext->{$tool};
+ if ($changedoms) {
+ my $newdomstr;
+ if (@new) {
+ $newdomstr = join(',',@new);
+ }
+ $changed->{$tool}=&tool_admin($tool,$newdomstr,$changeHash,
+ $context);
+ if ($changed->{$tool}) {
+ if ($env{'form.'.$context.'_'.$tool}) {
+ if ($env{'form.'.$context.'_'.$tool} eq 'autolimit') {
+ if ($env{'form.'.$context.'_'.$tool.'_limit'} =~ /\D/) {
+ $newaccesstext->{$tool} = &mt('Yes, processed automatically');
+ } else {
+ $newaccesstext->{$tool} = &mt('Yes, up to limit of [quant,_1,request] per user).',$env{'form.'.$context.'_'.$tool.'_limit'});
+ }
+ } else {
+ $newaccesstext->{$tool} = $reqdisplay{$env{'form.'.$context.'_'.$tool}};
+ }
+ } else {
+ $newaccesstext->{$tool} = &mt('No');
+ }
+ }
+ }
+ }
+ }
+ return;
+ }
+ foreach my $tool (@{$usertools}) {
+ if ($userenv->{$context.'.'.$tool} ne '') {
+ $oldaccess->{$tool} = &mt('custom');
+ if ($userenv->{$context.'.'.$tool}) {
+ $oldaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $oldaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
+ $changeHash->{$context.'.'.$tool} = $userenv->{$context.'.'.$tool};
+ if ($env{'form.custom'.$tool} == 1) {
+ if ($env{'form.'.$context.'_'.$tool} ne $userenv->{$context.'.'.$tool}) {
+ $changed->{$tool} = &tool_admin($tool,$env{'form.'.$context.'_'.$tool},
+ $changeHash,$context);
+ if ($changed->{$tool}) {
+ $newaccess->{$tool} = &mt('custom');
+ if ($env{'form.'.$context.'_'.$tool}) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
+ } else {
+ $newaccess->{$tool} = $oldaccess->{$tool};
+ if ($userenv->{$context.'.'.$tool}) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
+ }
+ } else {
+ $newaccess->{$tool} = $oldaccess->{$tool};
+ $newaccesstext->{$tool} = $oldaccesstext->{$tool};
+ }
+ } else {
+ $changed->{$tool} = &tool_admin($tool,'',$changeHash,$context);
+ if ($changed->{$tool}) {
+ $newaccess->{$tool} = &mt('default');
+ } else {
+ $newaccess->{$tool} = $oldaccess->{$tool};
+ if ($userenv->{$context.'.'.$tool}) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
+ }
+ }
+ } else {
+ $oldaccess->{$tool} = &mt('default');
+ if ($env{'form.custom'.$tool} == 1) {
+ $changed->{$tool} = &tool_admin($tool,$env{'form.'.$context.'_'.$tool},
+ $changeHash,$context);
+ if ($changed->{$tool}) {
+ $newaccess->{$tool} = &mt('custom');
+ if ($env{'form.'.$context.'_'.$tool}) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
+ } else {
+ $newaccess->{$tool} = $oldaccess->{$tool};
+ }
+ } else {
+ $newaccess->{$tool} = $oldaccess->{$tool};
+ }
+ }
+ }
+ return;
+}
+
sub update_roles {
my ($r,$context) = @_;
my $now=time;
@@ -2441,8 +2890,8 @@ sub update_roles {
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
# Delete custom role
- $r->print(&mt('Deleting custom role [_1] by [_2]:[_3] in [_4]',
- $rolename,$rnam,$rdom,$url).': '.
+ $r->print(&mt('Deleting custom role [_1] by [_2] in [_3]',
+ $rolename,$rnam.':'.$rdom,$url).': '.
&Apache::lonnet::assigncustomrole($env{'form.ccdomain'},
$env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,
0,1,$context).' ');
@@ -2493,8 +2942,8 @@ sub update_roles {
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
$url,$rdom,$rnam,$rolename,0,$now,undef,$context);
- $r->print(&mt('Re-enabling custom role [_1] by [_2]:[_3] in [_4] : [_5]',
- $rolename,$rnam,$rdom,$url,''.$result.'').' ');
+ $r->print(&mt('Re-enabling custom role [_1] by [_2] in [_3]: [_4]',
+ $rolename,$rnam.':'.$rdom,$url,''.$result.'').' ');
if (!grep(/^cr$/,@rolechanges)) {
push(@rolechanges,'cr');
}
@@ -2616,12 +3065,18 @@ sub update_roles {
$r->print('
'.&mt('[_1] may not be used as the name for a section, as it is a reserved word.',$key));
+ $r->print(&mt('[_1] may not be used as the name for a section, as it is a reserved word.',''.$key.''));
} else {
- $r->print('
'.&mt('[_1] may not be used as the name for a section, as it is the name of a course group.',$key));
+ $r->print(&mt('[_1] may not be used as the name for a section, as it is the name of a course group.',''.$key.''));
}
- $r->print(' '.&mt('Please go back and choose a different section name.').'
');
+ $r->print('
'
+ .&mt('Please [_1]go back[_2] and choose a different section name.'
+ ,'':' ').
+ ($courselevel{$priv}?'':' ').
'
';
@@ -3892,7 +4364,7 @@ ENDSCRIPT
}
if (@ccs) {
$output .= ' '.&mt('Personnel to be notified when an enrollment request needs approval, or has been approved:').' '.&Apache::loncommon::start_data_table().
- &Apache::loncommon::start_data_table_row();
+ &Apache::loncommon::start_data_table_row();
my $count = 0;
my $numcols = 4;
foreach my $cc (sort(@ccs)) {
@@ -3914,7 +4386,7 @@ ENDSCRIPT
my $rem = $count%$numcols;
if ($rem) {
my $emptycols = $numcols - $rem;
- for (my $i=0; $i<$emptycols; $i++) {
+ for (my $i=0; $i<$emptycols; $i++) {
$output .= '
';
}
}
@@ -3934,7 +4406,7 @@ ENDSCRIPT
} elsif ($currlim eq 'selfenrolled') {
$crslimit = ' ';
$selflimit = ' checked="checked" ';
- $nolimit = ' ';
+ $nolimit = ' ';
} else {
$crslimit = ' ';
$selflimit = ' ';
@@ -3956,7 +4428,7 @@ ENDSCRIPT
}
$output .= &Apache::lonhtmlcommon::end_pick_box().
' '
+ .&mt('Save').'" onclick="validate_types(this.form);" />'
.'';
$r->print($output);
return;
@@ -4017,7 +4489,7 @@ sub display_selfenroll_queue {
$r->print(&Apache::loncommon::end_data_table().
'');
} else {
- $r->print(&mt('There are currently no enrollment requests.'));
+ $r->print(&mt('There are currently no enrollment requests.'));
}
return;
}
@@ -4028,7 +4500,7 @@ sub update_selfenroll_queue {
my @rejections = &Apache::loncommon::get_env_multiple('form.rejectreq');
my $access_start = $env{'course.'.$cid.'.internal.selfenroll_start_access'};
my $access_end = $env{'course.'.$cid.'.internal.selfenroll_end_access'};
- my $limit = $env{'course.'.$cid.'.internal.selfenroll_limit'};
+ my $limit = $env{'course.'.$cid.'.internal.selfenroll_limit'};
my $cap = $env{'course.'.$cid.'.internal.selfenroll_cap'};
my $notifylist = $env{'course.'.$cid.'.internal.selfenroll_notifylist'};
my $namespace = 'selfenrollrequests';
@@ -4050,7 +4522,7 @@ sub update_selfenroll_queue {
mt => 'Visit [_1], to log-in and access the course',
args => [$protocol.'://'.$hostname],
}];
-
+
my $rejectedmsg = [{
mt => 'Your request for enrollment has not been approved.',
}];
@@ -4059,7 +4531,7 @@ sub update_selfenroll_queue {
my $uhome = &Apache::lonnet::homeserver($uname,$udom);
if ($uhome ne 'no_host') {
if (exists($requesthash{$uname.':'.$udom})) {
-
+
if (exists($classlist->{$uname.':'.$udom})) {
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') {
if (($classlist->{$uname.':'.$udom}->[$idx->{'status'}] eq 'Active') ||
@@ -4085,7 +4557,7 @@ sub update_selfenroll_queue {
last;
}
}
- my $result =
+ my $result =
&Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$usec,$access_end,$access_start,'selfenroll',undef,$cdom.'_'.$cnum,1);
if ($result eq 'ok') {
push(@enrolled,$uname.':'.$udom);
@@ -4101,7 +4573,7 @@ sub update_selfenroll_queue {
status => 'approved',
}
);
- my $userresult =
+ my $userresult =
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname);
if ($userresult ne 'ok') {
push(@warn_approves,$uname.':'.$udom);
@@ -4123,11 +4595,11 @@ sub update_selfenroll_queue {
my %userrequest = (
$cdom.'_'.$cnum => {
timestamp => $now,
- adjudicator => $env{'user.name'}.':'.$env{'user.domain'},
+ adjudicator => $env{'user.name'}.':'.$env{'user.domain'},
status => 'rejected',
}
);
- my $userresult =
+ my $userresult =
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname);
if ($userresult ne 'ok') {
push(@warn_rejects,$user);
@@ -4137,7 +4609,7 @@ sub update_selfenroll_queue {
if (@changes) {
my $delresult = &Apache::lonnet::del($namespace,\@changes,$cdom,$cnum);
if ($delresult eq 'ok') {
- my $namelink =
+ my $namelink =
&Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}).' ('.$env{'user.name'}.':'.$env{'user.domain'}.')';
my $chgmsg = "'Action was taken on the following enrollment requests by [_1].',$namelink";
my ($approvedlist,$rejectedlist);
@@ -4145,8 +4617,8 @@ sub update_selfenroll_queue {
$approvedlist = join("\n",@enrolled);
$r->print('
'.&mt('The following were enrolled in the course:').'
');
foreach my $user (@enrolled) {
- my ($uname,$udom) = split(/:/,$user);
- my $userlink =
+ my ($uname,$udom) = split(/:/,$user);
+ my $userlink =
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom);
$r->print('
'.$userlink.'
');
}
@@ -4245,7 +4717,7 @@ sub visible_in_cat {
miss => 'Your course does not currently appear in the Course Catalog for this domain.',
yous => 'You should remedy this if you plan to allow self-enrollment, otherwise students will have difficulty finding your course.',
coca => 'Courses can be absent from the Catalog, because they do not have an institutional code, have no assigned category, or have been specifically excluded.',
- make => 'Make any changes to self-enrollment settings below, click "Save changes", then take action to include the course in the Catalog:',
+ make => 'Make any changes to self-enrollment settings below, click "Save", then take action to include the course in the Catalog:',
take => 'Take the following action to ensure the course appears in the Catalog:',
dc_unhide => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',
dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',
@@ -4671,7 +5143,7 @@ sub role_display_filter {
&mt('[_1]Note:[_2] Only changes made from servers running LON-CAPA 2.6.99.0 or later are displayed.');
if ($version) {
$output .= ' '.&mt('This server is version [_3].','','',$version); }
- $output .= ' ';
+ $output .= ' ';
return $output;
}
@@ -5084,7 +5556,7 @@ sub build_search_response {
.&mt("You are not authorized to create new users in your current role's domain - [_1]."
,''.$env{'request.role.domain'}.'')
.' '
- .&mt('Contact the [_1]helpdesk[_2] if you need to create a new user.'
+ .&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.'
,' '
,'')
.'
';
@@ -5445,11 +5917,11 @@ sub update_selfenroll_config {
}
$changes{'internal.selfenroll_limit'} = $newlimit;
} else {
- $warning{$item} = &mt('Maximum enrollment setting unchanged.').' '.&mt('The value provided was invalid - it must be a positive integer if enrollment is being limited.');
+ $warning{$item} = &mt('Maximum enrollment setting unchanged.').' '.&mt('The value provided was invalid - it must be a positive integer if enrollment is being limited.');
}
} elsif ($currcap ne '') {
$changes{'internal.selfenroll_cap'} = '';
- $changes{'internal.selfenroll_limit'} = $newlimit;
+ $changes{'internal.selfenroll_limit'} = $newlimit;
}
} elsif ($currlimit ne 'none') {
if ($newcap =~ /^\d+$/) {
@@ -5478,8 +5950,8 @@ sub update_selfenroll_config {
$changes{'internal.selfenroll_notifylist'} = '';
}
} else {
- my @differences =
- &compare_arrays(\@currnotified,\@newnotified);
+ my @differences =
+ &Apache::loncommon::compare_arrays(\@currnotified,\@newnotified);
if (@differences > 0) {
if (@newnotified > 0) {
$changes{'internal.selfenroll_notifylist'} = join(',',@newnotified);
@@ -5489,7 +5961,7 @@ sub update_selfenroll_config {
}
}
} else {
- my @differences = &compare_arrays(\@currnotified,\@newnotified);
+ my @differences = &Apache::loncommon::compare_arrays(\@currnotified,\@newnotified);
if (@differences > 0) {
if (@newnotified > 0) {
$changes{'internal.selfenroll_notifylist'} = join(',',@newnotified);
@@ -5509,7 +5981,7 @@ sub update_selfenroll_config {
$warning{$item} = &mt('Section for self-enrolled users unchanged as the proposed section is a group').' '.&mt('Group names and section names must be distinct');
} elsif ($newval eq 'all') {
$newval = $curr_val;
- $warning{$item} = &mt("Section for self-enrolled users unchanged, as 'all' is a reserved section name.");
+ $warning{$item} = &mt('Section for self-enrolled users unchanged, as "all" is a reserved section name.');
}
if ($newval eq '') {
$newval = 'none';
@@ -5581,7 +6053,7 @@ sub update_selfenroll_config {
}
if ($changes{'internal.selfenroll_limit'} eq 'none') {
$newval = &mt('No limit');
- } elsif ($changes{'internal.selfenroll_limit'} eq
+ } elsif ($changes{'internal.selfenroll_limit'} eq
'allstudents') {
$newval = &mt('New self-enrollment no longer allowed when total (all students) reaches [_1].',$newcap);
} elsif ($changes{'internal.selfenroll_limit'} eq 'selfenrolled') {
@@ -5602,7 +6074,7 @@ sub update_selfenroll_config {
my ($newval,$newnotify);
if (exists($changes{'internal.selfenroll_notifylist'})) {
$newnotify = $changes{'internal.selfenroll_notifylist'};
- } else {
+ } else {
$newnotify = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_notifylist'};
}
if ($changes{'internal.selfenroll_approval'}) {
@@ -5610,7 +6082,7 @@ sub update_selfenroll_config {
} elsif ($changes{'internal.selfenroll_approval'} eq '0') {
$newval = &mt('No');
} else {
- my $currapproval =
+ my $currapproval =
$env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_approval'};
if ($currapproval) {
$newval = &mt('Yes');
@@ -5679,22 +6151,6 @@ sub update_selfenroll_config {
return;
}
-sub compare_arrays {
- my ($arrayref1,$arrayref2) = @_;
- my (@difference,%count);
- @difference = ();
- %count = ();
- if ((ref($arrayref1) eq 'ARRAY') && (ref($arrayref2) eq 'ARRAY')) {
- foreach my $element (@{$arrayref1}, @{$arrayref2}) { $count{$element}++; }
- foreach my $element (keys(%count)) {
- if ($count{$element} == 1) {
- push(@difference,$element);
- }
- }
- }
- return @difference;
-}
-
sub get_selfenroll_titles {
my @row = ('types','registered','enroll_dates','access_dates','section',
'approval','limit');