--- loncom/interface/loncoursequeueadmin.pm 2013/01/04 01:56:35 1.34 +++ 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.34 2013/01/04 01:56:35 raeburn Exp $ +# $Id: loncoursequeueadmin.pm,v 1.40 2013/12/25 20:43:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -224,6 +224,11 @@ sub send_selfserve_notification { if (ref($textstr) eq 'ARRAY') { push(@rawmsg,@{$textstr}); } + } elsif ($context eq 'uniquecode') { + $rawsubj = 'Course Identifier'; + if (ref($textstr) eq 'ARRAY') { + push(@rawmsg,@{$textstr}); + } } my @to_notify = split(/,/,$notifylist); my $numsent = 0; @@ -435,6 +440,7 @@ sub build_queue_display { official => 'Official course', unofficial => 'Unofficial course', community => 'Community', + textbook => 'Textbook course', ); $output .= ''.&mt('Type').''. ''.&mt('Date requested').''. @@ -533,7 +539,7 @@ sub update_request_queue { @processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels, @rejections,@rejectionerrors,@nopermissions,%courseroles,@toremove, %communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue, - $firsturl); + $firsturl,$uniquecode,%codes); my $count=0; while (my @course = &Apache::loncommon::get_env_multiple('form.'.$count.'radioreq')) { if ($course[0] =~ /^\d+:.*/) { @@ -783,10 +789,10 @@ sub update_request_queue { $ownerdom,$ownername); if ((ref($history{'details'}) eq 'HASH') && ($history{'disposition'} eq $queue)) { - my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg); + my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code); my $result = &course_creation($cdom,$cnum,$context,$history{'details'},\$logmsg, \$newusermsg,\$addresult,\$enrollcount, - \$response,\$keysmsg,\%domdefs,$longroles); + \$response,\$keysmsg,\%domdefs,$longroles,\$code); if ($result eq 'created') { if ($crstype eq 'community') { $approvedmsg = $approvalmsg{'community'}; @@ -798,6 +804,14 @@ sub update_request_queue { if (ref($approvedmsg->[1]) eq 'HASH') { $approvedmsg->[1]->{'args'} = [$firsturl]; } + if ($code) { + push(@{$approvedmsg}, + { + mt => 'Students can automatically select your course by entering this code: [_1]', + args => [$code], + }); + $codes{$cnum} = $code; + } } push(@completed,$cnum); @@ -1047,6 +1061,9 @@ sub update_request_queue { } my $syllabuslink = &Apache::loncommon::syllabuswrapper($showcourse,$cnum,$cdom); + if ($codes{$cnum}) { + $syllabuslink .= &mt('Unique code: [_1]',$codes{$cnum}); + } $output .= '
  • '.$syllabuslink.'
  • '; } $output .= '

    '; @@ -1256,7 +1273,7 @@ sub update_request_queue { } $output .= '

    '; } else { - $output .= '

    '.&mt("For the following course/community requests an error occurred when removing requests for the following from the pending queue:").'