version 1.717, 2025/01/04 01:34:57
|
version 1.722, 2025/01/07 21:01:37
|
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); |
#FIXME publish meta file also? |
if (-e $destresfile) { |
|
$newresfile{$file} = $destresurl.'/'.$subdir.'/'.$file; |
|
} |
} |
} |
} |
} |
} else { |
} else { |
Line 1141 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 1172 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 $file (keys(%newfile)) { |
|
my %storehash = ( |
|
'priv' => $newfile{$file}, |
|
'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; |
Line 1262 ENDJS
|
Line 1277 ENDJS
|
&mt('Choose the files and/or folders to copy from Course Authoring to User Authoring'). |
&mt('Choose the files and/or folders to copy from Course Authoring to User Authoring'). |
'</span><br /><br />'."\n"; |
'</span><br /><br />'."\n"; |
my $count = 0; |
my $count = 0; |
my $startcount = 4 + $home; |
# |
|
# Warning to developers: |
|
# |
|
# If you add or remove form elements which precede the table of items to copy |
|
# you will need to modify the value for startcount. Form elements include both: |
|
# <input> and <fieldset> tags. |
|
# $startcount (set to 9) contains the following: |
|
# fieldsets with following legends: (a) Folder in Authoring Space, (b) Distribution to set in metadata |
|
# (c) Content to copy |
|
# inputs: textbox for destination folder; dropdown lists: (a) Copyright, (b) Source |
|
# hidden: customrights file; buttons: (a) check all, (b) uncheck all. |
|
# authorspace: if more than 1: a fieldset with legend: Select the Authoring Space, |
|
# or if 1: an input (hidden) with available author/coauthor role. |
|
# if there are multiple possible author/coauthor roles (i.e., $home > 1), |
|
# incerement startcount by 1 for the dropdown list uses to select the target. |
|
# |
|
# If there are published files, increment startcount by 3: |
|
# fieldset (legend: Published Resources), and two radio buttons (Yes/No). |
|
# |
|
my $startcount = 9; |
|
if ($home > 1) { |
|
$startcount ++; |
|
} |
|
if ($numpub) { |
|
$startcount += 3; |
|
} |
my $lastcontainer = $startcount; |
my $lastcontainer = $startcount; |
$display .= &Apache::loncommon::start_data_table()."\n". |
$display .= &Apache::loncommon::start_data_table()."\n". |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
Line 8644 sub generate_admin_menu {
|
Line 8684 sub generate_admin_menu {
|
if (grep(/^\Q$crshome\E$/,@ids)) { |
if (grep(/^\Q$crshome\E$/,@ids)) { |
$linkurl = $crsauthorurl; |
$linkurl = $crsauthorurl; |
} else { |
} else { |
$linkurl = |
my $jscall = &Apache::lonhtmlcommon::jump_to_editres($crsauthorurl,$crshome,1); |
&Apache::lonhtmlcommon::jump_to_editres($crsauthorurl,$crshome,1); |
if ($jscall) { |
|
$linkurl = 'javascript:'.$jscall; |
|
} |
} |
} |
if ((ref($menu[0]) eq 'HASH') && (ref($menu[0]->{'items'}) eq 'ARRAY')) { |
if ((ref($menu[0]) eq 'HASH') && (ref($menu[0]->{'items'}) eq 'ARRAY') && ($linkurl)) { |
push(@{$menu[0]->{items}}, |
push(@{$menu[0]->{items}}, |
{ linktext => $lt{'ca'}, |
{ linktext => $lt{'ca'}, |
url => $linkurl, |
url => $linkurl, |