--- loncom/interface/loncoursequeueadmin.pm 2011/03/07 02:13:02 1.27
+++ loncom/interface/loncoursequeueadmin.pm 2011/11/30 12:31:00 1.29
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Utilities to administer domain course requests and course self-enroll requests
#
-# $Id: loncoursequeueadmin.pm,v 1.27 2011/03/07 02:13:02 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.29 2011/11/30 12:31:00 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -424,9 +424,11 @@ sub build_queue_display {
}
unless ($context eq 'pending') {
$row = '
'.
+ ''.&mt('Approve').''.
'
| ';
+ ''.&mt('Reject').''.
+ ''.&mt('Decide Later').
+ '
';
}
$row .= ''.$namelink.' | '."\n";
if ($context eq 'course') {
@@ -461,8 +463,19 @@ sub update_request_queue {
@processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels,
@rejections,@rejectionerrors,@nopermissions,%courseroles,
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue,$firsturl);
- @approvals = &Apache::loncommon::get_env_multiple('form.approvereq');
- @rejections = &Apache::loncommon::get_env_multiple('form.rejectreq');
+ my $count=0;
+ while (my @course = &Apache::loncommon::get_env_multiple('form.'.$count.'radioreq')) {
+ if (@course[0] =~ /^\d+:.*/) {
+ push(@approvals,@course[0]);
+ } elsif (@course[0] =~ /^later:.*/) {
+ #decide later
+ } else {
+ push(@rejections,@course[0]);
+ }
+ $count+=1;
+ }
+
+
$now = time;
$sender = $env{'user.name'}.':'.$env{'user.domain'};
if ($context eq 'course') {
@@ -482,7 +495,7 @@ sub update_request_queue {
mt => 'Your request for enrollment has been approved.',
},
{
- mt => 'Visit [_1], to log-in and access the course',
+ mt => 'Visit [_1] to log-in and access the course',
args => [$firsturl],
}];
$rejectedmsg = [{
@@ -497,7 +510,6 @@ sub update_request_queue {
$queue = 'pending';
}
%requesthash = &Apache::lonnet::dump_dom($namespace,$cdom,'_'.$queue);
- $firsturl= &course_portal_url($cnum,$cdom);
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$cdom);
if (ref($domconfig{'requestcourses'}) eq 'HASH') {
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') {
@@ -509,8 +521,8 @@ sub update_request_queue {
mt => 'Your course request has been approved.',
},
{
- mt => 'Visit [_1], to log-in and access the course',
- args => [$firsturl],
+ mt => 'Visit [_1] to log-in and access the course',
+ args => [],
}];
$rejectionmsg{'course'} =
[{
@@ -522,8 +534,8 @@ sub update_request_queue {
mt => 'Your community request has been approved.',
},
{
- mt => 'Visit [_1], to log-in and access the community',
- args => [$firsturl],
+ mt => 'Visit [_1] to log-in and access the community',
+ args => [],
}];
$rejectionmsg{'community'} =
@@ -645,6 +657,12 @@ sub update_request_queue {
} else {
$approvedmsg = $approvalmsg{'course'};
}
+ my $firsturl = &course_portal_url($cnum,$cdom);
+ if (ref($approvedmsg) eq 'ARRAY') {
+ if (ref($approvedmsg->[1]) eq 'HASH') {
+ $approvedmsg->[1]->{'args'} = [$firsturl];
+ }
+ }
push(@completed,$cnum);
unless (&Apache::lonnet::del_dom($namespace,[$cnum.'_'.$queue],$cdom) eq 'ok') {
@@ -1432,7 +1450,7 @@ sub process_official_reqs {
args => [$cdescr],
},
{
- mt => 'Visit [_1], to log-in and access the course.',
+ mt => 'Visit [_1] to log-in and access the course.',
args => [$firsturl],
},
{