Diff for /loncom/interface/Attic/londropadd.pm between versions 1.26 and 1.27

version 1.26, 2002/04/16 21:02:17 version 1.27, 2002/04/17 13:55:35
Line 59  use Apache::Constants qw(:common :http R Line 59  use Apache::Constants qw(:common :http R
 # ================================================================ Print header  # ================================================================ Print header
   
 sub header {  sub header {
     my $r=shift;      return(<<ENDHEAD);
     $r->print(<<ENDHEAD);  
 <html>  <html>
 <head>  <head>
 <title>LON-CAPA Student Drop/Add</title>  <title>LON-CAPA Student Drop/Add</title>
Line 94  sub modifystudent { Line 93  sub modifystudent {
             my $section=$1;              my $section=$1;
             $section='' if ($course eq $courseid.'_st');              $section='' if ($course eq $courseid.'_st');
             if (((!$section) && (!$csec)) || ($section ne $csec)) {              if (((!$section) && (!$csec)) || ($section ne $csec)) {
                 my (undef,$end,$start)=split(/\_/,$course);                  my (undef,$end,$start)=split(/\_/,$roles{$course});
                 my $now=time;                  my $now=time;
                 if (($start) && ($end) && ($now>$start) && ($now<$end)) {                  if (!($start && ($now<$start)) || !($end && ($now>$end))) {
                     my $reply=&Apache::lonnet::modifystudent                      my $reply=&Apache::lonnet::modifystudent
                         ($udom,$unam,'','','','','','','',$section,time);                          ($udom,$unam,'','','','','','','',$section,time);
                 }                  }
Line 654  sub get_current_classlist { Line 653  sub get_current_classlist {
                 $currentlist{$student}=1;                  $currentlist{$student}=1;
             }              }
         }          }
         return %currentlist;          return (undef,%currentlist);
     } else {      } else {
         return undef;          return ($tmp,undef);
     }      }
 }  }
   
Line 664  sub get_current_classlist { Line 663  sub get_current_classlist {
 sub menu_phase_two_drop {  sub menu_phase_two_drop {
     my $r=shift;      my $r=shift;
     my $cid=$ENV{'request.course.id'};      my $cid=$ENV{'request.course.id'};
     my %currentlist=&get_current_classlist($ENV{'course.'.$cid.'.domain'},      my ($error,%currentlist)=&get_current_classlist($ENV{'course.'.$cid.'.domain'},
                                            $ENV{'course.'.$cid.'.num'});                                             $ENV{'course.'.$cid.'.num'});
       if (defined($error)) {
           $r->print('<pre>ERROR:$error</pre>');
       }
     if (!defined(%currentlist)) {       if (!defined(%currentlist)) { 
         $r->print('<font color=red>'.          $r->print("There are no students currently enrolled.\n");
                   '<h3> Could not access classlist.</h3></font>');  
     } else {      } else {
         # Print out the available choices          # Print out the available choices
         &show_drop_list($r,%currentlist);          &show_drop_list($r,%currentlist);
Line 854  sub upfile_drop_add { Line 855  sub upfile_drop_add {
         if ($ENV{'form.fullup'} eq 'yes') {          if ($ENV{'form.fullup'} eq 'yes') {
             $r->print('<h3>Dropping Students</h3>');              $r->print('<h3>Dropping Students</h3>');
             #  Get current classlist              #  Get current classlist
             my %currentlist=&get_current_classlist              my ($error,%currentlist)=&get_current_classlist
                 ($ENV{'course.'.$cid.'.domain'},                  ($ENV{'course.'.$cid.'.domain'},
                  $ENV{'course.'.$cid.'.num'});                   $ENV{'course.'.$cid.'.num'});
               if (defined($error)) {
                   $r->print('<pre>ERROR:$error</pre>');
               }
             if (defined(%currentlist)) {              if (defined(%currentlist)) {
                 # Drop the students                  # Drop the students
                 foreach (@studentdata) {                  foreach (@studentdata) {
Line 870  sub upfile_drop_add { Line 874  sub upfile_drop_add {
                 # Print out list of dropped students                  # Print out list of dropped students
                 &show_drop_list($r,%currentlist);                  &show_drop_list($r,%currentlist);
             } else {              } else {
                 $r->print('<font color=red>'.                  $r->print("There are no students currently enrolled.\n");
                           '<h3>Could not access classlist</h3></font>');  
             }              }
         }          }
     } # end of unless      } # end of unless
Line 906  sub handler { Line 909  sub handler {
         # Start page          # Start page
         $r->content_type('text/html');          $r->content_type('text/html');
         $r->send_http_header;          $r->send_http_header;
         &header($r);          $r->print(&header());
         # Phase one, initial screen          # Phase one, initial screen
         unless ($ENV{'form.phase'}) {          unless ($ENV{'form.phase'}) {
             &menu_phase_one($r);              &menu_phase_one($r);

Removed from v.1.26  
changed lines
  Added in v.1.27


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