version 1.32, 2012/08/16 17:02:55
|
version 1.39, 2013/12/25 09:52:42
|
Line 224 sub send_selfserve_notification {
|
Line 224 sub send_selfserve_notification {
|
if (ref($textstr) eq 'ARRAY') { |
if (ref($textstr) eq 'ARRAY') { |
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
} |
} |
|
} elsif ($context eq 'uniquecode') { |
|
$rawsubj = 'Course Identifier'; |
|
if (ref($textstr) eq 'ARRAY') { |
|
push(@rawmsg,@{$textstr}); |
|
} |
} |
} |
my @to_notify = split(/,/,$notifylist); |
my @to_notify = split(/,/,$notifylist); |
my $numsent = 0; |
my $numsent = 0; |
Line 435 sub build_queue_display {
|
Line 440 sub build_queue_display {
|
official => 'Official course', |
official => 'Official course', |
unofficial => 'Unofficial course', |
unofficial => 'Unofficial course', |
community => 'Community', |
community => 'Community', |
|
textbook => 'Textbook course', |
); |
); |
$output .= '<th>'.&mt('Type').'</th>'. |
$output .= '<th>'.&mt('Type').'</th>'. |
'<th>'.&mt('Date requested').'</th>'. |
'<th>'.&mt('Date requested').'</th>'. |
Line 533 sub update_request_queue {
|
Line 539 sub update_request_queue {
|
@processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels, |
@processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels, |
@rejections,@rejectionerrors,@nopermissions,%courseroles,@toremove, |
@rejections,@rejectionerrors,@nopermissions,%courseroles,@toremove, |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue, |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue, |
$firsturl); |
$firsturl,$uniquecode,%codes); |
my $count=0; |
my $count=0; |
while (my @course = &Apache::loncommon::get_env_multiple('form.'.$count.'radioreq')) { |
while (my @course = &Apache::loncommon::get_env_multiple('form.'.$count.'radioreq')) { |
if (@course[0] =~ /^\d+:.*/) { |
if ($course[0] =~ /^\d+:.*/) { |
push(@approvals,@course[0]); |
push(@approvals,$course[0]); |
} elsif (@course[0] =~ /^later:.*/) { |
} elsif ($course[0] =~ /^later:.*/) { |
#decide later |
#decide later |
} else { |
} else { |
push(@rejections,@course[0]); |
push(@rejections,$course[0]); |
} |
} |
$count+=1; |
$count+=1; |
} |
} |
Line 608 sub update_request_queue {
|
Line 614 sub update_request_queue {
|
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
$notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'}; |
$notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'}; |
} |
} |
|
if ($domconfig{'requestcourses'}{'uniquecode'}) { |
|
$uniquecode = 1; |
|
} |
} |
} |
$approvalmsg{'course'} = |
$approvalmsg{'course'} = |
[{ |
[{ |
Line 783 sub update_request_queue {
|
Line 792 sub update_request_queue {
|
$ownerdom,$ownername); |
$ownerdom,$ownername); |
if ((ref($history{'details'}) eq 'HASH') && |
if ((ref($history{'details'}) eq 'HASH') && |
($history{'disposition'} eq $queue)) { |
($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, |
my $result = &course_creation($cdom,$cnum,$context,$history{'details'},\$logmsg, |
\$newusermsg,\$addresult,\$enrollcount, |
\$newusermsg,\$addresult,\$enrollcount, |
\$response,\$keysmsg,\%domdefs,$longroles); |
\$response,\$keysmsg,\%domdefs,$longroles,\$code); |
if ($result eq 'created') { |
if ($result eq 'created') { |
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
$approvedmsg = $approvalmsg{'community'}; |
$approvedmsg = $approvalmsg{'community'}; |
Line 798 sub update_request_queue {
|
Line 807 sub update_request_queue {
|
if (ref($approvedmsg->[1]) eq 'HASH') { |
if (ref($approvedmsg->[1]) eq 'HASH') { |
$approvedmsg->[1]->{'args'} = [$firsturl]; |
$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); |
push(@completed,$cnum); |
|
|
Line 1047 sub update_request_queue {
|
Line 1064 sub update_request_queue {
|
} |
} |
my $syllabuslink = |
my $syllabuslink = |
&Apache::loncommon::syllabuswrapper($showcourse,$cnum,$cdom); |
&Apache::loncommon::syllabuswrapper($showcourse,$cnum,$cdom); |
|
if ($uniquecode && $codes{$cnum}) { |
|
$syllabuslink .= &mt('Unique code: [_1]',$codes{$cnum}); |
|
} |
$output .= '<li>'.$syllabuslink.'</li>'; |
$output .= '<li>'.$syllabuslink.'</li>'; |
} |
} |
$output .= '</ul></p>'; |
$output .= '</ul></p>'; |
Line 1256 sub update_request_queue {
|
Line 1276 sub update_request_queue {
|
} |
} |
$output .= '</ul></p>'; |
$output .= '</ul></p>'; |
} else { |
} else { |
$output .= '<p>'.&mt("For the following course/community requests an error occurred when removing requests for the following from the pending queue:").'<ul>'; |
$output .= '<p>'.&mt("For the following course/community requests an error occurred when removing requests from the pending queue:").'<ul>'; |
foreach my $cnum (@warn_dels) { |
foreach my $cnum (@warn_dels) { |
my $showcourse; |
my $showcourse; |
if (ref($requesthash{$cnum.'_'.$queue})) { |
if (ref($requesthash{$cnum.'_'.$queue})) { |
Line 1308 sub get_student_counts {
|
Line 1328 sub get_student_counts {
|
|
|
sub course_creation { |
sub course_creation { |
my ($dom,$cnum,$context,$details,$logmsg,$newusermsg,$addresult,$enrollcount,$output, |
my ($dom,$cnum,$context,$details,$logmsg,$newusermsg,$addresult,$enrollcount,$output, |
$keysmsg,$domdefs,$longroles) = @_; |
$keysmsg,$domdefs,$longroles,$coderef) = @_; |
unless ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH') && |
unless ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH') && |
(ref($longroles) eq 'HASH')) { |
(ref($longroles) eq 'HASH')) { |
return 'error: Invalid request'; |
return 'error: Invalid request'; |
Line 1331 sub course_creation {
|
Line 1351 sub course_creation {
|
my %reqdetails = &build_batchcreatehash($dom,$context,$details,$owneremail,$domdefs); |
my %reqdetails = &build_batchcreatehash($dom,$context,$details,$owneremail,$domdefs); |
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
\%reqdetails,$longroles,$logmsg,$newusermsg,$addresult, |
\%reqdetails,$longroles,$logmsg,$newusermsg,$addresult, |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype); |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype,$coderef); |
if ($cid eq "/$dom/$cnum") { |
if ($cid eq "/$dom/$cnum") { |
$result = 'created'; |
$result = 'created'; |
} else { |
} else { |
Line 1343 sub course_creation {
|
Line 1363 sub course_creation {
|
sub build_batchcreatehash { |
sub build_batchcreatehash { |
my ($dom,$context,$details,$owneremail,$domdefs) = @_; |
my ($dom,$context,$details,$owneremail,$domdefs) = @_; |
my %batchhash; |
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 datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users uniquecode}; |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
my $emailenc = &escape($owneremail); |
my $emailenc = &escape($owneremail); |
my $owner = $details->{'owner'}.':'.$details->{'domain'}; |
my $owner = $details->{'owner'}.':'.$details->{'domain'}; |
Line 1352 sub build_batchcreatehash {
|
Line 1372 sub build_batchcreatehash {
|
} |
} |
$batchhash{'title'} = $details->{'cdescr'}; |
$batchhash{'title'} = $details->{'cdescr'}; |
$batchhash{'coursecode'} = $details->{'instcode'}; |
$batchhash{'coursecode'} = $details->{'instcode'}; |
|
if ($domdefs->{'officialcredits'} || $domdefs->{'unofficialcredits'}) { |
|
$batchhash{'defaultcredits'} = $details->{'defaultcredits'}; |
|
} |
$batchhash{'emailenc'} = $emailenc; |
$batchhash{'emailenc'} = $emailenc; |
$batchhash{'adds'} = $details->{'autoadds'}; |
$batchhash{'adds'} = $details->{'autoadds'}; |
$batchhash{'drops'} = $details->{'autodrops'}; |
$batchhash{'drops'} = $details->{'autodrops'}; |
Line 1470 sub get_processtype {
|
Line 1493 sub get_processtype {
|
} else { |
} else { |
my %alltasks; |
my %alltasks; |
if (($isadv) && ($settings{'_LC_adv'} ne '')) { |
if (($isadv) && ($settings{'_LC_adv'} ne '')) { |
$val = $settings{$crstype}{'_LC_adv'}; |
$val = $settings{'_LC_adv'}; |
@{$inststatuses} = ('_LC_adv_'); |
@{$inststatuses} = ('_LC_adv_'); |
} else { |
} else { |
if ($userenv{'inststatus'} ne '') { |
if ($userenv{'inststatus'} ne '') { |
Line 1696 sub process_official_reqs {
|
Line 1719 sub process_official_reqs {
|
} |
} |
$reqstatus = $disposition; |
$reqstatus = $disposition; |
if ($disposition eq 'process') { |
if ($disposition eq 'process') { |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg); |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code); |
my $result = &course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,\$newusermsg,\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles); |
my $result = &course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,\$newusermsg,\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles,\$code); |
if ($result eq 'created') { |
if ($result eq 'created') { |
$disposition = 'created'; |
$disposition = 'created'; |
$reqstatus = 'created'; |
$reqstatus = 'created'; |
Line 1840 sub process_reqauthor {
|
Line 1863 sub process_reqauthor {
|
unless ($env{'environment.canrequest.author'}) { |
unless ($env{'environment.canrequest.author'}) { |
return '<span class="LC_warning">'. |
return '<span class="LC_warning">'. |
&mt('You do not currently have rights to request an authoring space.').'<br />'. |
&mt('You do not currently have rights to request an authoring space.').'<br />'. |
&mt('Please contact the [_1]helpdesk[_2].','<a href="/adm/helpdesk">', |
&mt('Please contact the [_1]helpdesk[_2] for assistance.','<a href="/adm/helpdesk">', |
'</a>').'</span>'; |
'</a>').'</span>'; |
} |
} |
my $queued = &reqauthor_check(); |
my $queued = &reqauthor_check(); |