Diff for /loncom/interface/lonrequestcourse.pm between versions 1.95.2.5.2.1 and 1.95.2.7.2.2

version 1.95.2.5.2.1, 2020/07/20 11:30:21 version 1.95.2.7.2.2, 2023/01/23 05:30:44
Line 432  function setCloneDisplay(courseForm) { Line 432  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 721  sub onload_action { Line 710  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 2396  sub print_cancel_request { Line 2382  sub print_cancel_request {
                       &Apache::loncommon::start_data_table_row().                        &Apache::loncommon::start_data_table_row().
                       '<td>'.$history{details}{'cdescr'}.'</td><td>'.                        '<td>'.$history{details}{'cdescr'}.'</td><td>'.
                       &Apache::lonlocal::locallocaltime($timestamp).'</td>'.                        &Apache::lonlocal::locallocaltime($timestamp).'</td>'.
                       '<td>'.$showtype.'</td>'.                        '<td>'.&mt($showtype).'</td>'.
                       &Apache::loncommon::end_data_table_row().                        &Apache::loncommon::end_data_table_row().
                       &Apache::loncommon::end_data_table().                        &Apache::loncommon::end_data_table().
                       '<br /><div class="LC_warning">';                        '<br /><div class="LC_warning">';
Line 2750  sub requestlog_display_filter { Line 2736  sub requestlog_display_filter {
                         $typename = $typenames->{$crstype};                          $typename = $typenames->{$crstype};
                     }                      }
                 }                  }
                 $output .= '<option value="'.$crstype.'"'.$selstr.'>'.$typename.'</option>'."\n";                  $output .= '<option value="'.$crstype.'"'.$selstr.'>'.&mt($typename).'</option>'."\n";
             }              }
             $output .= '</select></td>';              $output .= '</select></td>';
         }          }
