--- loncom/interface/londocs.pm 2013/08/06 14:18:52 1.556 +++ loncom/interface/londocs.pm 2013/08/07 00:03:24 1.557 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.556 2013/08/06 14:18:52 raeburn Exp $ +# $Id: londocs.pm,v 1.557 2013/08/07 00:03:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -56,6 +56,7 @@ my $hashtied; my %alreadyseen=(); my $hadchanges; +my $suppchanges; my %help=(); @@ -79,7 +80,11 @@ sub storemap { $map,1,$report); if ($errtext) { return ($errtext,2); } - $hadchanges=1; + if ($map =~ /^default/) { + $hadchanges=1; + } else { + $suppchanges=1; + } return ($errtext,0); } @@ -402,6 +407,11 @@ END } my ($errtext,$fatal) = &storemap($coursenum, $coursedom, $folder.'.'.$container,1); + unless ($fatal) { + if ($folder =~ /^supplemental/) { + &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); + } + } return ($errtext,$fatal,$fixuperrors); } @@ -4976,7 +4986,19 @@ my %suporderhash = ( $supplementalflag,\%suporderhash,$iconpath,$pathitem); if ($error) { $r->print('

'.$error.'

'); - } + } else { + if ($suppchanges) { + my %servers = &Apache::lonnet::internet_dom_servers($coursedom); + my @ids=&Apache::lonnet::current_machine_ids(); + foreach my $server (keys(%servers)) { + next if (grep(/^\Q$server\E$/,@ids)); + my $hashid=$coursenum.':'.$coursedom; + &Apache::lonnet::remote_devalidate_cache($server,'suppcount',$hashid); + } + &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); + undef($suppchanges); + } + } } } elsif ($supplementalflag) { my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,