--- loncom/interface/londocs.pm 2006/11/12 06:29:33 1.248
+++ loncom/interface/londocs.pm 2006/11/13 01:57:57 1.249
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.248 2006/11/12 06:29:33 albertel Exp $
+# $Id: londocs.pm,v 1.249 2006/11/13 01:57:57 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1001,6 +1001,7 @@ sub log_docs {
my $parmidx;
my %parmaction=();
my %parmvalue=();
+ my $changedflag;
sub snapshotbefore {
@oldresources=@LONCAPA::map::resources;
@@ -1008,6 +1009,7 @@ sub log_docs {
$parmidx=undef;
%parmaction=();
%parmvalue=();
+ $changedflag=0;
}
sub remember_parms {
@@ -1015,11 +1017,12 @@ sub log_docs {
$parmidx=$idx;
$parmaction{$parameter}=$action;
$parmvalue{$parameter}=$value;
+ $changedflag=1;
}
sub log_differences {
- my $r=shift;
- my %storehash=('folder' => $env{'form.folder'});
+ my ($coursenum,$coursedom,$folder)=@_;
+ my %storehash=('folder' => '/uploaded/'.$coursedom.'/'.$coursenum.'/userfiles/'.$folder);
if ($parmidx) {
$storehash{'parameter_idx'}=$parmidx;
$storehash{'parameter_res'}=$oldresources[$parmidx];
@@ -1036,15 +1039,17 @@ sub log_docs {
if ($LONCAPA::map::resources[$idx] ne $oldresources[$idx]) {
$storehash{'before_resources_'.$idx}=$oldresources[$idx];
$storehash{'after_resources_'.$idx}=$LONCAPA::map::resources[$idx];
+ $changedflag=1;
}
if ($LONCAPA::map::order[$idx] ne $oldorder[$idx]) {
$storehash{'before_order_'.$idx}=$oldorder[$idx];
$storehash{'after_order_'.$idx}=$LONCAPA::map::order[$idx];
$storehash{'before_order_res_'.$idx}=$oldresources[$idx];
$storehash{'after_order_res_'.$idx}=$LONCAPA::map::resources[$idx];
+ $changedflag=1;
}
}
- &log_docs(\%storehash);
+ if ($changedflag) { &log_docs(\%storehash); }
}
}
@@ -1080,7 +1085,7 @@ sub docs_change_log {
$r->print('
'.$errtext.'
'); @@ -1356,7 +1362,8 @@ sub editor { $r->print(''.&mt('No map selected.').'
'); } } - &log_differences($r); + &log_differences($coursenum,$coursedom, + $folder.'.'.$container); } # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen