--- loncom/interface/portfolio.pm 2006/06/16 22:37:10 1.104 +++ loncom/interface/portfolio.pm 2006/06/20 03:13:08 1.107 @@ -166,6 +166,8 @@ sub display_directory { } my $href_location="/uploaded/$udom/$uname/$port_path".$current_path; my $href_edit_location="/editupload/$udom/$uname/$port_path".$current_path; + my @dir_lines; + my %versioned; foreach my $line (sort { my ($afile)=split('&',$a,2); @@ -176,6 +178,15 @@ sub display_directory { #$dom my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); $filename =~ s/\s+$//; + my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); + if ($version) { + $versioned{$fname} .= $version.","; + } + push(@dir_lines, [$filename,$dom,$testdir,$size,$mtime,$obs]); + } + foreach my $line (@dir_lines) { + my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$line; + my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { if ($dirptr&$testdir) { if ($select_mode eq 'true'){ @@ -188,7 +199,13 @@ sub display_directory { $r->print(''); } else { $r->print(''); - my $fullpath = $current_path.$filename; + my $version_flag; + if (exists($versioned{$fname})) { + $version_flag = "*"; + } else { + $version_flag = ""; + } + my $fullpath = $current_path.$filename; $fullpath = &prepend_group($fullpath,$group); if ($select_mode eq 'true'){ $r->print(''.&mt('Delete').'
'.&mt('Update'). + $pub_action = '
+ '. ''; $pub_startdate = &Apache::lonhtmlcommon::date_setter('portform', @@ -620,11 +641,14 @@ sub access_setting_table { $pub_enddate = &Apache::lonhtmlcommon::date_setter('portform', 'enddate_'.$num,$end,undef,undef,undef,1,undef, undef,undef,1). - '  '.&mt('No end date').''; + '  '; } else { - $pub_action = ''. - &mt('Activate'). + $pub_action = ''. ''; $pub_startdate = &Apache::lonhtmlcommon::date_setter('portform', 'startdate_0',$now,undef,undef,undef,1,undef, @@ -632,9 +656,9 @@ sub access_setting_table { $pub_enddate = &Apache::lonhtmlcommon::date_setter('portform', 'enddate_0',$then,,undef,undef,undef,1,undef, undef,undef,1). - '  '; + ''; } $r->print(''.$pub_action.''.&mt('Start: ').$pub_startdate.