--- loncom/interface/spreadsheet/lonspreadsheet.pm 2004/01/15 03:18:20 1.32 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2004/04/26 14:06:00 1.37 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.32 2004/01/15 03:18:20 www Exp $ +# $Id: lonspreadsheet.pm,v 1.37 2004/04/26 14:06:00 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,9 +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::loncommon::help_open_faq(134). - &Apache::loncommon::help_open_bug('Spreadsheet'). + &Apache::lonhtmlcommon::breadcrumbs(undef,'Spreadsheet'). '
'); $r->print(&hiddenfield('sname' ,$ENV{'form.sname'}). &hiddenfield('sdomain',$ENV{'form.sdomain'}). @@ -391,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). + '

'); } } }