Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.109 and 1.112

version 1.109, 2002/09/10 19:04:13 version 1.112, 2002/09/27 20:40:19
Line 852  sub sett { Line 852  sub sett {
     }      }
     # Deal with the normal cells      # Deal with the normal cells
     foreach (keys(%f)) {      foreach (keys(%f)) {
  if (($f{$_}) && ($_!~/template\_/)) {   if (exists($f{$_}) && ($_!~/template\_/)) {
             my $matches=($_=~/^$pattern(\d+)/);              my $matches=($_=~/^$pattern(\d+)/);
             if  (($matches) && ($1)) {              if  (($matches) && ($1)) {
         unless ($f{$_}=~/^\!/) {          unless ($f{$_}=~/^\!/) {
Line 1226  sub rown { Line 1226  sub rown {
                 if ($vl eq '') {                  if ($vl eq '') {
                     $vl='<font size=+2 color='.$bgcolor.'>&#35;</font>';                      $vl='<font size=+2 color='.$bgcolor.'>&#35;</font>';
                 }                  }
                 $rowdata.='<td bgcolor='.$bgcolor.'>'.                  $rowdata.='<td bgcolor='.$bgcolor.'>';
                     '<a href="javascript:celledit('.$fm.');">'.$vl.'</a></td>';                  if ($ENV{'request.role'} =~ /^st\./) {
                       $rowdata.=$vl;
                   } else {
                       $rowdata.='<a href="javascript:celledit('.$fm.');">'.
                           $vl.'</a>';
                   }
                   $rowdata.='</td>';
             } else {              } else {
                 $rowdata.='<td bgcolor='.$bgcolor.'>&nbsp;'.$vl.'&nbsp;</td>';                  $rowdata.='<td bgcolor='.$bgcolor.'>&nbsp;'.$vl.'&nbsp;</td>';
             }              }
Line 1299  sub outsheet { Line 1305  sub outsheet {
         push (@sortby, $safeeval->reval('$f{"A'.$row.'"}'));          push (@sortby, $safeeval->reval('$f{"A'.$row.'"}'));
         push (@sortidx, $row-1);          push (@sortidx, $row-1);
     }      }
     @sortidx=sort { $sortby[$a] cmp $sortby[$b]; } @sortidx;      @sortidx=sort { lc($sortby[$a]) cmp lc($sortby[$b]); } @sortidx;
     #      #
     # Determine the type of child spreadsheets      # Determine the type of child spreadsheets
     my $what='Student';      my $what='Student';
Line 2412  sub cachedssheets { Line 2418  sub cachedssheets {
 # Interactive call to screen  # Interactive call to screen
 #  #
 #  #
   
   
 sub handler {  sub handler {
     my $r=shift;      my $r=shift;
   
       my $loaderror=&Apache::lonnet::overloaderror($r);
       if ($loaderror) { return $loaderror; }
       $loaderror= &Apache::lonnet::overloaderror($r,
                         $ENV{'course.'.$ENV{'request.course.id'}.'.home'});
       if ($loaderror) { return $loaderror; } 
   
     if ($r->header_only) {      if ($r->header_only) {
         $r->content_type('text/html');          $r->content_type('text/html');
         $r->send_http_header;          $r->send_http_header;
Line 2434  sub handler { Line 2445  sub handler {
     # Get query string for limited number of parameters      # Get query string for limited number of parameters
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['uname','udom','usymb','ufn']);                                              ['uname','udom','usymb','ufn']);
       if ($ENV{'request.role'} =~ /^st\./) {
           delete $ENV{'form.unewfield'}   if (exists($ENV{'form.unewfield'}));
           delete $ENV{'form.unewformula'} if (exists($ENV{'form.unewformula'}));
       }
     if (($ENV{'form.usymb'}=~/^\_(\w+)/) && (!$ENV{'form.ufn'})) {      if (($ENV{'form.usymb'}=~/^\_(\w+)/) && (!$ENV{'form.ufn'})) {
         $ENV{'form.ufn'}='default_'.$1;          $ENV{'form.ufn'}='default_'.$1;
     }      }
Line 2460  sub handler { Line 2475  sub handler {
     $r->send_http_header;      $r->send_http_header;
     # Screen output      # Screen output
     $r->print('<html><head><title>LON-CAPA Spreadsheet</title>');      $r->print('<html><head><title>LON-CAPA Spreadsheet</title>');
     $r->print(<<ENDSCRIPT);      if ($ENV{'request.role'} !~ /^st\./) {
           $r->print(<<ENDSCRIPT);
 <script language="JavaScript">  <script language="JavaScript">
   
     function celledit(cn,cf) {      function celledit(cn,cf) {
Line 2486  sub handler { Line 2502  sub handler {
   
 </script>  </script>
 ENDSCRIPT  ENDSCRIPT
       }
     $r->print('</head>'.&Apache::loncommon::bodytag('Grades Spreadsheet').      $r->print('</head>'.&Apache::loncommon::bodytag('Grades Spreadsheet').
               '<form action="'.$r->uri.'" name=sheet method=post>');                '<form action="'.$r->uri.'" name=sheet method=post>');
     $r->print(&hiddenfield('uname',$ENV{'form.uname'}).      $r->print(&hiddenfield('uname',$ENV{'form.uname'}).

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


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