--- loncom/interface/loncoursequeueadmin.pm 2010/09/03 19:20:47 1.12.2.9 +++ loncom/interface/loncoursequeueadmin.pm 2010/12/05 21:57:33 1.12.2.10 @@ -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.9 2010/09/03 19:20:47 raeburn Exp $ +# $Id: loncoursequeueadmin.pm,v 1.12.2.10 2010/12/05 21:57:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -459,16 +459,28 @@ sub update_request_queue { } } + my %allnums = &Apache::loncommon::get_faculty_cnums(); foreach my $item (sort {$a <=> $b} @approvals) { if ($context eq 'course') { my ($num,$uname,$udom,$usec) = split(/:/,$item); my $uhome = &Apache::lonnet::homeserver($uname,$udom); if ($uhome ne 'no_host') { if (exists($requesthash{$uname.':'.$udom})) { - if ($cdom eq 'gci' && $cnum eq '9615072b469884921gcil1') { - foreach my $crs ('1H96711d710194bfegcil1','5422913620b814c90gcil1') { - my $enresult = &enable_additional_roles($cdom,$crs,$udom,$uname, - $access_end,$access_start); + if ($cdom ne '' && ref($allnums{$cdom} eq 'HASH') { + my ($addothers,@others); + foreach my $key (%{$allnums{$cdom}}) { + if ($key eq $cnum) { + $addothers = 1; + } else { + push(@others,$key); + } + } + if ($addothers) { + foreach my $crs (@others) { + my $enresult = + &enable_additional_roles($cdom,$crs,$udom,$uname, + $access_end,$access_start); + } } } if (exists($classlist->{$uname.':'.$udom})) { @@ -516,9 +528,9 @@ sub update_request_queue { &Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); if ($userresult ne 'ok') { push(@warn_approves,$uname.':'.$udom); - } elsif ($udom eq 'gci') { + } elsif (ref($allnums{$udom}) eq 'HASH') { my %changehash = ( - 'reqcrsotherdom.unofficial' => 'gcitest:autolimit=', + 'reqcrsotherdom.unofficial' => $udom.'test:autolimit=', ); my $reqresult = &Apache::lonnet::put('environment',\%changehash, $udom,$uname); @@ -990,7 +1002,7 @@ sub build_batchcreatehash { my ($dom,$context,$details,$owneremail,$domdefs) = @_; my %batchhash; my @items = qw{owner domain coursehome clonecrs clonedom cloneroster datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users}; - if ($dom eq 'gcitest') { + if ($dom =~ /^\w+citest$/) { push(@items,'firstres'); } if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) {