--- loncom/interface/lonrequestcourse.pm 2022/01/01 17:40:20 1.95.2.7.2.1 +++ loncom/interface/lonrequestcourse.pm 2023/01/23 05:30:44 1.95.2.7.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Request a course # -# $Id: lonrequestcourse.pm,v 1.95.2.7.2.1 2022/01/01 17:40:20 raeburn Exp $ +# $Id: lonrequestcourse.pm,v 1.95.2.7.2.2 2023/01/23 05:30:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -432,17 +432,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); @@ -721,9 +710,6 @@ sub onload_action { if ($state eq 'courseinfo') { $loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);'; } - if ($state eq 'process') { - $loaditems{'onload'} .= 'javascript:hideProcessing();'; - } } return \%loaditems; } @@ -3824,9 +3810,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'}) { @@ -3851,6 +3848,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'}; } @@ -5086,11 +5086,7 @@ sub process_textbook_request { undef($clonedom); } } - my $js = &processing_javascript(); - my $loaditems = { - onload => 'javascript:hideProcessing();', - }; - $r->print(&header('Course Creation',$js,$loaditems)); + $r->print(&header('Course Creation')); if (ref($can_request) eq 'HASH') { unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) {