Diff for /loncom/interface/Attic/londropadd.pm between versions 1.91.2.2 and 1.92

version 1.91.2.2, 2004/01/21 00:29:56 version 1.92, 2003/12/08 21:01:03
Line 43  use Apache::lonhtmlcommon(); Line 43  use Apache::lonhtmlcommon();
 use Apache::Constants qw(:common :http REDIRECT);  use Apache::Constants qw(:common :http REDIRECT);
 use Spreadsheet::WriteExcel;  use Spreadsheet::WriteExcel;
 use Apache::lonlocal;  use Apache::lonlocal;
 use localenroll();  
   
 ###############################################################  ###############################################################
 ###############################################################  ###############################################################
Line 172  sub print_main_menu { Line 171  sub print_main_menu {
     <a href="/adm/dropadd?action=drop">$Text{'drop'}</a>      <a href="/adm/dropadd?action=drop">$Text{'drop'}</a>
 </font>  </font>
 </p><p>  </p><p>
 END  
     if (&localenroll::run() ) {  
  $r->print(<<END);  
 <font size="+1">  <font size="+1">
     <a href="/adm/populate">$Text{'populate'}</a>      <a href="/adm/populate">$Text{'populate'}</a>
 </font>  </font>
 END  END
     }  
 }  }
   
 ###############################################################  ###############################################################
