[LON-CAPA-cvs] cvs: loncom /interface londropadd.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 27 Feb 2004 14:59:19 -0000


matthew		Fri Feb 27 09:59:19 2004 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Fixed: &print_html_classlist now properly indicates the currently selected
  output format.
  Added Excel formatting to output.
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.103 loncom/interface/londropadd.pm:1.104
--- loncom/interface/londropadd.pm:1.103	Thu Feb 26 17:42:21 2004
+++ loncom/interface/londropadd.pm	Fri Feb 27 09:59:19 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.103 2004/02/26 22:42:21 matthew Exp $
+# $Id: londropadd.pm,v 1.104 2004/02/27 14:59:19 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1145,7 +1145,7 @@
         foreach my $outputformat ('html','csv','excel') {
             my $option = '<option value="'.$outputformat.'" ';
             if ($outputformat eq $ENV{'form.state'}) {
-                $option .= 'checked ';
+                $option .= 'selected ';
             }
             $option .='>'.$lt{$outputformat}.'</option>';
             $output_selector .= "\n".$option;
@@ -1183,7 +1183,7 @@
     my $cid=$ENV{'request.course.id'};
     #
     # 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
     my ($CSVfile,$CSVfilename);
@@ -1267,14 +1267,16 @@
         $excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'.
                                                        $excel_filename);
         $excel_workbook->set_tempdir('/home/httpd/perl/tmp');
+        #
+        $format = &Apache::loncommon::define_excel_formats($excel_workbook);
         $excel_sheet = $excel_workbook->addworksheet('classlist');
         #
         my $description = 'Class List for '.
             $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",
-                                      "student name","section","status"]);
+                                      "student name","section","status"],$format->{'bold'});
     }
     #
     # Sort the students