[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 13 Nov 2006 17:20:30 -0000
www Mon Nov 13 12:20:30 2006 EDT
Modified files:
/loncom/interface londocs.pm
Log:
Saving my work: doclogs
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.250 loncom/interface/londocs.pm:1.251
--- loncom/interface/londocs.pm:1.250 Mon Nov 13 10:02:58 2006
+++ loncom/interface/londocs.pm Mon Nov 13 12:20:29 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.250 2006/11/13 15:02:58 www 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 @@
}
my $folderpath;
my $cpinfo='';
+ my $plain='';
if ($env{'form.markedcopy_url'}) {
$cpinfo='&markedcopy_url='.
&escape($env{'form.markedcopy_url'}).
@@ -986,9 +987,11 @@
'text'=>'<font size="+1">'.
$name.'</font>'
});
+ $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 {
@@ -1021,8 +1024,8 @@
}
sub log_differences {
- my ($coursenum,$coursedom,$folder)=@_;
- my %storehash=('folder' => '/uploaded/'.$coursedom.'/'.$coursenum.'/userfiles/'.$folder);
+ my ($plain)=@_;
+ my %storehash=('folder' => $plain);
if ($parmidx) {
$storehash{'parameter_idx'}=$parmidx;
$storehash{'parameter_res'}=$oldresources[$parmidx];
@@ -1049,6 +1052,7 @@
$changedflag=1;
}
}
+ $storehash{'maxidx'}=$maxidx;
if ($changedflag) { &log_docs(\%storehash); }
}
}
@@ -1085,8 +1089,8 @@
$r->print('<nobr>'.&mt('[_1] Records',$countselect).'</nobr>'.
'<input type="submit" value="'.&mt('Display').'" /></form>');
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
- '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Folder').'</th><th>'.&mt('Users').'</th><th>'.
- &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'.
+ '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Folder').'</th><th>'.&mt('Before').'</th><th>'.
+ &mt('After').'</th>'.
&Apache::loncommon::end_data_table_header_row());
my $shown=0;
foreach my $id (sort { $docslog{$b}{'exe_time'}<=>$docslog{$a}{'exe_time'} } (keys(%docslog))) {
@@ -1115,9 +1119,27 @@
'<br /><tt>'.$docslog{$id}{'exe_uname'}.
':'.$docslog{$id}{'exe_udom'}.'</tt>'.
$send_msg_link.'</td><td>'.
- &Apache::lonnet::gettitle($docslog{$id}{'logentry'}{'folder'}).'</td>');
-
- $r->print(&Apache::loncommon::end_data_table_row());
+ $docslog{$id}{'logentry'}{'folder'}.'</td><td>');
+# 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('</td><td>');
+
+ 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('</td>'.&Apache::loncommon::end_data_table_row());
$shown++;
if (!($env{'form.show'} eq &mt('all')
|| $shown<=$env{'form.show'})) { last; }
@@ -1148,7 +1170,7 @@
$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('<p><font color="red">'.$errtext.'</font></p>');
@@ -1368,8 +1390,7 @@
$r->print('<p><font color="red">'.&mt('No map selected.').'</font></p>');
}
}
- &log_differences($coursenum,$coursedom,
- $folder.'.'.$container);
+ &log_differences($plain);
}
# ---------------------------------------------------------------- End commands
# ---------------------------------------------------------------- Print screen