Line 240  sub print_upload_manager_header { Line 235  sub print_upload_manager_header {
 ###############################################################  ###############################################################
 ###############################################################  ###############################################################
 sub javascript_validations {  sub javascript_validations {
     my ($mode,$krbdefdom,$curr_authtype,$curr_authfield)=@_;      my ($mode,$krbdefdom)=@_;
     my $authheader;      my $authheader;
     if ($mode eq 'auth') {      if ($mode eq 'auth') {
         my %param = ( formname => 'studentform',          my %param = ( formname => 'studentform',
Line 250  sub javascript_validations { Line 245  sub javascript_validations {
         my %param = ( formname => 'ccrs',          my %param = ( formname => 'ccrs',
                   kerb_def_dom => $krbdefdom );                    kerb_def_dom => $krbdefdom );
         $authheader = &Apache::loncommon::authform_header(%param);          $authheader = &Apache::loncommon::authform_header(%param);
     } elsif ($mode eq 'modifycourse') {  
         my %param = ( formname => 'cmod',  
                   kerb_def_dom => $krbdefdom,  
                   mode => 'modifycourse',  
                   curr_authtype => $curr_authtype,  
                   curr_autharg => $curr_authfield );  
         $authheader = &Apache::loncommon::authform_header(%param);  
     }      }
   
           
     my %alert = &Apache::lonlocal::texthash      my %alert = &Apache::lonlocal::texthash
         (username => 'You need to specify the username field.',          (username => 'You need to specify the username field.',
Line 276  sub javascript_validations { Line 263  sub javascript_validations {
     my $function_name =(<<END);      my $function_name =(<<END);
 function verify_message (vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail) {  function verify_message (vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail) {
 END  END
     my $auth_checks;      my $auth_checks = (<<END);
     if ($mode eq 'createcourse') {      var foundatype=0;
         $auth_checks .= (<<END);  
     if (vf.autoadds[0].checked == true) {  
         if (current.radiovalue == null || current.radiovalue == 'nochange') {  
             alert('$alert{'authen'}');  
             return;  
         }  
     }  
 END  END
     } else {      unless ($mode eq 'createcourse') {
         $auth_checks .= (<<END);          $auth_checks .= (<<END);
     var foundatype=0;  
     if (founduname==0) {      if (founduname==0) {
  alert('$alert{'username'}');   alert('$alert{'username'}');
         return;          return;
     }      }
   END
       }
       $auth_checks .= (<<END);
     // alert('current.radiovalue = '+current.radiovalue);      // alert('current.radiovalue = '+current.radiovalue);
     if (current.radiovalue == null || current.radiovalue == 'nochange') {      if (current.radiovalue == null || current.radiovalue == 'nochange') {
         // They did not check any of the login radiobuttons.          // They did not check any of the login radiobuttons.
         alert('$alert{'authen'}');          alert('$alert{'authen'}');
         return;          return;
     }      }
 END  
     }  
     if ($mode eq 'createcourse') {  
         $auth_checks .= "  
     if ( (vf.autoadds[0].checked == true) &&  
          (vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') ) {  
 ";  
     } elsif ($mode eq 'modifycourse') {  
         $auth_checks .= "   
     if (vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') {  
 ";  
     }  
     if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) {  
         $auth_checks .= (<<END);  
         var alertmsg = '';  
         switch (current.radiovalue) {  
             case 'krb':  
                 alertmsg = '$alert{'krb'}';  
                 break;  
             default:  
                 alertmsg = '';  
         }  
         if (alertmsg != '') {  
             alert(alertmsg);  
             return;  
         }  
     }  
 END  
     } else {  
         $auth_checks .= (<<END);  
     foundatype=1;      foundatype=1;
     if (current.argfield == null || current.argfield == '') {      if (current.argfield == null || current.argfield == '') {
         var alertmsg = '';          var alertmsg = '';
Line 352  END Line 304  END
         }          }
     }      }
 END  END
     }  
     my $optional_checks = '';      my $optional_checks = '';
     if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) {      if ($mode eq 'createcourse') {
         $optional_checks = (<<END);          $optional_checks = (<<END);
     vf.submit();      vf.submit();
 }  }
Line 397  END Line 348  END
 END  END
     }      }
     my $result = $function_name;      my $result = $function_name;
     if ( ($mode eq 'auth') || ($mode eq 'createcourse') || ($mode eq 'modifycourse')  ) {      if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) {
         $result .= $auth_checks;          $result .= $auth_checks;
     }      }
     $result .= $optional_checks;      $result .= $optional_checks;
     if ( ($mode eq 'auth') || ($mode eq 'createcourse') || ($mode eq 'modifycourse')  ) {      if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) {
         $result .= $authheader;          $result .= $authheader;
     }      }
     return $result;      return $result;
Line 1025  END Line 976  END
 # ========================================================= Menu Phase Two Drop  # ========================================================= Menu Phase Two Drop
 sub print_drop_menu {  sub print_drop_menu {
     my $r=shift;      my $r=shift;
     $r->print("<h3>Drop Students</h3>");      $r->print("<h3>".&mt('Drop Students')."</h3>");
     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 1144  END Line 1095  END
             $r->print('"'.join('","',("username","domain","ID","student name",              $r->print('"'.join('","',("username","domain","ID","student name",
                                       "section","status")).'"'."\n");                                        "section","status")).'"'."\n");
         } else {          } else {
             $r->print('"'.join('","',("username","domain","ID","student name",              $r->print('"'.join('","',(&mt("username"),"domain","ID","student name",
                                       "section")).'"'."\n");                                        "section")).'"'."\n");
         }          }
     } elsif ($mode eq 'excel') {      } elsif ($mode eq 'excel') {
Line 1563  END Line 1514  END
 <tr>  <tr>
     <th>&nbsp;</th>      <th>&nbsp;</th>
     <th>username</th>      <th>username</th>
     <th>domain</th>      <th>domaind</th>
     <th>ID</th>      <th>ID</th>
     <th>student name</th>      <th>student name</th>
     <th>section</th>      <th>section</th>
Line 1571  END Line 1522  END
 END  END
   
     } else  {      } else  {
           my $wordusername=&mt('username');
           my $worddomain=&mt('domain');
           my $wordstudentname=&mt('student name');
           my $wordsection=&mt('section');
         $r->print(<<END);          $r->print(<<END);
 <table border=2>  <table border=2>
 <tr><th>&nbsp;</th>  <tr><th>&nbsp;</th>
     <th>      <th>
        <a href="/adm/dropadd?action=$action&sortby=username">username</a>         <a href="/adm/dropadd?action=$action&sortby=username">$wordusername</a>
     </th><th>      </th><th>
        <a href="/adm/dropadd?action=$action&sortby=domain">domain</a>         <a href="/adm/dropadd?action=$action&sortby=domain">$worddomain</a>
     </th><th>      </th><th>
        <a href="/adm/dropadd?action=$action&sortby=id">ID</a>         <a href="/adm/dropadd?action=$action&sortby=id">ID</a>
     </th><th>      </th><th>
        <a href="/adm/dropadd?action=$action&sortby=fullname">student name</a>         <a href="/adm/dropadd?action=$action&sortby=fullname">$wordstudentname</a>
     </th><th>      </th><th>
        <a href="/adm/dropadd?action=$action&sortby=section">section</a>         <a href="/adm/dropadd?action=$action&sortby=section">$wordsection</a>
     </th>      </th>
 </tr>  </tr>
 END  END
Line 1627  END Line 1582  END
 END  END
     }      }
     $r->print('</table><br>');      $r->print('</table><br>');
       my $DropStudents=&mt('Drop Students');
       my $CheckAll=&mt('check all');
       my $UncheckAll=&mt('uncheck all');
     $r->print(<<"END");      $r->print(<<"END");
 </p><p>  </p><p>
 <input type="button" value="check all" onclick="javascript:checkAll(document.studentform.droplist)"> &nbsp;  <input type="button" value="$CheckAll" onclick="javascript:checkAll(document.studentform.droplist)"> &nbsp;
 <input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.studentform.droplist)">   <input type="button" value="$UncheckAll" onclick="javascript:uncheckAll(document.studentform.droplist)"> 
 <p><input type=submit value="Drop Students"></p>  <p><input type=submit value="$DropStudents"></p>
 END  END
     return;      return;
 }  }
Line 1653  sub print_first_courselist_upload_form { Line 1611  sub print_first_courselist_upload_form {
     $str .= '<input type="checkbox" name="noFirstLine" /> '.      $str .= '<input type="checkbox" name="noFirstLine" /> '.
         &mt('Ignore First Line')."</p>\n";          &mt('Ignore First Line')."</p>\n";
     $str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List",      $str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List",
                          "How do I create a class list from a spreadsheet").                           &mt("How do I create a class list from a spreadsheet")).
                              "<br />\n";                               "<br />\n";
     $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",      $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
                            "How do I create a CSV file from a spreadsheet").                             &mt("How do I create a CSV file from a spreadsheet")).
                                "<br />\n";                                 "<br />\n";
     $str .= "</body>\n</html>\n";      $str .= "</body>\n</html>\n";
     $r->print($str);      $r->print($str);

Removed from v.1.91.2.2  
changed lines
  Added in v.1.92


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