--- loncom/interface/lonrequestcourse.pm 2009/08/21 13:18:46 1.20
+++ loncom/interface/lonrequestcourse.pm 2009/08/22 18:12:37 1.21
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Request a course
#
-# $Id: lonrequestcourse.pm,v 1.20 2009/08/21 13:18:46 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.21 2009/08/22 18:12:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -792,7 +792,7 @@ sub print_request_form {
$message = '
'.
&mt('No course was found matching your choice of institutional course category.');
}
- unless ($code_chk eq 'ok') {
+ unless ($code_chk eq 'valid') {
$prev = 'crstype';
}
$r->print($message);
@@ -2024,7 +2024,7 @@ sub print_request_outcome {
$disposition = &check_autolimit($env{'user.name'},$env{'user.domain'},
$dom,$crstype,$limit,\$message);
} elsif ($val eq 'validate') {
- my $inststatuslist;
+ my ($inststatuslist,$validationchk,$validation);
if (@inststatuses > 0) {
$inststatuslist = join(',',@inststatuses);
}
@@ -2032,23 +2032,18 @@ sub print_request_outcome {
if (@instsections > 0) {
$instseclist = join(',',@instsections);
}
- my $validation =
- &Apache::lonnet::auto_validate_instcode('',$dom,$instcode,
- $env{'user.name'}.':'.$env{'user.domain'},$inststatuslist,
- $instseclist);
- if ($validation eq 'valid') {
- $disposition = 'process';
- } elsif ($validation eq 'rejected') {
- $disposition = 'rejected';
- } elsif ($validation eq 'pending') {
- $disposition = 'pending';
- } elsif ($disposition eq 'approval') {
- $disposition = 'approval';
- } elsif ($disposition =~ /^error(.*)$/) {
+ $validationchk =
+ &Apache::lonnet::auto_courserequest_validation($dom,
+ $env{'user.name'}.':'.$env{'user.domain'},$crstype,
+ $inststatuslist,$instcode,$instseclist);
+ if ($validationchk =~ /:/) {
+ ($validation,$message) = split(':',$validationchk);
+ } else {
+ $validation = $validationchk;
+ }
+ if ($validation =~ /^error(.*)$/) {
$disposition = 'approval';
$validationerror = $1;
- } else {
- $disposition = 'approval';
}
} else {
$disposition = 'approval';