Line 3208  sub clone_form { Line 3194  sub clone_form {
         '</label><br /><label>'.          '</label><br /><label>'.
         '<input type="radio" name="datemode" value="shift" checked="checked" /> '.          '<input type="radio" name="datemode" value="shift" checked="checked" /> '.
         $lt{'shd'}.'</label>'.          $lt{'shd'}.'</label>'.
         '<input type="text" size="5" name="dateshift" value="365" />'.          '<input type="text" size="5" name="dateshift" value="364" />'.
         &Apache::lonhtmlcommon::row_closure(1).          &Apache::lonhtmlcommon::row_closure(1).
         &Apache::lonhtmlcommon::row_title($lt{'dpl'}).'<label>'.          &Apache::lonhtmlcommon::row_title($lt{'dpl'}).'<label>'.
         '<input type="radio" name="tinyurls" value="delete" /> '.$lt{'nsl'}.          '<input type="radio" name="tinyurls" value="delete" /> '.$lt{'nsl'}.
Line 3824  sub process_request { Line 3810  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 3851  sub process_request { Line 3848  sub process_request {
                                           'autocreate',$details,\$logmsg,$clonemsg,\$newusermsg,                                            'autocreate',$details,\$logmsg,$clonemsg,\$newusermsg,
                                           \$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,                                            \$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,
                                           \%longroles,\$code,\%customitems);                                            \%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') {              if (ref($postprocess) eq 'HASH') {
                 $customized = $postprocess->{'createdcustomized'};                  $customized = $postprocess->{'createdcustomized'};
             }              }
Line 4025  sub process_request { Line 4025  sub process_request {
             } elsif ($disposition eq 'pending') {              } elsif ($disposition eq 'pending') {
                 my $pendingform;                  my $pendingform;
                 if ($crstype ne 'official') {                  if ($crstype ne 'official') {
                     $pendingform = &pending_validation_form($dom,$cnum,$crstype,$now,$token,                      $pendingform = &pending_validation_form($r,$dom,$cnum,$crstype,$now,$token,
                                                             $lonhost,$env{'form.cdescr'});                                                              $lonhost,$env{'form.cdescr'});
                 }                  }
                 if ($pendingform) {                  if ($pendingform) {
Line 4343  sub notification_information { Line 4343  sub notification_information {
 }  }
   
 sub pending_validation_form {  sub pending_validation_form {
     my ($cdom,$cnum,$crstype,$now,$token,$lonhost,$cdesc) = @_;      my ($r,$cdom,$cnum,$crstype,$now,$token,$lonhost,$cdesc) = @_;
     my $output;      my $output;
     my %postvalues = (      my %postvalues = (
                       'owner'      => $env{'user.name'}.':'.$env{'user.domain'},                        'owner'      => $env{'user.name'}.':'.$env{'user.domain'},
Line 4379  sub pending_validation_form { Line 4379  sub pending_validation_form {
                 my $hostname = &Apache::lonnet::hostname($lonhost);                  my $hostname = &Apache::lonnet::hostname($lonhost);
                 my $protocol = $Apache::lonnet::protocol{$lonhost};                  my $protocol = $Apache::lonnet::protocol{$lonhost};
                 $protocol = 'http' if ($protocol ne 'https');                  $protocol = 'http' if ($protocol ne 'https');
                   my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost);
                   $hostname = $alias if ($alias ne '');
                 my $crscreator = $protocol.'://'.$hostname.'/cgi-bin/createpending.pl';                  my $crscreator = $protocol.'://'.$hostname.'/cgi-bin/createpending.pl';
                 $output .= '<input type="hidden" name="crscreator" value="'.$crscreator.'" />'."\n".                  $output .= '<input type="hidden" name="crscreator" value="'.$crscreator.'" />'."\n".
                            '<input type="hidden" name="token" value="'.$token.'" />'."\n".                             '<input type="hidden" name="token" value="'.$token.'" />'."\n".
Line 4455  sub retrieve_settings { Line 4457  sub retrieve_settings {
             }              }
             $env{'form.datemode'} = $reqinfo{'datemode'};              $env{'form.datemode'} = $reqinfo{'datemode'};
             $env{'form.dateshift'} = $reqinfo{'dateshift'};              $env{'form.dateshift'} = $reqinfo{'dateshift'};
             $env{'form.tinyurls'} = $reqinfo{'tinyurls'};               $env{'form.tinyurls'} = $reqinfo{'tinyurls'};
             if ($reqinfo{'crstype'} eq 'official') {              if ($reqinfo{'crstype'} eq 'official') {
                 $env{'form.autoadds'} = $reqinfo{'autoadds'};                  $env{'form.autoadds'} = $reqinfo{'autoadds'};
                 $env{'form.autodrops'} = $reqinfo{'autodrops'};                  $env{'form.autodrops'} = $reqinfo{'autodrops'};
Line 4869  sub print_textbook_form { Line 4871  sub print_textbook_form {
                   '</label><br /><label>'.                    '</label><br /><label>'.
                   '<input type="radio" name="owndatemode" value="shift" checked="checked" /> '.                    '<input type="radio" name="owndatemode" value="shift" checked="checked" /> '.
                   $lt{'shd'}.'</label>'.                    $lt{'shd'}.'</label>'.
                   '<input type="text" size="5" name="owndateshift" value="365" />'.                    '<input type="text" size="5" name="owndateshift" value="364" />'.
                   '</fieldset><fieldset style="display:inline-block">'.                    '</fieldset><fieldset style="display:inline-block">'.
                   '<legend>'.$lt{'dpl'}.'</legend><label>'.                    '<legend>'.$lt{'dpl'}.'</legend><label>'.
                   '<input type="radio" name="owntinyurls" value="delete" />'.$lt{'nsl'}.                    '<input type="radio" name="owntinyurls" value="delete" />'.$lt{'nsl'}.
Line 4893  sub print_textbook_form { Line 4895  sub print_textbook_form {
                   '</label><br /><label>'.                    '</label><br /><label>'.
                   '<input type="radio" name="colldatemode" value="shift" checked="checked" /> '.                    '<input type="radio" name="colldatemode" value="shift" checked="checked" /> '.
                   $lt{'shd'}.'</label>'.                    $lt{'shd'}.'</label>'.
                   '<input type="text" size="5" name="colldateshift" value="365" />'.                    '<input type="text" size="5" name="colldateshift" value="364" />'.
                   '</fieldset><fieldset style="display:inline-block">'.                    '</fieldset><fieldset style="display:inline-block">'.
                   '<legend>'.$lt{'dpl'}.'</legend><label>'.                    '<legend>'.$lt{'dpl'}.'</legend><label>'.
                   '<input type="radio" name="colltinyurls" value="delete" />'.$lt{'nsl'}.                    '<input type="radio" name="colltinyurls" value="delete" />'.$lt{'nsl'}.
Line 5084  sub process_textbook_request { Line 5086  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'})) {

Removed from v.1.95.2.5.2.1  
changed lines
  Added in v.1.95.2.7.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>