version 1.8, 2009/08/11 01:39:34
|
version 1.9, 2009/08/12 02:04:38
|
Line 1325 sub print_request_outcome {
|
Line 1325 sub print_request_outcome {
|
$output = &mt('Invalid LON-CAPA course number for the new course')."\n"; |
$output = &mt('Invalid LON-CAPA course number for the new course')."\n"; |
return $output; |
return $output; |
} |
} |
my $req_notifylist = &Apache::lonnet::get_dom('configuration',['requestcourses'], |
my $req_notifylist; |
$dom); |
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom); |
|
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
|
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
|
$req_notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'}; |
|
} |
|
} |
my $now = time; |
my $now = time; |
my $crstype = $env{'form.crstype'}; |
my $crstype = $env{'form.crstype'}; |
my ($startenroll,$endenroll,%sections,%crosslistings,%personnel); |
my ($startenroll,$endenroll,%sections,%crosslistings,%personnel); |
Line 1363 sub print_request_outcome {
|
Line 1368 sub print_request_outcome {
|
personnel => \%personnel |
personnel => \%personnel |
}; |
}; |
my @inststatuses; |
my @inststatuses; |
my $val = &get_processtype($dom,$crstype,\@inststatuses); |
my $val = &get_processtype($dom,$crstype,\@inststatuses,\%domconfig); |
if ($val eq '') { |
if ($val eq '') { |
if ($crstype eq 'official') { |
if ($crstype eq 'official') { |
$output = &mt('You are not permitted to request creation of official courses'); |
$output = &mt('You are not permitted to request creation of official courses'); |
Line 1476 sub print_request_outcome {
|
Line 1481 sub print_request_outcome {
|
} |
} |
|
|
sub get_processtype { |
sub get_processtype { |
my ($dom,$crstype,$inststatuses) = @_; |
my ($dom,$crstype,$inststatuses,$domconfig) = @_; |
return unless (ref($inststatuses) eq 'ARRAY'); |
return unless ((ref($inststatuses) eq 'ARRAY') && (ref($domconfig) eq 'HASH')); |
my (%userenv,%settings,$val); |
my (%userenv,%settings,$val); |
my @options = ('autolimit','validate','approve'); |
my @options = ('autolimit','validate','approve'); |
if ($dom eq $env{'user.domain'}) { |
if ($dom eq $env{'user.domain'}) { |
Line 1488 sub get_processtype {
|
Line 1493 sub get_processtype {
|
$val = $userenv{'requestcourses.'.$crstype}; |
$val = $userenv{'requestcourses.'.$crstype}; |
@{$inststatuses} = ('_custom_'); |
@{$inststatuses} = ('_custom_'); |
} else { |
} else { |
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom); |
|
my ($task,%alltasks); |
my ($task,%alltasks); |
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig->{'requestcourses'}) eq 'HASH') { |
%settings = %{$domconfig{'requestcourses'}}; |
%settings = %{$domconfig->{'requestcourses'}}; |
if (ref($settings{$crstype}) eq 'HASH') { |
if (ref($settings{$crstype}) eq 'HASH') { |
if (($env{'user.adv'}) && (exists($settings{$crstype}{'_LC_adv'}))) { |
if (($env{'user.adv'}) && (exists($settings{$crstype}{'_LC_adv'}))) { |
$val = $settings{$crstype}{'_LC_adv'}; |
$val = $settings{$crstype}{'_LC_adv'}; |