--- loncom/interface/lonwhatsnew.pm 2007/02/27 22:16:02 1.68 +++ loncom/interface/lonwhatsnew.pm 2008/03/18 22:00:28 1.76 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.68 2007/02/27 22:16:02 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.76 2008/03/18 22:00:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -99,28 +99,28 @@ sub handler { text=>"Display Action Items"}); if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, + ({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, text=>"Change thresholds"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs ("What's New?",#'Course_Action_Items_Thresholds' )); } elsif (($command eq 'chginterval') && $checkallowed{'versionchanges'} ) { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage, + ({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage, text=>"Change interval"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs ("What's New?",#'Course_Action_Items_Intervals' )); } elsif (($command eq 'chgdisc') && $checkallowed{'coursediscussion'}) { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage, + ({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage, text=>"Change discussion display"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs ("What's New?",#'Course_Action_Items_Intervals' )); } elsif ($command eq 'courseinit') { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage, + ({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage, text=>"Course initialization preference"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs ("What's New?",#'Course_Action_Items_Initialization' @@ -144,7 +144,6 @@ sub display_main_box { my ($r,$command,$refpage,$checkallowed) = @_; my $domain=&Apache::loncommon::determinedomain(); my $function = &Apache::loncommon::get_users_function(); - my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); my $lctype = lc(&Apache::loncommon::course_type()); $r->print(' -
'); @@ -172,7 +171,7 @@ sub display_main_box { if (($command eq 'chgthreshold') && $checkallowed->{'abovethreshold'}) { - &display_threshold_config($r,$refpage,$tabbg,\%threshold_titles, + &display_threshold_config($r,$refpage,\%threshold_titles, $cdom,$crs); } elsif (($command eq 'chginterval') && $checkallowed->{'versionchanges'}) { @@ -183,7 +182,7 @@ sub display_main_box { } elsif ($command eq 'courseinit') { &courseinit_config($r,$refpage,\%initpage); } else { - &display_actions_box($r,$tabbg,$command,$refpage,\%threshold_titles, + &display_actions_box($r,$command,$refpage,\%threshold_titles, \%interval_titles,\%initpage,$cdom,$crs,$checkallowed); } my $end_page = &Apache::loncommon::end_page(); @@ -241,8 +240,8 @@ END #------------------------------- sub display_actions_box { - my ($r,$tabbg,$command,$refpage,$threshold_titles,$interval_titles, - $initpage,$cdom,$crs,$checkallowed) = @_; + my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage, + $cdom,$crs,$checkallowed) = @_; my $udom = $env{'user.domain'}; my $uname = $env{'user.name'}; my $cid = $env{'request.course.id'}; @@ -296,7 +295,7 @@ sub display_actions_box { my $currinit = $pagedesc{$initdisp}.' ('.$pagedesc{$initcontrol}.')'; unless ($cid) { - $r->print('
'.$lt{'yacc'}.'


'); + $r->print('

'.$lt{'yacc'}.'

'); return; } @@ -305,14 +304,22 @@ sub display_actions_box { &GDBM_READER(),0640)) { my $furl=$bighash{'first_url'}; untie(%bighash); - $r->print(''.$lt{'gtfr'}. - '
'); + $r->print(''.$lt{'gtfr'}. + '
'); } } - $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype). - '. '.&mt('Currently: [_1]',$currinit).'.  '. - &mt('Change for just this '.$lctype.'',$refpage).' '. - &mt('or for all your courses',$refpage).'

'); + $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.' + .' ' + .&mt('Currently: [_1]',$currinit) + .'.  ' +# &mt('Change for just this '.$lctype.'',$refpage).' '. +# &mt('or for all your courses.',$refpage).'

'); + .&mt('Change for just [_1]this course[_2]' + .' or for all [_3]your courses[_2].' + ,'' + ,'' + ,'') + .'

'); if ($command eq 'reset') { $result = &process_reset($cdom,$crs); @@ -327,9 +334,9 @@ sub display_actions_box { my $store_result=&store_display_settings($uname,$udom,$cid,$checkallowed); unless ($store_result eq 'ok') { - &Apache::lonnet::logthis('Error storing whatsnew settings: '. + &Apache::lonnet::logthis('Error saving whatsnew settings: '. $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); - $result .= &mt('Unable to store visibility settings due to [_1]', + $result .= &mt('Unable to save visibility settings due to [_1]', $store_result); } @@ -412,7 +419,7 @@ sub display_actions_box { } } - $r->print('
- -
'); + $r->print('
'); my $displayed = 0; my $totalboxes = 0; @@ -427,20 +434,17 @@ sub display_actions_box { foreach my $actionitem (@actionorder) { if ($$checkallowed{$actionitem}) { if ($displayed == $halfway) { - $r->print(' '); + $r->print(' '); } - &display_launcher($r,$actionitem,$refpage,$checkallowed,$tabbg,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread); + &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); $displayed ++; } } $r->print(' -
-
'); + +'); } #------------------------------- @@ -451,7 +455,7 @@ sub display_actions_box { #------------------------------- sub display_threshold_config { - my ($r,$refpage,$tabbg,$threshold_titles,$cdom,$crs) = @_; + my ($r,$refpage,$threshold_titles,$cdom,$crs) = @_; my $uname = $env{'user.name'}; my $udom = $env{'user.dom'}; my $cid = $env{'request.course.id'}; @@ -471,9 +475,9 @@ sub display_threshold_config { $r->print('
'. &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). - 'Threshold Name'."\n". - 'Current value'."\n". - 'Change?'."\n". + ''.&mt('Threshold Name').''."\n". + ''.&mt('Current value').''."\n". + ''.&mt('Change?').''."\n". &Apache::loncommon::end_data_table_header_row()); foreach my $type (@thresholditems) { my $parameter = $env{'request.course.id'}.':threshold_'.$type; @@ -492,7 +496,7 @@ sub display_threshold_config { &Apache::loncommon::end_data_table_row()); } $r->print(&Apache::loncommon::end_data_table()."\n". - '
+ '
'); @@ -510,10 +514,10 @@ sub display_interval_config { my $lctype = lc(&Apache::loncommon::course_type()); my $current = &get_current($env{'user.name'},$env{'user.domain'}, $env{'request.course.id'},'interval'); - $r->print('
'.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.')); + $r->print('
'.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.').'
'); unless ($current eq '') { - $r->print(' '.&mt('Current value is [_1]',''. - $$interval_titles{$current}.'.')); + $r->print(' '.&mt('Current value is [_1].',''. + $$interval_titles{$current}.'')); } $r->print('

