Diff for /loncom/interface/Attic/londropadd.pm between versions 1.58 and 1.59

version 1.58, 2002/10/16 15:02:28 version 1.59, 2002/10/16 18:45:10
Line 755  sub print_html_classlist { Line 755  sub print_html_classlist {
     if (! exists($ENV{'form.sortby'})) {      if (! exists($ENV{'form.sortby'})) {
         $ENV{'form.sortby'} = 'username';          $ENV{'form.sortby'} = 'username';
     }      }
     if (! exists($ENV{'form.Status'}) ||       if ($ENV{'form.Status'} !~ /^(Any|Expired|Active)$/) {
         $ENV{'form.Status'} !~ /^(Any|Expired|Active)$/) {  
         $ENV{'form.Status'} = 'Active';          $ENV{'form.Status'} = 'Active';
     }      }
     my $status_select = &Apache::lonhtmlcommon::StatusOptions      my $status_select = &Apache::lonhtmlcommon::StatusOptions
Line 767  sub print_html_classlist { Line 766  sub print_html_classlist {
 <p>  <p>
 <font size="+1">Current Classlist</font>  <font size="+1">Current Classlist</font>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
   END
       if ($ENV{'form.action'} ne 'modifystudent') {
           $r->print(<<END);
 <font size="+1">  <font size="+1">
 <a href="javascript:document.studentform.state.value='csv';document.studentform.submit();">CSV format</a>  <a href="javascript:document.studentform.state.value='csv';document.studentform.submit();">CSV format</a>
 </font>  </font>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 $status_select  
 </p>  
 END  END
       }
       $r->print($status_select."</p>\n");
     my $cid=$ENV{'request.course.id'};      my $cid=$ENV{'request.course.id'};
     my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();      my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();
     if (! defined($classlist)) {      if (! defined($classlist)) {
Line 821  sub show_class_list { Line 823  sub show_class_list {
             $r->print('Select a user name to modify the students information');              $r->print('Select a user name to modify the students information');
         }          }
         $r->print(<<END);          $r->print(<<END);
   
 <input type="hidden" name="sortby" value="$sortby" />  <input type="hidden" name="sortby" value="$sortby" />
   <input type="hidden" name="sname"  value="" />
   <input type="hidden" name="sdom"   value="" />
 <p>  <p>
 <table border=2>  <table border=2>
 <tr><th>  <tr><th>
Line 883  END Line 888  END
                                                              $username,                                                               $username,
                                                              $domain));                                                               $domain));
             } elsif ($linkto eq 'modify') {              } elsif ($linkto eq 'modify') {
                 $r->print('<a href="/adm/dropadd?action=modifystudent'.                  $r->print('<a href="'.
                           '&state=selected'.'&sname='.$username.                            "javascript:document.studentform.sname.value='".
                           '&sdom='.$domain.'&sortby='.$sortby.'">'.                            $username.
                             "';document.studentform.sdom.value='".$domain.
                             "';document.studentform.state.value='selected".
                             "';document.studentform.submit();".'">'.
                           $username."</a>\n");                            $username."</a>\n");
             }              }
             $r->print(<<"END");              $r->print(<<"END");
Line 921  END Line 929  END
 sub print_modify_student_form {  sub print_modify_student_form {
     my $r = shift();      my $r = shift();
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['sdom','sname','sortby']);                                                  ['sdom','sname']);    
     my $sname  = $ENV{'form.sname'};      my $sname  = $ENV{'form.sname'};
     my $sdom   = $ENV{'form.sdom'};      my $sdom   = $ENV{'form.sdom'};
     my $sortby = $ENV{'form.sortby'};      my $sortby = $ENV{'form.sortby'};
