--- loncom/interface/loncoursequeueadmin.pm 2023/09/04 17:10:13 1.52.2.5.2.3
+++ loncom/interface/loncoursequeueadmin.pm 2016/08/25 22:33:03 1.55
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Utilities to administer domain course requests and course self-enroll requests
#
-# $Id: loncoursequeueadmin.pm,v 1.52.2.5.2.3 2023/09/04 17:10:13 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.55 2016/08/25 22:33:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -105,13 +105,13 @@ sub send_selfserve_notification {
$rawsubj = 'Self-enrollment requests processed';
push(@rawmsg,{
mt => 'Enrollment requests in the following course: [_1] have been processed.',
- args => ["\n$contextdesc\n"],
+ args => ["\n$contextdesc"],
});
} elsif ($context eq 'domainmanagers') {
$rawsubj = 'Course/Community requests reviewed';
push(@rawmsg,{
- mt => 'Course/Community creation requests in the following domain: [_1] have been reviewed.',
- args => ["\n$contextdesc\n"],
+ mt => 'Course/Community creation requests in the following domain: "[_1]" have been reviewed.',
+ args => ["\n$contextdesc"],
});
if (ref($textstr) eq 'ARRAY') {
push(@rawmsg,@{$textstr});
@@ -119,8 +119,8 @@ sub send_selfserve_notification {
} elsif ($context eq 'authormanagers') {
$rawsubj = 'Authoring Space requests reviewed';
push(@rawmsg,{
- mt => 'Authoring requests in the following domain: [_1] have been reviewed.',
- args => ["\n$contextdesc\n"],
+ mt => 'Authoring requests in the following domain: "[_1]" have been reviewed.',
+ args => ["\n$contextdesc"],
});
if (ref($textstr) eq 'ARRAY') {
push(@rawmsg,@{$textstr});
@@ -128,8 +128,8 @@ sub send_selfserve_notification {
} elsif ($context eq 'usernamemanagers') {
$rawsubj = 'LON-CAPA account requests reviewed';
push(@rawmsg,{
- mt => 'Account requests in the following domain: [_1] have been reviewed.',
- args => ["\n$contextdesc\n"],
+ mt => 'Account requests in the following domain: "[_1]" have been reviewed.',
+ args => ["\n$contextdesc"],
});
if (ref($textstr) eq 'ARRAY') {
push(@rawmsg,@{$textstr});
@@ -304,11 +304,11 @@ sub send_selfserve_notification {
my $stamp = time;
my $msgcount = &Apache::lonmsg::get_uniq();
my $sender_lh = &Apache::loncommon::user_lang($uname,$udom,$cid);
- $subject = &mt_user($sender_lh,$rawsubj);
+ $subject = &Apache::lonlocal::mt_user($sender_lh,$rawsubj);
$message = '';
foreach my $item (@rawmsg) {
if (ref($item) eq 'HASH') {
- $message .= &mt_user($sender_lh,$item->{mt},@{$item->{args}})."\n";
+ $message .= &Apache::lonlocal::mt_user($sender_lh,$item->{mt},@{$item->{args}})."\n";
}
}
&Apache::lonmsg::process_sent_mail($subject,'',$numsent,$stamp,$uname,$udom,$msgcount,$cid,$$,$message,
@@ -322,41 +322,41 @@ sub send_selfserve_notification {
foreach my $recip (sort(keys(%{$msgcc}))) {
my ($ccname,$ccdom) = split(/:/,$recip);
my $recip_lh = &Apache::loncommon::user_lang($ccname,$ccdom,$cid);
- my $subject = &mt_user($sender_lh,$rawsubj);
+ my $subject = &Apache::lonlocal::mt_user($sender_lh,$rawsubj);
my $message = '';
foreach my $item (@rawmsg) {
if (ref($item) eq 'HASH') {
- $message .= &mt_user($sender_lh,$item->{mt},
- @{$item->{args}})."\n";
+ $message .= &Apache::lonlocal::mt_user($sender_lh,$item->{mt},
+ @{$item->{args}})."\n";
}
}
if ($context eq 'coursemanagers') {
if ($approvedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Approved enrollments:')."\n".$approvedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Approved enrollments:')."\n".$approvedlist;
}
if ($rejectedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Rejected enrollments:')."\n".$rejectedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Rejected enrollments:')."\n".$rejectedlist;
}
} elsif ($context eq 'domainmanagers') {
if ($approvedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Approved course requests:')."\n".$approvedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Approved course requests:')."\n".$approvedlist;
}
if ($rejectedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Rejected course requests:')."\n".$rejectedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Rejected course requests:')."\n".$rejectedlist;
}
} elsif ($context eq 'authormanagers') {
if ($approvedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Approved author role requests:')."\n".$approvedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Approved author role requests:')."\n".$approvedlist;
}
if ($rejectedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Rejected author role requests:')."\n".$rejectedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Rejected author role requests:')."\n".$rejectedlist;
}
} elsif ($context eq 'usernamemanagers') {
if ($approvedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Approved LON-CAPA account requests:')."\n".$approvedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Approved LON-CAPA account requests:')."\n".$approvedlist;
}
if ($rejectedlist) {
- $message .= "\n\n".&mt_user($sender_lh,'Rejected LON-CAPA account requests:')."\n".$rejectedlist;
+ $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Rejected LON-CAPA account requests:')."\n".$rejectedlist;
}
}
$status .= &Apache::lonmsg::user_normal_msg($ccname,$ccdom,$subject,$message,undef,undef,undef,1,
@@ -396,8 +396,6 @@ sub display_queued_requests {
if ($context eq 'pending') {
$disposition = 'pending';
$nextphase = 'requestvalidation';
- } elsif ($context eq 'displaypending') {
- $disposition = 'pending';
}
%requesthash = &Apache::lonnet::dump_dom($namespace,$dom,'_'.$disposition);
$nextelement = ' ';
@@ -424,7 +422,7 @@ sub display_queued_requests {
my ($cnum,$disposition) = split('_',$item);
$entry = $cnum.':'.$requesthash{$item}{'ownername'}.':'.
$requesthash{$item}{'ownerdom'}.':';
- if (($context eq 'pending') || ($context eq 'displaypending')) {
+ if ($context eq 'pending') {
$entry .= $requesthash{$item}{'instcode'};
} else {
$entry .= $requesthash{$item}{'crstype'};
@@ -443,12 +441,10 @@ sub display_queued_requests {
if (keys(%queue_by_date) > 0) {
if ($context eq 'course') {
$output .= '
'.&mt('Self-enrollment requests queued pending approval by a Coordinator').' ';
- } elsif (($context eq 'pending') || ($context eq 'displaypending')) {
+ } elsif ($context eq 'pending') {
$output .= ''.&mt('Requests for official courses queued pending validation').' '.
''.&mt('Requests are validated against institutional data to confirm that the requestor is an instructor of record.').' '.
- &mt('Validation is attempted when the request is submitted.').' '.
- &mt('If unvalidated, the request will be held in a queue.').' '.
- &mt('Validation of pending requests is automatically repeated daily.').'
';
+ &mt('Validation is attempted when the request is submitted.').' '.&mt('If unvalidated, the request will be held in a queue.').' '.&mt('Validation of pending requests is automatically repeated daily.').'';
} elsif ($context eq 'requestauthor') {
$output .= ''.&mt('Requests for Authoring Space queued pending approval by a Domain Coordinator').' ';
} elsif ($context eq 'requestusername') {
@@ -476,9 +472,8 @@ sub display_queued_requests {
if ($context eq 'pending') {
$output .= ' '."\n".
- ''.&mt('Any course/community requests which are successfully validated will be created immediately.').' '.
- &mt('Unvalidated requests will be listed for manual approval/rejection.').'
';
- } elsif (($context ne 'helpdesk') && ($context ne 'displaypending')) {
+ ''.&mt('Any course/community requests which are successfully validated will be created immediately.').' '.&mt('Unvalidated requests will be listed for manual approval/rejection.').'
';
+ } else {
$output .= ' ';
}
$output .= '';
@@ -486,7 +481,7 @@ sub display_queued_requests {
$output .= '';
if ($context eq 'course') {
$output .= &mt('There are currently no enrollment requests awaiting approval.');
- } elsif (($context eq 'pending') || ($context eq 'displaypending')) {
+ } elsif ($context eq 'pending') {
$output .= &mt('There are currently no requests for official courses awaiting validation.');
} elsif ($context eq 'requestauthor') {
$output .= &mt('There are currently no requests for Authoring Space awaiting approval.');
@@ -506,7 +501,7 @@ sub build_queue_display {
my %crstypes;
my $output = &Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row();
- unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) {
+ unless ($context eq 'pending') {
$output .= '
'.&mt('Action').' ';
}
$output .= ''.&mt('Requestor').' ';
@@ -518,7 +513,7 @@ sub build_queue_display {
} elsif ($context eq 'requestusername') {
$output .= ''.&mt('Date requested').' '.
''.&mt('Details').' ';
- } elsif ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') {
+ } elsif ($context eq 'pending' || $context eq 'stillpending') {
$output .= ''.&mt('Institutional code').' '.
''.&mt('Date requested').' '.
''.&mt('Details').' ';
@@ -528,6 +523,7 @@ sub build_queue_display {
unofficial => 'Unofficial course',
community => 'Community',
textbook => 'Textbook course',
+ placement => 'Placement test',
);
$output .= ''.&mt('Type').' '.
''.&mt('Date requested').' '.
@@ -573,7 +569,7 @@ sub build_queue_display {
} else {
my ($cnum,$ownername,$ownerdom,$type,$cdesc);
my $queued = 'approval';
- if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') {
+ if ($context eq 'pending' || $context eq 'stillpending') {
($cnum,$ownername,$ownerdom,$instcode,$cdesc)=split(/:/,$request,5);
$queued = 'pending';
} else {
@@ -591,7 +587,7 @@ sub build_queue_display {
&Apache::loncommon::plainname($ownername,$ownerdom),
$ownername,$ownerdom);
}
- unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) {
+ unless ($context eq 'pending') {
$row = ''.
' '.&mt('Approve').' '.
''.(' 'x2).
@@ -609,8 +605,8 @@ sub build_queue_display {
} elsif ($context eq 'requestusername') {
$row .= ''.$showtime.' '."\n".
''.$detailslink.' '."\n";
- } else {
- if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') {
+ } else {
+ if ($context eq 'pending' || $context eq 'stillpending') {
$row .= ''.$instcode.' '."\n";
} else {
$row .= ''.$crstype.' '."\n";
@@ -879,10 +875,10 @@ sub update_request_queue {
my $dbname = 'nohist_requestedusernames';
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom);
my %curr = &Apache::lonnet::get($dbname,[$uname],$cdom,$domconfiguser);
-
+
if (ref($curr{$uname}) eq 'HASH') {
- my ($logtoken,$serverid,$encpass,$courseid,$id,$firstname,
- $middlename,$lastname,$generation,$inststatus,$email);
+ my ($username,$logtoken,$serverid,$encpass,$courseid,$id,$firstname,
+ $middlename,$lastname,$generation,$inststatus);
$curr{$uname}{'timestamp'} = $now;
$curr{$uname}{'adjudicator'} = $env{'user.name'}.':'.$env{'user.domain'};
$courseid = $curr{$uname}{'courseid'};
@@ -893,35 +889,14 @@ sub update_request_queue {
$generation = $curr{$uname}{'generation'};
$inststatus = $curr{$uname}{'inststatus'};
- if ($curr{$uname}{'email'} ne '') {
- $email = $curr{$uname}{'email'};
- } elsif ($uname =~ /^[^\@]+\@[^\@]+$/) {
- $email = $uname;
- }
-
- my $upass;
- if ($curr{$uname}{'tmpinfo'}) {
- my ($key,$caller)=split(/&/,$curr{$uname}{'tmpinfo'});
- if ($caller eq 'createaccount') {
- if ($curr{$uname}{'upass'} eq '') {
- $upass = $curr{$uname}{'upass'};
- } else {
- $upass = &Apache::loncommon::des_decrypt($key,$curr{$uname}{'upass'});
- }
- } else {
- push(@processing_errors,$uname);
- }
- } else {
- $upass = $curr{$uname}{'upass'};
- }
- if ($upass eq '') {
- push(@processing_errors,$uname);
- } else {
+ my ($key,$caller)=split(/&/,$curr{$uname}{'tmpinfo'});
+ if ($caller eq 'createaccount') {
+ my $upass = &Apache::loncommon::des_decrypt($key,$curr{$uname}{'upass'});
undef($curr{$uname}{'upass'});
my $result =
&Apache::lonnet::modifyuser($cdom,$uname,$id,'internal',$upass,
$firstname,$middlename,$lastname,
- $generation,undef,undef,$email);
+ $generation,undef,undef,$uname);
if ($result eq 'ok') {
$curr{$uname}{'status'} = 'created';
push(@completed,$uname);
@@ -942,6 +917,8 @@ sub update_request_queue {
} else {
push(@processing_errors,$uname);
}
+ } else {
+ push(@processing_errors,$uname);
}
} else {
push(@invalidusers,$uname);
@@ -981,9 +958,7 @@ sub update_request_queue {
$ownerdom,$ownername);
if ((ref($history{'details'}) eq 'HASH') &&
($history{'disposition'} eq $queue)) {
- my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,
- $keysmsg,$code,%customitems);
- my $clonemsg = [];
+ my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code,%customitems);
my $fullname = '';
my $inprocess = &Apache::lonnet::auto_crsreq_update($cdom,$cnum,$crstype,'process',$ownername,
$ownerdom,$fullname,$coursedesc);
@@ -997,8 +972,8 @@ sub update_request_queue {
if ($history{'details'}{'clonecrs'}) {
$customitems{'_LC_clonefrom'} = $history{'details'}{'clonedom'}.'_'.$history{'details'}{'clonecrs'};
}
- my ($result,$postprocess) = &course_creation($cdom,$cnum,$context,$history{'details'},
- \$logmsg,$clonemsg,\$newusermsg,\$addresult,\$enrollcount,
+ my ($result,$postprocess) = &course_creation($cdom,$cnum,$context,$history{'details'},\$logmsg,
+ \$newusermsg,\$addresult,\$enrollcount,
\$response,\$keysmsg,\%domdefs,$longroles,\$code,\%customitems);
if ($result eq 'created') {
if ($crstype eq 'community') {
@@ -1011,9 +986,6 @@ sub update_request_queue {
if (ref($approvedmsg->[1]) eq 'HASH') {
$approvedmsg->[1]->{'args'} = [$firsturl];
}
- if ((ref($clonemsg) eq 'ARRAY') && (@{$clonemsg})) {
- push(@{$approvedmsg},@{$clonemsg});
- }
if ($code) {
push(@{$approvedmsg},
{
@@ -1612,19 +1584,18 @@ sub get_student_counts {
}
sub course_creation {
- my ($dom,$cnum,$context,$details,$logmsg,$clonemsg,$newusermsg,$addresult,
- $enrollcount,$output,$keysmsg,$domdefs,$longroles,$coderef,$customhash,
- $callercontext,$user_lh) = @_;
+ my ($dom,$cnum,$context,$details,$logmsg,$newusermsg,$addresult,$enrollcount,$output,
+ $keysmsg,$domdefs,$longroles,$coderef,$customhash) = @_;
unless ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH') &&
(ref($longroles) eq 'HASH')) {
return ('error: Invalid request');
}
- my ($result,$ownername,$ownerdom,$autocoowner);
+ my ($result,$ownername,$ownerdom);
my $crstype = $details->{'crstype'};
my $coursedesc = $details->{'cdescr'};
my $accessstart = $details->{'accessstart'};
my $accessend = $details->{'accessend'};
- my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses','autoenroll'],$dom);
+ my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom);
if (ref($domconfig{'requestcourses'}) eq 'HASH') {
if (ref($domconfig{'requestcourses'}{'uniquecode'}) eq 'HASH') {
if ($domconfig{'requestcourses'}{'uniquecode'}{$crstype}) {
@@ -1632,9 +1603,6 @@ sub course_creation {
}
}
}
- if (ref($domconfig{'autoenroll'}) eq 'HASH') {
- $autocoowner = $domconfig{'autoenroll'}{'co-owners'};
- }
if ($context eq 'domain') {
$ownername = $details->{'owner'};
$ownerdom = $details->{'domain'};
@@ -1649,11 +1617,10 @@ sub course_creation {
$owneremail = $emails{$email};
last if ($owneremail ne '');
}
- my %reqdetails = &build_batchcreatehash($dom,$cnum,$context,$details,$owneremail,$domdefs);
+ my %reqdetails = &build_batchcreatehash($dom,$context,$details,$owneremail,$domdefs);
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses',
- \%reqdetails,$longroles,$logmsg,$clonemsg,$newusermsg,$addresult,
- $enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype,
- $coderef,$callercontext,$user_lh);
+ \%reqdetails,$longroles,$logmsg,$newusermsg,$addresult,
+ $enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype,$coderef);
my $postprocess;
if ($cid eq "/$dom/$cnum") {
$result = 'created';
@@ -1664,66 +1631,6 @@ sub course_creation {
$postprocess = &Apache::lonnet::auto_crsreq_update($dom,$cnum,$crstype,$result,$ownername,
$ownerdom,$fullname,$coursedesc,$code,
$accessstart,$accessend,$customhash);
- if ($autocoowner) {
- my $instcode = $details->{'instcode'};
- if (($instcode ne '') && (ref($reqdetails{'users'}) eq 'HASH')) {
- my @posscoowners;
- my $now = time;
- foreach my $person (keys(%{$reqdetails{'users'}})) {
- my ($uname,$udom) = split(/:/,$person);
- next if (($udom ne $dom) || (($uname eq $ownername) && ($udom eq $ownerdom)));
- if ((&Apache::lonnet::homeserver($uname,$udom,1) ne 'no_host') &&
- (ref($reqdetails{'users'}{$person}) eq 'HASH')) {
- if ((grep(/^cc$/,keys(%{$reqdetails{'users'}{$person}}))) &&
- (ref($reqdetails{'users'}{$person}{'cc'}) eq 'HASH')) {
- my $start = $reqdetails{'users'}{$person}{'cc'}{'start'};
- my $end = $reqdetails{'users'}{$person}{'cc'}{'end'};
- if ((($start eq '') || ($start <= $now)) &&
- (($end eq '') || ($end >= $now))) {
- push(@posscoowners,$person);
- }
- }
- }
- }
- my @coowners;
- if (@posscoowners) {
- foreach my $user (@posscoowners) {
- my ($checkcc,$desc) =
- &Apache::lonnet::auto_validate_instcode($cnum,$dom,$instcode,$user);
- unless ($checkcc eq 'valid') {
- if (ref($reqdetails{'crosslists'}) eq 'HASH') {
- foreach my $key (keys(%{$reqdetails{'crosslists'}})) {
- if (ref($reqdetails{'crosslists'}{$key}) eq 'HASH') {
- my $inst_crosslist = $reqdetails{'crosslists'}{$key}{'inst'};
- if ($inst_crosslist ne '') {
- $checkcc =
- &Apache::lonnet::auto_validate_inst_crosslist($cnum,$dom,$instcode,
- $inst_crosslist,$user);
- last if ($checkcc eq 'valid');
- }
- }
- }
- }
- }
- if ($checkcc eq 'valid') {
- if (@coowners > 0) {
- unless (grep(/^\Q$user\E$/,@coowners)) {
- push(@coowners,$user);
- }
- } else {
- push(@coowners,$user);
- }
- }
- }
- }
- if (@coowners > 0) {
- my $chome = &Apache::lonnet::homeserver($cnum,$dom);
- unless ($chome eq 'no_host') {
- &Apache::lonnet::store_coowners($dom,$cnum,$chome,'',@coowners);
- }
- }
- }
- }
} else {
$result = 'error: '.$cid;
}
@@ -1731,30 +1638,15 @@ sub course_creation {
}
sub build_batchcreatehash {
- my ($dom,$cnum,$context,$details,$owneremail,$domdefs) = @_;
+ my ($dom,$context,$details,$owneremail,$domdefs) = @_;
my %batchhash;
- my @items = qw{owner domain coursehome clonecrs clonedom datemode dateshift tinyurls enrollstart enrollend accessstart accessend sections users uniquecode};
+ 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')) {
my $emailenc = &escape($owneremail);
my $owner = $details->{'owner'}.':'.$details->{'domain'};
foreach my $item (@items) {
$batchhash{$item} = $details->{$item};
}
- if (ref($details->{'crosslists'}) eq 'HASH') {
- foreach my $key (keys(%{$details->{'crosslists'}})) {
- if (ref($details->{'crosslists'}->{$key}) eq 'HASH') {
- my $instsec = $details->{crosslists}->{$key}->{instsec};
- $batchhash{'crosslists'}{$key}{'inst'} = $details->{crosslists}->{$key}->{instcode};
- my $crskey = $cnum.':'.$batchhash{'crosslists'}{$key}{'inst'};
- my %formatted = &Apache::lonnet::auto_instsec_reformat($dom,'clutter',
- {$crskey => [$instsec]});
- if (ref($formatted{$crskey}) eq 'ARRAY') {
- $batchhash{'crosslists'}{$key}{'inst'} .= $formatted{$crskey}->[0];
- }
- $batchhash{'crosslists'}{$key}{'loncapa'} = $details->{crosslists}->{$key}->{loncapa};
- }
- }
- }
$batchhash{'title'} = $details->{'cdescr'};
$batchhash{'coursecode'} = $details->{'instcode'};
if ($domdefs->{'officialcredits'} || $domdefs->{'unofficialcredits'}) {
@@ -1767,14 +1659,14 @@ sub build_batchcreatehash {
$batchhash{'authparam'} = $domdefs->{'auth_arg_def'};
if ($details->{'crstype'} eq 'community') {
$batchhash{'crstype'} = 'Community';
+ } elsif ($details->{'crstype'} eq 'placement') {
+ $batchhash{'crstype'} = 'Placement';
} else {
if ($details->{'crstype'} eq 'textbook') {
if ($details->{'clonecrs'} && $details->{'clonedom'}) {
my %clonedfrom = &Apache::lonnet::coursedescription($details->{'clonedom'}.'_'.$details->{'clonecrs'});
$batchhash{'textbook'} = $clonedfrom{'description'};
}
- } elsif ($details->{'crstype'} eq 'lti') {
- $batchhash{'lti'} = 1;
}
$batchhash{'crstype'} = 'Course';
}
@@ -2101,10 +1993,9 @@ sub process_official_reqs {
$longroles{$role}=&Apache::lonnet::plaintext($role);
}
my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
- my ($output,$linefeed,$user_lh);
+ my ($output,$linefeed);
if ($context eq 'auto') {
$linefeed = "\n";
- $user_lh = &Apache::loncommon::user_lang($dcname,$dcdom);
} else {
$linefeed = ' '."\n";
}
@@ -2166,7 +2057,6 @@ sub process_official_reqs {
$reqstatus = $disposition;
if ($disposition eq 'process') {
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code);
- my $clonemsg = [];
my %customitems;
my $fullname = &Apache::loncommon::plainname($ownername,$ownerdom);
my $inprocess = &Apache::lonnet::auto_crsreq_update($dom,$cnum,$crstype,'process',$ownername,
@@ -2182,9 +2072,8 @@ sub process_official_reqs {
$customitems{'_LC_clonefrom'} = $history{'details'}{'clonedom'}.'_'.$history{'details'}{'clonecrs'};
}
my ($result,$postprocess) =
- &course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,$clonemsg,\$newusermsg,
- \$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles,
- \$code,\%customitems,$context,$user_lh);
+ &course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,\$newusermsg,\$addresult,
+ \$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles,\$code,\%customitems);
if ($result eq 'created') {
$disposition = 'created';
$reqstatus = 'created';
@@ -2199,20 +2088,14 @@ sub process_official_reqs {
[{
mt => 'Your requested course: [_1], (queued pending validation) has now been created.',
args => [$cdescr],
- }];
- if ((ref($clonemsg) eq 'ARRAY') && (@{$clonemsg})) {
- push(@{$approvedmsg},@{$clonemsg});
- }
- push(@{$approvedmsg},
+ },
{
mt => 'Visit [_1] to log-in and access the course.',
args => [$firsturl],
},
{
- mt => 'If currently logged-in to LON-CAPA, log-out and log-in again to select your new course role.',
- args => [],
- }
- );
+ mt => 'If currently logged-in to LON-CAPA, log-out and log-in again to select your new course role.'
+ }];
my $sender = $dcname.':'.$dcdom;
if (ref($postprocess) eq 'HASH') {
if (ref($postprocess->{'createdmsg'}) eq 'ARRAY') {
@@ -2318,7 +2201,7 @@ sub postprocess_crsenv {
my %needcrsidput = (
'internal.selfenroll_types' => 1,
'internal.selfenroll_start_date' => 1,
- 'internal.selfenroll_end_date' => 1,
+ 'internal. selfenroll_end_date' => 1,
);
my (@needupdate,%newcrsenv);
foreach my $key (keys(%{$postprocessenv})) {