Diff for /loncom/interface/Attic/londropadd.pm between versions 1.103 and 1.109

version 1.103, 2004/02/26 22:42:21 version 1.109, 2004/05/12 20:04:57
Line 699  sub enroll_single_student { Line 699  sub enroll_single_student {
     $ENV{'form.csec'}=~s/\W//g;      $ENV{'form.csec'}=~s/\W//g;
     #      #
     # We do the dates first because the action of making them the defaul      # We do the dates first because the action of making them the defaul
     # in the course is entirely seperate 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) = &get_dates_from_form();
Line 1145  sub print_html_classlist { Line 1145  sub print_html_classlist {
         foreach my $outputformat ('html','csv','excel') {          foreach my $outputformat ('html','csv','excel') {
             my $option = '<option value="'.$outputformat.'" ';              my $option = '<option value="'.$outputformat.'" ';
             if ($outputformat eq $ENV{'form.state'}) {              if ($outputformat eq $ENV{'form.state'}) {
                 $option .= 'checked ';                  $option .= 'selected ';
             }              }
             $option .='>'.$lt{$outputformat}.'</option>';              $option .='>'.$lt{$outputformat}.'</option>';
             $output_selector .= "\n".$option;              $output_selector .= "\n".$option;
Line 1154  sub print_html_classlist { Line 1154  sub print_html_classlist {
         $r->print(&mt('Output Format: [_1]',$output_selector).('&nbsp;'x3));          $r->print(&mt('Output Format: [_1]',$output_selector).('&nbsp;'x3));
     }      }
     $r->print(&mt('Student Status: [_1]',$status_select)."\n");      $r->print(&mt('Student Status: [_1]',$status_select)."\n");
     $r->print('<input type="submit" value="'.&mt('Refresh Display').'" />'."\n</p>\n");      $r->print('<input type="submit" value="'.&mt('Update Display').'" />'.
                 "\n</p>\n");
   
     #      #
     # Print the classlist      # Print the classlist
Line 1183  sub show_class_list { Line 1184  sub show_class_list {
     my $cid=$ENV{'request.course.id'};      my $cid=$ENV{'request.course.id'};
     #      #
     # Variables for excel output      # Variables for excel output
     my ($excel_workbook, $excel_sheet, $excel_filename,$row);      my ($excel_workbook, $excel_sheet, $excel_filename,$row,$format);
     #      #
     # Variables for csv output      # Variables for csv output
     my ($CSVfile,$CSVfilename);      my ($CSVfile,$CSVfilename);
Line 1194  sub show_class_list { Line 1195  sub show_class_list {
     }      }
     # Print out header       # Print out header 
     $r->print(<<END);      $r->print(<<END);
   
   <input type="hidden" name="state" value="$ENV{'form.state'}" />
 <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="" />  
 END  END
     if ($mode eq 'view') {      if ($mode eq 'view') {
         if ($linkto eq 'aboutme') {          if ($linkto eq 'aboutme') {
Line 1211  END Line 1212  END
                        'sec'    => "section",                         'sec'    => "section",
    );     );
         $r->print(<<END);          $r->print(<<END);
   
 <input type="hidden" name="sortby" value="$sortby" />  
 <input type="hidden" name="sname"  value="" />  <input type="hidden" name="sname"  value="" />
 <input type="hidden" name="sdom"   value="" />  <input type="hidden" name="sdom"   value="" />
 <p>  <p>
 <table border=2>  <table border=2>
 <tr><th>  <tr><th>Count
       </th><th>
        <a href="javascript:document.studentform.sortby.value='username';document.studentform.submit();">$lt{'usrn'}</a>         <a href="javascript:document.studentform.sortby.value='username';document.studentform.submit();">$lt{'usrn'}</a>
     </th><th>      </th><th>
        <a href="javascript:document.studentform.sortby.value='domain';document.studentform.submit();">$lt{'dom'}</a>         <a href="javascript:document.studentform.sortby.value='domain';document.studentform.submit();">$lt{'dom'}</a>
Line 1267  END Line 1267  END
         $excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'.          $excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'.
                                                        $excel_filename);                                                         $excel_filename);
         $excel_workbook->set_tempdir('/home/httpd/perl/tmp');          $excel_workbook->set_tempdir('/home/httpd/perl/tmp');
           #
           $format = &Apache::loncommon::define_excel_formats($excel_workbook);
         $excel_sheet = $excel_workbook->addworksheet('classlist');          $excel_sheet = $excel_workbook->addworksheet('classlist');
         #          #
         my $description = 'Class List for '.          my $description = 'Class List for '.
             $ENV{'course.'.$ENV{'request.course.id'}.'.description'};              $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
         $excel_sheet->write($row++,0,$description);          $excel_sheet->write($row++,0,$description,$format->{'h1'});
         #          #
         $excel_sheet->write($row++,0,["username","domain","ID",          $excel_sheet->write($row++,0,["username","domain","ID",
                                       "student name","section","status"]);                                        "student name","section","status"],$format->{'bold'});
     }      }
     #      #
     # Sort the students      # Sort the students
Line 1293  END Line 1295  END
             ||              ||
         lc($classlist->{$a}->[$third]) cmp lc($classlist->{$b}->[$third])          lc($classlist->{$a}->[$third]) cmp lc($classlist->{$b}->[$third])
         } (keys(%$classlist));          } (keys(%$classlist));
       my $studentcount = 0;
     foreach my $student (@Sorted_Students) {      foreach my $student (@Sorted_Students) {
         my $username = $classlist->{$student}->[$index{'username'}];          my $username = $classlist->{$student}->[$index{'username'}];
         my $domain   = $classlist->{$student}->[$index{'domain'}];          my $domain   = $classlist->{$student}->[$index{'domain'}];
Line 1302  END Line 1305  END
         my $status   = $classlist->{$student}->[$index{'status'}];          my $status   = $classlist->{$student}->[$index{'status'}];
         next if (($statusmode ne 'Any') && ($status ne $statusmode));          next if (($statusmode ne 'Any') && ($status ne $statusmode));
         if ($mode eq 'view') {          if ($mode eq 'view') {
             $r->print("<tr>\n    <td>\n        ");              $r->print("<tr>\n    <td>".(++$studentcount)."</td><td>\n    ");
             if ($linkto eq 'nothing') {              if ($linkto eq 'nothing') {
                 $r->print($username);                  $r->print($username);
             } elsif ($linkto eq 'aboutme') {              } elsif ($linkto eq 'aboutme') {
Line 2160  sub handler { Line 2163  sub handler {
     } elsif ($ENV{'form.action'} eq 'upload') {      } elsif ($ENV{'form.action'} eq 'upload') {
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=upload&state=',              ({href=>'/adm/dropadd?action=upload&state=',
               text=>"Upload Classlist",                text=>"Upload Classlist"});
               faq=>9,bug=>'Instructor Interface',});  
         $r->print(&Apache::lonhtmlcommon::breadcrumbs          $r->print(&Apache::lonhtmlcommon::breadcrumbs
                   (undef,'Upload Classlist'));                    (undef,'Upload Classlist'));
         if (! exists($ENV{'form.state'})) {          if (! exists($ENV{'form.state'})) {
Line 2180  sub handler { Line 2182  sub handler {
     } elsif ($ENV{'form.action'} eq 'drop') {      } elsif ($ENV{'form.action'} eq 'drop') {
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=drop',              ({href=>'/adm/dropadd?action=drop',
               text=>"Drop Students",                text=>"Drop Students"});
               faq=>9,bug=>'Instructor Interface',});  
         $r->print(&Apache::lonhtmlcommon::breadcrumbs          $r->print(&Apache::lonhtmlcommon::breadcrumbs
                   (undef,'Drop Students'));                    (undef,'Drop Students'));
         if (! exists($ENV{'form.state'})) {          if (! exists($ENV{'form.state'})) {
Line 2194  sub handler { Line 2195  sub handler {
     } elsif ($ENV{'form.action'} eq 'enrollstudent') {      } elsif ($ENV{'form.action'} eq 'enrollstudent') {
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=enrollstudent',              ({href=>'/adm/dropadd?action=enrollstudent',
               text=>"Enroll Student",                text=>"Enroll Student"});
               faq=>9,bug=>'Instructor Interface',});  
         $r->print(&Apache::lonhtmlcommon::breadcrumbs          $r->print(&Apache::lonhtmlcommon::breadcrumbs
                   (undef,'Enroll Student'));                    (undef,'Enroll Student'));
         if (! exists($ENV{'form.state'})) {          if (! exists($ENV{'form.state'})) {
Line 2210  sub handler { Line 2210  sub handler {
     } elsif ($ENV{'form.action'} eq 'classlist') {      } elsif ($ENV{'form.action'} eq 'classlist') {
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=classlist',              ({href=>'/adm/dropadd?action=classlist',
               text=>"View Classlist",                text=>"View Classlist"});
               faq=>9,bug=>'Instructor Interface',});  
         $r->print(&Apache::lonhtmlcommon::breadcrumbs          $r->print(&Apache::lonhtmlcommon::breadcrumbs
                   (undef,'View Classlist'));                    (undef,'View Classlist'));
         if (! exists($ENV{'form.state'})) {          if (! exists($ENV{'form.state'})) {
Line 2226  sub handler { Line 2225  sub handler {
     } elsif ($ENV{'form.action'} eq 'modifystudent') {      } elsif ($ENV{'form.action'} eq 'modifystudent') {
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=modifystudent',              ({href=>'/adm/dropadd?action=modifystudent',
               text=>"Modify Student Data",                text=>"Modify Student Data"});
               faq=>9,bug=>'Instructor Interface',});  
         $r->print(&Apache::lonhtmlcommon::breadcrumbs          $r->print(&Apache::lonhtmlcommon::breadcrumbs
                   (undef,'Modify Student Data'));                    (undef,'Modify Student Data'));
         if (! exists($ENV{'form.state'})) {          if (! exists($ENV{'form.state'})) {

Removed from v.1.103  
changed lines
  Added in v.1.109


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