--- loncom/interface/londocs.pm 2024/01/08 18:17:50 1.708
+++ loncom/interface/londocs.pm 2024/06/07 14:37:55 1.710
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.708 2024/01/08 18:17:50 raeburn Exp $
+# $Id: londocs.pm,v 1.710 2024/06/07 14:37:55 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -102,6 +102,7 @@ sub authorhosts {
my %outhash=();
my $home=0;
my $other=0;
+ my @ids=&Apache::lonnet::current_machine_ids();
foreach my $key (keys(%env)) {
if ($key=~/^user\.role\.(au|ca)\.(.+)$/) {
my $role=$1;
@@ -118,7 +119,6 @@ sub authorhosts {
}
my $allowed=0;
my $myhome=&Apache::lonnet::homeserver($ca,$cd);
- my @ids=&Apache::lonnet::current_machine_ids();
foreach my $id (@ids) {
if ($id eq $myhome) {
$allowed=1;
@@ -263,8 +263,8 @@ ENDJS
add_entries => {'onload' => "hide_searching();"},
};
}
- $r->print(&Apache::loncommon::start_page('Copy '.$crstype.' Content to Authoring Space',$js,$starthash)."\n".
- &Apache::lonhtmlcommon::breadcrumbs('Copy '.$crstype.' Content to Authoring Space')."\n");
+ $r->print(&Apache::loncommon::start_page('Copy uploaded content to Authoring Space',$js,$starthash)."\n".
+ &Apache::lonhtmlcommon::breadcrumbs('Copy uploaded content to Authoring Space')."\n");
$r->print(&startContentScreen('tools'));
my ($home,$other,%outhash)=&authorhosts();
unless ($home) {
@@ -5965,7 +5965,7 @@ sub handler {
&init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions');
&checkversions($r,$canedit);
} elsif ($canedit && $env{'form.dumpcourse'}) {
- &init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space');
+ &init_breadcrumbs('dumpcourse','Copy uploaded content to Authoring Space');
&dumpcourse($r);
} elsif ($canedit && $env{'form.exportcourse'}) {
&init_breadcrumbs('exportcourse','IMS Export');
@@ -6694,7 +6694,18 @@ SEDFFORM
$checkcrsres = 1;
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.crsauthor'} ne '0') {
my %domdefs=&Apache::lonnet::get_domain_defaults($coursedom);
- if ($domdefs{'crsauthor'}) {
+ my $type = lc($env{'course.'.$env{'request.course.id'}.'.type'});
+ unless (($type eq 'community') || ($type eq 'placement')) {
+ $type = 'unofficial';
+ if ($env{'course.'.$env{'request.course.id'}.'internal.coursecode'} ne '') {
+ $type = 'official';
+ } elsif ($env{'course.'.$env{'request.course.id'}.'internal.textbook'} ne '') {
+ $type = 'textbook';
+ } else {
+ $type = 'unofficial';
+ }
+ }
+ if ($domdefs{$type.'crsauthor'}) {
$checkcrsres = 1;
}
}
@@ -9407,7 +9418,7 @@ sub dump_switchserver_js {
);
my %html_js_lt = &Apache::lonlocal::texthash(
swit => 'Switch server?',
- duco => 'Copying Content to Authoring Space',
+ duco => 'Copying uploaded content to Authoring Space',
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.',
chos => 'Choose server',
);
@@ -9548,55 +9559,8 @@ sub makenewproblem {
if ($redirect) {
my $rightsfile = 'default.rights';
my $sourcerights = "$path/$rightsfile";
+ &Apache::loncommon::crsauthor_rights($rightsfile,$path,$docroot,$coursenum,$coursedom);
my $targetrights = $docroot."/res/$coursedom/$coursenum/$rightsfile";
- my $now = time;
- if (!-e $sourcerights) {
- my $cid = $coursedom.'_'.$coursenum;
- if (open(my $fh,">$sourcerights")) {
- print $fh <