Diff for /loncom/interface/loncoursequeueadmin.pm between versions 1.52.2.4 and 1.58

version 1.52.2.4, 2020/08/22 01:23:54 version 1.58, 2017/08/03 16:28:39
Line 506  sub build_queue_display { Line 506  sub build_queue_display {
     my %crstypes;      my %crstypes;
     my $output =  &Apache::loncommon::start_data_table().      my $output =  &Apache::loncommon::start_data_table().
                   &Apache::loncommon::start_data_table_header_row();                    &Apache::loncommon::start_data_table_header_row();
     unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) {      unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) { 
         $output .= '<th>'.&mt('Action').'</th>';          $output .= '<th>'.&mt('Action').'</th>';
     }      }
     $output .= '<th>'.&mt('Requestor').'</th>';      $output .= '<th>'.&mt('Requestor').'</th>';
Line 528  sub build_queue_display { Line 528  sub build_queue_display {
                         unofficial => 'Unofficial course',                          unofficial => 'Unofficial course',
                         community  => 'Community',                          community  => 'Community',
                         textbook   => 'Textbook course',                          textbook   => 'Textbook course',
                           placement  => 'Placement test',
                     );                      );
         $output .= '<th>'.&mt('Type').'</th>'.          $output .= '<th>'.&mt('Type').'</th>'.
                    '<th>'.&mt('Date requested').'</th>'.                     '<th>'.&mt('Date requested').'</th>'.
