Diff for /loncom/interface/lonpickcourse.pm between versions 1.39 and 1.46

version 1.39, 2006/02/02 17:57:40 version 1.46, 2006/05/18 01:08:50
Line 34  use Apache::loncommon; Line 34  use Apache::loncommon;
 use Apache::loncoursedata;  use Apache::loncoursedata;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::longroup;
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 42  sub handler { Line 43  sub handler {
     return OK if $r->header_only;      return OK if $r->header_only;
   
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     my $html=&Apache::lonxml::xmlbegin();  
     $r->print(<<ENDDOCUMENT);  
 $html  
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 </head>  
 ENDDOCUMENT  
 # Get parameters from query string  # Get parameters from query string
     &Apache::loncommon::get_unprocessed_cgi      &Apache::loncommon::get_unprocessed_cgi
         ($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',          ($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',
Line 102  ENDDOCUMENT Line 97  ENDDOCUMENT
                       ['-1','86400','604800','2592000','7776000',                        ['-1','86400','604800','2592000','7776000',
       '15552000','31104000']));        '15552000','31104000']));
 # if called from loncreateuser, report sections, then close  # if called from loncreateuser, report sections, then close
     my ($loaditem,$seclist);      my (%loaditem,$seclist,$groupslist);
     my $num_sections = 0;      my $num_sections = 0;
     if ($env{'form.form'} eq 'cu' && $env{'form.pickedcourse'}) {      if ($env{'form.form'} eq 'cu' && $env{'form.pickedcourse'}) {
         $loaditem = 'onLoad="setSections()"';          $loaditem{'onload'} ="setSections()";
         my ($cdom,$cnum) = split/_/,$env{'form.pickedcourse'};          my ($cdom,$cnum) = split/_/,$env{'form.pickedcourse'};
         my %sections_count = ();  
         $num_sections = &Apache::loncommon::get_sections($cdom,$cnum,\%sections_count);          my %sections_count = &Apache::loncommon::get_sections($cdom,$cnum);
         my @sections = ();          my @sections =  (sort {$a <=> $b} keys(%sections_count));
         if ($num_sections > 0) {   $seclist = join('","',@sections);
             @sections = (sort {$a <=> $b} keys(%sections_count));  
             $seclist = join('","',@sections);          my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum);
         }   $groupslist = join(',',sort(keys(%curr_groups)));
     }      }
     my $jscript;      my $jscript;
     my $title = 'Selecting a course';      my $title = 'Selecting a course';
Line 125  ENDDOCUMENT Line 120  ENDDOCUMENT
         $jscript = &Apache::loncommon::check_uncheck_jscript();          $jscript = &Apache::loncommon::check_uncheck_jscript();
         $multelement = '<input type="hidden" name="multiple" value="'.$multiple.'" />';          $multelement = '<input type="hidden" name="multiple" value="'.$multiple.'" />';
     }      }
     $r->print(&Apache::loncommon::bodytag($title,undef,$loaditem,undef,undef,undef,undef,1));      $r->print(&Apache::loncommon::start_page($title,undef,
        {'add_entries' => \%loaditem,
         'no_nav_bar'  => 1, }));
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
        'cac' => 'Course Activity',         'cac' => 'Course Activity',
        'cde' => 'Course Description',         'cde' => 'Course Description',
Line 240  function setSections() { Line 237  function setSections() {
             opener.document.$env{"form.form"}.currsec.options[0].selected = false              opener.document.$env{"form.form"}.currsec.options[0].selected = false
         }          }
     }      }
       opener.document.$env{"form.form"}.groups.value='$groupslist';
     self.close()      self.close()
 }  }
   
Line 336  ENDSCRIPT Line 334  ENDSCRIPT
         }          }
         $r->print("</form>\n");          $r->print("</form>\n");
     }      }
     $r->print('</body></html>');      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;
 }  }
   

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


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