--- loncom/interface/londocs.pm 2012/03/10 21:24:59 1.478 +++ loncom/interface/londocs.pm 2012/03/28 12:58:42 1.479 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.478 2012/03/10 21:24:59 raeburn Exp $ +# $Id: londocs.pm,v 1.479 2012/03/28 12:58:42 goltermann Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1730,9 +1730,11 @@ sub checkversions { if (&Apache::lonnet::put('resourceversions',\%newsetversions, $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') { - $r->print('
'.&mt('Resources').' | '. + "$lt{'mr'} | ". + "$lt{'ve'} | ". + "$lt{'vu'} | ". + ''.&mt('History').' | '. + ''); foreach my $key (sort(keys(%changes))) { if ($changes{$key}>$starttime) { my ($root,$extension)=($key=~/^(.*)\.(\w+)$/); my $currentversion=&Apache::lonnet::getversion($key); if ($currentversion<0) { - $currentversion=&mt('Could not be determined.'); + $currentversion=''.&mt('Could not be determined.').''; } my $linkurl=&Apache::lonnet::clutter($key); - $r->print( - '||||
---|---|---|---|---|---|---|---|---|
'. - &Apache::lonnet::gettitle($linkurl). - ' | ||||||||
'. - ' | '. - ''.$linkurl. - ' | |||||||
'. - ' | '. - &Apache::lonlocal::locallocaltime( - &Apache::lonnet::metadata($root.'.'.$extension, - 'lastrevisiondate') - ). - ' | '. - 'Most Recent: '. - ''.$currentversion.''. - ' | '. - 'In '.$crstype.': '. - ''); + $r->print( + &Apache::loncommon::end_data_table_header_row(). + &Apache::loncommon::start_data_table_row(). + ' | '.&Apache::lonnet::gettitle($linkurl).' '. + ''.$linkurl.' | '.
+ ''.$currentversion.' ('. + &Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate')).') | '.
+ ''); # Used in course my $usedversion=$hash{'version_'.$linkurl}; if (($usedversion) && ($usedversion ne 'mostrecent')) { - $r->print($usedversion); + if($usedversion != $currentversion){ + $r->print(''.$usedversion.''); + }else{ + $r->print($usedversion); + } } else { $r->print($currentversion); } - $r->print(' | '. - 'Use: '); + $r->print(' | '); # Set version $r->print(&Apache::loncommon::select_form($setversions{$linkurl}, 'set_version_'.$linkurl, @@ -1861,7 +1872,6 @@ ENDHEADERS '' => '', 'mostrecent' => &mt('most recent'), map {$_,$_} (1..$currentversion)})); - $r->print(' |
'); my $lastold=1; for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { my $url=$root.'.'.$prevvers.'.'.$extension; @@ -1875,13 +1885,13 @@ ENDHEADERS # each of the four columns my $entries_per_col = 0; my $num_entries = ($currentversion-$lastold); - if ($num_entries % 4 == 0) { - $entries_per_col = $num_entries/4; + if ($num_entries % $num_ver_col == 0) { + $entries_per_col = $num_entries/$num_ver_col; } else { - $entries_per_col = $num_entries/4 + 1; + $entries_per_col = $num_entries/$num_ver_col + 1; } my $entries_count = 0; - $r->print(' | '); + $r->print(' | ');
my $cols_output = 1;
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) {
my $url=$root.'.'.$prevvers.'.'.$extension;
@@ -1900,21 +1910,21 @@ ENDHEADERS
}
$r->print(' '); if (++$entries_count % $entries_per_col == 0) { - $r->print(' | ');
- if ($cols_output != 4) {
- $r->print(''); + $r->print(' | '); + if ($cols_output != $num_ver_col) { + $r->print(''); $cols_output++; } } } - while($cols_output++ < 4) { - $r->print(' | ') + while($cols_output++ < $num_ver_col) { + $r->print(' | '); } - $r->print(' |
'.&mt('Done').'
'); + $r->print(''.&Apache::loncommon::end_data_table_row(). + &Apache::loncommon::end_data_table(). + ''); &untiehash(); }