--- loncom/interface/domainprefs.pm 2009/08/20 20:13:06 1.103
+++ loncom/interface/domainprefs.pm 2009/08/22 18:48:56 1.106
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.103 2009/08/20 20:13:06 raeburn Exp $
+# $Id: domainprefs.pm,v 1.106 2009/08/22 18:48:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -105,7 +105,7 @@ affiliate type (and also default, and _L
(official, unofficial and community). In each case the radio buttons allow the
selection of one of four values:
-0, approve, validate, autolimit=N (where N is blank, or a positive integer).
+0, approval, validate, autolimit=N (where N is blank, or a positive integer).
which have the following effects:
0
@@ -116,7 +116,7 @@ which have the following effects:
=back
-approve
+approval
=over
@@ -1149,7 +1149,7 @@ sub print_quotas {
my ($css_class,%titles);
if ($context eq 'requestcourses') {
@usertools = ('official','unofficial','community');
- @options =('norequest','approve','autolimit','validate');
+ @options =('norequest','approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($dom);
%titles = &courserequest_titles();
} else {
@@ -1249,7 +1249,7 @@ sub print_quotas {
if ($context eq 'requestcourses') {
$datatable .= '
'.
- ''.&mt('LON-CAPA Advanced Users').
- ' ('.
- &mt('overrides affiliation').') | '.
+ ''.&mt('LON-CAPA Advanced Users').' ';
+ if ($context eq 'requestcourses') {
+ $datatable .= &mt('(overrides affiliation, if set)');
+ } else {
+ $datatable .= &mt('(overrides affiliation, if checked)');
+ }
+ $datatable .= ' | '.
'';
if ($context eq 'requestcourses') {
$datatable .= '';
}
@@ -1455,7 +1470,7 @@ sub print_quotas {
sub print_courserequestmail {
my ($dom,$settings,$rowtotal) = @_;
- my ($now,$datatable,%dompersonnel,@domcoord,@currapprove,$rows);
+ my ($now,$datatable,%dompersonnel,@domcoord,@currapproval,$rows);
$now = time;
$rows = 0;
%dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc'],$now,$now);
@@ -1470,12 +1485,12 @@ sub print_courserequestmail {
if (ref($settings) eq 'HASH') {
if (ref($settings->{'notify'}) eq 'HASH') {
if ($settings->{'notify'}{'approval'} ne '') {
- @currapprove = split(',',$settings->{'notify'}{'approval'});
+ @currapproval = split(',',$settings->{'notify'}{'approval'});
}
}
}
- if (@currapprove) {
- foreach my $dc (@currapprove) {
+ if (@currapproval) {
+ foreach my $dc (@currapproval) {
unless (grep(/^\Q$dc\E$/,@domcoord)) {
push(@domcoord,$dc);
}
@@ -1501,7 +1516,7 @@ sub print_courserequestmail {
$rows ++;
}
my $check = ' ';
- if (grep(/^\Q$domcoord[$i]\E$/,@currapprove)) {
+ if (grep(/^\Q$domcoord[$i]\E$/,@currapproval)) {
$check = ' checked="checked" ';
}
my ($uname,$udom) = split(':',$domcoord[$i]);
@@ -1872,7 +1887,7 @@ sub courserequest_titles {
unofficial => 'Unofficial',
community => 'Communities',
norequest => 'Not allowed',
- approve => 'Approval by Dom. Coord.',
+ approval => 'Approval by Dom. Coord.',
validate => 'With validation',
autolimit => 'Numerical limit',
unlimited => '(blank for unlimited)',
@@ -1882,7 +1897,7 @@ sub courserequest_titles {
sub courserequest_conditions {
my %conditions = &Apache::lonlocal::texthash (
- approve => '(Processing of request subject to approval by Domain Coordinator).',
+ approval => '(Processing of request subject to approval by Domain Coordinator).',
validate => '(Processing of request subject to instittutional validation).',
);
return %conditions;
@@ -3773,7 +3788,7 @@ sub modify_quotas {
}
if ($context eq 'requestcourses') {
@usertools = ('official','unofficial','community');
- @options =('norequest','approve','autolimit','validate');
+ @options =('norequest','approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($dom);
%titles = &courserequest_titles();
$toolregexp = join('|',@usertools);
@@ -3828,7 +3843,12 @@ sub modify_quotas {
}
foreach my $item (@usertools) {
foreach my $type (@{$types},'default','_LC_adv') {
+ my $unset;
if ($context eq 'requestcourses') {
+ $unset = '0';
+ if ($type eq '_LC_adv') {
+ $unset = '';
+ }
if ($confhash{$item}{$type} eq 'autolimit') {
$confhash{$item}{$type} .= '=';
unless ($limithash{$item}{$type} =~ /\D/) {
@@ -3849,7 +3869,7 @@ sub modify_quotas {
}
} else {
if ($context eq 'requestcourses') {
- if ($confhash{$item}{$type} ne 'norequest') {
+ if ($confhash{$item}{$type} ne $unset) {
$changes{$item}{$type} = 1;
}
} else {
@@ -3860,7 +3880,7 @@ sub modify_quotas {
}
} else {
if ($context eq 'requestcourses') {
- if ($confhash{$item}{$type} eq 'norequest') {
+ if ($confhash{$item}{$type} ne $unset) {
$changes{$item}{$type} = 1;
}
} else {
@@ -3986,7 +4006,15 @@ sub modify_quotas {
$resulttext .= ''.&mt('Set to be available to [_1]',$typetitle).'';
}
} else {
- $resulttext .= ''.&mt('Set to be unavailable to [_1]',$typetitle).'';
+ if ($type eq '_LC_adv') {
+ if ($confhash{$item}{$type} eq '0') {
+ $resulttext .= ''.&mt('Set to be unavailable to [_1]',$typetitle).'';
+ } else {
+ $resulttext .= ''.&mt('No override set for [_1]',$typetitle).'';
+ }
+ } else {
+ $resulttext .= ''.&mt('Set to be unavailable to [_1]',$typetitle).'';
+ }
}
}
}
|