version 1.718, 2025/01/04 21:16:45
|
version 1.719, 2025/01/07 01:25:57
|
Line 884 ENDJS
|
Line 884 ENDJS
|
if (keys(%tocopy)) { |
if (keys(%tocopy)) { |
my (%resdirs,%resfiles); |
my (%resdirs,%resfiles); |
&Apache::lonnet::recursedirs($is_course_home,1,undef,$res_exclude,0,0,$resurl,'',\%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('<p>'.&mt('Copy to: [_1]', |
$r->print('<p>'.&mt('Copy to: [_1]', |
'<span class="LC_filename">'.$desturl.'/'.$subdir.'</span>'). |
'<span class="LC_filename">'.$desturl.'/'.$subdir.'</span>'). |
'</p>'."\n"); |
'</p>'."\n"); |
Line 1026 ENDJS
|
Line 1026 ENDJS
|
} |
} |
} else { |
} else { |
if (&File::Copy::copy($src,$dest)) { |
if (&File::Copy::copy($src,$dest)) { |
$newfile{$file} = 1; |
$newfile{$file} = $desturl.'/'.$subdir.'/'.$file; |
if ($embstyle eq 'ssi') { |
if ($embstyle eq 'ssi') { |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
} |
} |
Line 1055 ENDJS
|
Line 1055 ENDJS
|
my $destresfile = $docroot.$destresurl.'/'.$subdir.'/'.$file; |
my $destresfile = $docroot.$destresurl.'/'.$subdir.'/'.$file; |
if (-e $dest) { |
if (-e $dest) { |
my $output = &Apache::lonpublisher::batchpublish($r,$dest,$destresfile,$nokeyref,1); |
my $output = &Apache::lonpublisher::batchpublish($r,$dest,$destresfile,$nokeyref,1); |
|
if (-e $destresfile) { |
|
$newresfile{$file} = $destresurl.'/'.$subdir.'/'.$file; |
|
} |
} |
} |
} |
} |
} else { |
} else { |
Line 1065 ENDJS
|
Line 1068 ENDJS
|
} |
} |
if ($needpriv) { |
if ($needpriv) { |
if (&File::Copy::copy($src,$dest)) { |
if (&File::Copy::copy($src,$dest)) { |
$newfile{$file} = 1; |
$newfile{$file} = $desturl.'/'.$subdir.'/'.$file; |
if ($embstyle eq 'ssi') { |
if ($embstyle eq 'ssi') { |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
} |
} |
Line 1099 ENDJS
|
Line 1102 ENDJS
|
if ($embstyle eq 'ssi') { |
if ($embstyle eq 'ssi') { |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
} |
} |
$newfile{$file} = 1; |
$newfile{$file} = $desturl.'/'.$subdir.'/'.$file; |
} |
} |
} |
} |
} else { |
} else { |
Line 1127 ENDJS
|
Line 1130 ENDJS
|
my $destresfile = $docroot.$destresurl.'/'.$subdir.'/'.$file; |
my $destresfile = $docroot.$destresurl.'/'.$subdir.'/'.$file; |
if (-e $dest) { |
if (-e $dest) { |
my $output = &Apache::lonpublisher::batchpublish($r,$dest,$destresfile,$nokeyref,1); |
my $output = &Apache::lonpublisher::batchpublish($r,$dest,$destresfile,$nokeyref,1); |
|
if (-e $destresfile) { |
|
$newresfile{$file} = $destresurl.'/'.$subdir.'/'.$file; |
|
} |
} |
} |
} |
} |
} else { |
} else { |
Line 1140 ENDJS
|
Line 1146 ENDJS
|
if ($embstyle eq 'ssi') { |
if ($embstyle eq 'ssi') { |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
&crsres_fixup($dest,$coursenum,$coursedom,$ca,$cd,$subdir); |
} |
} |
$newfile{$file} = 1; |
$newfile{$file} = $desturl.'/'.$subdir.'/'.$file; |
} |
} |
} |
} |
if ($needprivmeta) { |
if ($needprivmeta) { |
Line 1171 ENDJS
|
Line 1177 ENDJS
|
$r->print('<p>'.&mt('Copied the following files to [_1]:','<span class="LC_filename">'.$desturl.'/'.$subdir.'</span>'). |
$r->print('<p>'.&mt('Copied the following files to [_1]:','<span class="LC_filename">'.$desturl.'/'.$subdir.'</span>'). |
'</p>'."\n". |
'</p>'."\n". |
'<ul><li>'.join('</li><li>',sort(keys(%newfile))).'</li></ul></p>'."\n"); |
'<ul><li>'.join('</li><li>',sort(keys(%newfile))).'</li></ul></p>'."\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)) { |
if (keys(%checkdeps)) { |
my %missingdep; |
my %missingdep; |