--- loncom/interface/londocs.pm 2017/05/10 23:34:15 1.630 +++ loncom/interface/londocs.pm 2017/05/19 18:24:03 1.632 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.630 2017/05/10 23:34:15 raeburn Exp $ +# $Id: londocs.pm,v 1.632 2017/05/19 18:24:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1672,8 +1672,8 @@ sub do_paste_from_buffer { $srcdom{$suffix} = $srcd; $srcnum{$suffix} = $srcn; } elsif (($url =~ m{^/res/lib/templates/\w+\.problem$}) || - ($url =~ m{^/adm/$match_domain/$match_username/\d+/(bulletinboard|smppg|ext\.tool)$})) { - my $srctype= $1; + ($url =~ m{^/adm/$match_domain/$match_username/\d+/(bulletinboard|smppg)$}) || + ($url =~ m{^/adm/$match_domain/$match_courseid/\d+/ext\.tool$})) { my ($srcd,$srcn) = split(/_/,$cid); # When paste buffer was populated using an active role in a different course # check for mdc privilege in the course from which the resource was pasted @@ -1683,7 +1683,9 @@ sub do_paste_from_buffer { next; } } - if (($srctype eq 'ext.tool') && ($srcd ne $coursedom)) { +# When buffer was populated using an active role in a different course +# disallow pasting of External Tool if course is in a different domain. + if (($url =~ m{/ext\.tool$}) && ($srcd ne $coursedom)) { $notindom{$suffix} = 1; next; } @@ -2164,6 +2166,8 @@ sub dbcopy { if (!$suffix) { if ($prefix eq 'smppg') { $errtext = &mt('Failed to acquire a unique timestamp-based suffix when copying a simple page [_1].',$url); + } elsif ($prefix eq 'exttool') { + $errtext = &mt('Failed to acquire a unique timestamp-based suffix when copying an external tool [_1].',$url); } else { $errtext = &mt('Failed to acquire a unique timestamp-based suffix when copying a discussion board [_1].',$url); } @@ -4326,7 +4330,7 @@ $form_end; $line.=&Apache::loncommon::modal_link($link,$title,600,500); } } elsif (($hiddenfolder) || ($hiddenres)) { - $line.=$title.' '.&mt('(Hidden)').''; + $line.=$title.' ('.&mt('Hidden').')'; } else { $line.=$title.' '.$reinit.''; } @@ -6052,7 +6056,7 @@ NWEBFORM $numauthor ++; } } - my ($pickdir,$showtitle);; + my ($pickdir,$showtitle); if ($numauthor) { my @order; my $defrole;