--- loncom/interface/loncoursequeueadmin.pm 2010/01/15 05:26:51 1.12.2.5
+++ loncom/interface/loncoursequeueadmin.pm 2010/02/26 23:39:01 1.12.2.8
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Utilities to administer domain course requests and course self-enroll requests
#
-# $Id: loncoursequeueadmin.pm,v 1.12.2.5 2010/01/15 05:26:51 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.12.2.8 2010/02/26 23:39:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,7 +67,6 @@ described at http://www.lon-capa.org.
package Apache::loncoursequeueadmin;
use strict;
-use Apache::Constants qw(:common :http);
use Apache::lonnet;
use Apache::loncommon;
use Apache::lonmsg;
@@ -977,8 +976,8 @@ sub course_creation {
}
my %reqdetails = &build_batchcreatehash($dom,$context,$details,$owneremail,$domdefs);
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses',
- \%reqdetails,$longroles,\$logmsg,\$newusermsg,\$addresult,
- \$enrollcount,\$output,\$keysmsg,$ownerdom,$ownername,$cnum,$crstype);
+ \%reqdetails,$longroles,$logmsg,$newusermsg,$addresult,
+ $enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype);
if ($cid eq "/$dom/$cnum") {
$result = 'created';
} else {
@@ -990,12 +989,12 @@ sub course_creation {
sub build_batchcreatehash {
my ($dom,$context,$details,$owneremail,$domdefs) = @_;
my %batchhash;
- my @items = qw{owner domain coursehome clonecrs clonedom datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users};
+ my @items = qw{owner domain coursehome clonecrs clonedom cloneroster datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users};
if ($dom eq 'gcitest') {
push(@items,'firstres');
}
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) {
- my $emailenc = &Apache::lonnet::escape($owneremail);
+ my $emailenc = &escape($owneremail);
my $owner = $details->{'owner'}.':'.$details->{'domain'};
foreach my $item (@items) {
$batchhash{$item} = $details->{$item};
@@ -1078,6 +1077,11 @@ sub can_clone_course {
$canclone = 1;
}
}
+ unless ($canclone) {
+ if (&Apache::lonnet::is_course_owner($clonedom,$clonecrs,$uname,$udom)) {
+ $canclone = 1;
+ }
+ }
}
return $canclone;
}
@@ -1097,7 +1101,6 @@ sub queued_selfenrollment {
}
}
if (keys(%reqs_by_date)) {
- my $rolename = &Apache::lonnet::plaintext('st');
unless ($notitle) {
$output .= ''.&mt('Enrollment requests pending Course Coordinator approval').'
';
}
@@ -1112,6 +1115,7 @@ sub queued_selfenrollment {
foreach my $crs (@{$reqs_by_date{$item}}) {
my %courseinfo = &Apache::lonnet::coursedescription($crs);
my $usec = $selfenrollrequests{$crs}{'section'};
+ my $rolename = &Apache::lonnet::plaintext('st',$courseinfo{'type'},$crs);
if ($usec eq '') {
$usec = &mt('No section');
}