version 1.100, 2009/08/06 15:14:08
|
version 1.101, 2009/08/08 00:36:00
|
Line 28
|
Line 28
|
############################################################### |
############################################################### |
############################################################## |
############################################################## |
|
|
|
=pod |
|
|
|
=head1 NAME |
|
|
|
Apache::domainprefs.pm |
|
|
|
=head1 SYNOPSIS |
|
|
|
Handles configuration of a LON-CAPA domain. |
|
|
|
This is part of the LearningOnline Network with CAPA project |
|
described at http://www.lon-capa.org. |
|
|
|
|
|
=head1 OVERVIEW |
|
|
|
Each institution using LON-CAPA will typically have a single domain designated |
|
for use by individuals affliated with the institution. Accordingly, each domain |
|
may define a default set of logos and a color scheme which can be used to "brand" |
|
the LON-CAPA instance. In addition, an institution will typically have a language |
|
and timezone which are used for the majority of courses. |
|
|
|
LON-CAPA provides a mechanism to display and modify these defaults, as well as a |
|
host of other domain-wide settings which determine the types of functionality |
|
available to users and courses in the domain. |
|
|
|
There is also a mechanism to configure cataloging of courses in the domain, and |
|
controls on the operation of automated processes which govern such things as |
|
roster updates, user directory updates and processing of course requests. |
|
|
|
The domain coordination manual which is built dynamically on install/update of |
|
LON-CAPA from the relevant help items provides more information about domain |
|
configuration. |
|
|
|
Most of the domain settings are stored in the configuration.db GDBM file which is |
|
housed on the primary library server for the domain in /home/httpd/lonUsers/$dom, |
|
where $dom is the domain. The configuration.db stores settings in a number of |
|
frozen hashes of hashes. In a few cases, domain information must be uploaded to |
|
the domain as files (e.g., image files for logos etc., or plain text files for |
|
bubblesheet formats). In this case the domainprefs.pm must be running in a user |
|
session hosted on the primary library server in the domain, as these files are |
|
stored in author space belonging to a special $dom-domainconfig user. |
|
|
|
domainprefs.pm in combination with lonconfigsettings.pm will retrieve and display |
|
the current settings, and provides an interface to make modifications. |
|
|
|
=head1 SUBROUTINES |
|
|
|
=over |
|
|
|
=item print_quotas() |
|
|
|
Inputs: 4 |
|
|
|
$dom,$settings,$rowtotal,$action. |
|
|
|
$dom is the domain, $settings is a reference to a hash of current settings for |
|
the current context, $rowtotal is a reference to the scalar used to record the |
|
number of rows displayed on the page, and $action is the context (either quotas |
|
or requestcourses). |
|
|
|
The print_quotas routine was orginally created to display/store information |
|
about default quota sizes for portfolio spaces for the different types of |
|
institutional affiliation in the domain (e.g., Faculty, Staff, Student etc.), |
|
but is now also used to manage availability of user tools: |
|
i.e., blogs, aboutme page, and portfolios, and the course request tool, |
|
used by course owners to request creation of a course. |
|
|
|
Outputs: 1 |
|
|
|
$datatable - HTML containing form elements which allow settings to be changed. |
|
|
|
In the case of course requests, radio buttons are displayed for each institutional |
|
affiliate type (and also default, and _LC_adv) for each of the course types |
|
(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). |
|
which have the following effects: |
|
|
|
0 |
|
|
|
=over |
|
|
|
- course requests are not allowed for this course types/affiliation |
|
|
|
=back |
|
|
|
approve |
|
|
|
=over |
|
|
|
- course requests must be approved by a Doman Coordinator in the |
|
course's domain |
|
|
|
=back |
|
|
|
validate |
|
|
|
=over |
|
|
|
- an institutional validation (e.g., check requestor is instructor |
|
of record) needs to be passed before the course will be created. The required |
|
validation is in localenroll.pm on the primary library server for the course |
|
domain. |
|
|
|
=back |
|
|
|
autolimit |
|
|
|
=over |
|
|
|
- course requests will be processed autoatically up to a limit of |
|
N requests for the course type for the particular requestor. |
|
If N is undefined, there is no limit to the number of course requests |
|
which a course owner may submit and have processed automatically. |
|
|
|
=back |
|
|
|
=item modify_quotas() |
|
|
|
=back |
|
|
|
=cut |
|
|
package Apache::domainprefs; |
package Apache::domainprefs; |
|
|
use strict; |
use strict; |
Line 172 sub handler {
|
Line 297 sub handler {
|
{text => 'Request creation of courses', |
{text => 'Request creation of courses', |
help => 'Domain_Configuration_Request_Courses', |
help => 'Domain_Configuration_Request_Courses', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Requestable course types',}], |
col2 => 'Availability/Processing of requests',}], |
}, |
}, |
'coursecategories' => |
'coursecategories' => |
{ text => 'Cataloging of courses', |
{ text => 'Cataloging of courses', |
Line 1014 sub print_quotas {
|
Line 1139 sub print_quotas {
|
} else { |
} else { |
$context = $action; |
$context = $action; |
} |
} |
my ($datatable,$defaultquota,@usertools); |
my ($datatable,$defaultquota,@usertools,@options,%validations); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my $typecount = 0; |
my $typecount = 0; |
my $css_class; |
my ($css_class,%titles); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
@usertools = ('official','unofficial','community'); |
@usertools = ('official','unofficial','community'); |
|
@options =('norequest','approve','autolimit','validate'); |
|
%validations = &Apache::lonnet::auto_courserequest_checks($dom); |
|
%titles = &courserequest_titles(); |
} else { |
} else { |
@usertools = ('aboutme','blog','portfolio'); |
@usertools = ('aboutme','blog','portfolio'); |
|
%titles = &tool_titles(); |
} |
} |
my %titles = &tool_titles(); |
|
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
foreach my $type (@{$types}) { |
foreach my $type (@{$types}) { |
my $currdefquota; |
my $currdefquota; |
Line 1042 sub print_quotas {
|
Line 1170 sub print_quotas {
|
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.$usertypes->{$type}.'</td>'. |
'<td>'.$usertypes->{$type}.'</td>'. |
'<td class="LC_left_item">'; |
'<td class="LC_left_item">'; |
|
if ($context eq 'requestcourses') { |
|
$datatable .= '<table><tr>'; |
|
} |
|
my %cell; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my $checked; |
if ($context eq 'requestcourses') { |
unless ($context eq 'requestcourses') { |
my ($curroption,$currlimit); |
$checked = 'checked="checked" '; |
if (ref($settings) eq 'HASH') { |
} |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$curroption = $settings->{$item}->{$type}; |
if (ref($settings->{$item}) eq 'HASH') { |
if ($curroption =~ /^autolimit=(\d*)$/) { |
if ($settings->{$item}->{$type} == 0) { |
$currlimit = $1; |
$checked = ''; |
} |
} elsif ($settings->{$item}->{$type} == 1) { |
|
$checked = 'checked="checked" '; |
|
} |
} |
} |
} |
|
if (!$curroption) { |
|
$curroption = 'norequest'; |
|
} |
|
$datatable .= '<th>'.$titles{$item}.'</th>'; |
|
foreach my $option (@options) { |
|
my $val = $option; |
|
if ($option eq 'norequest') { |
|
$val = 0; |
|
} |
|
if ($option eq 'validate') { |
|
my $canvalidate = 0; |
|
if (ref($validations{$item}) eq 'HASH') { |
|
if ($validations{$item}{$type}) { |
|
$canvalidate = 1; |
|
} |
|
} |
|
next if (!$canvalidate); |
|
} |
|
my $checked = ''; |
|
if ($option eq $curroption) { |
|
$checked = ' checked="checked"'; |
|
} elsif ($option eq 'autolimit') { |
|
if ($curroption =~ /^autolimit/) { |
|
$checked = ' checked="checked"'; |
|
} |
|
} |
|
$cell{$item} .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="crsreq_'.$item. |
|
'_'.$type.'" value="'.$val.'"'.$checked.' />'. |
|
$titles{$option}.'</label> '; |
|
if ($option eq 'autolimit') { |
|
$cell{$item} .= '<input type="text" name="crsreq_'. |
|
$item.'_limit_'.$type.'" size="1" '. |
|
'value="'.$currlimit.'" />'; |
|
} |
|
$cell{$item} .= '</span> '; |
|
} |
|
} else { |
|
my $checked = 'checked="checked" '; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{$item}) eq 'HASH') { |
|
if ($settings->{$item}->{$type} == 0) { |
|
$checked = ''; |
|
} elsif ($settings->{$item}->{$type} == 1) { |
|
$checked = 'checked="checked" '; |
|
} |
|
} |
|
} |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.'_'.$item. |
|
'" value="'.$type.'" '.$checked.'/>'.$titles{$item}. |
|
'</label></span> '; |
|
} |
|
} |
|
if ($context eq 'requestcourses') { |
|
$datatable .= '</tr><tr>'; |
|
foreach my $item (@usertools) { |
|
$datatable .= '<td>'.$cell{$item}.'</td>'; |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '</tr></table>'; |
'<input type="checkbox" name="'.$context.'_'.$item. |
|
'" value="'.$type.'" '.$checked.'/>'.$titles{$item}. |
|
'</label></span> '; |
|
} |
} |
$datatable .= '</td>'; |
$datatable .= '</td>'; |
unless ($context eq 'requestcourses') { |
unless ($context eq 'requestcourses') { |
Line 1088 sub print_quotas {
|
Line 1273 sub print_quotas {
|
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.$othertitle.'</td>'. |
'<td>'.$othertitle.'</td>'. |
'<td class="LC_left_item">'; |
'<td class="LC_left_item">'; |
|
if ($context eq 'requestcourses') { |
|
$datatable .= '<table><tr>'; |
|
} |
|
my %defcell; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my $checked; |
if ($context eq 'requestcourses') { |
unless ($context eq 'requestcourses') { |
my ($curroption,$currlimit); |
$checked = 'checked="checked" '; |
if (ref($settings) eq 'HASH') { |
} |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$curroption = $settings->{$item}->{'default'}; |
if (ref($settings->{$item}) eq 'HASH') { |
if ($curroption =~ /^autolimit=(\d*)$/) { |
if ($settings->{$item}->{'default'} == 0) { |
$currlimit = $1; |
$checked = ''; |
} |
} elsif ($settings->{$item}->{'default'} == 1) { |
} |
$checked = 'checked="checked" '; |
} |
|
if (!$curroption) { |
|
$curroption = 'norequest'; |
|
} |
|
$datatable .= '<th>'.$titles{$item}.'</th>'; |
|
foreach my $option (@options) { |
|
my $val = $option; |
|
if ($option eq 'norequest') { |
|
$val = 0; |
|
} |
|
if ($option eq 'validate') { |
|
my $canvalidate = 0; |
|
if (ref($validations{$item}) eq 'HASH') { |
|
if ($validations{$item}{'default'}) { |
|
$canvalidate = 1; |
|
} |
|
} |
|
next if (!$canvalidate); |
|
} |
|
my $checked = ''; |
|
if ($option eq $curroption) { |
|
$checked = ' checked="checked"'; |
|
} elsif ($option eq 'autolimit') { |
|
if ($curroption =~ /^autolimit/) { |
|
$checked = ' checked="checked"'; |
|
} |
|
} |
|
$defcell{$item} .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="crsreq_'.$item. |
|
'_default" value="'.$val.'"'.$checked.' />'. |
|
$titles{$option}.'</label>'; |
|
if ($option eq 'autolimit') { |
|
$defcell{$item} .= '<input type="text" name="crsreq_'. |
|
$item.'_limit_default" size="1" '. |
|
'value="'.$currlimit.'" />'; |
|
} |
|
$defcell{$item} .= '</span> '; |
|
} |
|
} else { |
|
my $checked = 'checked="checked" '; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{$item}) eq 'HASH') { |
|
if ($settings->{$item}->{'default'} == 0) { |
|
$checked = ''; |
|
} elsif ($settings->{$item}->{'default'} == 1) { |
|
$checked = 'checked="checked" '; |
|
} |
} |
} |
} |
} |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.'_'.$item. |
|
'" value="default" '.$checked.'/>'.$titles{$item}. |
|
'</label></span> '; |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
} |
'<input type="checkbox" name="'.$context.'_'.$item. |
if ($context eq 'requestcourses') { |
'" value="default" '.$checked.'/>'.$titles{$item}. |
$datatable .= '</tr><tr>'; |
'</label></span> '; |
foreach my $item (@usertools) { |
|
$datatable .= '<td>'.$defcell{$item}.'</td>'; |
|
} |
|
$datatable .= '</tr></table>'; |
} |
} |
$datatable .= '</td>'; |
$datatable .= '</td>'; |
unless ($context eq 'requestcourses') { |
unless ($context eq 'requestcourses') { |
Line 1120 sub print_quotas {
|
Line 1362 sub print_quotas {
|
'<td>'.&mt('LON-CAPA Advanced Users'). |
'<td>'.&mt('LON-CAPA Advanced Users'). |
' <span class="LC_nobreak">('. |
' <span class="LC_nobreak">('. |
&mt('overrides affiliation').')</span></td>'. |
&mt('overrides affiliation').')</span></td>'. |
'<td class="LC_left_item" colspan="2"><br />'; |
'<td class="LC_left_item" colspan="2">'; |
|
if ($context eq 'requestcourses') { |
|
$datatable .= '<table><tr>'; |
|
} else { |
|
$datatable .= '<br />'; |
|
} |
|
my %advcell; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my $checked; |
if ($context eq 'requestcourses') { |
unless ($context eq 'requestcourses') { |
my ($curroption,$currlimit); |
$checked = 'checked="checked" '; |
if (ref($settings) eq 'HASH') { |
} |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$curroption = $settings->{$item}->{'_LC_adv'}; |
if (ref($settings->{$item}) eq 'HASH') { |
if ($curroption =~ /^autolimit=(\d*)$/) { |
if ($settings->{$item}->{'_LC_adv'} == 0) { |
$currlimit = $1; |
$checked = ''; |
} |
} elsif ($settings->{$item}->{'_LC_adv'} == 1) { |
|
$checked = 'checked="checked" '; |
|
} |
} |
} |
} |
|
if (!$curroption) { |
|
$curroption = 'norequest'; |
|
} |
|
$datatable .= '<th>'.$titles{$item}.'</th>'; |
|
foreach my $option (@options) { |
|
my $val = $option; |
|
if ($option eq 'norequest') { |
|
$val = 0; |
|
} |
|
if ($option eq 'validate') { |
|
my $canvalidate = 0; |
|
if (ref($validations{$item}) eq 'HASH') { |
|
if ($validations{$item}{'_LC_adv'}) { |
|
$canvalidate = 1; |
|
} |
|
} |
|
next if (!$canvalidate); |
|
} |
|
my $checked = ''; |
|
if ($option eq $curroption) { |
|
$checked = ' checked="checked"'; |
|
} elsif ($option eq 'autolimit') { |
|
if ($curroption =~ /^autolimit/) { |
|
$checked = ' checked="checked"'; |
|
} |
|
} |
|
$advcell{$item} .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="crsreq_'.$item. |
|
'__LC_adv" value="'.$val.'"'.$checked.' />'. |
|
$titles{$option}.'</label>'; |
|
if ($option eq 'autolimit') { |
|
$advcell{$item} .= '<input type="text" name="crsreq_'. |
|
$item.'_limit__LC_adv" size="1" '. |
|
'value="'.$currlimit.'" />'; |
|
} |
|
$advcell{$item} .= '</span> '; |
|
} |
|
} else { |
|
my $checked = 'checked="checked" '; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{$item}) eq 'HASH') { |
|
if ($settings->{$item}->{'_LC_adv'} == 0) { |
|
$checked = ''; |
|
} elsif ($settings->{$item}->{'_LC_adv'} == 1) { |
|
$checked = 'checked="checked" '; |
|
} |
|
} |
|
} |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.'_'.$item. |
|
'" value="_LC_adv" '.$checked.'/>'.$titles{$item}. |
|
'</label></span> '; |
|
} |
|
} |
|
if ($context eq 'requestcourses') { |
|
$datatable .= '</tr><tr>'; |
|
foreach my $item (@usertools) { |
|
$datatable .= '<td>'.$advcell{$item}.'</td>'; |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '</tr></table>'; |
'<input type="checkbox" name="'.$context.'_'.$item. |
|
'" value="_LC_adv" '.$checked.'/>'.$titles{$item}. |
|
'</label></span> '; |
|
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$$rowtotal += $typecount; |
$$rowtotal += $typecount; |
Line 1477 sub tool_titles {
|
Line 1778 sub tool_titles {
|
return %titles; |
return %titles; |
} |
} |
|
|
|
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_conditions { |
|
my %conditions = &Apache::lonlocal::texthash ( |
|
approve => '(Processing of request subject to approval by Domain Coordinator).', |
|
validate => '(Processing of request subject to instittutional validation).', |
|
); |
|
return %conditions; |
|
} |
|
|
|
|
sub print_usercreation { |
sub print_usercreation { |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my $numinrow = 4; |
my $numinrow = 4; |
Line 3352 sub check_switchserver {
|
Line 3675 sub check_switchserver {
|
|
|
sub modify_quotas { |
sub modify_quotas { |
my ($dom,$action,%domconfig) = @_; |
my ($dom,$action,%domconfig) = @_; |
my ($context,@usertools); |
my ($context,@usertools,@options,%validations,%titles,%confhash,%toolshash, |
|
%limithash,$toolregexp,%conditions,$resulttext,%changes); |
if ($action eq 'quotas') { |
if ($action eq 'quotas') { |
$context = 'tools'; |
$context = 'tools'; |
} else { |
} else { |
Line 3360 sub modify_quotas {
|
Line 3684 sub modify_quotas {
|
} |
} |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
@usertools = ('official','unofficial','community'); |
@usertools = ('official','unofficial','community'); |
|
@options =('norequest','approve','autolimit','validate'); |
|
%validations = &Apache::lonnet::auto_courserequest_checks($dom); |
|
%titles = &courserequest_titles(); |
|
$toolregexp = join('|',@usertools); |
|
%conditions = &courserequest_conditions(); |
} else { |
} else { |
@usertools = ('aboutme','blog','portfolio'); |
@usertools = ('aboutme','blog','portfolio'); |
|
%titles = &tool_titles(); |
} |
} |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my ($resulttext,%changes); |
|
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my %titles = &tool_titles(); |
|
my (%confhash,%toolshash); |
|
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
unless ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
|
if ($key =~ /^form\.crsreq_($toolregexp)_(.+)$/) { |
|
my $item = $1; |
|
my $type = $2; |
|
if ($type =~ /^limit_(.+)/) { |
|
$limithash{$item}{$1} = $env{$key}; |
|
} else { |
|
$confhash{$item}{$type} = $env{$key}; |
|
} |
|
} |
|
} else { |
if ($key =~ /^form\.quota_(.+)$/) { |
if ($key =~ /^form\.quota_(.+)$/) { |
$confhash{'defaultquota'}{$1} = $env{$key}; |
$confhash{'defaultquota'}{$1} = $env{$key}; |
} |
} |
} |
if ($key =~ /^form\.\Q$context\E_(.+)$/) { |
if ($key =~ /^form\.\Q$context\E_(.+)$/) { |
@{$toolshash{$1}} = &Apache::loncommon::get_env_multiple($key); |
@{$toolshash{$1}} = &Apache::loncommon::get_env_multiple($key); |
} |
} |
} |
} |
} |
unless ($context eq 'requestcourses') { |
unless ($context eq 'requestcourses') { |
Line 3383 sub modify_quotas {
|
Line 3720 sub modify_quotas {
|
} |
} |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
foreach my $type (@{$types},'default','_LC_adv') { |
foreach my $type (@{$types},'default','_LC_adv') { |
if (grep(/^\Q$type\E$/,@{$toolshash{$item}})) { |
if ($context eq 'requestcourses') { |
$confhash{$item}{$type} = 1; |
if ($confhash{$item}{$type} eq 'autolimit') { |
|
$confhash{$item}{$type} .= '='; |
|
unless ($limithash{$item}{$type} =~ /\D/) { |
|
$confhash{$item}{$type} .= $limithash{$item}{$type}; |
|
} |
|
} |
} else { |
} else { |
$confhash{$item}{$type} = 0; |
if (grep(/^\Q$type\E$/,@{$toolshash{$item}})) { |
|
$confhash{$item}{$type} = 1; |
|
} else { |
|
$confhash{$item}{$type} = 0; |
|
} |
} |
} |
if (ref($domconfig{$action}) eq 'HASH') { |
if (ref($domconfig{$action}) eq 'HASH') { |
if (ref($domconfig{$action}{$item}) eq 'HASH') { |
if (ref($domconfig{$action}{$item}) eq 'HASH') { |
Line 3395 sub modify_quotas {
|
Line 3741 sub modify_quotas {
|
} |
} |
} else { |
} else { |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if ($confhash{$item}{$type}) { |
if ($confhash{$item}{$type} ne 'norequest') { |
$changes{$item}{$type} = 1; |
$changes{$item}{$type} = 1; |
} |
} |
} else { |
} else { |
Line 3406 sub modify_quotas {
|
Line 3752 sub modify_quotas {
|
} |
} |
} else { |
} else { |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if ($confhash{$item}{$type}) { |
if ($confhash{$item}{$type} eq 'norequest') { |
$changes{$item}{$type} = 1; |
$changes{$item}{$type} = 1; |
} |
} |
} else { |
} else { |
Line 3498 sub modify_quotas {
|
Line 3844 sub modify_quotas {
|
$env{'user.domain'}, |
$env{'user.domain'}, |
$item,'reload',$context); |
$item,'reload',$context); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if ($env{'environment.canrequest.'.$item} ne $newacc) { |
if ($env{'environment.crsrequest.'.$item} ne $newacc) { |
$newenv{'environment.canrequest.'.$item} = $newacc; |
$newenv{'environment.crsrequest.'.$item} = $newacc; |
} |
} |
} else { |
} else { |
if ($env{'environment.availabletools.'.$item} ne $newacc) { |
if ($env{'environment.availabletools.'.$item} ne $newacc) { |
Line 3516 sub modify_quotas {
|
Line 3862 sub modify_quotas {
|
$typetitle = 'LON-CAPA Advanced Users'; |
$typetitle = 'LON-CAPA Advanced Users'; |
} |
} |
if ($confhash{$item}{$type}) { |
if ($confhash{$item}{$type}) { |
$resulttext .= '<li>'.&mt('Set to be available to [_1]',$typetitle).'</li>'; |
if ($context eq 'requestcourses') { |
|
my $cond; |
|
if ($confhash{$item}{$type} =~ /^autolimit=(\d*)$/) { |
|
if ($1 eq '') { |
|
$cond = &mt('(Automatic processing of any request).'); |
|
} else { |
|
$cond = &mt('(Automatic processing of requests up to limit of [quant,_1,request] per user).',$1); |
|
} |
|
} else { |
|
$cond = $conditions{$confhash{$item}{$type}}; |
|
} |
|
$resulttext .= '<li>'.&mt('Set to be available to [_1].',$typetitle).' '.$cond.'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Set to be available to [_1]',$typetitle).'</li>'; |
|
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt('Set to be unavailable to [_1]',$typetitle).'</li>'; |
$resulttext .= '<li>'.&mt('Set to be unavailable to [_1]',$typetitle).'</li>'; |
} |
} |