[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet assesscalc.pm studentcalc.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 19 May 2003 15:48:18 -0000


matthew		Mon May 19 11:48:18 2003 EDT

  Modified files:              
    /loncom/interface/spreadsheet	assesscalc.pm studentcalc.pm 
  Log:
  Modified $spreadsheet->title() subroutines to look prettier, link to the 
  students 'aboutme' page, and call &Apache::loncoursedata::GetUserName.
  
  
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.1 loncom/interface/spreadsheet/assesscalc.pm:1.2
--- loncom/interface/spreadsheet/assesscalc.pm:1.1	Fri May 16 16:55:11 2003
+++ loncom/interface/spreadsheet/assesscalc.pm	Mon May 19 11:48:18 2003
@@ -1,5 +1,5 @@
 #
-# $Id: assesscalc.pm,v 1.1 2003/05/16 20:55:11 matthew Exp $
+# $Id: assesscalc.pm,v 1.2 2003/05/19 15:48:18 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,6 +46,7 @@
 use strict;
 use Apache::Constants qw(:common :http);
 use Apache::lonnet;
+use Apache::loncommon;
 use Apache::Spreadsheet;
 use HTML::Entities();
 use Spreadsheet::WriteExcel;
@@ -321,7 +322,17 @@
     } else {
         $title = '<h1>'.&Apache::lonnet::gettitle($self->{'symb'})."</h1>\n";
     }
-    $title .= '<h2>'.$self->{'name'}.'@'.$self->{'domain'}."</h2>\n";
+    # Look up the users identifying information
+    # Get the users information
+    my %userenv = &Apache::loncoursedata::GetUserName($self->{'name'},
+                                                      $self->{'domain'});
+    my $name = 
+        join(' ',@userenv{'firstname','middlename','lastname','generation'});
+    $name =~ s/\s+$//;
+    $title .= '<h2>'.$name.', '.
+        &Apache::loncommon::aboutmewrapper($self->{'name'}.'@'.$self->{'domain'},
+                                           $self->{'name'},$self->{'domain'}).
+                                           "</h2>\n";
     $title .= '<h3>'.localtime(time).'</h3>';
     #
     return $title;
Index: loncom/interface/spreadsheet/studentcalc.pm
diff -u loncom/interface/spreadsheet/studentcalc.pm:1.2 loncom/interface/spreadsheet/studentcalc.pm:1.3
--- loncom/interface/spreadsheet/studentcalc.pm:1.2	Mon May 19 10:34:54 2003
+++ loncom/interface/spreadsheet/studentcalc.pm	Mon May 19 11:48:18 2003
@@ -1,5 +1,5 @@
 #
-# $Id: studentcalc.pm,v 1.2 2003/05/19 14:34:54 matthew Exp $
+# $Id: studentcalc.pm,v 1.3 2003/05/19 15:48:18 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -48,9 +48,11 @@
 use strict;
 use Apache::Constants qw(:common :http);
 use Apache::lonnet;
+use Apache::loncommon();
+use Apache::loncoursedata();
 use Apache::lonnavmaps;
-use Apache::Spreadsheet;
-use Apache::assesscalc;
+use Apache::Spreadsheet();
+use Apache::assesscalc();
 use HTML::Entities();
 use Spreadsheet::WriteExcel;
 use Time::HiRes;
@@ -90,8 +92,22 @@
 sub get_title {
     my $self = shift;
     my $title = '';
-    $title .= '<h2>Spreadsheet for '.
-        $self->{'name'}.'@'.$self->{'domain'}.'</h2>';
+    my %userenv = &Apache::loncoursedata::GetUserName($self->{'name'},
+                                                      $self->{'domain'});
+    &Apache::lonnet::logthis('userenv = '.join(' ',%userenv));
+    my $name = 
+        join(' ',@userenv{'firstname','middlename','lastname','generation'});
+    $name =~ s/\s+$//;
+    $title .= '<h1>'.$name;
+    if ($ENV{'user.name'} ne $self->{'name'} && 
+        $ENV{'user.domain'} ne $self->{'domain'}) {
+        $title .= &Apache::loncommon::aboutmewrapper
+                                    ($self->{'name'}.'@'.$self->{'domain'},
+                                     $self->{'name'},$self->{'domain'});
+    }
+    $title .= "</h1>\n";
+    $title .= '<h2>'.$self->{'coursedesc'}."</h2>\n";
+    $title .= '<h3>'.localtime(time).'</h3>';
     return $title;
 }