--- loncom/interface/londocs.pm 2006/11/12 06:29:33 1.248 +++ loncom/interface/londocs.pm 2006/11/13 17:20:29 1.251 @@ -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.251 2006/11/13 17:20:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -954,6 +954,7 @@ sub breadcrumbs { } my $folderpath; my $cpinfo=''; + my $plain=''; if ($env{'form.markedcopy_url'}) { $cpinfo='&markedcopy_url='. &escape($env{'form.markedcopy_url'}). @@ -986,9 +987,11 @@ sub breadcrumbs { 'text'=>''. $name.'' }); + $plain.=$name.' > '; } + $plain=~s/\>\;\s*$//; return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', - 'LC_docs_path'),$randompick,$ishidden,$isencrypted); + 'LC_docs_path'),$randompick,$ishidden,$isencrypted,$plain); } sub log_docs { @@ -1001,6 +1004,7 @@ sub log_docs { my $parmidx; my %parmaction=(); my %parmvalue=(); + my $changedflag; sub snapshotbefore { @oldresources=@LONCAPA::map::resources; @@ -1008,6 +1012,7 @@ sub log_docs { $parmidx=undef; %parmaction=(); %parmvalue=(); + $changedflag=0; } sub remember_parms { @@ -1015,11 +1020,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 ($plain)=@_; + my %storehash=('folder' => $plain); if ($parmidx) { $storehash{'parameter_idx'}=$parmidx; $storehash{'parameter_res'}=$oldresources[$parmidx]; @@ -1036,15 +1042,18 @@ 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); + $storehash{'maxidx'}=$maxidx; + if ($changedflag) { &log_docs(\%storehash); } } } @@ -1080,8 +1089,8 @@ 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('Parameter').''.&mt('Part').''.&mt('New Value').''.&mt('Announce').''. + ''.&mt('Time').''.&mt('User').''.&mt('Folder').''.&mt('Before').''. + &mt('After').''. &Apache::loncommon::end_data_table_header_row()); my $shown=0; foreach my $id (sort { $docslog{$b}{'exe_time'}<=>$docslog{$a}{'exe_time'} } (keys(%docslog))) { @@ -1109,9 +1118,28 @@ sub docs_change_log { '.$about_me_link. '
'.$docslog{$id}{'exe_uname'}. ':'.$docslog{$id}{'exe_udom'}.''. - $send_msg_link.''); + $send_msg_link.''. + $docslog{$id}{'logentry'}{'folder'}.''); +# Before + for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) { + my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0]; + my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0]; + if ($oldname ne $newname) { + $r->print(&LONCAPA::map::qtunescape($oldname)); + } + } +# After + $r->print(''); - $r->print(&Apache::loncommon::end_data_table_row()); + for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) { + my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0]; + my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0]; + if ($oldname ne $newname) { + $r->print(&LONCAPA::map::qtunescape($newname)); + } + } +# End + $r->print(''.&Apache::loncommon::end_data_table_row()); $shown++; if (!($env{'form.show'} eq &mt('all') || $shown<=$env{'form.show'})) { last; } @@ -1142,7 +1170,7 @@ sub editor { $env{'form.markedcopy_title'}=$title; $env{'form.markedcopy_url'}=$url; } - my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted)=&breadcrumbs($folder); + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain)=&breadcrumbs($folder); $r->print($breadcrumbtrail); if ($fatal) { $r->print('

'.$errtext.'

'); @@ -1177,6 +1205,12 @@ sub editor { &LONCAPA::map::delparameter($idx,'parameter_encrypturl'); &remember_parms($idx,'encrypturl','del'); } +# store the changed version + ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); + if ($fatal) { + $r->print('

'.$errtext.'

'); + return; + } } if ($env{'form.newpos'}) { @@ -1329,7 +1363,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 +1390,7 @@ sub editor { $r->print('

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

'); } } - &log_differences($r); + &log_differences($plain); } # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen