version 1.103, 2009/08/20 20:13:06
|
version 1.104, 2009/08/22 18:09:17
|
Line 105 affiliate type (and also default, and _L
|
Line 105 affiliate type (and also default, and _L
|
(official, unofficial and community). In each case the radio buttons allow the |
(official, unofficial and community). In each case the radio buttons allow the |
selection of one of four values: |
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: |
which have the following effects: |
|
|
0 |
0 |
Line 116 which have the following effects:
|
Line 116 which have the following effects:
|
|
|
=back |
=back |
|
|
approve |
approval |
|
|
=over |
=over |
|
|
Line 1149 sub print_quotas {
|
Line 1149 sub print_quotas {
|
my ($css_class,%titles); |
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'); |
@options =('norequest','approval','autolimit','validate'); |
%validations = &Apache::lonnet::auto_courserequest_checks($dom); |
%validations = &Apache::lonnet::auto_courserequest_checks($dom); |
%titles = &courserequest_titles(); |
%titles = &courserequest_titles(); |
} else { |
} else { |
Line 1331 sub print_quotas {
|
Line 1331 sub print_quotas {
|
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" />'; |
} |
} |
$defcell{$item} .= '</span> '; |
$defcell{$item} .= '</span> '; |
|
if ($option eq 'autolimit') { |
|
$defcell{$item} .= $titles{'unlimited'} |
|
} |
} |
} |
} else { |
} else { |
my $checked = 'checked="checked" '; |
my $checked = 'checked="checked" '; |
Line 1366 sub print_quotas {
|
Line 1369 sub print_quotas {
|
$typecount ++; |
$typecount ++; |
$css_class = $typecount%2?' class="LC_odd_row"':''; |
$css_class = $typecount%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.&mt('LON-CAPA Advanced Users'). |
'<td>'.&mt('LON-CAPA Advanced Users').' '; |
' <span class="LC_nobreak">('. |
if ($context eq 'requestcourses') { |
&mt('overrides affiliation').')</span></td>'. |
$datatable .= &mt('overrides affiliation, if set'); |
|
} else { |
|
$datatable .= &mt('overrides affiliation, if checked'); |
|
} |
|
$datatable .= '</td>'. |
'<td class="LC_left_item" colspan="2">'; |
'<td class="LC_left_item" colspan="2">'; |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '<table><tr>'; |
$datatable .= '<table><tr>'; |
Line 1387 sub print_quotas {
|
Line 1394 sub print_quotas {
|
} |
} |
} |
} |
} |
} |
if (!$curroption) { |
|
$curroption = 'norequest'; |
|
} |
|
$datatable .= '<th>'.$titles{$item}.'</th>'; |
$datatable .= '<th>'.$titles{$item}.'</th>'; |
|
my $checked = ''; |
|
if ($curroption eq '') { |
|
$checked = ' checked="checked"'; |
|
} |
|
$advcell{$item} .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="crsreq_'.$item. |
|
'__LC_adv" value=""'.$checked.' />'. |
|
&mt('No override set').'</label></span> '; |
foreach my $option (@options) { |
foreach my $option (@options) { |
my $val = $option; |
my $val = $option; |
if ($option eq 'norequest') { |
if ($option eq 'norequest') { |
Line 1406 sub print_quotas {
|
Line 1418 sub print_quotas {
|
next if (!$canvalidate); |
next if (!$canvalidate); |
} |
} |
my $checked = ''; |
my $checked = ''; |
if ($option eq $curroption) { |
if ($val eq $curroption) { |
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} elsif ($option eq 'autolimit') { |
} elsif ($option eq 'autolimit') { |
if ($curroption =~ /^autolimit/) { |
if ($curroption =~ /^autolimit/) { |
Line 1423 sub print_quotas {
|
Line 1435 sub print_quotas {
|
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" />'; |
} |
} |
$advcell{$item} .= '</span> '; |
$advcell{$item} .= '</span> '; |
|
if ($option eq 'autolimit') { |
|
$advcell{$item} .= $titles{'unlimited'} |
|
} |
} |
} |
} else { |
} else { |
my $checked = 'checked="checked" '; |
my $checked = 'checked="checked" '; |
Line 1455 sub print_quotas {
|
Line 1470 sub print_quotas {
|
|
|
sub print_courserequestmail { |
sub print_courserequestmail { |
my ($dom,$settings,$rowtotal) = @_; |
my ($dom,$settings,$rowtotal) = @_; |
my ($now,$datatable,%dompersonnel,@domcoord,@currapprove,$rows); |
my ($now,$datatable,%dompersonnel,@domcoord,@currapproval,$rows); |
$now = time; |
$now = time; |
$rows = 0; |
$rows = 0; |
%dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc'],$now,$now); |
%dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc'],$now,$now); |
Line 1470 sub print_courserequestmail {
|
Line 1485 sub print_courserequestmail {
|
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{'notify'}) eq 'HASH') { |
if (ref($settings->{'notify'}) eq 'HASH') { |
if ($settings->{'notify'}{'approval'} ne '') { |
if ($settings->{'notify'}{'approval'} ne '') { |
@currapprove = split(',',$settings->{'notify'}{'approval'}); |
@currapproval = split(',',$settings->{'notify'}{'approval'}); |
} |
} |
} |
} |
} |
} |
if (@currapprove) { |
if (@currapproval) { |
foreach my $dc (@currapprove) { |
foreach my $dc (@currapproval) { |
unless (grep(/^\Q$dc\E$/,@domcoord)) { |
unless (grep(/^\Q$dc\E$/,@domcoord)) { |
push(@domcoord,$dc); |
push(@domcoord,$dc); |
} |
} |
Line 1501 sub print_courserequestmail {
|
Line 1516 sub print_courserequestmail {
|
$rows ++; |
$rows ++; |
} |
} |
my $check = ' '; |
my $check = ' '; |
if (grep(/^\Q$domcoord[$i]\E$/,@currapprove)) { |
if (grep(/^\Q$domcoord[$i]\E$/,@currapproval)) { |
$check = ' checked="checked" '; |
$check = ' checked="checked" '; |
} |
} |
my ($uname,$udom) = split(':',$domcoord[$i]); |
my ($uname,$udom) = split(':',$domcoord[$i]); |
Line 1872 sub courserequest_titles {
|
Line 1887 sub courserequest_titles {
|
unofficial => 'Unofficial', |
unofficial => 'Unofficial', |
community => 'Communities', |
community => 'Communities', |
norequest => 'Not allowed', |
norequest => 'Not allowed', |
approve => 'Approval by Dom. Coord.', |
approval => 'Approval by Dom. Coord.', |
validate => 'With validation', |
validate => 'With validation', |
autolimit => 'Numerical limit', |
autolimit => 'Numerical limit', |
unlimited => '(blank for unlimited)', |
unlimited => '(blank for unlimited)', |
Line 1882 sub courserequest_titles {
|
Line 1897 sub courserequest_titles {
|
|
|
sub courserequest_conditions { |
sub courserequest_conditions { |
my %conditions = &Apache::lonlocal::texthash ( |
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).', |
validate => '(Processing of request subject to instittutional validation).', |
); |
); |
return %conditions; |
return %conditions; |
Line 3773 sub modify_quotas {
|
Line 3788 sub modify_quotas {
|
} |
} |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
@usertools = ('official','unofficial','community'); |
@usertools = ('official','unofficial','community'); |
@options =('norequest','approve','autolimit','validate'); |
@options =('norequest','approval','autolimit','validate'); |
%validations = &Apache::lonnet::auto_courserequest_checks($dom); |
%validations = &Apache::lonnet::auto_courserequest_checks($dom); |
%titles = &courserequest_titles(); |
%titles = &courserequest_titles(); |
$toolregexp = join('|',@usertools); |
$toolregexp = join('|',@usertools); |
Line 3828 sub modify_quotas {
|
Line 3843 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') { |
|
my $unset; |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
|
$unset = '0'; |
|
if ($type eq '_LC_adv') { |
|
$unset = ''; |
|
} |
if ($confhash{$item}{$type} eq 'autolimit') { |
if ($confhash{$item}{$type} eq 'autolimit') { |
$confhash{$item}{$type} .= '='; |
$confhash{$item}{$type} .= '='; |
unless ($limithash{$item}{$type} =~ /\D/) { |
unless ($limithash{$item}{$type} =~ /\D/) { |
Line 3849 sub modify_quotas {
|
Line 3869 sub modify_quotas {
|
} |
} |
} else { |
} else { |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if ($confhash{$item}{$type} ne 'norequest') { |
if ($confhash{$item}{$type} ne $unset) { |
$changes{$item}{$type} = 1; |
$changes{$item}{$type} = 1; |
} |
} |
} else { |
} else { |
Line 3860 sub modify_quotas {
|
Line 3880 sub modify_quotas {
|
} |
} |
} else { |
} else { |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if ($confhash{$item}{$type} eq 'norequest') { |
if ($confhash{$item}{$type} ne $unset) { |
$changes{$item}{$type} = 1; |
$changes{$item}{$type} = 1; |
} |
} |
} else { |
} else { |
Line 3986 sub modify_quotas {
|
Line 4006 sub modify_quotas {
|
$resulttext .= '<li>'.&mt('Set to be available to [_1]',$typetitle).'</li>'; |
$resulttext .= '<li>'.&mt('Set to be available to [_1]',$typetitle).'</li>'; |
} |
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt('Set to be unavailable to [_1]',$typetitle).'</li>'; |
if ($type eq '_LC_adv') { |
|
if ($confhash{$item}{$type} eq '0') { |
|
$resulttext .= '<li>'.&mt('Set to be unavailable to [_1]',$typetitle).'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No override set for [_1]',$typetitle).'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('Set to be unavailable to [_1]',$typetitle).'</li>'; |
|
} |
} |
} |
} |
} |
} |
} |