Line 949  sub print_modify_student_form { Line 957  sub print_modify_student_form {
     my $enddateform = &Apache::lonhtmlcommon::date_setter('studentform',      my $enddateform = &Apache::lonhtmlcommon::date_setter('studentform',
                                                           'enddate',                                                            'enddate',
                                                           $endtime);                                                            $endtime);
       #
       if (! exists($ENV{'form.Status'}) || 
           $ENV{'form.Status'} !~ /^(Any|Expired|Active)$/) {
           $ENV{'form.Status'} = 'crap';
       }
     # Make sure student is enrolled in course          # Make sure student is enrolled in course    
     $r->print(<<END);      $r->print(<<END);
 <p>  <p>
Line 961  Only domain coordinators can change a us Line 974  Only domain coordinators can change a us
 <input type="hidden" name="action"  value="modifystudent" />  <input type="hidden" name="action"  value="modifystudent" />
 <input type="hidden" name="state"   value="done" />  <input type="hidden" name="state"   value="done" />
 <input type="hidden" name="sortby"  value="$sortby" />  <input type="hidden" name="sortby"  value="$sortby" />
   <input type="hidden" name="Status"  value="$ENV{'form.Status'}" />
   
 <h2>Modify Enrollment for $info{'firstname'} $info{'middlename'}   <h2>Modify Enrollment for $info{'firstname'} $info{'middlename'} 
 $info{'lastname'} $info{'generation'}, $sname\@$sdom</h2>  $info{'lastname'} $info{'generation'}, $sname\@$sdom</h2>
 <p>  <p>
Line 998  END Line 1013  END
 #  #
 sub modify_single_student {  sub modify_single_student {
     my $r = shift;      my $r = shift;
     # Get the 'sortby' variable so the user does not need to re-sort      # Get the 'sortby' and 'Status' variables so the user goes back to their
       # previous screen
     my $sortby = $ENV{'form.sortby'};      my $sortby = $ENV{'form.sortby'};
       my $status = $ENV{'form.Status'};
     #      #
     # We always need this information      # We always need this information
     my $slogin     = $ENV{'form.slogin'};      my $slogin     = $ENV{'form.slogin'};
Line 1010  sub modify_single_student { Line 1027  sub modify_single_student {
                                  ['firstname','middlename',                                   ['firstname','middlename',
                                   'lastname','generation','id'],                                    'lastname','generation','id'],
                                  $sdom, $slogin);                                   $sdom, $slogin);
       $old{'section'} = &Apache::lonnet::getsection($sdom,$slogin,
                                                     $ENV{'request.course.id'});
     my ($tmp) = keys(%old);      my ($tmp) = keys(%old);
     if ($tmp =~ /^(con_lost|error|no_such_host)/i) {      if ($tmp =~ /^(con_lost|error|no_such_host)/i) {
         $r->print("There was an error determining the environment values ".          $r->print("There was an error determining the environment values ".
Line 1071  sub modify_single_student { Line 1090  sub modify_single_student {
     <td> <b>ID</b> </td>      <td> <b>ID</b> </td>
     <td> $old{'id'} </td>      <td> $old{'id'} </td>
     <td> $sid </td>      <td> $sid </td>
   </tr><tr>
       <td> <b>Section</b> </td>
       <td> $old{'section'} </td>
       <td> $section</td>
 </tr>  </tr>
 </table>  </table>
 <h3>Role Information</h3>  <h3>Role Information</h3>
 <table>  <table>
 <tr><td>Section     </td><td> $section    </td></tr>  
 <tr><td>Start Time  </td><td> $displayable_starttime </td></tr>  <tr><td>Start Time  </td><td> $displayable_starttime </td></tr>
 <tr><td>End Time    </td><td> $displayable_endtime   </td></tr>  <tr><td>End Time    </td><td> $displayable_endtime   </td></tr>
 </table>  </table>
Line 1106  END Line 1128  END
     }      }
     $r->print(<<END);      $r->print(<<END);
 </p><p>  </p><p>
 <a href="/adm/dropadd?action=modifystudent&sortby=$sortby">Modify another students data</a>  <input type="hidden" name="action" value="modifystudent" />
   <input type="hidden" name="sortby" value="$sortby" />
   <input type="hidden" name="Status" value="$status" />
   <a href="javascript:document.studentform.submit();">Modify another students data</a>
 </body></html>  </body></html>
 END  END
     return;      return;
Line 1175  which describes the order elements are s Line 1200  which describes the order elements are s
 sub show_drop_list {  sub show_drop_list {
     my ($r,$classlist,$keylist,$nosort)=@_;      my ($r,$classlist,$keylist,$nosort)=@_;
     my $cid=$ENV{'request.course.id'};      my $cid=$ENV{'request.course.id'};
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      if (! exists($ENV{'form.sortby'})) {
                                             ['sortby']);          &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                                   ['sortby']);
       }
     my $sortby = $ENV{'form.sortby'};      my $sortby = $ENV{'form.sortby'};
     if ($sortby !~ /^(username|domain|section|fullname|id)$/) {      if ($sortby !~ /^(username|domain|section|fullname|id)$/) {
         $sortby = 'username';          $sortby = 'username';
Line 1502  sub drop_student_list { Line 1529  sub drop_student_list {
         my $result = &modifystudent($udom,$uname,$ENV{'request.course.id'});          my $result = &modifystudent($udom,$uname,$ENV{'request.course.id'});
         if ($result eq 'ok' || $result eq 'ok:') {          if ($result eq 'ok' || $result eq 'ok:') {
             $r->print('Dropped '.$uname.' @ '.$udom.'<br>');              $r->print('Dropped '.$uname.' @ '.$udom.'<br>');
               $count++;
         } else {          } else {
             $r->print('Error dropping '.$uname.' @ '.$udom.': '.$result.              $r->print('Error dropping '.$uname.' @ '.$udom.': '.$result.
                       '<br />');                        '<br />');
         }          }
         $count++;  
     }      }
     $r->print('<p><b>Dropped '.$count.' student(s).</b>');      $r->print('<p><b>Dropped '.$count.' student(s).</b>');
     $r->print('<p>Re-enrollment will re-activate data.');      $r->print('<p>Re-enrollment will re-activate data.') if ($count);
 }  }
   
 ###################################################################  ###################################################################

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


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