@@ -522,7 +526,7 @@ sub display_interval_config {    @@ -557,7 +561,7 @@ 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 [_1] page by a few seconds.',"What's New?").'  '.&mt('Currently set to [_1].',''.$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 $current.")); $r->print('

@@ -566,7 +570,7 @@ function toggle_countunread(choice) { '); $r->print('
        print(''); + '  '); } $r->print('

'.&mt('If').' '.$$initpage{'coursespecific'}. ' -
'.$lt{'chce'}.": \n"); @@ -624,9 +628,9 @@ END if (($choice eq $current) && ($control eq 'coursespecific')) { $chkstring = ' checked="checked" '; } - $r->print(''); + '  '); } $r->print('

'); @@ -654,13 +658,13 @@ sub curr_courseinit { } sub display_launcher { - my ($r,$action,$refpage,$checkallowed,$tabbg,$show,$headings,$res_title, + my ($r,$action,$refpage,$checkallowed,$show,$headings,$res_title, $tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered, $newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs, $interval,$countunread) = @_; if ($$checkallowed{$action}) { - &start_box($r,$tabbg,$show,$headings,$action,$refpage,$action); + &start_box($r,$show,$headings,$action,$refpage,$action); if ($$show{$action}) { if ($action eq 'handgrading') { # UNGRADED ITEMS &display_handgrade($r,$tograde,$ungraded); @@ -870,10 +874,10 @@ sub check_thresholds { my $resettitle = 'title_'.&escape($symb."\0".$part); if (@parts > 1) { $$triggered{$symb}{text}[$partcount] = ' - part - '.$part.''; + '.&mt('part - ').$part.''; } else { $$triggered{$symb}{text}[$partcount] = ' - single part'; + '.&mt('single part').''; } $$triggered{$symb}{text}[$partcount] .= ' '.$stats{$part}{users}.' @@ -983,7 +987,7 @@ sub process_reset { sub process_update { my ($uname,$udom,$threshold_titles) = @_; - my $setoutput = 'Changes to threshold(s) for problem tracking:
'; + my $setoutput = ''.&mt('Changes to threshold(s) for problem tracking:').'
'; foreach (keys %env) { next if ($_!~/^form\.(.+)\_setparmval$/); my $name = $1; @@ -1303,7 +1307,7 @@ sub display_coursediscussion { my $css_class = $rowNum%2?' class="LC_odd_row"':''; my $lastpost = &Apache::lonnavmaps::timeToHumanString( $$unread{$ressymb}{'lastpost'}); - $r->print(''.$forum_title.' '.$type.' '); + $r->print(''.$forum_title.' '.&mt($type).' '); if ($countunread eq 'on') { my $unreadnum = $$unread{$ressymb}{'unreadcount'}; $r->print(''.$lastpost.''. @@ -1330,11 +1334,12 @@ sub display_coursenormalmail { foreach my $msg (@{$newmsgs}) { $mailcount ++; my $css_class = $mailcount%2?' class="LC_odd_row"':''; - $r->print(''.$mailcount. - '.  '. - $msg->{'shortsub'}.'    '. - $msg->{'from'}.'@'.$msg->{'fromdom'}.' '. - $msg->{'sendtime'}.''); + $r->print(''.$mailcount + .'. ' + .$msg->{'shortsub'}.'   ' + .$msg->{'from'}.':'.$msg->{'fromdom'}.' ' + .$msg->{'sendtime'}.''); } } else { $r->print(''. @@ -1357,7 +1362,7 @@ sub display_coursecritmail { $r->print(''.$mailcount. '.  '. $msg->{'shortsub'}.'    '. - $msg->{'from'}.'@'.$msg->{'fromdom'}.' '. + $msg->{'from'}.':'.$msg->{'fromdom'}.' '. $msg->{'sendtime'}.''); } } else { @@ -1421,11 +1426,11 @@ sub store_interval_setting { \%interval_settings,$udom,$uname); if ($outcome eq 'ok') { $result = &mt('Interval set to version changes [_1]', - ''.$$interval_titles{$env{'form.interval'}}.'
'); + ''.$$interval_titles{$env{'form.interval'}}.'').'
'; } else { my $lctype = lc(&Apache::loncommon::course_type()); - &Apache::lonnet::logthis('Error storing whatsnew interval setting'. + &Apache::lonnet::logthis('Error saving whatsnew interval setting'. ' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); $result = &mt('Unable to set interval to [_1] due to [_2].', ''.$$interval_titles{$env{'form.interval'}}.'', @@ -1445,15 +1450,15 @@ sub store_discussion_setting { \%discussion_settings,$udom,$uname); if ($outcome eq 'ok') { $result = &mt('Count unread posts in discussions display set to [_1]', - ''.$env{'form.countunread'}.'
'); + ''.&mt($env{'form.countunread'}).'').'
'; } else { my $lctype = lc(&Apache::loncommon::course_type()); - &Apache::lonnet::logthis('Error storing whatsnew countunread setting'. + &Apache::lonnet::logthis('Error saving whatsnew countunread setting'. ' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); $result = &mt('Unable to set "number unread posts display" to [_1]'. ' due to [_2].', - ''.$env{'form.countunread'}.'', + ''.&mt($env{'form.countunread'}).'', ''.$outcome.'.
'); } } @@ -1487,7 +1492,7 @@ sub store_courseinit_setting { $result = &mt('Page displayed after role selection in this '.$lctype.' set to [_2]',$lctype,$$initpage{$env{'form.courseinit_page'}}); } } else { - &Apache::lonnet::logthis('Error storing whatsnew courseinit '. + &Apache::lonnet::logthis('Error saving whatsnew courseinit '. 'setting: '.$outcome.' for '.$uname. ':'.$udom.' in '.$lctype.' '.$cid); if ($page_control eq 'global preferences') { @@ -1506,7 +1511,7 @@ sub store_courseinit_setting { } sub start_box { - my ($r,$tabbg,$show,$heading,$caller,$refpage) = @_; + my ($r,$show,$heading,$caller,$refpage) = @_; my %lt = &Apache::lonlocal::texthash( chth => 'Change thresholds?', chin => 'Change interval?', @@ -1515,17 +1520,19 @@ sub start_box { my $showhide; if ($$show{$caller}) { $showhide = 'Hide'; + 'display_'.$caller.",'hide'".');">'. + &mt('Hide').''; } else { $showhide = 'Show'; + 'display_'.$caller.",'show'".');">'. + &mt('Show').''; } $r->print(' - + '); if (($caller eq 'abovethreshold') && ($$show{$caller})) {
'.$$heading{$caller}.''.$$heading{$caller}.' '.$showhide.'