--- 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(''.&mt('[_1] Records',$countselect).''. ''); $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). - ''.&mt('Time').''.&mt('User').''.&mt('Extent').''.&mt('Users').''. + ''.&mt('Time').''.&mt('User').''.&mt('Folder').''.&mt('Users').''. &mt('Parameter').''.&mt('Part').''.&mt('New Value').''.&mt('Announce').''. &Apache::loncommon::end_data_table_header_row()); my $shown=0; @@ -1109,7 +1114,8 @@ sub docs_change_log { '.$about_me_link. '
'.$docslog{$id}{'exe_uname'}. ':'.$docslog{$id}{'exe_udom'}.''. - $send_msg_link.''); + $send_msg_link.''. + &Apache::lonnet::gettitle($docslog{$id}{'logentry'}{'folder'}).''); $r->print(&Apache::loncommon::end_data_table_row()); $shown++; @@ -1329,7 +1335,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 +1362,8 @@ sub editor { $r->print('

'.&mt('No map selected.').'

'); } } - &log_differences($r); + &log_differences($coursenum,$coursedom, + $folder.'.'.$container); } # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen