--- loncom/publisher/lonpublisher.pm 2007/07/13 19:23:33 1.226 +++ loncom/publisher/lonpublisher.pm 2008/02/14 21:29:08 1.231 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.226 2007/07/13 19:23:33 albertel Exp $ +# $Id: lonpublisher.pm,v 1.231 2008/02/14 21:29:08 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -344,8 +344,8 @@ sub text_with_browse_field { return "\n

$title:". "


". ''. - 'Select '. - 'Search'; + ''.&mt('Select').' '. + ''.&mt('Search').''; } @@ -841,8 +841,9 @@ sub store_metadata { if (($metadata{'obsolete'}) || ($metadata{'copyright'} eq 'priv') || ($metadata{'copyright'} eq 'custom')) { # remove this entry - $status=&LONCAPA::lonmetadata::delete_metadata($dbh,undef, - $metadata{'url'}); + my $delitem = 'url = '.$dbh->quote($metadata{'url'}); + $status = &LONCAPA::lonmetadata::delete_metadata($dbh,undef,$delitem); + } else { $status = &LONCAPA::lonmetadata::update_metadata($dbh,undef,undef, \%metadata); @@ -966,15 +967,21 @@ sub publish { foreach (sort(keys(%allow))) { my $thisdep=$_; if ($thisdep !~ /[^\s]/) { next; } + if ($thisdep =~/\$/) { + $scrout.='
'. + &mt('The resource depends on another resource with variable filename, i.e., [_1]. '. + 'You likely need to explicitly allow access to all possible dependencies using the [_2]-tag', + ''.$thisdep.'','<allow>').''; + } unless ($style eq 'rat') { $allowstr.="\n".''; } $scrout.='
'; - if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { + if ($thisdep!~/[\*\$]/ && $thisdep!~m|^/adm/|) { $scrout.=''; } $scrout.=''.$thisdep.''; - if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { + if ($thisdep!~/[\*\$]/ && $thisdep!~m|^/adm/|) { $scrout.=''; if ( &Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. @@ -1130,6 +1137,11 @@ sub publish { '

'. &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'


'; } + if ($metadatafields{'copyright'} eq 'priv') { + $scrout.='

'.&mt('Warning!'). + '

'. + &mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.').'


'; + } # ------------------------------------------------------- Now have all metadata @@ -1289,6 +1301,9 @@ END $metadatafields{'copyright'}='default'; $metadatafields{'sourceavail'}='open'; } + if ($metadatafields{'copyright'} eq 'priv') { + $metadatafields{'copyright'}='domain'; + } # ------------------------------------------------ Dial in reasonable defaults my $defaultoption=$metadatafields{'copyright'}; unless ($defaultoption) { $defaultoption='default'; } @@ -1305,12 +1320,12 @@ END $intr_scrout.=&selectbox('Copyright/Distribution','copyright', $defaultoption, \&Apache::loncommon::copyrightdescription, - (grep !/^public$/,(&Apache::loncommon::copyrightids))); + (grep !/^(public|priv)$/,(&Apache::loncommon::copyrightids))); } else { $intr_scrout.=&selectbox('Copyright/Distribution','copyright', $defaultoption, \&Apache::loncommon::copyrightdescription, - (&Apache::loncommon::copyrightids)); + (grep !/^priv$/,(&Apache::loncommon::copyrightids))); } my $copyright_help = Apache::loncommon::help_open_topic('Publishing_Copyright'); @@ -1440,6 +1455,11 @@ sub phasetwo { &mt('No write permission to user directory, FAIL').''); return 0; } + + if ($source =~ /\.rights$/) { + $r->print('

'.&mt('Warning: It can take up to 1 hour for rights changes to fully propagate.').'

'); + } + print $logfile "\n================= Publish ".localtime()." Phase Two ================\n".$env{'user.name'}.':'.$env{'user.domain'}."\n";