version 1.95.2.7, 2021/12/14 02:54:52
|
version 1.95.2.8, 2024/07/03 22:34:22
|
Line 319 sub handler {
|
Line 319 sub handler {
|
$jscript = &Apache::lonhtmlcommon::set_form_elements($elementsref,\%stored); |
$jscript = &Apache::lonhtmlcommon::set_form_elements($elementsref,\%stored); |
if ($state eq 'courseinfo') { |
if ($state eq 'courseinfo') { |
$jscript .= &cloning_javascript(); |
$jscript .= &cloning_javascript(); |
} elsif ($state eq 'process') { |
|
$jscript .= &processing_javascript(); |
|
} |
} |
} |
} |
} |
} |
Line 432 function setCloneDisplay(courseForm) {
|
Line 430 function setCloneDisplay(courseForm) {
|
END |
END |
} |
} |
|
|
sub processing_javascript { |
|
return <<"END"; |
|
function hideProcessing() { |
|
if (document.getElementById('processing')) { |
|
document.getElementById('processing').style.display="none"; |
|
} |
|
} |
|
|
|
END |
|
} |
|
|
|
sub get_breadcrumbs { |
sub get_breadcrumbs { |
my ($dom,$action,$state,$states,$trail) = @_; |
my ($dom,$action,$state,$states,$trail) = @_; |
my ($crumb,$newinstcode,$codechk,$checkedcode,$numtitles,$description); |
my ($crumb,$newinstcode,$codechk,$checkedcode,$numtitles,$description); |
Line 720 sub onload_action {
|
Line 707 sub onload_action {
|
if ($state eq 'courseinfo') { |
if ($state eq 'courseinfo') { |
$loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);'; |
$loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);'; |
} |
} |
if ($state eq 'process') { |
|
$loaditems{'onload'} .= 'javascript:hideProcessing();'; |
|
} |
|
} |
} |
return \%loaditems; |
return \%loaditems; |
} |
} |
Line 3638 sub print_request_outcome {
|
Line 3622 sub print_request_outcome {
|
} |
} |
} |
} |
} |
} |
|
if ($env{'form.chome'} eq 'default') { |
|
my %servers = &Apache::lonnet::get_servers($dom,'library'); |
|
my $numlib = keys(%servers); |
|
if ($numlib) { |
|
my $loadm=10000000; |
|
my $chome; |
|
foreach my $tryserver (keys(%servers)) { |
|
($chome,$loadm) = |
|
&Apache::lonnet::compare_server_load($tryserver,$chome,$loadm); |
|
} |
|
$env{'form.chome'} = $chome; |
|
} |
|
} |
my $details = { |
my $details = { |
owner => $env{'user.name'}, |
owner => $env{'user.name'}, |
domain => $env{'user.domain'}, |
domain => $env{'user.domain'}, |
Line 3793 sub process_request {
|
Line 3790 sub process_request {
|
foreach my $role (@roles) { |
foreach my $role (@roles) { |
$longroles{$role}=&Apache::lonnet::plaintext($role,$type); |
$longroles{$role}=&Apache::lonnet::plaintext($role,$type); |
} |
} |
$r->print('<div id="processing" style="display:block;">'."\n". |
my $preamble = '<div id="LC_update" class="LC_info">'. |
&mt('Your request is being processed; this page will update when processing is complete.'). |
'<br />'. |
'</div>'); |
&mt("Please be patient while your request is processed"). |
|
'<br /></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
|
my $closure = <<ENDCLOSE; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
\$("#LC_update").hide('slow'); |
|
// ]]> |
|
</script> |
|
ENDCLOSE |
|
my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble); |
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Processing ...')); |
$r->rflush(); |
$r->rflush(); |
if (ref($details) eq 'HASH') { |
if (ref($details) eq 'HASH') { |
if ($details->{'clonecrs'}) { |
if ($details->{'clonecrs'}) { |
Line 3820 sub process_request {
|
Line 3828 sub process_request {
|
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, |
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$code,\%customitems); |
\$code,\%customitems); |
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); |
|
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
if (ref($postprocess) eq 'HASH') { |
if (ref($postprocess) eq 'HASH') { |
$customized = $postprocess->{'createdcustomized'}; |
$customized = $postprocess->{'createdcustomized'}; |
} |
} |
Line 5024 sub process_textbook_request {
|
Line 5034 sub process_textbook_request {
|
undef($clonedom); |
undef($clonedom); |
} |
} |
} |
} |
my $js = &processing_javascript(); |
$r->print(&header('Course Creation')); |
my $loaditems = { |
|
onload => 'javascript:hideProcessing();', |
|
}; |
|
$r->print(&header('Course Creation',$js,$loaditems)); |
|
|
|
if (ref($can_request) eq 'HASH') { |
if (ref($can_request) eq 'HASH') { |
unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) { |
unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) { |