--- loncom/interface/lonrequestcourse.pm 2022/02/16 16:35:23 1.114
+++ loncom/interface/lonrequestcourse.pm 2022/06/08 01:00:57 1.115
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Request a course
#
-# $Id: lonrequestcourse.pm,v 1.114 2022/02/16 16:35:23 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.115 2022/06/08 01:00:57 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -450,17 +450,6 @@ function setCloneDisplay(courseForm) {
END
}
-sub processing_javascript {
- return <<"END";
-function hideProcessing() {
- if (document.getElementById('processing')) {
- document.getElementById('processing').style.display="none";
- }
-}
-
-END
-}
-
sub get_breadcrumbs {
my ($dom,$action,$state,$states,$trail) = @_;
my ($crumb,$newinstcode,$codechk,$checkedcode,$numtitles,$description);
@@ -739,9 +728,6 @@ sub onload_action {
if ($state eq 'courseinfo') {
$loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);';
}
- if ($state eq 'process') {
- $loaditems{'onload'} .= 'javascript:hideProcessing();';
- }
}
return \%loaditems;
}
@@ -3865,9 +3851,20 @@ sub process_request {
foreach my $role (@roles) {
$longroles{$role}=&Apache::lonnet::plaintext($role,$type);
}
- $r->print('
'."\n".
- &mt('Your request is being processed; this page will update when processing is complete.').
- '
');
+ my $preamble = ''.
+ '
'.
+ &mt("Please be patient while your request is processed").
+ '
'.
+ '';
+ my $closure = <
+//
+
+ENDCLOSE
+ my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble);
+ &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Processing ...'));
$r->rflush();
if (ref($details) eq 'HASH') {
if ($details->{'clonecrs'}) {
@@ -3892,6 +3889,9 @@ sub process_request {
'autocreate',$details,\$logmsg,$clonemsg,\$newusermsg,
\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,
\%longroles,\$code,\%customitems);
+ &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!'));
+ &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
+ $r->print($closure);
if (ref($postprocess) eq 'HASH') {
$customized = $postprocess->{'createdcustomized'};
}
@@ -5146,15 +5146,11 @@ sub process_textbook_request {
undef($clonedom);
}
}
- my $js = &processing_javascript();
- my ($loaditems,$args);
- $loaditems = {
- onload => 'javascript:hideProcessing();',
- };
+ my $args;
if ($crstype eq 'lti') {
$args = { 'only_body' => 1};
}
- $r->print(&header('Course Creation',$js,$loaditems,undef,$args));
+ $r->print(&header('Course Creation','','',undef,$args));
unless ($crstype eq 'lti') {
if (ref($can_request) eq 'HASH') {