Diff for /loncom/interface/lonrequestcourse.pm between versions 1.35 and 1.39

version 1.35, 2009/09/11 12:53:10 version 1.39, 2009/11/04 17:42:17
Line 52  described at http://www.lon-capa.org. Line 52  described at http://www.lon-capa.org.
   
 =item onload_action()  =item onload_action()
   
 =item check_can_request()   
   
 =item course_types()  
   
 =item print_main_menu()  =item print_main_menu()
   
 =item request_administration()  =item request_administration()
Line 134  sub handler { Line 130  sub handler {
     }      }
   
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['action','showdom','cnum','state']);          ['action','showdom','cnum','state','crstype']);
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     my $dom = &get_course_dom();      my $dom = &get_course_dom();
     my $action = $env{'form.action'};      my $action = $env{'form.action'};
Line 178  sub handler { Line 174  sub handler {
         $trail{'enrollment'} = 'Enrollment';          $trail{'enrollment'} = 'Enrollment';
     }      }
   
     my ($page,$crumb,$newinstcode,$codechk,$checkedcode) =       my ($page,$crumb,$newinstcode,$codechk,$checkedcode,$description) = 
         &get_breadcrumbs($dom,$action,\$state,\%states,\%trail);          &get_breadcrumbs($dom,$action,\$state,\%states,\%trail);
     if ($action eq 'display') {      if ($action eq 'display') {
         if (($dom eq $env{'request.role.domain'}) && (&Apache::lonnet::allowed('ccc',$dom))) {          if (($dom eq $env{'request.role.domain'}) && (&Apache::lonnet::allowed('ccc',$dom))) {
Line 239  sub handler { Line 235  sub handler {
                                         $crosslistcode .= $env{'form.crosslist_'.$i.'_'.$item};                                           $crosslistcode .= $env{'form.crosslist_'.$i.'_'.$item}; 
                                     }                                      }
                                     if ($crosslistcode ne '') {                                       if ($crosslistcode ne '') { 
                                          $codechk{$i} =                                            ($codechk{$i}, my $rest) = 
                                             &Apache::lonnet::auto_validate_instcode('',$dom,$crosslistcode);                                              &Apache::lonnet::auto_validate_instcode('',$dom,$crosslistcode);
                                     }                                      }
                                     unless ($codechk{$i} eq 'valid') {                                      unless ($codechk{$i} eq 'valid') {
Line 276  sub handler { Line 272  sub handler {
   
     my $loaditems = &onload_action($action,$state);      my $loaditems = &onload_action($action,$state);
   
     my %can_request;      my (%can_request,%request_domains);
     my $canreq = &check_can_request($dom,\%can_request);      my $canreq = 
           &Apache::lonnet::check_can_request($dom,\%can_request,\%request_domains);
     if ($action eq 'new') {      if ($action eq 'new') {
         if ($canreq) {          if ($canreq) {
             if ($state eq 'crstype') {              if ($state eq 'crstype') {
                 &print_main_menu($r,\%can_request,\%states,$dom,$jscript,$loaditems,                  &print_main_menu($r,\%can_request,\%states,$dom,$jscript,$loaditems,
                                  $crumb);                                   $crumb,\%request_domains);
             } else {              } else {
                 &request_administration($r,$action,$state,$page,\%states,$dom,                  &request_administration($r,$action,$state,$page,\%states,$dom,
                                         $jscript,$loaditems,$crumb,$newinstcode,                                          $jscript,$loaditems,$crumb,$newinstcode,
                                         $codechk,$checkedcode,\@invalidcrosslist);                                          $codechk,$checkedcode,$description,
                                           \@invalidcrosslist);
             }              }
         } else {          } else {
             $r->print(&header('Course Requests').$crumb.              $r->print(&header('Course Requests').$crumb.
Line 296  sub handler { Line 294  sub handler {
         }          }
     } elsif ($action eq 'view') {      } elsif ($action eq 'view') {
         if ($state eq 'crstype') {          if ($state eq 'crstype') {
             &print_main_menu($r,\%can_request,\%states,$dom,$jscript,$loaditems,$crumb);              &print_main_menu($r,\%can_request,\%states,$dom,$jscript,$loaditems,$crumb,\%request_domains);
         } else {          } else {
             &request_administration($r,$action,$state,$page,\%states,$dom,$jscript,              &request_administration($r,$action,$state,$page,\%states,$dom,$jscript,
                                     $loaditems,$crumb);                                      $loaditems,$crumb);
Line 310  sub handler { Line 308  sub handler {
                       &close_popup_form());                        &close_popup_form());
         } else {          } else {
             &request_administration($r,$action,$state,$page,\%states,$dom,$jscript,              &request_administration($r,$action,$state,$page,\%states,$dom,$jscript,
                                     $loaditems,$crumb,'','','','',$uname,$udom);                                      $loaditems,$crumb,'','','','','',$uname,$udom);
         }          }
     } elsif ($action eq 'log') {      } elsif ($action eq 'log') {
         &print_request_logs($jscript,$loaditems,$crumb);          &print_request_logs($jscript,$loaditems,$crumb);
     } else {      } else {
         &print_main_menu($r,\%can_request,\%states,$dom,$jscript,'',$crumb);          &print_main_menu($r,\%can_request,\%states,$dom,$jscript,'',$crumb,\%request_domains);
     }      }
     return OK;      return OK;
 }  }
Line 346  END Line 344  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);      my ($crumb,$newinstcode,$codechk,$checkedcode,$numtitles,$description);
     my $page = 0;      my $page = 0;
     if ((ref($states) eq 'HASH') && (ref($trail) eq 'HASH') && (ref($state))) {      if ((ref($states) eq 'HASH') && (ref($trail) eq 'HASH') && (ref($state))) {
         if (defined($action)) {          if (defined($action)) {
Line 371  sub get_breadcrumbs { Line 369  sub get_breadcrumbs {
                                     $$state = 'codepick';                                      $$state = 'codepick';
                                     $page --;                                      $page --;
                                 } else {                                  } else {
                                     $codechk =                                       ($codechk,$description) = 
                                         &Apache::lonnet::auto_validate_instcode('',                                          &Apache::lonnet::auto_validate_instcode('',
                                             $dom,$newinstcode);                                              $dom,$newinstcode);
                                     if ($codechk ne 'valid') {                                      if ($codechk ne 'valid') {
Line 416  sub get_breadcrumbs { Line 414  sub get_breadcrumbs {
                 {text=>'Pick Action'});                  {text=>'Pick Action'});
         $crumb = &Apache::lonhtmlcommon::breadcrumbs('Course Requests','Course_Requests');          $crumb = &Apache::lonhtmlcommon::breadcrumbs('Course Requests','Course_Requests');
     }      }
     return ($page,$crumb,$newinstcode,$codechk,$checkedcode);      return ($page,$crumb,$newinstcode,$codechk,$checkedcode,$description);
 }  }
   
 sub header {  sub header {
Line 593  sub onload_action { Line 591  sub onload_action {
     return \%loaditems;      return \%loaditems;
 }  }
   
 sub check_can_request {  
     my ($dom,$can_request) = @_;  
     my $canreq = 0;  
     my ($types,$typename) = &course_types();  
     my @options = ('approval','validate','autolimit');  
     my $optregex = join('|',@options);  
     if ((ref($can_request) eq 'HASH') && (ref($types) eq 'ARRAY')) {  
         foreach my $type (@{$types}) {  
             if (&Apache::lonnet::usertools_access($env{'user.name'},  
                                                   $env{'user.domain'},  
                                                   $type,undef,'requestcourses')) {  
                 $canreq ++;  
                 if ($dom eq $env{'user.domain'}) {  
                     $can_request->{$type} = 1;  
                 }  
             }  
             if ($env{'environment.reqcrsotherdom.'.$type} ne '') {  
                 my @curr = split(',',$env{'environment.reqcrsotherdom.'.$type});  
                 if (@curr > 0) {  
                     $canreq ++;  
                     unless ($dom eq $env{'user.domain'}) {  
                         if (grep(/^\Q$dom\E:($optregex)(=?\d*)$/,@curr)) {  
                             $can_request->{$type} = 1;  
                         }  
                     }  
                 }  
             }  
         }  
     }  
     return $canreq;  
 }  
   
 sub course_types {  
     my @types = ('official','unofficial','community');  
     my %typename = (  
                          official   => 'Official course',  
                          unofficial => 'Unofficial course',  
                          community  => 'Community',  
                    );  
     return (\@types,\%typename);  
 }  
   
   
 sub print_main_menu {  sub print_main_menu {
     my ($r,$can_request,$states,$dom,$jscript,$loaditems,$crumb) = @_;      my ($r,$can_request,$states,$dom,$jscript,$loaditems,$crumb,$request_domains) = @_;
     my ($types,$typename) = &course_types();      my ($types,$typename) = &Apache::loncommon::course_types();
     my $onchange;      my $onchange;
     unless ($env{'form.interface'} eq 'textual') {      unless ($env{'form.interface'} eq 'textual') {
         $onchange = 1;          $onchange = 'this.form.submit()';
     }      }
   
     my $nextstate_setter = "\n";      my $nextstate_setter = "\n";
Line 681  function check_can_request(crschoice,act Line 636  function check_can_request(crschoice,act
     var unofficial = '';      var unofficial = '';
     var community = '';          var community = '';    
 END  END
       if (ref($can_request) eq 'HASH') {
     foreach my $item (keys(%{$can_request})) {          foreach my $item (keys(%{$can_request})) {
             $js .= "                   $js .= " 
         $item = 1;          $item = 1;
 ";  ";
           }
     }      }
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
         official => 'You are not permitted to request creation of an official course in this domain.',          official => 'You are not permitted to request creation of an official course in this domain.',
Line 721  END Line 677  END
     }      }
     return true;      return true;
 }  }
   
 END  END
       my ($pagetitle,$pageinfo,$domaintitle);
     $r->print(&header('Course Requests',$js.$jscript,$loaditems).$crumb.      if (ref($can_request) eq 'HASH') {
              '<p>'.&mt('Request creation of a new course, or review your pending course requests.').'</p>'.          if (($can_request->{'official'}) || ($can_request->{'unofficial'})) {
               if ($can_request->{'community'}) {
                   $pagetitle = 'Course/Community Requests';
                   $pageinfo = &mt('Request creation of a new course or community, or review your pending requests.');
                   $domaintitle = &mt('Course/Community Domain');
               } else {
                   $pagetitle = 'Course Requests';
                   $pageinfo = &mt('Request creation of a new course, or review your pending course requests.');
                   $domaintitle = &mt('Course Domain');
               }
           } elsif ($can_request->{'community'}) {
               $pagetitle = 'Course/Community Requests';
               $pageinfo = &mt('Request creation of a new course or community, or review your pending requests.');
               $domaintitle = &mt('Community Domain');
           } else {
               $pagetitle = 'Course/Community Requests';
               $pageinfo = &mt('You do not have rights to request creation of courses in this domain; please choose a different domain.');
               $domaintitle = &mt('Course/Community Domain');
           }
       }
       my @incdoms;
       if (ref($request_domains) eq 'HASH') {
           foreach my $item (keys(%{$request_domains})) {
               if (ref($request_domains->{$item}) eq 'ARRAY') {
                   foreach my $possdom (@{$request_domains->{$item}}) {
                       unless(grep(/^\Q$possdom\E$/,@incdoms)) {
                           push(@incdoms,$possdom);
                       } 
                   } 
               }
           }
       }
       $r->print(&header($pagetitle,$js.$jscript,$loaditems).$crumb.
                '<p>'.$pageinfo.'</p>'.
              '<div>'.               '<div>'.
               &Apache::lonhtmlcommon::start_pick_box().                &Apache::lonhtmlcommon::start_pick_box().
               &Apache::lonhtmlcommon::row_title(&mt('Course Domain')).                &Apache::lonhtmlcommon::row_title($domaintitle).
               '<form name="domforcourse" method="post" action="/adm/requestcourse">'.                '<form name="domforcourse" method="post" action="/adm/requestcourse">'.
               &Apache::loncommon::select_dom_form($dom,'showdom','',1,$onchange));                &Apache::loncommon::select_dom_form($dom,'showdom','',1,$onchange,\@incdoms));
     if (!$onchange) {      if (!$onchange) {
         $r->print('&nbsp;<input type="submit" name="godom" value="'.          $r->print('&nbsp;<input type="submit" name="godom" value="'.
                    &mt('Change').'" />');                     &mt('Change').'" />');
     }      }
       unless ((ref($can_request) eq 'HASH') && (keys(%{$can_request}) > 0)) {
           $r->print(&Apache::lonhtmlcommon::row_closure(1)."\n".
                     &Apache::lonhtmlcommon::end_pick_box().'</div>'."\n".
                     &Apache::loncommon::end_page());
           return;
       }
     $r->print('</form>'.&Apache::lonhtmlcommon::row_closure());      $r->print('</form>'.&Apache::lonhtmlcommon::row_closure());
   
     my $formname = 'requestcrs';      my $formname = 'requestcrs';
     my $nexttext = &mt('Next');      my $nexttext = &mt('Next');
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Action')).'      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Action')).'
Line 747  END Line 740  END
  <option value="log">'.&mt('View request history').'</option>   <option value="log">'.&mt('View request history').'</option>
 </select></form>'.  </select></form>'.
               &Apache::lonhtmlcommon::row_closure(1).                &Apache::lonhtmlcommon::row_closure(1).
               &Apache::lonhtmlcommon::row_title(&mt('Course Type')).'                &Apache::lonhtmlcommon::row_title(&mt('Type')).'
 <form name="mainmenu_coursetype" method="post" action="">  <form name="mainmenu_coursetype" method="post" action="">
 <select size="1" name="crstype">  <select size="1" name="crstype">');
  <option value="any">'.&mt('All types').'</option>');      if (ref($can_request) eq 'HASH') {
     if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) {          if (keys(%{$can_request}) > 1) {
         foreach my $type (@{$types}) {              $r->print(' <option value="any">'.&mt('All types').'</option>');
             my $selected = '';          }
             if ($type eq 'official') {          if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) {
                 $selected = ' selected="selected"';              foreach my $type (@{$types}) {
                   next unless($can_request->{$type});
                   my $selected = '';
                   if ($env{'form.crstype'} eq '') {
                       if ($type eq 'official') {
                           $selected = ' selected="selected"';
                       }
                   } else {
                       if ($type eq $env{'form.crstype'}) {
                           $selected = ' selected="selected"';
                       }
                   }
                   $r->print('<option value="'.$type.'"'.$selected.'>'.&mt($typename->{$type}).
                             '</option>'."\n");
             }              }
             $r->print('<option value="'.$type.'"'.$selected.'>'.&mt($typename->{$type}).  
                       '</option>'."\n");  
         }          }
     }      }
     $r->print('</select></form>'."\n".      $r->print('</select></form>'."\n".
               &Apache::lonhtmlcommon::row_closure(1)."\n".                &Apache::lonhtmlcommon::row_closure(1)."\n".
               &Apache::lonhtmlcommon::end_pick_box().'</div>'."\n".                &Apache::lonhtmlcommon::end_pick_box().'</div>'."\n".
               '<div><form name="'.$formname.'" method="post" action="">'."\n".                '<div><form name="'.$formname.'" method="post" action="/adm/requestcourse">'."\n".
               '<input type="hidden" name="state" value="crstype" />'."\n".                '<input type="hidden" name="state" value="crstype" />'."\n".
               '<input type="hidden" name="showdom" value="'.$dom.'" />'."\n".                '<input type="hidden" name="showdom" value="'.$dom.'" />'."\n".
               '<input type="hidden" name="crstype" value="" />'."\n".                '<input type="hidden" name="crstype" value="" />'."\n".
Line 778  END Line 782  END
   
 sub request_administration {  sub request_administration {
     my ($r,$action,$state,$page,$states,$dom,$jscript,$loaditems,$crumb,      my ($r,$action,$state,$page,$states,$dom,$jscript,$loaditems,$crumb,
         $newinstcode,$codechk,$checkedcode,$invalidcrosslist,$uname,$udom) = @_;          $newinstcode,$codechk,$checkedcode,$description,$invalidcrosslist,
           $uname,$udom) = @_;
     my $js;      my $js;
     if (($action eq 'new') || (($action eq 'view') && ($state eq 'pick_request'))) {      if (($action eq 'new') || (($action eq 'view') && ($state eq 'pick_request'))) {
         $js =  <<END;          $js =  <<END;
Line 814  END Line 819  END
         }          }
         $r->print(&header('Request a course',$js.$jscript,$loaditems,$jsextra).$crumb);          $r->print(&header('Request a course',$js.$jscript,$loaditems,$jsextra).$crumb);
         &print_request_form($r,$action,$state,$page,$states,$dom,$newinstcode,          &print_request_form($r,$action,$state,$page,$states,$dom,$newinstcode,
                             $codechk,$checkedcode,$invalidcrosslist);                              $codechk,$checkedcode,$description,$invalidcrosslist);
     } elsif ($action eq 'view') {      } elsif ($action eq 'view') {
         my $jsextra;          my $jsextra;
         my $formname = 'requestcrs';          my $formname = 'requestcrs';
Line 1126  sub get_instcode { Line 1131  sub get_instcode {
   
 sub print_request_form {  sub print_request_form {
     my ($r,$action,$state,$page,$states,$dom,$newinstcode,$codechk,$checkedcode,      my ($r,$action,$state,$page,$states,$dom,$newinstcode,$codechk,$checkedcode,
         $invalidcrosslist) = @_;          $description,$invalidcrosslist) = @_;
     my $formname = 'requestcrs';      my $formname = 'requestcrs';
     my ($next,$prev,$message,$output,$codepicker,$crstype);      my ($next,$prev,$message,$output,$codepicker,$crstype);
     $prev = $states->{$action}[$page-1];      $prev = $states->{$action}[$page-1];
Line 1191  sub print_request_form { Line 1196  sub print_request_form {
         if ($instcode eq '') {          if ($instcode eq '') {
             $prev = $states->{$action}[$page-2];              $prev = $states->{$action}[$page-2];
         }          }
         $r->print(&courseinfo_form($dom,$formname,$crstype,$next));          $r->print(&courseinfo_form($dom,$formname,$crstype,$next,$description));
     } elsif ($state eq 'enrollment') {      } elsif ($state eq 'enrollment') {
         if ($crstype eq 'official') {          if ($crstype eq 'official') {
             &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,              &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
Line 1749  sub print_request_status { Line 1754  sub print_request_status {
     my %statusinfo = &Apache::lonnet::dump('courserequests',$env{'user.domain'},      my %statusinfo = &Apache::lonnet::dump('courserequests',$env{'user.domain'},
                                            $env{'user.name'},'^status:'.$dom);                                             $env{'user.name'},'^status:'.$dom);
     my ($output,$formname,%queue_by_date);      my ($output,$formname,%queue_by_date);
     my ($types,$typenames) = &course_types();      my ($types,$typenames) = &Apache::loncommon::course_types();
     foreach my $key (keys(%statusinfo)) {      foreach my $key (keys(%statusinfo)) {
         if (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending')) {           if (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending')) { 
             (undef,my($cdom,$cnum)) = split(':',$key);              (undef,my($cdom,$cnum)) = split(':',$key);
Line 1871  sub print_cancel_request { Line 1876  sub print_cancel_request {
             }              }
             $output = &mt('No further action will be taken');              $output = &mt('No further action will be taken');
         } elsif (ref($history{'details'}) eq 'HASH') {          } elsif (ref($history{'details'}) eq 'HASH') {
             my ($types,$typename) = &course_types();              my ($types,$typename) = &Apache::loncommon::course_types();
             my $showtype = $crstype;              my $showtype = $crstype;
             if (defined($typename->{$crstype})) {              if (defined($typename->{$crstype})) {
                 $showtype = $typename->{$crstype};                   $showtype = $typename->{$crstype}; 
Line 1957  sub print_request_logs { Line 1962  sub print_request_logs {
 sub print_review {  sub print_review {
     my ($dom,$codetitles,$cat_titles,$cat_order,$code_order,$uname,$udom,      my ($dom,$codetitles,$cat_titles,$cat_order,$code_order,$uname,$udom,
         $disallowed,$disallowmsg) = @_;          $disallowed,$disallowmsg) = @_;
     my ($types,$typename) = &course_types();      my ($types,$typename) = &Apache::loncommon::course_types();
     my ($owner,$ownername,$owneremail);      my ($owner,$ownername,$owneremail);
     if ($uname eq '' || $udom eq '') {      if ($uname eq '' || $udom eq '') {
         $uname = $env{'user.name'};          $uname = $env{'user.name'};
Line 2080  sub print_review { Line 2085  sub print_review {
     if (($env{'form.clonecrs'} =~ /^$match_name$/) &&       if (($env{'form.clonecrs'} =~ /^$match_name$/) && 
         ($env{'form.clonedom'} =~ /^$match_domain$/)) {          ($env{'form.clonedom'} =~ /^$match_domain$/)) {
         my $canclone = &Apache::loncoursequeueadmin::can_clone_course($env{'user.name'},          my $canclone = &Apache::loncoursequeueadmin::can_clone_course($env{'user.name'},
                            $env{'user.domain'},$env{'form.clonecrs'}, $env{'form.clonedom'});                             $env{'user.domain'},$env{'form.clonecrs'},$env{'form.clonedom'},
                              $env{'form.crstype'});
         if ($canclone) {          if ($canclone) {
             my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'},              my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'},
                               $env{'form.clonecrs'},('description','internal.coursecode'));                                $env{'form.clonecrs'},('description','internal.coursecode'));
Line 2238  sub dates_from_form { Line 2244  sub dates_from_form {
 }  }
   
 sub courseinfo_form {  sub courseinfo_form {
     my ($dom,$formname,$crstype,$next) = @_;      my ($dom,$formname,$crstype,$next,$description) = @_;
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                 official => 'You must provide a (brief) course description.',                  official => 'You must provide a (brief) course description.',
                 community => 'You must provide a (brief) community description.'                  community => 'You must provide a (brief) community description.'
Line 2268  ENDJS Line 2274  ENDJS
                   '<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Description').'&nbsp;'.$title.'</h3>'.                    '<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Description').'&nbsp;'.$title.'</h3>'.
                   &Apache::lonhtmlcommon::row_closure(1).                    &Apache::lonhtmlcommon::row_closure(1).
                   &Apache::lonhtmlcommon::row_title(&mt('Description')).                    &Apache::lonhtmlcommon::row_title(&mt('Description')).
                  '<input type="text" size="40" name="cdescr" />';                   '<input type="text" size="60" name="cdescr" value="'.$description.'" />';
     my ($home_server_pick,$numlib) =      my ($home_server_pick,$numlib) =
         &Apache::loncommon::home_server_form_item($dom,'chome',          &Apache::loncommon::home_server_form_item($dom,'chome',
                                                   'default','hide');                                                    'default','hide');
Line 2423  sub get_course_dom { Line 2429  sub get_course_dom {
         }          }
     }      }
     if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne 'public')) {      if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne 'public')) {
         my ($types,$typename) = &course_types();          my ($types,$typename) = &Apache::loncommon::course_types();
         if (ref($types) eq 'ARRAY') {          if (ref($types) eq 'ARRAY') {
             foreach my $type (@{$types}) {              foreach my $type (@{$types}) {
                 if (&Apache::lonnet::usertools_access($env{'user.name'},                  if (&Apache::lonnet::usertools_access($env{'user.name'},
Line 2646  sub print_request_outcome { Line 2652  sub print_request_outcome {
         if ($clonehome ne 'no_host') {            if ($clonehome ne 'no_host') {  
             my $canclone =                my $canclone =  
                 &Apache::loncoursequeueadmin::can_clone_course($env{'user.name'},                  &Apache::loncoursequeueadmin::can_clone_course($env{'user.name'},
                         $env{'user.domain'},$env{'form.clonecrs'}, $env{'form.clonedom'});                          $env{'user.domain'},$env{'form.clonecrs'},$env{'form.clonedom'},
                           $crstype);
             if ($canclone) {              if ($canclone) {
                 $clonecrs = $env{'form.clonecrs'};                  $clonecrs = $env{'form.clonecrs'};
                 $clonedom = $env{'form.clonedom'};                  $clonedom = $env{'form.clonedom'};
Line 3088  sub check_autolimit { Line 3095  sub check_autolimit {
     my ($uname,$udom,$dom,$crstype,$limit,$message) = @_;      my ($uname,$udom,$dom,$crstype,$limit,$message) = @_;
     my %crsroles = &Apache::lonnet::get_my_roles($env{'user.name'},$env{'user.domain'},      my %crsroles = &Apache::lonnet::get_my_roles($env{'user.name'},$env{'user.domain'},
                                         'userroles',['active','future'],['cc'],[$dom]);                                          'userroles',['active','future'],['cc'],[$dom]);
     my ($types,$typename) = &course_types();      my ($types,$typename) = &Apache::loncommon::course_types();
     my %requests = &Apache::lonnet::dumpstore('courserequests',$udom,$uname);      my %requests = &Apache::lonnet::dumpstore('courserequests',$udom,$uname);
     my %count;      my %count;
     if (ref($types) eq 'ARRAY') {      if (ref($types) eq 'ARRAY') {

Removed from v.1.35  
changed lines
  Added in v.1.39


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