Diff for /loncom/interface/lonwhatsnew.pm between versions 1.58 and 1.59

version 1.58, 2006/06/03 21:05:04 version 1.59, 2006/06/03 21:28:07
Line 145  sub display_main_box { Line 145  sub display_main_box {
     my $domain=&Apache::loncommon::determinedomain();      my $domain=&Apache::loncommon::determinedomain();
     my $function = &Apache::loncommon::get_users_function();      my $function = &Apache::loncommon::get_users_function();
     my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain);      my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain);
     my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
     $r->print('<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td width="100%">');      $r->print('<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td width="100%">');
   
     my %threshold_titles = &Apache::lonlocal::texthash (      my %threshold_titles = &Apache::lonlocal::texthash (
Line 249  sub display_actions_box { Line 249  sub display_actions_box {
     my $udom = $env{'user.domain'};      my $udom = $env{'user.domain'};
     my $uname = $env{'user.name'};      my $uname = $env{'user.name'};
     my $cid = $env{'request.course.id'};      my $cid = $env{'request.course.id'};
     my $crstype = $env{'course.'.$cid.'.type'};      my $crstype = &Apache::loncommon::course_type();
     my $lctype = lc($crstype);      my $lctype = lc($crstype);
     my %stulabel = (      my %stulabel = (
                     'Course' => 'students',                      'Course' => 'students',
Line 316  sub display_actions_box { Line 316  sub display_actions_box {
                   '</a></font><br />');                    '</a></font><br />');
         }          }
     }      }
     $r->print(&mt('Page set to be displayed after you have selected a role in this [_1]',$lctype).      $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).
               '. <nobr>'.&mt('Currently: <i>[_1]</i>',$currinit).'.&nbsp;&nbsp;'.                '. <nobr>'.&mt('Currently: <i>[_1]</i>',$currinit).'.&nbsp;&nbsp;'.
               &mt('<b>Change</b> for just <a href="/adm/whatsnew?command=courseinit&refpage=[_1]">this [_2]</a>',$refpage,$lctype).' '.                &mt('<b>Change</b> for just <a href="/adm/whatsnew?command=courseinit&refpage=[_1]">this '.$lctype.'</a>',$refpage).' '.
               &mt('or for all <a href="/adm/preferences?action=changecourseinit&refpage=[_1]">your courses/groups</a>',$refpage).'</nobr><br /><hr />');                &mt('or for all <a href="/adm/preferences?action=changecourseinit&refpage=[_1]">your courses/groups</a>',$refpage).'</nobr><br /><hr />');
   
     if ($command eq 'reset') {      if ($command eq 'reset') {
Line 373  sub display_actions_box { Line 373  sub display_actions_box {
         &get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs);          &get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs);
     }      }
   
     $headings{'abovethreshold'} = &mt('Problems with av. attempts').' &ge; '.$threshold{'av_attempts'}.' '.&mt('or deg. difficulty').' &ge; '.$threshold{'degdiff'}.'<br /> '.&mt('and total number of [_1] with submissions',$stulabel{$crstype}).' &ge; '.$threshold{'numstudents'};      $headings{'abovethreshold'} = 
    &mt('Problems with av. attempts &ge; [_1] or deg. difficulty &ge; [_2] <br /> and total number of '.$stulabel{$crstype}.' with submissions &ge; [_3]',
       $threshold{'av_attempts'},$threshold{'degdiff'},
       $threshold{'numstudents'});
   
     my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail');      my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail');
   
