Diff for /loncom/interface/Attic/londropadd.pm between versions 1.172 and 1.173

version 1.172, 2007/10/11 02:16:25 version 1.173, 2007/10/22 22:16:38
Line 423  END Line 423  END
 }  }
 END  END
     } else {      } else {
         $section_checks = &section_check_js();          $section_checks = &Apache::lonuserutils::section_check_js();
         $optional_checks = (<<END);          $optional_checks = (<<END);
     var message='';      var message='';
     if (foundname==0) {       if (foundname==0) { 
Line 759  sub enroll_single_student { Line 759  sub enroll_single_student {
     # in the course is entirely separate from the action of enrolling the      # in the course is entirely separate from the action of enrolling the
     # student.  Also, a failure in setting the dates as default is not fatal      # student.  Also, a failure in setting the dates as default is not fatal
     # to the process of enrolling / modifying a student.      # to the process of enrolling / modifying a student.
     my ($startdate,$enddate) = &get_dates_from_form();      my ($startdate,$enddate) = &Apache::lonuserutils::get_dates_from_form();
     if ($env{'form.makedatesdefault'}) {      if ($env{'form.makedatesdefault'}) {
         $r->print(&make_dates_default($startdate,$enddate));          $r->print(&Apache::lonuserutils::make_dates_default($startdate,
                                                               $enddate));
     }      }
   
     $r->print('<h3>'.&mt('Enrolling Student').'</h3>');      $r->print('<h3>'.&mt('Enrolling Student').'</h3>');
Line 806  sub enroll_single_student { Line 807  sub enroll_single_student {
                                                    $env{'form.lcdomain'});                                                     $env{'form.lcdomain'});
         if ((($amode) && ($genpwd)) || ($home ne 'no_host')) {          if ((($amode) && ($genpwd)) || ($home ne 'no_host')) {
             # Clean out any old roles the student has in this class.              # Clean out any old roles the student has in this class.
             &modifystudent($env{'form.lcdomain'},$env{'form.cuname'},              &Apache::lonuserutils::modifystudent($env{'form.lcdomain'},$env{'form.cuname'},
                            $env{'request.course.id'},$env{'form.csec'},                             $env{'request.course.id'},$env{'form.csec'},
                             $desiredhost);                              $desiredhost);
             my $login_result = &Apache::lonnet::modifystudent              my $login_result = &Apache::lonnet::modifystudent
Line 1066  sub print_enroll_single_student_form { Line 1067  sub print_enroll_single_student_form {
         my ($krbdef,$krbdefdom) =          my ($krbdef,$krbdefdom) =
             &Apache::loncommon::get_kerberos_defaults($ccdomain);              &Apache::loncommon::get_kerberos_defaults($ccdomain);
         $javascript_validations =           $javascript_validations = 
             &javascript_validations('auth',$krbdefdom,undef,undef,$ccdomain);              &Apache::lonuserutils::javascript_validations('auth',$krbdefdom,
                                                         undef,undef,$ccdomain);
         my %param = ( formname => 'document.studentform',          my %param = ( formname => 'document.studentform',
                       kerb_def_dom => $krbdefdom,                        kerb_def_dom => $krbdefdom,
                       kerb_def_auth => $krbdef                        kerb_def_auth => $krbdef
Line 1132  END Line 1134  END
     } else {      } else {
         # User already exists.  Do not worry about authentication          # User already exists.  Do not worry about authentication
         my %uenv = &Apache::lonnet::dump('environment',$ccdomain,$ccuname);          my %uenv = &Apache::lonnet::dump('environment',$ccdomain,$ccuname);
         $javascript_validations = &javascript_validations('noauth');          $javascript_validations = &Apache::lonuserutils::javascript_validations('noauth');
  my %lt=&Apache::lonlocal::texthash(   my %lt=&Apache::lonlocal::texthash(
        'udf'  => "User Data for",         'udf'  => "User Data for",
                        'fn'   => "First Name",                         'fn'   => "First Name",
Line 1158  END Line 1160  END
 </table>  </table>
 END  END
     }      }
     my $date_table = &date_setting_table();      my $date_table = &Apache::lonuserutils::date_setting_table();
         # Print it all out          # Print it all out
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
    'cd'   => "Course Data",     'cd'   => "Course Data",
Line 1807  sub print_modify_student_form { Line 1809  sub print_modify_student_form {
                 &Apache::lonlocal::locallocaltime($endtime)).'<br />';                  &Apache::lonlocal::locallocaltime($endtime)).'<br />';
   
     }      }
     my $date_table = &date_setting_table($starttime,$endtime);      my $date_table = 
           &Apache::lonuserutils::date_setting_table($starttime,$endtime);
     #      #
     if (! exists($env{'form.Status'}) ||       if (! exists($env{'form.Status'}) || 
         $env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) {          $env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) {
Line 1829  sub print_modify_student_form { Line 1832  sub print_modify_student_form {
                    'sm'    => "Submit Modifications",                     'sm'    => "Submit Modifications",
        );         );
 # Check if section name is valid  # Check if section name is valid
     my $section_check = &section_check_js();      my $section_check = &Apache::lonuserutils::section_check_js();
     $r->print(<<"END");      $r->print(<<"END");
 <script type="text/javascript">  <script type="text/javascript">
 $section_check  $section_check
Line 1894  sub modify_single_student { Line 1897  sub modify_single_student {
     $env{'form.section'} =~ s/\W//g;      $env{'form.section'} =~ s/\W//g;
     #      #
     # Do the date defaults first      # Do the date defaults first
     my ($starttime,$endtime) = &get_dates_from_form();      my ($starttime,$endtime) = &Apache::lonuserutils::get_dates_from_form();
     if ($env{'form.makedatesdefault'}) {      if ($env{'form.makedatesdefault'}) {
         $r->print(&make_dates_default($starttime,$endtime));          $r->print(&Apache::lonuserutils::make_dates_default($starttime,
                                                               $endtime));
     }      }
     # Get the 'sortby' and 'Status' variables so the user goes back to their      # Get the 'sortby' and 'Status' variables so the user goes back to their
     # previous screen      # previous screen
Line 2042  END Line 2046  END
     #      #
     # Send request(s) to modify data (final undef is for 'desiredhost',      # Send request(s) to modify data (final undef is for 'desiredhost',
     # which is a moot point because the student already has an account.      # which is a moot point because the student already has an account.
     my $modify_section_results = &modifystudent($sdom,$slogin,      my $modify_section_results = 
                                                 $env{'request.course.id'},          &Apache::lonuserutils::modifystudent($sdom,$slogin,
                                                 $section,undef);                                               $env{'request.course.id'},
                                                $section,undef);
     if ($modify_section_results !~ /^ok/) {      if ($modify_section_results !~ /^ok/) {
         $r->print(&mt('An error occured during the attempt to change the section for this student.')."<br />");          $r->print(&mt('An error occured during the attempt to change the section for this student.')."<br />");
     }      }
Line 2504  sub upfile_drop_add { Line 2509  sub upfile_drop_add {
                         $$_ =~ s/(\s+$|^\s+)//g;                          $$_ =~ s/(\s+$|^\s+)//g;
                     }                      }
                     if ($password || $env{'form.login'} eq 'loc') {                      if ($password || $env{'form.login'} eq 'loc') {
                         &modifystudent($domain,$username,$cid,$sec,                          &Apache::lonuserutils::modifystudent($domain,
                                        $desiredhost);                                                           $username,$cid,
                                                            $sec,$desiredhost);
                         my $reply=&Apache::lonnet::modifystudent                          my $reply=&Apache::lonnet::modifystudent
                             ($domain,$username,$id,$amode,$password,                              ($domain,$username,$id,$amode,$password,
                              $fname,$mname,$lname,$gen,$sec,$enddate,                               $fname,$mname,$lname,$gen,$sec,$enddate,
Line 2572  sub drop_student_list { Line 2578  sub drop_student_list {
     foreach (@droplist) {      foreach (@droplist) {
         my ($uname,$udom)=split(/\:/,$_);          my ($uname,$udom)=split(/\:/,$_);
         # drop student          # drop student
         my $result = &modifystudent($udom,$uname,$env{'request.course.id'});          my $result = &Apache::lonuserutils::modifystudent($udom,$uname,
                                                   $env{'request.course.id'});
         if ($result eq 'ok' || $result eq 'ok:') {          if ($result eq 'ok' || $result eq 'ok:') {
             $r->print(&mt('Dropped [_1]',$uname.'@'.$udom).'<br>');              $r->print(&mt('Dropped [_1]',$uname.'@'.$udom).'<br>');
             $count++;              $count++;

Removed from v.1.172  
changed lines
  Added in v.1.173


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