--- loncom/interface/loncoursequeueadmin.pm 2010/03/30 15:23:51 1.23
+++ loncom/interface/loncoursequeueadmin.pm 2010/12/08 03:38:46 1.25
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Utilities to administer domain course requests and course self-enroll requests
#
-# $Id: loncoursequeueadmin.pm,v 1.23 2010/03/30 15:23:51 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.25 2010/12/08 03:38:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -260,11 +260,13 @@ sub display_queued_requests {
$formaction = '/adm/createcourse';
$namespace = 'courserequestqueue';
my $disposition = 'approval';
+ my $nextphase = 'requestchange';
if ($context eq 'pending') {
$disposition = 'pending';
+ $nextphase = 'requestvalidation';
}
%requesthash = &Apache::lonnet::dump_dom($namespace,$dom,'_'.$disposition);
- $nextelement = '';
+ $nextelement = '';
}
my ($output,%queue_by_date);
if (keys(%requesthash) > 0) {
@@ -322,8 +324,8 @@ sub display_queued_requests {
$output .= '';
}
if ($context eq 'pending') {
- $output .= '
'."\n".
+ $output .= '
'."\n".
'
'.&mt('Any course/community requests which are successfully validated will be created immediately.').' '.&mt('Unvalidated requests will be listed for manual approval/rejection.').'
';
} else {
$output .= ' ';
@@ -449,7 +451,7 @@ sub update_request_queue {
@existing,@missingreq,@invalidusers,@limitexceeded,@completed,
@processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels,
@rejections,@rejectionerrors,@nopermissions,%courseroles,
- %communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue);
+ %communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue,$firsturl);
@approvals = &Apache::loncommon::get_env_multiple('form.approvereq');
@rejections = &Apache::loncommon::get_env_multiple('form.rejectreq');
$now = time;
@@ -463,6 +465,12 @@ sub update_request_queue {
$hostname = &Apache::lonnet::hostname($chome);
$protocol = $Apache::lonnet::protocol{$chome};
$protocol = 'http' if ($protocol ne 'https');
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom);
+ if ($domdefaults{'portal_def'}) {
+ $firsturl = $domdefaults{'portal_def'};
+ } else {
+ $firsturl = $protocol.'://'.$hostname;
+ }
%requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum);
$access_start = $env{'course.'.$cid.'.internal.selfenroll_start_access'};
$access_end = $env{'course.'.$cid.'.internal.selfenroll_end_access'};
@@ -475,7 +483,7 @@ sub update_request_queue {
},
{
mt => 'Visit [_1], to log-in and access the course',
- args => [$protocol.'://'.$hostname],
+ args => [$firsturl],
}];
$rejectedmsg = [{
mt => 'Your request for enrollment has not been approved.',
@@ -493,6 +501,12 @@ sub update_request_queue {
$hostname = &Apache::lonnet::hostname($chome);
$protocol = $Apache::lonnet::protocol{$chome};
$protocol = 'http' if ($protocol ne 'https');
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom);
+ if ($domdefaults{'portal_def'}) {
+ $firsturl = $domdefaults{'portal_def'};
+ } else {
+ $firsturl = $protocol.'://'.$hostname;
+ }
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$cdom);
if (ref($domconfig{'requestcourses'}) eq 'HASH') {
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') {
@@ -505,7 +519,7 @@ sub update_request_queue {
},
{
mt => 'Visit [_1], to log-in and access the course',
- args => [$protocol.'://'.$hostname],
+ args => [$firsturl],
}];
$rejectionmsg{'course'} =
[{
@@ -518,7 +532,7 @@ sub update_request_queue {
},
{
mt => 'Visit [_1], to log-in and access the community',
- args => [$protocol.'://'.$hostname],
+ args => [$firsturl],
}];
$rejectionmsg{'community'} =
@@ -1320,7 +1334,7 @@ sub process_official_reqs {
my ($context,$dom) = @_;
my $reqsnamespace = 'courserequestqueue';
my %requesthash =
- &Apache::lonnet::dump_dom($reqsnamespace,$dom,undef,'_pending');
+ &Apache::lonnet::dump_dom($reqsnamespace,$dom,'_pending');
my (%newcids,%longroles,%stillpending);
my @courseroles = ('cc','in','ta','ep','ad','st');
foreach my $role (@courseroles) {