--- loncom/publisher/lonpubdir.pm 2023/06/11 20:45:40 1.178
+++ loncom/publisher/lonpubdir.pm 2023/07/13 21:41:40 1.179
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Authoring Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.178 2023/06/11 20:45:40 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.179 2023/07/13 21:41:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -128,7 +128,7 @@ sub handler {
}
# Put out actions for directory, browse/upload + new file page.
- &dircontrols($r,$uname,$udom,$thisdisfn, $current_disk_usage, $disk_quota);
+ &dircontrols($r,$uname,$udom,$thisdisfn,$current_disk_usage,$disk_quota,$crsauthor);
&resourceactions($r,$uname,$udom,$thisdisfn); # Put out form used for printing/deletion etc.
my $numdir = 0;
@@ -247,8 +247,13 @@ my $result = "
-
+ $selectbox
$lt{'shcu'}:
@@ -827,7 +851,7 @@ sub isMetaSame {
sub getStatus {
my ($resdir, $targetdir, $cstr_dir, $filename,
- $linkfilename, $cmtime, $meta_same) = @_;
+ $linkfilename, $crsauthor, $cmtime, $meta_same) = @_;
my $pubstatus = 'unpublished';
my $status = &mt('Unpublished');
@@ -853,7 +877,9 @@ sub getStatus {
);
$rights_status .=
$lt_SourceRight{&getSourceRightString($targetdir.'/'.$filename)};
-
+ if (($crsauthor) && ($filename =~ /\.rights$/)) {
+ $rights_status =~ s/,\s+$//;
+ }
if ($same) {
if (&Apache::lonnet::metadata($targetdir.'/'.$filename,'obsolete')) {
$pubstatus = 'obsolete';
@@ -871,17 +897,21 @@ sub getStatus {
$pubstatus = 'modified';
$status=&mt('Modified').
'
'. $rights_status;
- if (&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') {
- $status.='
'.
- &Apache::loncommon::modal_link(
- '/adm/diff?filename='.$linkfilename.'&versiontwo=priv',
- &mt('Diffs'),600,500);
+ unless (($crsauthor) && ($filename =~ /\.rights$/)) {
+ if (&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') {
+ $status.='
'.
+ &Apache::loncommon::modal_link(
+ '/adm/diff?filename='.$linkfilename.'&versiontwo=priv',
+ &mt('Diffs'),600,500);
+ }
}
- }
+ }
- $status.="\n".'
'.
- &Apache::loncommon::modal_link(
- '/adm/retrieve?filename='.$linkfilename.'&inhibitmenu=yes&add_modal=yes',&mt('Retrieve'),600,500);
+ unless (($crsauthor) && ($filename =~ /\.rights$/)) {
+ $status.="\n".'
'.
+ &Apache::loncommon::modal_link(
+ '/adm/retrieve?filename='.$linkfilename.'&inhibitmenu=yes&add_modal=yes',&mt('Retrieve'),600,500);
+ }
}
return ($status, $pubstatus);
@@ -892,9 +922,9 @@ sub getStatus {
# Put a table row for a file resource.
#
sub putresource {
- my ($r, $udom, $uname, $filename, $thisdisfn, $resdir, $targetdir,
- $linkdir, $cmtime, $size, $numres, $linkfilename, $title,
- $status, $pubstatus) = @_;
+ my ($r, $udom, $uname, $filename, $thisdisfn, $resdir,
+ $targetdir, $linkdir, $crsauthor, $cmtime, $size,
+ $numres, $linkfilename, $title, $status, $pubstatus) = @_;
&Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename);
my $editlink='';
@@ -920,7 +950,9 @@ sub putresource {
}
my $publish_button = (-e $resdir.'/'.$filename) ? &mt('Re-publish') : &mt('Publish');
my $pub_select = '';
- &create_pubselect($r,\$pub_select,$udom,$uname,$thisdisfn,$filename,$resdir,$pubstatus,$publish_button,$numres);
+ unless (($crsauthor) && ($filename=~ /\.rights$/)) {
+ &create_pubselect($r,\$pub_select,$udom,$uname,$thisdisfn,$filename,$resdir,$pubstatus,$publish_button,$numres);
+ }
$r->print(&Apache::loncommon::start_data_table_row().
'