--- loncom/interface/lonmeta.pm 2006/07/19 15:31:05 1.160 +++ loncom/interface/lonmeta.pm 2006/08/04 22:14:38 1.163 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.160 2006/07/19 15:31:05 albertel Exp $ +# $Id: lonmeta.pm,v 1.163 2006/08/04 22:14:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -315,7 +315,7 @@ sub get_port_path_and_group { $port_path = '/adm/portfolio'; } if ($env{'form.group'} ne $group) { - $env{'form.group'} = $group) { + $env{'form.group'} = $group; } return ($port_path,$group); } @@ -716,14 +716,13 @@ sub handler { # my ($resdomain,$resuser)= (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//); - if ($uri=~m:/adm/bombs/(.*)$:) { $r->print(&Apache::loncommon::start_page('Error Messages')); # Looking for all bombs? &report_bombs($r,$uri); - } elsif ($uri=~/\/portfolio\//) { + } elsif ($uri=~m|^/editupload/[^/]+/[^/]+/portfolio/|) { ($resdomain,$resuser)= - (&Apache::lonnet::declutter($uri)=~m|^(\w+)/(\w+)/portfolio|); + (&Apache::lonnet::declutter($uri)=~m|^(\w+)/(\w+)/portfolio|); $r->print(&Apache::loncommon::start_page('Edit Portfolio File Catalog Information', undef, {'domain' => $resdomain,})); @@ -732,7 +731,7 @@ sub handler { } else { &pre_select_course($r,$uri); } - } elsif ($uri=~/^\/\~/) { + } elsif ($uri=~m|^/~|) { # Construction space $r->print(&Apache::loncommon::start_page('Edit Catalog nformation', undef, @@ -798,6 +797,7 @@ ENDCLEAR sub present_uneditable_metadata { my ($r,$uri) = @_; # + my $uploaded = ($uri =~ m|/uploaded/|); my %content=(); # Read file foreach (split(/\,/,&Apache::lonnet::metadata($uri,'keys'))) { @@ -810,16 +810,18 @@ sub present_uneditable_metadata { my $disuri=&Apache::lonnet::clutter($uri); $disuri=~s/^\/adm\/wrapper//; # version - my $currentversion=&Apache::lonnet::getversion($disuri); my $versiondisplay=''; - if ($thisversion) { - $versiondisplay=&mt('Version').': '.$thisversion. - ' ('.&mt('most recent version').': '. - ($currentversion>0 ? - $currentversion : - &mt('information not available')).')'; - } else { - $versiondisplay='Version: '.$currentversion; + if (!$uploaded) { + my $currentversion=&Apache::lonnet::getversion($disuri); + if ($thisversion) { + $versiondisplay=&mt('Version').': '.$thisversion. + ' ('.&mt('most recent version').': '. + ($currentversion>0 ? + $currentversion : + &mt('information not available')).')'; + } else { + $versiondisplay='Version: '.$currentversion; + } } # crumbify displayed URL uri target prefix form size $disuri=&Apache::lonhtmlcommon::crumbs($disuri,undef, undef, undef,'+1'); @@ -839,30 +841,38 @@ sub present_uneditable_metadata { if (! defined($title)) { $title = 'Untitled Resource'; } - foreach ('title', - 'author', - 'subject', - 'keywords', - 'notes', - 'abstract', - 'lowestgradelevel', - 'highestgradelevel', - 'standards', - 'mime', - 'language', - 'creationdate', - 'lastrevisiondate', - 'owner', - 'copyright', - 'customdistributionfile', - 'sourceavail', - 'sourcerights', - 'obsolete', - 'obsoletereplacement') { - $table.='