Line 609  sub build_queue_display { Line 610  sub build_queue_display {
                 } elsif ($context eq 'requestusername') {                  } elsif ($context eq 'requestusername') {
                     $row .= '<td>'.$showtime.'</td>'."\n".                      $row .= '<td>'.$showtime.'</td>'."\n".
                             '<td>'.$detailslink.'</td>'."\n";                              '<td>'.$detailslink.'</td>'."\n";
                 } else {                  } else { 
                     if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') {                      if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') {
                         $row .= '<td>'.$instcode.'</td>'."\n";                          $row .= '<td>'.$instcode.'</td>'."\n";
                     } else {                      } else {
Line 656  sub update_request_queue { Line 657  sub update_request_queue {
         $beneficiary = 'enroller';          $beneficiary = 'enroller';
         $cid = $env{'request.course.id'};          $cid = $env{'request.course.id'};
         $crstype = lc(&Apache::loncommon::course_type());          $crstype = lc(&Apache::loncommon::course_type());
         $firsturl = &course_portal_url($cnum,$cdom);          $firsturl = &Apache::lonnet::course_portal_url($cnum,$cdom);
         %requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum);          %requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum);
         $access_start =  $env{'course.'.$cid.'.internal.selfenroll_start_access'};          $access_start =  $env{'course.'.$cid.'.internal.selfenroll_start_access'};
         $access_end =  $env{'course.'.$cid.'.internal.selfenroll_end_access'};          $access_end =  $env{'course.'.$cid.'.internal.selfenroll_end_access'};
Line 685  sub update_request_queue { Line 686  sub update_request_queue {
             }              }
         }          }
         my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom);          my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom);
         $firsturl = &course_portal_url($domconfiguser,$cdom);          $firsturl = &Apache::lonnet::course_portal_url($domconfiguser,$cdom);
         $approvedmsg = [{          $approvedmsg = [{
                             mt => 'Your request for Authoring Space has been approved.',                              mt => 'Your request for Authoring Space has been approved.',
                         },                          },
Line 710  sub update_request_queue { Line 711  sub update_request_queue {
             }              }
         }          }
         my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom);          my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom);
         $firsturl = &course_portal_url($domconfiguser,$cdom);          $firsturl = &Apache::lonnet::course_portal_url($domconfiguser,$cdom);
         $approvedmsg = [{          $approvedmsg = [{
                             mt => 'Your request for a LON-CAPA account has been approved.',                              mt => 'Your request for a LON-CAPA account has been approved.',
                         },                          },
Line 1004  sub update_request_queue { Line 1005  sub update_request_queue {
                                 } else {                                  } else {
                                     $approvedmsg = $approvalmsg{'course'};                                      $approvedmsg = $approvalmsg{'course'};
                                 }                                  }
                                 my $firsturl = &course_portal_url($cnum,$cdom);                                  my $firsturl = &Apache::lonnet::course_portal_url($cnum,$cdom);
                                 if (ref($approvedmsg) eq 'ARRAY') {                                  if (ref($approvedmsg) eq 'ARRAY') {
                                     if (ref($approvedmsg->[1]) eq 'HASH') {                                      if (ref($approvedmsg->[1]) eq 'HASH') {
                                         $approvedmsg->[1]->{'args'} = [$firsturl];                                          $approvedmsg->[1]->{'args'} = [$firsturl];
Line 1588  sub update_request_queue { Line 1589  sub update_request_queue {
     return $output;      return $output;
 }  }
   
 sub course_portal_url {  
     my ($cnum,$cdom) = @_;  
     my $chome = &Apache::lonnet::homeserver($cnum,$cdom);  
     my $hostname = &Apache::lonnet::hostname($chome);  
     my $protocol = $Apache::lonnet::protocol{$chome};  
     $protocol = 'http' if ($protocol ne 'https');  
     my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom);  
     my $firsturl;  
     if ($domdefaults{'portal_def'}) {  
         $firsturl = $domdefaults{'portal_def'};  
     } else {  
         $firsturl = $protocol.'://'.$hostname;  
     }  
     return $firsturl;  
 }  
   
 sub get_student_counts {  sub get_student_counts {
     my ($cdom,$cnum) = @_;      my ($cdom,$cnum) = @_;
     my (%idx,%stucounts);      my (%idx,%stucounts);
Line 1679  sub course_creation { Line 1664  sub course_creation {
 sub build_batchcreatehash {  sub build_batchcreatehash {
     my ($dom,$context,$details,$owneremail,$domdefs) = @_;      my ($dom,$context,$details,$owneremail,$domdefs) = @_;
     my %batchhash;      my %batchhash;
     my @items = qw{owner domain coursehome clonecrs clonedom datemode dateshift enrollstart enrollend accessstart accessend sections users uniquecode};      my @items = qw{owner domain coursehome clonecrs clonedom datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users uniquecode};
     if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) {      if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) {
         my $emailenc = &escape($owneremail);          my $emailenc = &escape($owneremail);
         my $owner = $details->{'owner'}.':'.$details->{'domain'};          my $owner = $details->{'owner'}.':'.$details->{'domain'};
         foreach my $item (@items) {          foreach my $item (@items) {
             $batchhash{$item} = $details->{$item};              $batchhash{$item} = $details->{$item};
         }          }
         if (ref($details->{'crosslists'}) eq 'HASH') {  
             foreach my $key (keys(%{$details->{'crosslists'}})) {  
                 if (ref($details->{'crosslists'}->{$key}) eq 'HASH') {  
                     $batchhash{'crosslists'}{$key}{'inst'} = $details->{crosslists}->{$key}->{instcode}.$details->{crosslists}->{$key}->{instsec};  
                     $batchhash{'crosslists'}{$key}{'loncapa'} = $details->{crosslists}->{$key}->{loncapa};  
                 }  
             }  
         }  
         $batchhash{'title'} = $details->{'cdescr'};          $batchhash{'title'} = $details->{'cdescr'};
         $batchhash{'coursecode'} = $details->{'instcode'};          $batchhash{'coursecode'} = $details->{'instcode'};
         if ($domdefs->{'officialcredits'} || $domdefs->{'unofficialcredits'}) {          if ($domdefs->{'officialcredits'} || $domdefs->{'unofficialcredits'}) {
Line 1706  sub build_batchcreatehash { Line 1683  sub build_batchcreatehash {
         $batchhash{'authparam'} = $domdefs->{'auth_arg_def'};          $batchhash{'authparam'} = $domdefs->{'auth_arg_def'};
         if ($details->{'crstype'} eq 'community') {          if ($details->{'crstype'} eq 'community') {
             $batchhash{'crstype'} = 'Community';              $batchhash{'crstype'} = 'Community';
           } elsif ($details->{'crstype'} eq 'placement') {
               $batchhash{'crstype'} = 'Placement';
         } else {          } else {
             if ($details->{'crstype'} eq 'textbook') {              if ($details->{'crstype'} eq 'textbook') {
                 if ($details->{'clonecrs'} && $details->{'clonedom'}) {                  if ($details->{'clonecrs'} && $details->{'clonedom'}) {
Line 2125  sub process_official_reqs { Line 2104  sub process_official_reqs {
                         my $cid = $dom.'_'.$cnum;                          my $cid = $dom.'_'.$cnum;
                         push(@{$newcids{$instcode}},$cid);                          push(@{$newcids{$instcode}},$cid);
                         if ($dcname && $dcdom) {                          if ($dcname && $dcdom) {
                             my $firsturl = &course_portal_url($cnum,$dom);                              my $firsturl = &Apache::lonnet::course_portal_url($cnum,$dom);
                             my $beneficiary = 'pendingrequestor';                              my $beneficiary = 'pendingrequestor';
                             my $now = time;                              my $now = time;
                             my $owner = $ownername.':'.$ownerdom;                              my $owner = $ownername.':'.$ownerdom;

Removed from v.1.52.2.4  
changed lines
  Added in v.1.58


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