--- loncom/interface/londocs.pm 2003/09/28 00:14:25 1.84 +++ loncom/interface/londocs.pm 2003/10/22 21:41:11 1.88 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.84 2003/09/28 00:14:25 www Exp $ +# $Id: londocs.pm,v 1.88 2003/10/22 21:41:11 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -138,7 +138,7 @@ sub dumpcourse { # Do the dumping unless ($outhash{'home_'.$ENV{'form.authorspace'}}) { return ''; } my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'}); - $r->print('

Copying Files

'); + $r->print('

'.&mt('Copying Files').'

'); my $title=$ENV{'form.authorfolder'}; $title=~s/[^\w\/]+/\_/g; my %replacehash=(); @@ -395,8 +395,8 @@ sub entryline { ) { $foldertitle=&Apache::lontexconvert::msgtexconverted($4); $renametitle=$4; - $title=''.localtime($1).' '. - &Apache::loncommon::plainname($2,$3).':
'. + $title=''.&Apache::lonlocal::locallocaltime($1).' '. + &Apache::loncommon::plainname($2,$3).':
'. $foldertitle; } $renametitle=~s/\"\;/\\\"/g; @@ -490,7 +490,7 @@ sub checkonthis { my $result=&Apache::lonnet::repcopy( &Apache::lonnet::filelocation('',$url)); if ($result==OK) { - $r->print('ok'); + $r->print(''.&mt('ok').''); $r->rflush(); &Apache::lonnet::countacc($url); $url=~/\.(\w+)$/; @@ -511,7 +511,8 @@ sub checkonthis { ($Apache::lonxml::warningcount)) { if ($Apache::lonxml::errorcount) { $r->print(''. - $Apache::lonxml::errorcount.' error(s) '); + $Apache::lonxml::errorcount.' '. + &mt('error(s)').' '); } if ($Apache::lonxml::warningcount) { $r->print(''. @@ -519,7 +520,7 @@ sub checkonthis { &mt('warning(s)').''); } } else { - $r->print('ok'); + $r->print(''.&mt('ok').''); } $r->rflush(); } @@ -587,6 +588,7 @@ sub checkversions { my $monthsel=''; my $weeksel=''; my $daysel=''; + my $allsel=''; if ($ENV{'form.timerange'}==-1) { $seltext='since start of course'; $startsel='selected'; @@ -594,41 +596,47 @@ sub checkversions { } my $starttime=time-$ENV{'form.timerange'}; if ($ENV{'form.timerange'}==2592000) { - $seltext=&mt('during the last month').' ('.localtime($starttime).')'; + $seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; $monthsel='selected'; } elsif ($ENV{'form.timerange'}==604800) { - $seltext=&mt('during the last week').' ('.localtime($starttime).')'; + $seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; $weeksel='selected'; } elsif ($ENV{'form.timerange'}==86400) { - $seltext=&mt('since yesterday').' ('.localtime($starttime).')'; + $seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; $daysel='selected'; + } elsif ($ENV{'form.timerange'} eq 'all') { + $allsel='all'; } my %lt=&Apache::lonlocal::texthash - ('st' => 'Since Start of Course', - 'lm' => 'Last Month', - 'lw' => 'Last Week', - 'sy' => 'Since Yesterday', - 'di' => 'Display', + ('st' => 'Version changes since start of Course', + 'lm' => 'Version changes since last Month', + 'lw' => 'Version changes since last Week', + 'sy' => 'Version changes since Yesterday', + 'al' => 'All Resources', + 'sd' => 'Display', 'cc' => 'Content changed', 'fi' => 'File', 'md' => 'Modification Date', - 've' => 'Version', + 'mr' => 'Most recently published Version', + 've' => 'Version used in Course', + 'vu' => 'Set Version to be used in Course', 'di' => 'Differences'); $r->print(< - +

$lt{'cc'} $seltext

- - + + ENDHEADERS foreach (keys %changes) { if ($changes{$_}>$starttime) { @@ -638,8 +646,24 @@ ENDHEADERS $r->print( ''. - '
$lt{'fi'}$lt{'md'}$lt{'ve'}$lt{'di'}
$lt{'fi'}$lt{'md'}$lt{'mr'}$lt{'ve'}$lt{'vu'}$lt{'di'}
'.$linkurl. ''. - localtime($changes{$_}).''.$currentversion.''); + &Apache::lonlocal::locallocaltime($changes{$_}). + ''. + $currentversion.''); +# Used in course + my $usedversion=$hash{'version_'.$linkurl}; + if ($usedversion) { + $r->print($usedversion); + } else { + $r->print($currentversion); + } + $r->print(''); +# Set version + $r->print(&Apache::loncommon::select_form($usedversion, + 'set_version_'.$linkurl, + ('' => '', + 'current' => 'current', + map {$_,$_} (1..$currentversion)))); + $r->print(''); my $lastold=1; for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { my $url=$root.'.'.$prevvers.'.'.$extension; @@ -651,14 +675,14 @@ ENDHEADERS for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { my $url=$root.'.'.$prevvers.'.'.$extension; $r->print('Version '.$prevvers.' ('. - localtime(&Apache::lonnet::metadata($url,'lastrevisiondate')). + '">'.&mt('Version').' '.$prevvers.' ('. + &Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($url,'lastrevisiondate')). ')'); if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') { $r->print(' Diffs'); + '">'.&mt('Diffs').''); } $r->print('
'); } @@ -694,6 +718,8 @@ sub handler { 'Docs_About_Syllabus,Docs_Editing_Templated_Pages'); $help{'Simple Page'} = &Apache::loncommon::help_open_topic( 'Docs_About_Simple_Page,Docs_Editing_Templated_Pages'); + $help{'Simple Problem'} = &Apache::loncommon::help_open_topic( + 'Option_Response_Simple'); $help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( 'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); $help{'My Personal Info'} = &Apache::loncommon::help_open_topic( @@ -875,6 +901,10 @@ ENDNEWSCRIPT # ----------------------------------------------------------------------------- if ($allowed) { my $dumpbut=&dumpbutton(); + my %lt=&Apache::lonlocal::texthash( + 'vc' => 'Verify Content', + 'cv' => 'Check/Set Resource Versions', + ); $r->print(< @@ -888,9 +918,9 @@ ENDNEWSCRIPT
- + - + $dumpbut