Line 531  sub display_threshold_config { Line 534  sub display_threshold_config {
                                                                                                                                                                         
 sub display_interval_config {  sub display_interval_config {
     my ($r,$refpage,$interval_titles) = @_;      my ($r,$refpage,$interval_titles) = @_;
     my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
     my $current = &get_current($env{'user.name'},$env{'user.domain'},      my $current = &get_current($env{'user.name'},$env{'user.domain'},
                                 $env{'request.course.id'},'interval');                                  $env{'request.course.id'},'interval');
     $r->print('<br />'.&mt('Choose the time window to use for display of version changes for resources in the [_1].',$lctype));      $r->print('<br />'.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.'));
     unless ($current eq '') {      unless ($current eq '') {
         $r->print(' '.&mt('Current value is [_1]','<b>'.          $r->print(' '.&mt('Current value is [_1]','<b>'.
                   $$interval_titles{$current}.'</b>.'));                    $$interval_titles{$current}.'</b>.'));
Line 613  sub courseinit_config { Line 616  sub courseinit_config {
     my ($control,$current) = &curr_courseinit();      my ($control,$current) = &curr_courseinit();
     my @chgstate = ('userpref','coursespecific');      my @chgstate = ('userpref','coursespecific');
     my @chgentry = ('firstres','whatsnew');      my @chgentry = ('firstres','whatsnew');
     my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                              'chwp' => "Choose which page will be displayed when you enter this $lctype after selecting a role.",                               'chwp' => "Choose which page will be displayed when you enter this $lctype after selecting a role.",
                              'cuva' => 'Current value is determined by',                               'cuva' => 'Current value is determined by',
Line 1266  sub display_versionchanges { Line 1269  sub display_versionchanges {
 sub display_coursediscussion {  sub display_coursediscussion {
     my ($r,$newdiscussions,$unread,$countunread,$res_title,$rowColor1,      my ($r,$newdiscussions,$unread,$countunread,$res_title,$rowColor1,
                                                               $rowColor2) = @_;                                                                $rowColor2) = @_;
     my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                 'loca' => 'Location',                  'loca' => 'Location',
                 'type' => 'Type',                  'type' => 'Type',
Line 1325  sub display_coursediscussion { Line 1328  sub display_coursediscussion {
 sub display_coursenormalmail {  sub display_coursenormalmail {
     my ($r,$msgcount,$newmsgs,$rowColor1,$rowColor2) = @_;      my ($r,$msgcount,$newmsgs,$rowColor1,$rowColor2) = @_;
     my $rowColor;      my $rowColor;
     my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
     if ($msgcount > 0) {      if ($msgcount > 0) {
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.&mt('Number').'</small></b></td><td><b><small>'.&mt('Subject').'</small></b></td><td><b><small>'.&mt('Sender').'</small></b></td><td><b><small>'.&mt('Date/Time').'</small></b></td></tr>');          $r->print('<tr bgcolor="#cccccc"><td><b><small>'.&mt('Number').'</small></b></td><td><b><small>'.&mt('Subject').'</small></b></td><td><b><small>'.&mt('Sender').'</small></b></td><td><b><small>'.&mt('Date/Time').'</small></b></td></tr>');
         my $rowNum = 0;          my $rowNum = 0;
Line 1341  sub display_coursenormalmail { Line 1344  sub display_coursenormalmail {
             $mailcount ++;              $mailcount ++;
         }          }
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff" width="100%"><center><br /><b><i><small>'.&mt('No new [_1] messages',$lctype).'</small></i></b><br /><br /></center></td></tr>');          $r->print('<tr><td bgcolor="#ffffff" width="100%"><center><br /><b><i><small>'.&mt('No new '.$lctype.' messages').'</small></i></b><br /><br /></center></td></tr>');
     }      }
 }  }
   
 sub display_coursecritmail {  sub display_coursecritmail {
     my ($r,$critmsgcount,$critmsgs,$rowColor1,$rowColor2) = @_;      my ($r,$critmsgcount,$critmsgs,$rowColor1,$rowColor2) = @_;
     my $rowColor;      my $rowColor;
     my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
     if ($critmsgcount > 0) {      if ($critmsgcount > 0) {
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.&mt('Number').'</small></b></td><td><b><small>'.&mt('Subject').'</small></b></td><td><b><small>'.&mt('Sender').'</small></b></td><td><b><small>'.&mt('Date/Time').'</small></b></td></tr>');          $r->print('<tr bgcolor="#cccccc"><td><b><small>'.&mt('Number').'</small></b></td><td><b><small>'.&mt('Subject').'</small></b></td><td><b><small>'.&mt('Sender').'</small></b></td><td><b><small>'.&mt('Date/Time').'</small></b></td></tr>');
         my $rowNum = 0;          my $rowNum = 0;
Line 1364  sub display_coursecritmail { Line 1367  sub display_coursecritmail {
             $mailcount ++;              $mailcount ++;
         }          }
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff" width="100%"><center><br /><b><i><small>'.&mt('No unread critical messages in [_1]',$lctype).'</small></i></b><br /><br /></center></td></tr>');          $r->print('<tr><td bgcolor="#ffffff" width="100%"><center><br /><b><i><small>'.&mt('No unread critical messages in '.$lctype).'</small></i></b><br /><br /></center></td></tr>');
     }      }
 }  }
   
Line 1383  sub get_display_settings { Line 1386  sub get_display_settings {
     if ($tmp=~ /^(con_lost|error|no_such_host)/i) {      if ($tmp=~ /^(con_lost|error|no_such_host)/i) {
         %settings = ();          %settings = ();
         unless ($tmp =~ /^error: 2 /) {          unless ($tmp =~ /^error: 2 /) {
             my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
             &Apache::lonnet::logthis('Error retrieving whatsnew settings: '.              &Apache::lonnet::logthis('Error retrieving whatsnew settings: '.
             $tmp.' for '.$uname.':'.$udom.' for '.$lctype.': '.$cid);              $tmp.' for '.$uname.':'.$udom.' for '.$lctype.': '.$cid);
         }          }
Line 1425  sub store_interval_setting { Line 1428  sub store_interval_setting {
                   '<b>'.$$interval_titles{$env{'form.interval'}}.'</b><br />');                    '<b>'.$$interval_titles{$env{'form.interval'}}.'</b><br />');
   
         } else {          } else {
             my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
             &Apache::lonnet::logthis('Error storing whatsnew interval setting'.              &Apache::lonnet::logthis('Error storing whatsnew interval setting'.
                 ' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);                  ' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
             $result = &mt('Unable to set interval to [_1] due to [_2].',              $result = &mt('Unable to set interval to [_1] due to [_2].',
Line 1449  sub store_discussion_setting { Line 1452  sub store_discussion_setting {
                   '<b>'.$env{'form.countunread'}.'</b><br />');                    '<b>'.$env{'form.countunread'}.'</b><br />');
                                                                                                                                                                       
         } else {          } else {
             my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
             &Apache::lonnet::logthis('Error storing whatsnew countunread setting'.              &Apache::lonnet::logthis('Error storing whatsnew countunread setting'.
                 ' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);                  ' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
             $result = &mt('Unable to set "number unread posts display" to [_1]'.              $result = &mt('Unable to set "number unread posts display" to [_1]'.
Line 1478  sub store_courseinit_setting { Line 1481  sub store_courseinit_setting {
             }              }
         }          }
         if ($page_control) {          if ($page_control) {
             my $lctype = lc($env{'course.'.$env{'request.course.id'}.'.type'});      my $lctype = lc(&Apache::loncommon::course_type());
             my $outcome = &Apache::lonnet::put('nohist_whatsnew',              my $outcome = &Apache::lonnet::put('nohist_whatsnew',
                                            \%courseinit_settings,$udom,$uname);                                             \%courseinit_settings,$udom,$uname);
             if ($outcome eq 'ok') {              if ($outcome eq 'ok') {
                 if ($page_control eq 'global preferences') {                  if ($page_control eq 'global preferences') {
                     $result = &mt("Page displayed after role selection in [_1] now set by <b>user's global preferences</b>.",$lctype);                      $result = &mt("Page displayed after role selection in $lctype now set by <b>user's global preferences</b>.");
                 } else {                  } else {
                     $result = &mt('Page displayed after role selection in this [_1] set to <b>[_2]</b>',$lctype,$$initpage{$env{'form.courseinit_page'}});                      $result = &mt('Page displayed after role selection in this '.$lctype.' set to <b>[_2]</b>',$lctype,$$initpage{$env{'form.courseinit_page'}});
                 }                  }
             } else {              } else {
                 &Apache::lonnet::logthis('Error storing whatsnew courseinit '.                  &Apache::lonnet::logthis('Error storing whatsnew courseinit '.
Line 1497  sub store_courseinit_setting { Line 1500  sub store_courseinit_setting {
                          '<b>'.$page_control.'</b>',                           '<b>'.$page_control.'</b>',
                          '<tt>'.$outcome.'</tt>.<br />');                           '<tt>'.$outcome.'</tt>.<br />');
                 } else {                  } else {
                     $result = &mt('Unable to set page display, after role selection, for this [_1] to <b>[_2]</b> due to <tt>[_3]</tt>.<br />',$lctype,                      $result = &mt('Unable to set page display, after role selection, for this '.$lctype.' to <b>[_2]</b> due to <tt>[_3]</tt>.<br />',
                          $$initpage{$env{'form.courseinit_page'}},$outcome);                           $$initpage{$env{'form.courseinit_page'}},$outcome);
                 }                  }
             }              }

Removed from v.1.58  
changed lines
  Added in v.1.59


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>