--- loncom/interface/Attic/lonspreadsheet.pm	2002/09/10 21:11:23	1.100.2.2
+++ loncom/interface/Attic/lonspreadsheet.pm	2002/09/27 20:41:25	1.100.4.2
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.100.2.2 2002/09/10 21:11:23 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.100.4.2 2002/09/27 20:41:25 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -822,7 +822,7 @@ sub sett {
 
 # Deal with the normal cells
     foreach (keys(%f)) {
-	if (($f{$_}) && ($_!~/template\_/)) {
+	if (exists($f{$_}) && ($_!~/template\_/)) {
             my $matches=($_=~/^$pattern(\d+)/);
             if  (($matches) && ($1)) {
 	        unless ($f{$_}=~/^\!/) {
@@ -1187,9 +1187,14 @@ sub rown {
 	   if ($vl eq '') {
 	       $vl='<font size=+2 color='.$bgcolor.'>&#35;</font>';
            }
-           $rowdata.=
-       '<td bgcolor='.$bgcolor.'><a href="javascript:celledit('.$fm.');">'.$vl.
-	       '</a></td>';
+           $rowdata.='<td bgcolor='.$bgcolor.'>';
+           if ($ENV{'request.role'} =~ /^st\./) {
+               $rowdata.=$vl;
+           } else {
+               $rowdata.='<a href="javascript:celledit('.$fm.');">'.
+                   $vl.'</a>';
+           }
+           $rowdata.='</td>';
        } else {
            $rowdata.='<td bgcolor='.$bgcolor.'>&nbsp;'.$vl.'&nbsp;</td>';
        }
@@ -2461,6 +2466,11 @@ sub handler {
       return OK;
     }
 
+    if ($ENV{'request.role'} =~ /^st\./) {
+        delete $ENV{'form.unewfield'}   if (exists($ENV{'form.unewfield'}));
+        delete $ENV{'form.unewformula'} if (exists($ENV{'form.unewformula'}));
+    }
+
 # ---------------------------------------------------- Global directory configs
 
 $includedir=$r->dir_config('lonIncludes');
@@ -2506,7 +2516,8 @@ $tmpdir=$r->dir_config('lonDaemons').'/t
 # --------------------------------------------------------------- Screen output
 
     $r->print('<html><head><title>LON-CAPA Spreadsheet</title>');
-    $r->print(<<ENDSCRIPT);
+    if ($ENV{'request.role'} !~ /^st\./) {
+        $r->print(<<ENDSCRIPT);
 <script language="JavaScript">
 
     function celledit(cn,cf) {
@@ -2532,6 +2543,7 @@ $tmpdir=$r->dir_config('lonDaemons').'/t
 
 </script>
 ENDSCRIPT
+    }
     $r->print('</head><body bgcolor="#FFFFFF">'.
        '<img align=right src=/adm/lonIcons/lonlogos.gif>'.
        '<h1>LON-CAPA Spreadsheet</h1>'.