version 1.102.2.1, 2009/08/13 20:38:45
|
version 1.102.2.2, 2009/08/23 12:40:50
|
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 1126 sub print_quotas {
|
Line 1126 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 1199 sub print_quotas {
|
Line 1199 sub print_quotas {
|
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$cell{$item} .= '<input type="text" name="crsreq_'. |
$cell{$item} .= '<input type="text" name="crsreq_'. |
$item.'_limit_'.$type.'" size="1" '. |
$item.'_limit_'.$type.'" size="1" '. |
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" />'; |
|
} |
|
if ($option eq 'autolimit') { |
|
$cell{$item} .= $titles{'unlimited'}; |
} |
} |
$cell{$item} .= '</span> '; |
$cell{$item} .= '</span> '; |
} |
} |
Line 1223 sub print_quotas {
|
Line 1226 sub print_quotas {
|
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '</tr><tr>'; |
$datatable .= '</tr><tr>'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
$datatable .= '<td>'.$cell{$item}.'</td>'; |
$datatable .= '<td style="vertical-align: top;">'.$cell{$item}.'</td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} |
} |
Line 1305 sub print_quotas {
|
Line 1308 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 1326 sub print_quotas {
|
Line 1332 sub print_quotas {
|
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '</tr><tr>'; |
$datatable .= '</tr><tr>'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
$datatable .= '<td>'.$defcell{$item}.'</td>'; |
$datatable .= '<td style="vertical-align: top;">'.$defcell{$item}.'</td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} |
} |
Line 1340 sub print_quotas {
|
Line 1346 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)'); |
'<td class="LC_left_item" colspan="2">'; |
} else { |
|
$datatable .= &mt('(overrides affiliation, if checked)'); |
|
} |
|
$datatable .= '</td>'. |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '<table><tr>'; |
$datatable .= '<table><tr>'; |
} else { |
} else { |
Line 1365 sub print_quotas {
|
Line 1374 sub print_quotas {
|
$curroption = 'norequest'; |
$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 1380 sub print_quotas {
|
Line 1397 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 1397 sub print_quotas {
|
Line 1414 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 1418 sub print_quotas {
|
Line 1438 sub print_quotas {
|
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '</tr><tr>'; |
$datatable .= '</tr><tr>'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
$datatable .= '<td>'.$advcell{$item}.'</td>'; |
$datatable .= '<td style="vertical-align: top;">'.$advcell{$item}.'</td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} |
} |
Line 1429 sub print_quotas {
|
Line 1449 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 1444 sub print_courserequestmail {
|
Line 1464 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 1475 sub print_courserequestmail {
|
Line 1495 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 1846 sub courserequest_titles {
|
Line 1866 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)', |
); |
); |
return %titles; |
return %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 3735 sub modify_quotas {
|
Line 3756 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 3790 sub modify_quotas {
|
Line 3811 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 3811 sub modify_quotas {
|
Line 3837 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 3822 sub modify_quotas {
|
Line 3848 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 3914 sub modify_quotas {
|
Line 3940 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.crsrequest.'.$item} ne $newacc) { |
if ($env{'environment.canrequest.'.$item} ne $newacc) { |
$newenv{'environment.crsrequest.'.$item} = $newacc; |
$newenv{'environment.canrequest.'.$item} = $newacc; |
} |
} |
} else { |
} else { |
if ($env{'environment.availabletools.'.$item} ne $newacc) { |
if ($env{'environment.availabletools.'.$item} ne $newacc) { |
Line 3948 sub modify_quotas {
|
Line 3974 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>'; |
|
} |
} |
} |
} |
} |
} |
} |
Line 4496 sub modify_usercreation {
|
Line 4530 sub modify_usercreation {
|
if (@{$types} > 0) { |
if (@{$types} > 0) { |
@{$cancreate{'statustocreate'}} = |
@{$cancreate{'statustocreate'}} = |
&Apache::loncommon::get_env_multiple('form.statustocreate'); |
&Apache::loncommon::get_env_multiple('form.statustocreate'); |
|
} else { |
|
@{$cancreate{'statustocreate'}} = (); |
} |
} |
push(@contexts,'statustocreate'); |
push(@contexts,'statustocreate'); |
} |
} |
Line 4504 sub modify_usercreation {
|
Line 4540 sub modify_usercreation {
|
if (($item eq 'selfcreate') || ($item eq 'statustocreate')) { |
if (($item eq 'selfcreate') || ($item eq 'statustocreate')) { |
if (ref($curr_usercreation{'cancreate'}{$item}) eq 'ARRAY') { |
if (ref($curr_usercreation{'cancreate'}{$item}) eq 'ARRAY') { |
foreach my $curr (@{$curr_usercreation{'cancreate'}{$item}}) { |
foreach my $curr (@{$curr_usercreation{'cancreate'}{$item}}) { |
if (!grep(/^$curr$/,@{$cancreate{$item}})) { |
if (ref($cancreate{$item}) eq 'ARRAY') { |
if (!grep(/^$item$/,@{$changes{'cancreate'}})) { |
if (!grep(/^$curr$/,@{$cancreate{$item}})) { |
push(@{$changes{'cancreate'}},$item); |
if (!grep(/^$item$/,@{$changes{'cancreate'}})) { |
|
push(@{$changes{'cancreate'}},$item); |
|
} |
} |
} |
} |
} |
} |
} |
Line 4975 sub modify_defaults {
|
Line 5013 sub modify_defaults {
|
if ($newvalues{$item} ne '') { |
if ($newvalues{$item} ne '') { |
if ($newvalues{$item} =~ /^(\w+)/) { |
if ($newvalues{$item} =~ /^(\w+)/) { |
my $langcode = $1; |
my $langcode = $1; |
if (code2language($langcode) eq '') { |
if ($langcode ne 'x_chef') { |
push(@errors,$item); |
if (code2language($langcode) eq '') { |
|
push(@errors,$item); |
|
} |
} |
} |
} else { |
} else { |
push(@errors,$item); |
push(@errors,$item); |