version 1.52.2.3.2.4, 2021/06/20 18:37:35
|
version 1.60, 2020/08/21 21:59:20
|
Line 506 sub build_queue_display {
|
Line 506 sub build_queue_display {
|
my %crstypes; |
my %crstypes; |
my $output = &Apache::loncommon::start_data_table(). |
my $output = &Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(); |
&Apache::loncommon::start_data_table_header_row(); |
unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) { |
unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) { |
$output .= '<th>'.&mt('Action').'</th>'; |
$output .= '<th>'.&mt('Action').'</th>'; |
} |
} |
$output .= '<th>'.&mt('Requestor').'</th>'; |
$output .= '<th>'.&mt('Requestor').'</th>'; |
Line 528 sub build_queue_display {
|
Line 528 sub build_queue_display {
|
unofficial => 'Unofficial course', |
unofficial => 'Unofficial course', |
community => 'Community', |
community => 'Community', |
textbook => 'Textbook course', |
textbook => 'Textbook course', |
|
placement => 'Placement test', |
); |
); |
$output .= '<th>'.&mt('Type').'</th>'. |
$output .= '<th>'.&mt('Type').'</th>'. |
'<th>'.&mt('Date requested').'</th>'. |
'<th>'.&mt('Date requested').'</th>'. |
Line 609 sub build_queue_display {
|
Line 610 sub build_queue_display {
|
} elsif ($context eq 'requestusername') { |
} elsif ($context eq 'requestusername') { |
$row .= '<td>'.$showtime.'</td>'."\n". |
$row .= '<td>'.$showtime.'</td>'."\n". |
'<td>'.$detailslink.'</td>'."\n"; |
'<td>'.$detailslink.'</td>'."\n"; |
} else { |
} else { |
if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') { |
if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') { |
$row .= '<td>'.$instcode.'</td>'."\n"; |
$row .= '<td>'.$instcode.'</td>'."\n"; |
} else { |
} else { |
Line 1646 sub course_creation {
|
Line 1647 sub course_creation {
|
$owneremail = $emails{$email}; |
$owneremail = $emails{$email}; |
last if ($owneremail ne ''); |
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', |
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
\%reqdetails,$longroles,$logmsg,$clonemsg,$newusermsg,$addresult, |
\%reqdetails,$longroles,$logmsg,$clonemsg,$newusermsg,$addresult, |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype, |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype, |
Line 1668 sub course_creation {
|
Line 1669 sub course_creation {
|
} |
} |
|
|
sub build_batchcreatehash { |
sub build_batchcreatehash { |
my ($dom,$cnum,$context,$details,$owneremail,$domdefs) = @_; |
my ($dom,$context,$details,$owneremail,$domdefs) = @_; |
my %batchhash; |
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 tinyurls enrollstart enrollend accessstart accessend sections users uniquecode}; |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
Line 1680 sub build_batchcreatehash {
|
Line 1681 sub build_batchcreatehash {
|
if (ref($details->{'crosslists'}) eq 'HASH') { |
if (ref($details->{'crosslists'}) eq 'HASH') { |
foreach my $key (keys(%{$details->{'crosslists'}})) { |
foreach my $key (keys(%{$details->{'crosslists'}})) { |
if (ref($details->{'crosslists'}->{$key}) eq 'HASH') { |
if (ref($details->{'crosslists'}->{$key}) eq 'HASH') { |
my $instsec = $details->{crosslists}->{$key}->{instsec}; |
$batchhash{'crosslists'}{$key}{'inst'} = $details->{crosslists}->{$key}->{instcode}.$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{'crosslists'}{$key}{'loncapa'} = $details->{crosslists}->{$key}->{loncapa}; |
} |
} |
} |
} |
Line 1704 sub build_batchcreatehash {
|
Line 1698 sub build_batchcreatehash {
|
$batchhash{'authparam'} = $domdefs->{'auth_arg_def'}; |
$batchhash{'authparam'} = $domdefs->{'auth_arg_def'}; |
if ($details->{'crstype'} eq 'community') { |
if ($details->{'crstype'} eq 'community') { |
$batchhash{'crstype'} = 'Community'; |
$batchhash{'crstype'} = 'Community'; |
|
} elsif ($details->{'crstype'} eq 'placement') { |
|
$batchhash{'crstype'} = 'Placement'; |
} else { |
} else { |
if ($details->{'crstype'} eq 'textbook') { |
if ($details->{'crstype'} eq 'textbook') { |
if ($details->{'clonecrs'} && $details->{'clonedom'}) { |
if ($details->{'clonecrs'} && $details->{'clonedom'}) { |
Line 2119 sub process_official_reqs {
|
Line 2115 sub process_official_reqs {
|
my ($result,$postprocess) = |
my ($result,$postprocess) = |
&course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,$clonemsg,\$newusermsg, |
&course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,$clonemsg,\$newusermsg, |
\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$code,\%customitems,$context,$user_lh); |
\$code,\%customitems,$context,$user_lh); |
if ($result eq 'created') { |
if ($result eq 'created') { |
$disposition = 'created'; |
$disposition = 'created'; |
$reqstatus = 'created'; |
$reqstatus = 'created'; |