[LON-CAPA-cvs] cvs: loncom /interface lonrequestcourse.pm

raeburn raeburn at source.lon-capa.org
Tue Jun 7 21:00:57 EDT 2022


raeburn		Wed Jun  8 01:00:57 2022 EDT

  Modified files:              
    /loncom/interface	lonrequestcourse.pm 
  Log:
  - Reverse most of changes in rev. 1.84 and replace with progress indicator.
  
  
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.114 loncom/interface/lonrequestcourse.pm:1.115
--- loncom/interface/lonrequestcourse.pm:1.114	Wed Feb 16 16:35:23 2022
+++ loncom/interface/lonrequestcourse.pm	Wed Jun  8 01:00:57 2022
@@ -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 @@
 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 @@
         if ($state eq 'courseinfo') {
             $loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);';
         }
-        if ($state eq 'process') {
-            $loaditems{'onload'} .= 'javascript:hideProcessing();';
-        }
     }
     return \%loaditems;
 }
@@ -3865,9 +3851,20 @@
             foreach my $role (@roles) {
                 $longroles{$role}=&Apache::lonnet::plaintext($role,$type);
             }
-            $r->print('<div id="processing" style="display:block;">'."\n".
-                      &mt('Your request is being processed; this page will update when processing is complete.').
-                      '</div>');
+            my $preamble = '<div id="LC_update" class="LC_info">'.
+                           '<br />'.
+                           &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();
             if (ref($details) eq 'HASH') {
                 if ($details->{'clonecrs'}) {
@@ -3892,6 +3889,9 @@
                                           '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 @@
             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') {




More information about the LON-CAPA-cvs mailing list