\n";
+ }
+ ##
+ ## Editing code
+ $result .=&hiddenfield('cell','').
+ &hiddenfield('newformula','');
+ ##
+ ## Create the save and load dialogs
+ my $filename = $spreadsheet->filename();
+ $filename = 'Default' if ($filename =~ /^default\.$sheettype/i);
+ $filename =~ s/_$sheettype$//;
+ my $save_dialog = ''.
+ ' '.
+ ''.
+ '';
+ my $makedefault_dialog = '';
+ #
+ my $link = 'Browse";
+ my $load_dialog = <
+
+
+
+ $link
+
+
+
\n\n";
+ #
+ $result .=<
+
+
+
$load_dialog
+
+
+
$save_dialog
+
$makedefault_dialog
+
+
+
+
+END
+ return $result;
+}
+
sub handler {
my $r=shift;
#
@@ -99,7 +194,7 @@ sub handler {
# Check the course homeserver
$loaderror= &Apache::lonnet::overloaderror($r,
$ENV{'course.'.$ENV{'request.course.id'}.'.home'});
- if ($loaderror) { return $loaderror; }
+# if ($loaderror) { return $loaderror; }
#
# HTML Header
#
@@ -149,13 +244,20 @@ sub handler {
$r->header_out('Cache-control','no-cache');
$r->header_out('Pragma','no-cache');
$r->send_http_header;
+ ##
+ ## Check permissions
+ my $allowed_to_edit = &Apache::lonnet::allowed('mgr',
+ $ENV{'request.course.id'});
+ my $allowed_to_view = &Apache::lonnet::allowed('vgr',
+ $ENV{'request.course.id'});
+
#
- # Check user permissions - only those able to view others grades
- # will be allowed to continue if they are not requesting their own.
+ # Only those able to view others grades will be allowed to continue
+ # if they are not requesting their own.
if (($sheettype eq 'classcalc') ||
($name ne $ENV{'user.name'} ) ||
($domain ne $ENV{'user.domain'})) {
- if (! &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {
+ if (! $allowed_to_view) {
$r->print('