--- loncom/interface/spreadsheet/classcalc.pm 2003/09/10 14:47:42 1.13 +++ loncom/interface/spreadsheet/classcalc.pm 2003/10/14 18:36:54 1.14 @@ -1,5 +1,5 @@ # -# $Id: classcalc.pm,v 1.13 2003/09/10 14:47:42 matthew Exp $ +# $Id: classcalc.pm,v 1.14 2003/10/14 18:36:54 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,6 +58,7 @@ use HTML::Entities(); use Spreadsheet::WriteExcel; use Apache::lonnet; use Time::HiRes; +use Apache::lonlocal; @Apache::classcalc::ISA = ('Apache::Spreadsheet'); @@ -86,7 +87,7 @@ sub html_header { ['Enrollment Status',&Apache::lonhtmlcommon::StatusOptions(undef,undef,3)], ['Output Format',&Apache::Spreadsheet::output_selector()]) { my ($name,$selector) = @{$_}; - $toprow .= ''.$name.''; + $toprow .= ''.&mt($name).''; $bottomrow .= ''.$selector.''; } return "

\n\n". @@ -98,7 +99,7 @@ sub html_header { sub get_title { my $self = shift; # Section info should be included - my @title = ($self->{'coursedesc'}, scalar(localtime(time)) ); + my @title = ($self->{'coursedesc'}, &Apache::lonlocal::locallocaltime(time) ); return @title; } @@ -123,15 +124,25 @@ sub outsheet_html { my $exportcolor = '#BBBBFF'; my $num_uneditable = 26; my $num_left = 52-$num_uneditable; + my %lt=&Apache::lonlocal::texthash( + 'co' => 'Course', + 'im' => 'Import', + 'ca' => 'Calculations', + 'stu' => 'Student', + 'sta' => 'Status', + 'usr' => 'Username', + 'dom' => 'Domain', + 'sec' => 'Section', + ); my $tableheader =<<"END";

- + + $lt{'im'} + $lt{'ca'} END my $label_num = 0; @@ -149,21 +160,21 @@ END $r->print($tableheader); # # Print out template row - $r->print(''. + $r->print(''. $self->html_template_row($num_uneditable,$importcolor). "\n"); # # Print out summary/export row - $r->print(''. + $r->print(''. $self->html_export_row($exportcolor)."\n"); # # Prepare to output rows $tableheader =<<"END";

Course$lt{'co'} - Import - Calculations
Template 
'.&mt('Template').' 
Summary0
'.&mt('Summary').'0
- - - + + + END foreach (split(//,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')){ if ($label_num<$num_uneditable) { @@ -206,8 +217,8 @@ sub excel_rows { # # Write a header row $cols_output = 0; - foreach my $value ('fullname','username','domain','section','status','id') { - $worksheet->write($rows_output,$cols_output++,$value); + foreach my $value ('Fullname','Username','Domain','Section','Status','ID') { + $worksheet->write($rows_output,$cols_output++,&mt($value)); } $rows_output++; # @@ -238,7 +249,7 @@ sub csv_rows { # Write a header row $self->csv_output_row($filehandle,undef, - ('fullname','username','domain','section','status','id')); + (&mt('Fullname'),&mt('Username'),&mt('Domain'),&mt('Section'),&mt('Status'),&mt('ID'))); # # Write each students row foreach my $student (@Students) { @@ -270,13 +281,13 @@ sub compute { my %c = $self->constants(); my %f = $self->formulas(); my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin - ($r,'Spreadsheet Computation Status', - 'Spreadsheet Computation', scalar(@Students)); + ($r,&mt('Spreadsheet Computation Status'), + &mt('Spreadsheet Computation'), scalar(@Students)); &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, - 'Processing course structure'); + &mt('Processing course structure')); &Apache::studentcalc::initialize_package(); &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, - 'Processing first student'); + &mt('Processing first student')); foreach my $student (@Students) { if ($connection->aborted()) { $self->cleanup(); return; } my $sname = $student->{'username'}.':'.$student->{'domain'};
Rowstudentusernamedomainsectionstatus
$lt{'ro'}$lt{'stu'}$lt{'usr'}$lt{'dom'}$lt{'sec'}$lt{'sta'}