[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface loncoursequeueadmin.pm
raeburn
raeburn@source.lon-capa.org
Fri, 26 Feb 2010 23:39:01 -0000
raeburn Fri Feb 26 23:39:01 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface loncoursequeueadmin.pm
Log:
- Backport 1.17, 1.18, 1.20, 1.21, 1.22
- Add cloneroster to items included in %batchhash in &build_batchcreatehash().
Index: loncom/interface/loncoursequeueadmin.pm
diff -u loncom/interface/loncoursequeueadmin.pm:1.12.2.7 loncom/interface/loncoursequeueadmin.pm:1.12.2.8
--- loncom/interface/loncoursequeueadmin.pm:1.12.2.7 Mon Jan 18 15:54:23 2010
+++ loncom/interface/loncoursequeueadmin.pm Fri Feb 26 23:39:01 2010
@@ -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.7 2010/01/18 15:54:23 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
#
@@ -976,8 +976,8 @@
}
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 {
@@ -989,12 +989,12 @@
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};
@@ -1077,6 +1077,11 @@
$canclone = 1;
}
}
+ unless ($canclone) {
+ if (&Apache::lonnet::is_course_owner($clonedom,$clonecrs,$uname,$udom)) {
+ $canclone = 1;
+ }
+ }
}
return $canclone;
}