--- loncom/interface/spreadsheet/lonspreadsheet.pm 2003/11/21 18:18:04 1.30 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2004/06/08 15:55:38 1.38 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.30 2003/11/21 18:18:04 albertel Exp $ +# $Id: lonspreadsheet.pm,v 1.38 2004/06/08 15:55:38 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -240,7 +240,8 @@ sub handler { # Get query string for limited number of parameters # &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename','recalc']); + ($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename','recalc', + 'output_format','not_first_run']); # # Deal with restricted student permissions # @@ -256,10 +257,12 @@ sub handler { $symb = $ENV{'form.usymb'} if (exists($ENV{'form.usymb'})); my $name = $ENV{'user.name'}; my $domain = $ENV{'user.domain'}; - if (exists($ENV{'form.sname'})) { + if (exists($ENV{'form.sname'}) && $ENV{'form.sname'} ne '') { $name = $ENV{'form.sname'}; $domain = $ENV{'form.sdomain'}; } + $ENV{'form.sname'} = $name; + $ENV{'form.sdomain'} = $domain; ## ## Check permissions my $allowed_to_edit = &Apache::lonnet::allowed('mgr', @@ -365,7 +368,15 @@ sub handler { ENDSCRIPT } + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &Apache::lonhtmlcommon::add_breadcrumb + ({href => $r->uri, + title => 'Spreadsheet', + text => 'Spreadsheet', + faq => 134, + bug => 'Spreadsheet'}); $r->print(''.&Apache::loncommon::bodytag('Grades Spreadsheet'). + &Apache::lonhtmlcommon::breadcrumbs(undef,'Spreadsheet'). '
'); $r->print(&hiddenfield('sname' ,$ENV{'form.sname'}). &hiddenfield('sdomain',$ENV{'form.sdomain'}). @@ -389,23 +400,35 @@ ENDSCRIPT &Apache::loncoursedata::delete_caches($ENV{'requres.course.id'}); } if ($ENV{'form.recalc'} eq 'ilovewastingtime') { - &Apache::lonnet::logthis('ilovewastingtime'); + &Apache::lonnet::logthis('spreadsheet expired: entire course'); # expire ALL spreadsheets &Apache::lonnet::expirespread('','','studentcalc'); &Apache::lonnet::expirespread('','','assesscalc'); + $r->print('

'. + &mt('Expired spreadsheet caches for all students'). + '

'); } elsif ($ENV{'form.recalc'} =~ /^symb:/) { # expire for all students on this symb my ($symb) = ($ENV{'form.recalc'} =~ /^symb:(.*)$/); - &Apache::lonnet::logthis('symb = '.$symb); + &Apache::lonnet::logthis('spreadsheet expired: symb = '.$symb); &Apache::lonnet::expirespread('','','assesscalc',$symb); &Apache::lonnet::expirespread('','','studentcalc'); + $r->print('

'. + &mt('Expired spreadsheet caches for all students for symb [_1]', + $symb). + '

'); } elsif ($ENV{'form.recalc'} =~ /^student:/) { # expire all assessment spreadsheets for this user my ($sname,$sdom) = ($ENV{'form.recalc'}=~/^student:(.*):(.*)$/); - &Apache::lonnet::logthis('student = '.$sname.':'.$sdom); + &Apache::lonnet::logthis('spreadsheet expired: student = '. + $sname.'@'.$sdom); if (defined($sname) && defined($sdom)) { &Apache::lonnet::expirespread($sname,$sdom,'assesscalc'); &Apache::lonnet::expirespread($sname,$sdom,'studentcalc'); + $r->print('

'. + &mt('Expired spreadsheet caches for student [_1]', + $sname.'@'.$sdom). + '

'); } } } @@ -450,8 +473,10 @@ ENDSCRIPT } $action_message .= '.'; } - $r->print(''. - '
'.$spreadsheet->html_header().''.$html."
\n"); + $r->print(''. + '
'. + $spreadsheet->html_header(). + ''.$html."
\n"); if ($action_message ne '') { $r->print(< @@ -470,11 +495,9 @@ END $r->rflush(); # $r->print(""); - if ($sheettype eq 'classcalc') { - $r->print(''); - } + $r->print(''); if ($allowed_to_view) { $r->print('
'. - ''. + ''. &Apache::loncommon::help_open_topic("Spreadsheet_About",