--- loncom/interface/loncoursequeueadmin.pm 2013/12/25 09:52:42 1.39 +++ loncom/interface/loncoursequeueadmin.pm 2013/12/25 20:43:46 1.40 @@ -1,7 +1,7 @@ # The LearningOnline Network # Utilities to administer domain course requests and course self-enroll requests # -# $Id: loncoursequeueadmin.pm,v 1.39 2013/12/25 09:52:42 raeburn Exp $ +# $Id: loncoursequeueadmin.pm,v 1.40 2013/12/25 20:43:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -614,9 +614,6 @@ sub update_request_queue { if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { $notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'}; } - if ($domconfig{'requestcourses'}{'uniquecode'}) { - $uniquecode = 1; - } } $approvalmsg{'course'} = [{ @@ -1064,7 +1061,7 @@ sub update_request_queue { } my $syllabuslink = &Apache::loncommon::syllabuswrapper($showcourse,$cnum,$cdom); - if ($uniquecode && $codes{$cnum}) { + if ($codes{$cnum}) { $syllabuslink .= &mt('Unique code: [_1]',$codes{$cnum}); } $output .= '
  • '.$syllabuslink.'
  • '; @@ -1335,6 +1332,14 @@ sub course_creation { } my ($result,$ownername,$ownerdom); my $crstype = $details->{'crstype'}; + my %domconfig = &Apache::lonnet::get_dom('configuration',['requestauthor'],$dom); + if (ref($domconfig{'requestcourses'}) eq 'HASH') { + if (ref($domconfig{'requestcourses'}{'uniquecode'}) eq 'HASH') { + if ($domconfig{'requestcourses'}{'uniquecode'}{$crstype}) { + $details->{'uniquecode'} = 1; + } + } + } if ($context eq 'domain') { $ownername = $details->{'owner'}; $ownerdom = $details->{'domain'};