--- loncom/interface/londocs.pm 2025/01/04 21:16:45 1.718 +++ loncom/interface/londocs.pm 2025/01/07 01:25:57 1.719 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.718 2025/01/04 21:16:45 raeburn Exp $ +# $Id: londocs.pm,v 1.719 2025/01/07 01:25:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -884,7 +884,7 @@ ENDJS if (keys(%tocopy)) { my (%resdirs,%resfiles); &Apache::lonnet::recursedirs($is_course_home,1,undef,$res_exclude,0,0,$resurl,'',\%resdirs,\%resfiles); - my ($notopdir,%newdir,%newfile,%checkdeps); + my ($notopdir,%newdir,%newfile,%checkdeps,%newresfile); $r->print('

'.&mt('Copy to: [_1]', ''.$desturl.'/'.$subdir.''). '

'."\n"); @@ -1026,7 +1026,7 @@ ENDJS } } else { if (&File::Copy::copy($src,$dest)) { - $newfile{$file} = 1; + $newfile{$file} = $desturl.'/'.$subdir.'/'.$file; if ($embstyle eq 'ssi') { &crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); } @@ -1055,6 +1055,9 @@ ENDJS my $destresfile = $docroot.$destresurl.'/'.$subdir.'/'.$file; if (-e $dest) { my $output = &Apache::lonpublisher::batchpublish($r,$dest,$destresfile,$nokeyref,1); + if (-e $destresfile) { + $newresfile{$file} = $destresurl.'/'.$subdir.'/'.$file; + } } } } else { @@ -1065,7 +1068,7 @@ ENDJS } if ($needpriv) { if (&File::Copy::copy($src,$dest)) { - $newfile{$file} = 1; + $newfile{$file} = $desturl.'/'.$subdir.'/'.$file; if ($embstyle eq 'ssi') { &crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); } @@ -1099,7 +1102,7 @@ ENDJS if ($embstyle eq 'ssi') { &crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); } - $newfile{$file} = 1; + $newfile{$file} = $desturl.'/'.$subdir.'/'.$file; } } } else { @@ -1127,6 +1130,9 @@ ENDJS my $destresfile = $docroot.$destresurl.'/'.$subdir.'/'.$file; if (-e $dest) { my $output = &Apache::lonpublisher::batchpublish($r,$dest,$destresfile,$nokeyref,1); + if (-e $destresfile) { + $newresfile{$file} = $destresurl.'/'.$subdir.'/'.$file; + } } } } else { @@ -1140,7 +1146,7 @@ ENDJS if ($embstyle eq 'ssi') { &crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); } - $newfile{$file} = 1; + $newfile{$file} = $desturl.'/'.$subdir.'/'.$file; } } if ($needprivmeta) { @@ -1171,6 +1177,16 @@ ENDJS $r->print('

'.&mt('Copied the following files to [_1]:',''.$desturl.'/'.$subdir.''). '

'."\n". '

'."\n"); + foreach my $key (keys(%newfile)) { + my %storehash = ( + 'priv' => $newfile{$key}, + 'who' => $env{'user.name'}.':'.$env{'user.domain'}, + ); + if (exists($newresfile{$file})) { + $storehash{'res'} = 1; + } + &Apache::lonnet::store_userdata(\%storehash,$file,'copycourseauthor',$coursedom,$coursenum); + } } if (keys(%checkdeps)) { my %missingdep;