--- loncom/interface/lonwhatsnew.pm 2008/12/21 16:41:15 1.80.2.3 +++ loncom/interface/lonwhatsnew.pm 2008/12/06 12:49:18 1.81 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.80.2.3 2008/12/21 16:41:15 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.81 2008/12/06 12:49:18 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -354,11 +354,13 @@ sub display_actions_box { .' ' .&mt('Currently: [_1].',''.$currinit.'') .'  ' - .&mt('Change for just [_1]this course[_2]' - .' or for all [_3]your courses[_2].' + .&mt('[_1]Change[_2] for just [_3]this course[_4] or for all [_5]your courses[_6].' + ,'' + ,'' ,'' ,'' - ,'') + ,'' + ,'') .'

'); if ($command eq 'reset') { @@ -488,9 +490,8 @@ sub display_actions_box { } } - my $itemserror; if ($needitems) { - $itemserror = &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); + &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); } if ($show{'coursenormalmail'}) { $msgcount = &getnormalmail(\@newmsgs); @@ -532,7 +533,7 @@ sub display_actions_box { if ($displayed == $halfway) { $r->print(' '); } - &display_launcher($r,$actionitem,$refpage,$checkallowed,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,\%interval,$countunread,\%expired,$expirecount,\%activated,$activecount,$crstype,$itemserror); + &display_launcher($r,$actionitem,$refpage,$checkallowed,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,\%interval,$countunread,\%expired,$expirecount,\%activated,$activecount,$crstype); $displayed ++; } } @@ -678,7 +679,13 @@ function toggle_countunread(choice) { document.discussionswitch.submit(); } '); - $r->print('
'.&mt('Choose whether or not to display a count of the number of new posts for each resource or bulletin board which has unread posts.').'
'.&mt("This can increase the time taken to gather data for the 'What's New?' page by a few seconds.").'  '.&mt("Currently set to $current.")); + $r->print('
' + .&mt('Choose whether or not to display a count of the number of new posts for each resource or bulletin board which has unread posts.') + .'
' + .&mt("This can increase the time taken to gather data for the 'What's New?' page by a few seconds.") + .'  ' + .&mt('Currently set to [_1].',''.$current.'.') + ); $r->print('

@@ -688,9 +695,9 @@ function toggle_countunread(choice) { $r->print('
'. - (' ' x7). - ' +         +
'); @@ -779,23 +786,23 @@ sub display_launcher { $tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered, $newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs, $interval,$countunread,$expired,$expirecount,$activated,$activecount, - $crstype,$itemserror) = @_; + $crstype) = @_; if ($$checkallowed{$action}) { &start_box($r,$show,$headings,$action,$refpage,$action); if ($$show{$action}) { if ($action eq 'handgrading') { # UNGRADED ITEMS - &display_handgrade($r,$tograde,$ungraded,$itemserror); + &display_handgrade($r,$tograde,$ungraded); } elsif ($action eq 'haserrors') { # BOMBS - &display_haserrors($r,$bombs,$bombed,$res_title,$itemserror); + &display_haserrors($r,$bombs,$bombed,$res_title); } elsif ($action eq 'versionchanges') { # VERSION CHANGES - &display_versionchanges($r,$changed,$res_title,$interval->{'versions'},$itemserror); + &display_versionchanges($r,$changed,$res_title,$interval->{'versions'}); } elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS &display_abovethreshold($r,$refpage,$warnings,$triggered, - $res_title,$itemserror); + $res_title); } elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION &display_coursediscussion($r,$newdiscussions,$unread, - $countunread,$res_title,$itemserror); + $countunread,$res_title); } elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES &display_coursenormalmail($r,$msgcount,$newmsgs); } elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES @@ -818,10 +825,6 @@ sub getitems { $tograde,$bombs,$warnings,$threshold,$cdom,$crs,$res_title,$show, $starttime,$countunread) = @_; my $navmap = Apache::lonnavmaps::navmap->new(); - if (!defined($navmap)) { - my $itemserror = ''.&mt('An error occurred retrieving information about the course.').'
'.&mt('It is recommended that you [_1]re-select the course[_2].','','').'
'; - return $itemserror; - } # force retrieve Resource to seed the part id cache we'll need it later my @allres=$navmap->retrieveResources(undef, sub {if ($_[0]->is_problem) { $_[0]->parts();} return 1;}); @@ -880,7 +883,6 @@ sub getitems { } } - return; } sub check_discussions { @@ -1444,7 +1446,7 @@ sub checkversions { } sub display_handgrade { - my ($r,$tograde,$ungraded,$itemserror) = @_; + my ($r,$tograde,$ungraded) = @_; my %lt = &Apache::lonlocal::texthash( 'prna' => 'Problem Name', 'nmun' => 'Number ungraded', @@ -1467,15 +1469,13 @@ sub display_handgrade { } $r->print(''.$$ungraded{$res}{title}.''.$$ungraded{$res}{count}.''); } - } elsif ($itemserror) { - $r->print(''.$itemserror.''); } else { $r->print(''.$lt{'nopr'}.''); } } sub display_haserrors { - my ($r,$bombs,$bombed,$res_title,$itemserror) = @_; + my ($r,$bombs,$bombed,$res_title) = @_; my $bombnum = 0; my %lt = &Apache::lonlocal::texthash( reso => 'Resource', @@ -1494,8 +1494,6 @@ sub display_haserrors { ''. $$bombed{$bomb}{errorcount}.''); } - } elsif ($itemserror) { - $r->print(''.$itemserror.''); } else { $r->print(''.$lt{'noer'}.''); } @@ -1503,7 +1501,7 @@ sub display_haserrors { } sub display_abovethreshold { - my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror) = @_; + my ($r,$refpage,$warnings,$triggered,$res_title) = @_; my %lt = &Apache::lonlocal::texthash( reso => 'Resource', part => 'Part', @@ -1559,15 +1557,13 @@ sub display_abovethreshold { } } $r->print('
'); - } elsif ($itemserror) { - $r->print(''.$itemserror.''); } else { $r->print(''.$lt{'nopr'}.''); } } sub display_versionchanges { - my ($r,$changed,$res_title,$interval,$itemserror) = @_; + my ($r,$changed,$res_title,$interval) = @_; my %lt = &Apache::lonlocal::texthash( 'reso' => 'Resource', 'revd' => 'Last revised', @@ -1594,8 +1590,6 @@ sub display_versionchanges { $$changed{$item}{'current'}.''. $$changed{$item}{'version'}.''); } - } elsif ($itemserror) { - $r->print(''.$itemserror.''); } else { $r->print('' .&mt('No '.$interval).''); @@ -1661,7 +1655,7 @@ sub display_rolechanges { } sub display_coursediscussion { - my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_; + my ($r,$newdiscussions,$unread,$countunread,$res_title) = @_; my $lctype = lc(&Apache::loncommon::course_type()); my %lt = &Apache::lonlocal::texthash( 'loca' => 'Location', @@ -1709,8 +1703,6 @@ sub display_coursediscussion { } $r->print("\n"); } - } elsif ($itemserror) { - $r->print(''.$itemserror.''); } else { $r->print(''.$lt{'noun'}.''); } @@ -1889,9 +1881,10 @@ sub store_courseinit_setting { \%courseinit_settings,$udom,$uname); if ($outcome eq 'ok') { if ($page_control eq 'global preferences') { - $result = &mt("Page displayed after role selection in $lctype now set by user's global preferences."); + $result = &mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'',''); } else { - $result = &mt('Page displayed after role selection in this '.$lctype.' set to [_2]',$lctype,$$initpage{$env{'form.courseinit_page'}}); + $result = &mt('Page displayed after role selection in this '.$lctype.' set to [_1].' + ,''.$$initpage{$env{'form.courseinit_page'}}.''); } } else { &Apache::lonnet::logthis('Error saving whatsnew courseinit '. @@ -1903,8 +1896,10 @@ sub store_courseinit_setting { ''.$page_control.'', ''.$outcome.'.
'); } else { - $result = &mt('Unable to set page display, after role selection, for this '.$lctype.' to [_2] due to [_3].
', - $$initpage{$env{'form.courseinit_page'}},$outcome); + $result = &mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].' + ,''.$$initpage{$env{'form.courseinit_page'}}.'' + ,''.$outcome.'') + .'
'; } } }