--- loncom/interface/londocs.pm 2006/11/12 02:13:05 1.247
+++ loncom/interface/londocs.pm 2006/11/13 15:02:58 1.250
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.247 2006/11/12 02:13:05 www Exp $
+# $Id: londocs.pm,v 1.250 2006/11/13 15:02:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1001,13 +1001,15 @@ sub log_docs {
my $parmidx;
my %parmaction=();
my %parmvalue=();
+ my $changedflag;
sub snapshotbefore {
- @oldresources=@Apache::lonratedt::resources;
- @oldorder=@Apache::lonratedt::order;
+ @oldresources=@LONCAPA::map::resources;
+ @oldorder=@LONCAPA::map::order;
$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];
@@ -1029,22 +1032,24 @@ sub log_docs {
}
}
my $maxidx=$#oldresources;
- if ($#Apache::lonratedt::resources>$#oldresources) {
- $maxidx=$#Apache::lonratedt::resources;
+ if ($#LONCAPA::map::resources>$#oldresources) {
+ $maxidx=$#LONCAPA::map::resources;
}
for (my $idx=0; $idx<=$maxidx; $idx++) {
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.'
'); + return; + } } if ($env{'form.newpos'}) { @@ -1329,7 +1341,7 @@ sub editor { } } # Store the changed version - ($errtext,$fatal)=group_import($coursenum, $coursedom, $folder, + ($errtext,$fatal)=&group_import($coursenum, $coursedom, $folder, $container,'londocs',@imports); if ($fatal) { $r->print(''.$errtext.'
'); @@ -1356,7 +1368,8 @@ sub editor { $r->print(''.&mt('No map selected.').'
'); } } - &log_differences($r); + &log_differences($coursenum,$coursedom, + $folder.'.'.$container); } # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen