Diff for /loncom/interface/lonwhatsnew.pm between versions 1.105.2.16 and 1.132

version 1.105.2.16, 2020/03/30 11:15:09 version 1.132, 2025/03/22 21:18:30
Line 1 Line 1
   # The LearningOnline Network
   # What's New in a course
 #  #
 # $Id$  # $Id$
 #  #
Line 80  sub handler { Line 82  sub handler {
     }      }
     unless ($isadhoc) {      unless ($isadhoc) {
         %checkallowed = ( coursenormalmail => 1,          %checkallowed = ( coursenormalmail => 1,
                           coursecritmail => 1,);    coursecritmail => 1,);
     }      }
     foreach my $perm_check (['whn','whatsnew',1],      foreach my $perm_check (['whn','whatsnew',1],
     ['pch','coursediscussion',1],      ['pch','coursediscussion',1],
Line 116  sub handler { Line 118  sub handler {
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
   
     $r->print(&display_header($command,\%checkallowed));      my $udom = $env{'user.domain'};
       my $uname = $env{'user.name'};
       my $cid = $env{'request.course.id'};
       my $store_result = &store_display_settings($uname,$udom,$cid,\%checkallowed);
       my $store_error;
   
       unless ($store_result eq 'ok') {
           my $lctype = lc(&Apache::loncommon::course_type());
           &Apache::lonnet::logthis('Error saving whatsnew settings: '.
               $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
           $store_error = '<span class="LC_error">'
                     .&mt('Unable to save visibility settings due to [_1]',
                          $store_result)
                     .'</span>';
       }
   
       $r->print(&display_header($command,$uname,$udom,$cid,\%checkallowed));
   
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb
Line 183  sub handler { Line 201  sub handler {
             ("What's New?",#'Course_Action_Items_Display'              ("What's New?",#'Course_Action_Items_Display'
      ));       ));
     }      }
     &display_main_box($r,$command,$refpage,\%checkallowed,$cdom,$crs);      &display_main_box($r,$command,$refpage,\%checkallowed,$cdom,$crs,$store_error);
     return OK;      return OK;
 }  }
   
Line 194  sub handler { Line 212  sub handler {
 #------------------------------  #------------------------------
                                                                                                                                                                   
 sub display_main_box {  sub display_main_box {
     my ($r,$command,$refpage,$checkallowed,$cdom,$crs) = @_;      my ($r,$command,$refpage,$checkallowed,$cdom,$crs,$store_error) = @_;
     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 $lctype = lc(&Apache::loncommon::course_type());      my $lctype = lc(&Apache::loncommon::course_type());
     $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 (
                          av_attempts => 'Average number of attempts',                           av_attempts => 'Average number of attempts',
Line 243  sub display_main_box { Line 260  sub display_main_box {
         crslogin => \%crslogins,          crslogin => \%crslogins,
         sessions => \%sessions,          sessions => \%sessions,
     );      );
     my %initpage = &Apache::lonlocal::texthash (      my %initpage = (
                      firstres => "first resource in the $lctype",                       firstres => "first resource in the $lctype",
                      whatsnew => "What's New Page",                       whatsnew => "What's New Page",
                      userpref => 'your general user preferences',                       userpref => 'your general user preferences',
                      coursespecific => "specific setting for this $lctype",                       coursespecific => "specific setting for this $lctype",
                    );                     );
       $r->print('<div class="LC_landmark" role="main">');
   
     if (($command eq 'chgthreshold')       if (($command eq 'chgthreshold') 
  && $checkallowed->{'abovethreshold'}) {   && $checkallowed->{'abovethreshold'}) {
Line 275  sub display_main_box { Line 293  sub display_main_box {
         &display_interval_config($r,$refpage,\%interval_titles,'sessions');          &display_interval_config($r,$refpage,\%interval_titles,'sessions');
     } else {      } else {
         &display_actions_box($r,$command,$refpage,\%threshold_titles,          &display_actions_box($r,$command,$refpage,\%threshold_titles,
                         \%interval_titles,\%initpage,$cdom,$crs,$checkallowed);                          \%interval_titles,\%initpage,$cdom,$crs,
                           $checkallowed,$store_error);
     }      }
     my $end_page = &Apache::loncommon::end_page();      my $end_page = &Apache::loncommon::end_page();
     $r->print(<<END_OF_BLOCK);      $r->print('<br /></div>'.$end_page);
   </td>  
  </tr>  
 </table><br />  
 $end_page  
 END_OF_BLOCK  
 }  }
   
 #-------------------------------  #-------------------------------
Line 294  END_OF_BLOCK Line 308  END_OF_BLOCK
 #-------------------------------  #-------------------------------
   
 sub display_header {  sub display_header {
     my ($command,$checkallowed) = @_;      my ($command,$uname,$udom,$cid,$checkallowed) = @_;
       
     my $scripttag;      my $scripttag;
     unless ($command eq 'chgthreshold' || $command eq 'chginterval' ||       my $args = {};
             $command eq 'chgoldroleinterval' ||      my %loadentries;
             $command eq 'chgnewroleinterval' || $command eq 'chgcrslogininterval') {  
        $scripttag = <<"END";      if ($command eq 'courseinit') {
           $scripttag = <<"END";
   <script type="text/javascript">
   // <![CDATA[
   function toggleCourseInit(form) {
       if (document.getElementById('courseinit_by_course')) {
           var radioelem = form.elements['courseinit_control'];
           if (radioelem.length) {
               for (var i=0; i<radioelem.length; i++) {
                   if (radioelem[i].checked) {
                       if (radioelem[i].value == 'coursespecific') {
                           document.getElementById('courseinit_by_course').style.display = 'inline';
                       } else {
                            document.getElementById('courseinit_by_course').style.display = 'none';
                       }
                       break;
                   }
               }
           }
       }
       return;
   }
   // ]]>
   </script>
   END
           $loadentries{'onload'} = 'toggleCourseInit(document.courseinitswitch);';
       } else {
           unless (($command eq 'chgthreshold' && $checkallowed->{'abovethreshold'}) ||
                   ($command eq 'chginterval' && $checkallowed->{'versionchanges'}) ||
                   ($command eq 'chgdisc' && $checkallowed->{'coursediscussion'}) ||
                   ($command eq 'chgoldroleinterval' && $checkallowed->{'oldroles'}) ||
                   ($command eq 'chgnewroleinterval' && $checkallowed->{'newroles'}) ||
                   ($command eq 'chgcrslogininterval' && $checkallowed->{'crslogin'}) ||
                   ($command eq 'chgsessionlimit' && $checkallowed->{'sessions'})) {
               my %display_settings = &get_display_settings($uname,$udom,$cid);
               $scripttag = <<"END";
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
 function change_display(caller,change) {  function change_display(caller,change) {
Line 310  function change_display(caller,change) { Line 359  function change_display(caller,change) {
   
 function changeAll(change) {  function changeAll(change) {
 END  END
         foreach my $item (keys(%{$checkallowed})) {              foreach my $item (keys(%{$checkallowed})) {
     if ($item =~ /_section$/) { next; }          if ($item =~ /_section$/) { next; }
             if ($$checkallowed{$item}) {                  if ($$checkallowed{$item}) {
                 $scripttag.='document.visible.display_'.$item.'.value=change'.                      $scripttag.='document.visible.display_'.$item.'.value=change'.
                             "\n";                                  "\n";
                   }
             }              }
         }              $scripttag.=<<"ENDTOGG";
         $scripttag.=<<"ENDTOGG";  
     document.visible.submit();      document.visible.submit();
 }  }
   
Line 373  function toggledetails(prefix) { Line 422  function toggledetails(prefix) {
 // ]]>  // ]]>
 </script>  </script>
 ENDTOGG  ENDTOGG
               if (($checkallowed->{'crslogin'}) && ($display_settings{$cid.':crslogin'} ne 'hide')) {
                   $loadentries{'onload'} = "toggledetails('login');";
               }
               if (($checkallowed->{'sessions'}) && ($display_settings{$cid.':sessions'} ne 'hide')) {
                   $loadentries{'onload'} .= "toggledetails('session');";
               }
           }
     }      }
     my $course_type=&Apache::loncommon::course_type();      my $course_type=&Apache::loncommon::course_type();
       if (keys(%loadentries)) {
           $args->{'add_entries'} = \%loadentries;
       }
     return &Apache::loncommon::start_page("What's New?",      return &Apache::loncommon::start_page("What's New?",
   $scripttag);    $scripttag,$args);
 }  }
   
 #-------------------------------  #-------------------------------
Line 388  ENDTOGG Line 447  ENDTOGG
                                                                                                                                                                   
 sub display_actions_box {  sub display_actions_box {
     my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage,      my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage,
         $cdom,$crs,$checkallowed) = @_;          $cdom,$crs,$checkallowed,$store_error) = @_;
     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'};
Line 465  sub display_actions_box { Line 524  sub display_actions_box {
     }      }
     $header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'      $header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'
               .' <span class="LC_nobreak">'                .' <span class="LC_nobreak">'
               .&mt('Currently: [_1].','<i>'.$currinit.'</i>')                .&mt('Currently: [_1].','<span class="LC_cusr_emph">'.$currinit.'</span>')
               .'&nbsp;&nbsp;'                .'&nbsp;&nbsp;'
               .&mt('[_1]Change[_2] for just [_3]this '.$lctype.'[_4] or for [_5]all your courses/communities[_6].'                .&mt('[_1]Change[_2] for just [_3]this '.$lctype.'[_4] or for [_5]all your courses/communities[_6].'
                   ,'<b>'                    ,'<b>'
Line 488  sub display_actions_box { Line 547  sub display_actions_box {
         $result = &store_discussion_setting($uname,$udom,$cid);          $result = &store_discussion_setting($uname,$udom,$cid);
     }      }
   
     my $store_result=&store_display_settings($uname,$udom,$cid,$checkallowed);      if ($store_error) {
           $result = $store_error;
     unless ($store_result eq 'ok') {   
         &Apache::lonnet::logthis('Error saving whatsnew settings: '.  
             $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid);  
         $result .= '<span class="LC_error">'  
                   .&mt('Unable to save visibility settings due to [_1]',  
                        $store_result)  
                   .'</span>';  
     }      }
   
     if ($result) {      if ($result) {
Line 653  sub display_actions_box { Line 705  sub display_actions_box {
   
     foreach my $item (@actionorder) {      foreach my $item (@actionorder) {
         unless ($item eq 'coursenormalmail' || $item eq 'coursecritmail' ||          unless ($item eq 'coursenormalmail' || $item eq 'coursecritmail' ||
                 $item eq 'newroles' || $item eq 'oldroles') {                  $item eq 'newroles' || $item eq 'oldroles' || 
                   $item eq 'crslogin' || $item eq 'sessions') {
             if ($show{$item}) {              if ($show{$item}) {
                 $needitems = 1;                  $needitems = 1;
                 last;                  last;
Line 687  sub display_actions_box { Line 740  sub display_actions_box {
     if ($show{'sessions'}) {      if ($show{'sessions'}) {
         $sessioncount = &getsessions($cdom,$crs,\%sessions,$timediff{'sessions'},$classlist);          $sessioncount = &getsessions($cdom,$crs,\%sessions,$timediff{'sessions'},$classlist);
     }      }
     $r->print(qq|<a href="javascript:changeAll('hide');">$lt{'hial'}</a>      my $showhideall = <<"END";
      &nbsp;&nbsp;<a href="javascript:changeAll('show');">$lt{'shal'}</a>  <span class="LC_nobreak"><a href="javascript:changeAll('hide');">$lt{'hial'}</a>
      <form method="post" name="visible" action="/adm/whatsnew">\n|);  &nbsp;&nbsp;<a href="javascript:changeAll('show');">$lt{'shal'}</a></span>
   END
       $r->print(&Apache::loncommon::head_subbox($showhideall));
       $r->print(qq|<form method="post" name="visible" action="/adm/whatsnew">\n|);
   
     foreach my $item (keys(%{$checkallowed})) {      foreach my $item (keys(%{$checkallowed})) {
  if ($item =~ /_section$/) { next; }   if ($item =~ /_section$/) { next; }
         if ($$checkallowed{$item}) {          if ($$checkallowed{$item}) {
Line 697  sub display_actions_box { Line 754  sub display_actions_box {
         }          }
     }      }
   
     $r->print('<input type="hidden" name="refpage" value="'.$refpage.'" /><table class="LC_double_column"><tr><td class="LC_left_col">');      $r->print('<input type="hidden" name="refpage" value="'.$refpage.'" />'."\n".
                 '<div class=" LC_landmark" style="clear: both; width: 100%">'."\n".
                 '<div class="LC_floatleft LC_landmark" style="width: 48%">');
   
     my $displayed = 0;      my $displayed = 0;
     my $totalboxes = 0;      my $totalboxes = 0;
Line 713  sub display_actions_box { Line 772  sub display_actions_box {
     foreach my $actionitem (@actionorder) {      foreach my $actionitem (@actionorder) {
         if ($checkallowed->{$actionitem}) {          if ($checkallowed->{$actionitem}) {
             if (($actioncolumn{$actionitem} eq 'right') && ($currcolumn eq 'left')) {              if (($actioncolumn{$actionitem} eq 'right') && ($currcolumn eq 'left')) {
                 $r->print('</td><td>&nbsp;</td><td class="LC_right_col" >');                  $r->print('</div><div class="LC_floatright LC_landmark" style="width: 48%">');
                 $currcolumn = 'right';                   $currcolumn = 'right';
             }              }
             &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,\%loggedin,$logincount,\%sessions,$sessioncount,$classlist);              &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,\%loggedin,$logincount,\%sessions,$sessioncount,$classlist);
             $displayed ++;               $displayed ++; 
         }          }
     }      }
     $r->print('      $r->print('</div></div><div style="padding:0;clear:both;margin:0;border:0"></div>
       </td>  
     </tr>  
    </table>  
    </form>     </form>
 ');  ');
 }  }
Line 766  sub display_threshold_config { Line 822  sub display_threshold_config {
         my $onchange = 'onfocus="javascript:window.document.forms'.          my $onchange = 'onfocus="javascript:window.document.forms'.
               "['thresholdform'].elements['".$parameter."_setparmval']".                "['thresholdform'].elements['".$parameter."_setparmval']".
               '.checked=true;"';                '.checked=true;"';
           my $aria_textbox = ' aria-label="'.&mt('Threshold value for [_1]',
                                                  $threshold_titles{$type}).'"';
           my $aria_checkbox = ' aria-label="'.&mt('Change threshold value for [_1]',
                                                   $threshold_titles{$type}).'"';
         $r->print(&Apache::loncommon::start_data_table_row()."\n".          $r->print(&Apache::loncommon::start_data_table_row()."\n".
                  '<td>'.$threshold_titles{$type}.'</td>'."\n".                   '<td>'.$threshold_titles{$type}.'</td>'."\n".
                  '<td>'.&Apache::lonhtmlcommon::textbox($parameter.'_value',                   '<td>'.&Apache::lonhtmlcommon::textbox($parameter.'_value',
                                             $threshold{$type},                                              $threshold{$type},
                                             10,$onchange).'</td>'."\n".                                              10,$onchange.$aria_textbox).'</td>'."\n".
                  '<td>'.                   '<td>'.
                  &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval').                   &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval',
                                                     '','',$aria_checkbox).
                  '</td>'."\n".                   '</td>'."\n".
                  &Apache::loncommon::end_data_table_row());                   &Apache::loncommon::end_data_table_row());
     }      }
Line 826  sub display_interval_config { Line 887  sub display_interval_config {
 <input type="hidden" name="intervaltype" value="'.$context.'" />  <input type="hidden" name="intervaltype" value="'.$context.'" />
 <input type="hidden" name="refpage" value="'.$refpage.'" />'.  <input type="hidden" name="refpage" value="'.$refpage.'" />'.
 &mt('Display:').'   &mt('Display:').' 
 <select name="interval">  <select name="interval" aria-label="'.&mt('Choose time window').'">
 <option value="" selected="selected">'.&mt('Select').'</option>  <option value="" selected="selected">'.&mt('Select').'</option>
 ');  ');
     if (ref($interval_titles) eq 'HASH') {      if (ref($interval_titles) eq 'HASH') {
Line 914  sub courseinit_config { Line 975  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 $courseinitsty = 'display:none;';
       if ($control eq 'coursespecific') {
           $courseinitsty = 'display:inline;';
       }
     my $lctype = lc(&Apache::loncommon::course_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',  
                              'anis' => 'and is set to display',  
                              'padc' => 'Page display controlled by',                               'padc' => 'Page display controlled by',
                              'chce' => 'Choose '.$lctype.' entry',                               'chce' => "Choose $lctype entry",
                              'moce' => 'Save',                               'moce' => 'Save',
     );      );
     $r->print(<<"END");       $lt{'cuva'} = &mt('Current value is determined by[_1]'.$initpage->{$control}.'[_2] and is set to display[_1]'.$initpage->{$current}.'[_2].',
                         ': <span class="LC_cusr_emph">','</span>');
       $r->print(<<"END");
 <br />$lt{'chwp'}  <br />$lt{'chwp'}
 <br />$lt{'cuva'}: <b>  <br />$lt{'cuva'}
 $$initpage{$control}</b> $lt{'anis'} <b>  <br /><br />
 $$initpage{$current}</b>.<br /><br />  
 <form method="post" name="courseinitswitch" action="/adm/whatsnew">  <form method="post" name="courseinitswitch" action="/adm/whatsnew">
 <input type="hidden" name="command" value="newcourseinit" />  <input type="hidden" name="command" value="newcourseinit" />
 <input type="hidden" name="refpage" value="$refpage" />  <input type="hidden" name="refpage" value="$refpage" />
 $lt{'padc'}:&nbsp;&nbsp;  <fieldset style="display:inline"><legend>$lt{'padc'}</legend>
 END  END
     foreach my $choice (@chgstate) {      foreach my $choice (@chgstate) {
         my $chkstring;          my $chkstring;
         if ($choice eq $control) {          if ($choice eq $control) {
             $chkstring = ' checked="checked" ';              $chkstring = ' checked="checked" ';
         }            }
         $r->print('<span class="LC_nobreak"><label><input type="radio" name="courseinit_control" value="'.          $r->print('<span class="LC_nobreak"><label><input type="radio" name="courseinit_control" value="'.
                    $choice.'"'.$chkstring.'/>'.$$initpage{$choice}.                     $choice.'"'.$chkstring.' onclick="toggleCourseInit(this.form);" />'.&mt($initpage->{$choice}).
                    '&nbsp;&nbsp;</label></span>');                     '&nbsp;&nbsp;</label></span>');
     }      }
     $r->print('<br /><br />'.&mt('If').' '.$$initpage{'coursespecific'}.      $r->print('</fieldset><fieldset id="courseinit_by_course" style="'.$courseinitsty.'">'.
               ' - <br />'.$lt{'chce'}.": \n");                '<legend>'.$lt{'chce'}.'</legend>'."\n");
     foreach my $choice (@chgentry) {      foreach my $choice (@chgentry) {
         my $chkstring;          my $chkstring;
         if (($choice eq $current) && ($control eq 'coursespecific')) {          if (($choice eq $current) && ($control eq 'coursespecific')) {
             $chkstring = ' checked="checked" ';              $chkstring = ' checked="checked" ';
         }          }
         $r->print('<span class="LC_nobreak"><label><input type="radio" name="courseinit_page" value="'.          $r->print('<span class="LC_nobreak"><label><input type="radio" name="courseinit_page" value="'.
                   $choice.'"'.$chkstring.'/>'.$$initpage{$choice}.                    $choice.'"'.$chkstring.'/>'.&mt($initpage->{$choice}).
                   '&nbsp;&nbsp;</label></span>');                    '&nbsp;&nbsp;</label></span> ');
     }      }
     $r->print('<br /><br /><input type="submit" name="display" value="'.      $r->print('</fieldset><br /><br /><input type="submit" name="display" value="'.
                $lt{'moce'}.'" /></form>');                 $lt{'moce'}.'" /></form>');
     return;      return;
 }  }
Line 1120  sub check_discussions { Line 1184  sub check_discussions {
 sub check_handgraded {  sub check_handgraded {
     my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_;      my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_;
     if ($resource->is_problem()) {      if ($resource->is_problem()) {
         my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);          my ($handgradeable,$is_task);
         my $partlist=$resource->parts();          my $partlist=$resource->parts();
         my $handgradeable;          if ($resource->is_task()) {
         foreach my $part (@$partlist) {              $is_task = 1;
             if ($resource->handgrade($part) eq 'yes') {              foreach my $part (@$partlist) {
                 $handgradeable=1; last;                  if ($resource->handgrade($part) eq 'yes') {
                       $handgradeable=1;
                       last;
                   }
               }
           } else {
               foreach my $part (@$partlist) {
                   my @types = $resource->responseType($part);
                   if (grep(/^essay$/,@types)) {
                       $handgradeable=1;
                       last;
                   } elsif (grep(/^custom$/,@types)) {
                       if ($resource->handgrade($part) eq 'yes') {
                           $handgradeable=1;
                           last;
                       }
                   }
             }              }
         }          }
         if ($handgradeable) {          if ($handgradeable) {
Line 1134  sub check_handgraded { Line 1214  sub check_handgraded {
             if (@ungraded > 0) {              if (@ungraded > 0) {
                 $$ungraded{$symb}{count} = scalar(@ungraded);                  $$ungraded{$symb}{count} = scalar(@ungraded);
                 $$ungraded{$symb}{title} = $title;                  $$ungraded{$symb}{title} = $title;
                   $$ungraded{$symb}{is_task} = $is_task;
                 if ($resource->encrypted()) {                  if ($resource->encrypted()) {
                     $$ungraded{$symb}{'enclink'} = $resource->link();                      $$ungraded{$symb}{'enclink'} = $resource->link();
                     $$ungraded{$symb}{'encsymb'} = $resource->shown_symb();                      $$ungraded{$symb}{'encsymb'} = $resource->shown_symb();
Line 1230  sub check_thresholds { Line 1311  sub check_thresholds {
                      <td>'.$stats{$part}{degdiff}.'</td>                       <td>'.$stats{$part}{degdiff}.'</td>
                      <td>'.$lastreset{$part}.'</td>';                       <td>'.$lastreset{$part}.'</td>';
                 if ($checkallowed->{'resetcounters'}) {                  if ($checkallowed->{'resetcounters'}) {
                       my $aria = ' aria-label="'.&mt('Reset counter for [_1] (part [_2])',
                                                     $$triggered{$symb}{title},$part).'"';
                     $$triggered{$symb}{text}[$partcount] .=                      $$triggered{$symb}{text}[$partcount] .=
                         '<td><input type="checkbox" name="'.$resetname.'" />'.                          '<td><input type="checkbox" name="'.$resetname.'"'.$aria.' />'.
                         '<input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>';                          '<input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>';
                 }                  }
                 $partcount ++;                  $partcount ++;
Line 1389  sub getnormalmail { Line 1472  sub getnormalmail {
                 if (defined($sendtime) && $sendtime!~/error/) {                  if (defined($sendtime) && $sendtime!~/error/) {
                     if (($emailstatus{$msgid} eq 'new') || ($status eq 'new')) {                      if (($emailstatus{$msgid} eq 'new') || ($status eq 'new')) {
                         $sendtime = &Apache::lonlocal::locallocaltime($sendtime);                          $sendtime = &Apache::lonlocal::locallocaltime($sendtime);
                         $msgcount ++;          $msgcount ++;
                         if ($shortsubj eq '') {                          if ($shortsubj eq '') {
                             $shortsubj = &mt('No subject');                              $shortsubj = &mt('No subject');
                         }                          }
Line 1792  sub display_handgrade { Line 1875  sub display_handgrade {
                         'nopr' => 'No problems require handgrading',                          'nopr' => 'No problems require handgrading',
     );      );
     if (@{$tograde} > 0) {      if (@{$tograde} > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.          $r->print('<tr class="LC_info_row"><th class="LC_left_item">'.
                   $lt{'prna'}.'</td><td class="LC_right_item">'.                    $lt{'prna'}.'</th><th class="LC_right_item">'.
                   $lt{'nmun'}.'</td></tr>');                    $lt{'nmun'}.'</th></tr>');
         my $rowNum = 0;          my $rowNum = 0;
           my $usediv; 
           if (@{$tograde} > 1) {
               $usediv = 1;
           } 
         foreach my $res (@{$tograde}) {          foreach my $res (@{$tograde}) {
             $rowNum ++;              $rowNum ++;
             my $css_class = $rowNum%2?' class="LC_odd_row"':'';              my $css_class = $rowNum%2?' class="LC_odd_row"':'';
             my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);              my $linkurl;
             my $linkurl=&Apache::lonnet::clutter($url);              if ($$ungraded{$res}{'is_task'}) {
             $linkurl .= '?symb='.&escape($res);                  my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
             if ($$ungraded{$res}{'enclink'}) {                  $linkurl=&Apache::lonnet::clutter($url);
                 $linkurl =                  $linkurl .= '?symb='.&escape($res);
                     $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};                  if ($$ungraded{$res}{'enclink'}) {
                       $linkurl =
                           $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};
                   }
               } else {
                   $linkurl='/adm/grades';
                   if ($$ungraded{$res}{'enclink'}) {
                       $linkurl.='?symb='.$$ungraded{$res}{'encsymb'};
                   } else {
                       $linkurl.='?symb='.&escape($res);
                   }
                   $linkurl.='&amp;command=ungraded';
             }              }
             $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');              $r->print('<tr'.$css_class.'><td>');
               if ($usediv) {
                   $r->print('<div class="LC_minheight">');
               }
               $r->print('<a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a>');
               if ($usediv) {
                   $r->print('</div>');
               }
               $r->print('</td>'.
                         '<td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');
         }          }
     } elsif ($itemserror) {      } elsif ($itemserror) {
         $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$itemserror.'</th></tr>');
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$lt{'nopr'}.'</th></tr>');
     }      }
 }  }
   
Line 1824  sub display_haserrors { Line 1931  sub display_haserrors {
                                    noer => 'No problems with errors',                                     noer => 'No problems with errors',
     );      );
     if (@{$bombs} > 0) {      if (@{$bombs} > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.          $r->print('<tr class="LC_info_row"><th class="LC_left_item">'.
                   $lt{'reso'}.'</td><td class="LC_right_item">'.                    $lt{'reso'}.'</th><th class="LC_right_item">'.
                   $lt{'nmer'}.'</td></tr>');                    $lt{'nmer'}.'</th></tr>');
         @{$bombs} = sort { &cmp_title($a,$b,$res_title) } @{$bombs};          @{$bombs} = sort { &cmp_title($a,$b,$res_title) } @{$bombs};
           my $usediv;
           if (@{$bombs} > 1) {
               $usediv = 1;
           }
         foreach my $bomb (@{$bombs}) {          foreach my $bomb (@{$bombs}) {
             $bombnum ++;              $bombnum ++;
             my $css_class = $bombnum%2?' class="LC_odd_row"':'';              my $css_class = $bombnum%2?' class="LC_odd_row"':'';
             $r->print('<tr'.$css_class.'><td>'.$$bombed{$bomb}{errorlink}.              $r->print('<tr'.$css_class.'><td style="vertical-align:middle;">');
                       '</td><td class="LC_right_item">'.              if ($usediv) {
                   $r->print('<div class="LC_minheight">');
               }
               $r->print($$bombed{$bomb}{errorlink});
               if ($usediv) {
                   $r->print('</div>');
               } 
               $r->print('</td><td class="LC_right_item" style="vertical-align:middle;">'.
                       $$bombed{$bomb}{errorcount}.'</td></tr>');                        $$bombed{$bomb}{errorcount}.'</td></tr>');
         }          }
     } elsif ($itemserror) {      } elsif ($itemserror) {
         $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$itemserror.'</th></tr>');
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.$lt{'noer'}.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$lt{'noer'}.'</th></tr>');
     }      }
     return;      return;
 }  }
Line 1859  sub display_abovethreshold { Line 1977  sub display_abovethreshold {
     if (@{$warnings} > 0) {      if (@{$warnings} > 0) {
         @{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings};          @{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings};
         $r->print('<tr class="LC_info_row">'.          $r->print('<tr class="LC_info_row">'.
   '<td class="LC_left_item">'.$lt{'reso'}.    '<th class="LC_left_item">'.$lt{'reso'}.
                   '<input type="hidden" name="command" value="" /></td>'.                    '<input type="hidden" name="command" value="" /></th>'.
   '<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'.    '<th>'.$lt{'part'}.'</th><th>'.$lt{'nust'}.'</th>'.
   '<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'.    '<th>'.$lt{'avat'}.'</th><th>'.$lt{'dedi'}.'</th>'.
   '<td>'.$lt{'lare'}.'</td>');    '<th>'.$lt{'lare'}.'</th>');
         if ($checkallowed->{'resetcounters'}) {          if ($checkallowed->{'resetcounters'}) {
             $r->print('<td  class="LC_right_item">'.$lt{'reco'}.'</td>');              $r->print('<th class="LC_right_item">'.$lt{'reco'}.'</th>');
         }          }
         $r->print('</tr>');          $r->print('</tr>');
  my $row;   my ($usediv,$row);
           if (@{$warnings} > 1) {
               $usediv = 1;
           }
         foreach my $res (@{$warnings}) {          foreach my $res (@{$warnings}) {
     $row++;      $row++;
             my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);              my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
Line 1884  sub display_abovethreshold { Line 2005  sub display_abovethreshold {
             }              }
             my $css_class = $row%2?' class="LC_odd_row"':'';              my $css_class = $row%2?' class="LC_odd_row"':'';
             $r->print('<tr'.$css_class.'>'.              $r->print('<tr'.$css_class.'>'.
       '<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'.        '<td class="LC_first_item" '.$rowspan.'>');
       $$triggered{$res}{title}.'</a></td>');              if ($usediv) {
                       if (ref($$triggered{$res}{text}) eq 'ARRAY') {                  $r->print('<div class="LC_minheight">');
           $r->print($$triggered{$res}{text}[0]);              }
                       }              $r->print('<a href="'.$linkurl.'">'.
                       $r->print('</tr>');        $$triggered{$res}{title}.'</a>');
               if ($usediv) {
                   $r->print('</div>');
               }
               $r->print('</td>');
               if (ref($$triggered{$res}{text}) eq 'ARRAY') {
           $r->print($$triggered{$res}{text}[0]);
               }
               $r->print('</tr>');
             if (ref($$triggered{$res}{text}) eq 'ARRAY') {              if (ref($$triggered{$res}{text}) eq 'ARRAY') {
                 if (@{$$triggered{$res}{text}} > 1) {                  if (@{$$triggered{$res}{text}} > 1) {
                     for (my $i=1; $i<@{$$triggered{$res}{text}}; $i++) {                      for (my $i=1; $i<@{$$triggered{$res}{text}}; $i++) {
Line 1903  sub display_abovethreshold { Line 2032  sub display_abovethreshold {
             $r->print('<tr class="LC_info_row"><td colspan="7" class="LC_right_item"><br /><input type="button" name="counters" value="'.$lt{'rese'}.'" onclick="javascript:thresholdreset();" /></td></tr>');              $r->print('<tr class="LC_info_row"><td colspan="7" class="LC_right_item"><br /><input type="button" name="counters" value="'.$lt{'rese'}.'" onclick="javascript:thresholdreset();" /></td></tr>');
         }          }
     } elsif ($itemserror) {      } elsif ($itemserror) {
         $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$itemserror.'</th></tr>');
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$lt{'nopr'}.'</th></tr>');
     }      }
 }  }
   
Line 1918  sub display_versionchanges { Line 2047  sub display_versionchanges {
         'veru' => 'Version used',          'veru' => 'Version used',
     );      );
     if (keys(%{$changed}) > 0) {      if (keys(%{$changed}) > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.          $r->print('<tr class="LC_info_row">'.
                   $lt{'reso'}.'</td><td>'.$lt{'revd'}.'</td><td>'.                    '<th class="LC_left_item LC_nobreak">'.$lt{'reso'}.'</th>'.
                   $lt{'newv'}.'</td><td class="LC_right_item">'.                    '<th class="LC_left_item LC_nobreak">'.$lt{'revd'}.'</th>'.
                   $lt{'veru'}.'</td></tr>');                    '<th class="LC_left_item LC_nobreak">'.$lt{'newv'}.'</th>'.
                     '<th class="LC_left_item LC_nobreak">'.$lt{'veru'}.'</th>'.
                     '</tr>');
         my @changes = sort { &cmp_title($a,$b,$res_title) } keys(%{$changed});          my @changes = sort { &cmp_title($a,$b,$res_title) } keys(%{$changed});
         my $changenum = 0;          my $changenum = 0;
           my $usediv;
           if (@changes > 1) {
               $usediv = 1;
           }
         foreach my $item (@changes) {          foreach my $item (@changes) {
             $changenum ++;              $changenum ++;
             my $css_class = $changenum%2?' class="LC_odd_row"':'';              my $css_class = $changenum%2?' class="LC_odd_row"':'';
Line 1931  sub display_versionchanges { Line 2066  sub display_versionchanges {
             my $linkurl=&Apache::lonnet::clutter($url);              my $linkurl=&Apache::lonnet::clutter($url);
             $linkurl .= '?symb='.&escape($item);              $linkurl .= '?symb='.&escape($item);
   
             $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.              $r->print('<tr'.$css_class.'><td>');
                       $$res_title{$item}.'</a></td><td>'.              if ($usediv) {
                   $r->print('<div class="LC_minheight">');
               }
               $r->print('<a href="'.$linkurl.'">'.
                         $$res_title{$item}.'</a>');
               if ($usediv) {
                   $r->print('</div>');
               }
               $r->print('</td><td>'.
                       $$changed{$item}{'revdate'}.'</td><td>'.                        $$changed{$item}{'revdate'}.'</td><td>'.
                       $$changed{$item}{'current'}.'</td><td>'.                        $$changed{$item}{'current'}.'</td><td>'.
                       $$changed{$item}{'version'}.'</td></tr>');                        $$changed{$item}{'version'}.'</td></tr>');
         }          }
     } elsif ($itemserror) {      } elsif ($itemserror) {
         $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$itemserror.'</th></tr>');
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'          $r->print('<tr class="LC_empty_row"><th>'
                  .&mt('No '.$interval).'</td></tr>');                   .&mt('No '.$interval).'</th></tr>');
     }      }
     return;      return;
 }  }
Line 1958  sub display_rolechanges { Line 2101  sub display_rolechanges {
     );      );
     if ($chgcount) {      if ($chgcount) {
         $r->print('<tr class="LC_info_row">'.          $r->print('<tr class="LC_info_row">'.
                   '<td class="LC_left_item">'.$lt{'tich'}.'</td>'.                    '<th class="LC_left_item">'.$lt{'tich'}.'</th>'.
                   '<td class="LC_left_item">'.$lt{'user'}.'</td>'.                    '<th class="LC_left_item">'.$lt{'user'}.'</th>'.
                   '<td class="LC_left_item">'.$lt{'role'}.'</td>'.                    '<th class="LC_left_item">'.$lt{'role'}.'</th>'.
                   '<td class="LC_left_item">'.$lt{'sec'}.'</td>'.                    '<th class="LC_left_item">'.$lt{'sec'}.'</th>'.
                   '<td class="LC_left_item">'.$lt{'status'}.'</td></tr>');                    '<th class="LC_left_item">'.$lt{'status'}.'</th></tr>');
         if (ref($changed) eq 'HASH') {          if (ref($changed) eq 'HASH') {
             my @changes = sort { $b <=> $a } (keys(%{$changed}));              my @changes = sort { $b <=> $a } (keys(%{$changed}));
             my $changenum = 0;              my $changenum = 0;
             my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME();              my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME();
               my $usediv;
               if ($chgcount > 1) {
                   $usediv = 1;
               }
             foreach my $item (@changes) {              foreach my $item (@changes) {
                 if (ref($changed->{$item}) eq 'ARRAY') {                  if (ref($changed->{$item}) eq 'ARRAY') {
                     foreach my $chg (@{$changed->{$item}}) {                      foreach my $chg (@{$changed->{$item}}) {
Line 1994  sub display_rolechanges { Line 2141  sub display_rolechanges {
                                 &Apache::loncommon::aboutmewrapper($fullname,$uname,$udom);                                  &Apache::loncommon::aboutmewrapper($fullname,$uname,$udom);
                             $r->print('<tr'.$css_class.'>'.                              $r->print('<tr'.$css_class.'>'.
                                       '<td>'.&Apache::lonlocal::locallocaltime($item).'</td>'.                                        '<td>'.&Apache::lonlocal::locallocaltime($item).'</td>'.
                                       '<td>'.$link.'</td>'.                                        '<td>');
                               if ($usediv) {
                                   $r->print('<div class="LC_minheight">');
                               }
                               $r->print($link);
                               if ($usediv) {
                                   $r->print('</div>');
                               }
                               $r->print('</td>'.
                                       '<td>'.$role.'</td>'.                                        '<td>'.$role.'</td>'.
                                       '<td>'.$section.'</td>'.                                        '<td>'.$section.'</td>'.
                                       '<td>'.$status.'</td></tr>');                                        '<td>'.$status.'</td></tr>');
Line 2004  sub display_rolechanges { Line 2159  sub display_rolechanges {
             }              }
         }          }
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'          $r->print('<tr class="LC_empty_row"><th>'
                  .&mt('There are no '.$interval).'</td></tr>');                   .&mt('There are no '.$interval).'</th></tr>');
     }      }
     return;      return;
 }  }
Line 2028  sub display_activity { Line 2183  sub display_activity {
     if ($count) {      if ($count) {
   
         my $hdr = '<tr class="LC_info_row" style="display:none" id="'.$prefix.'titledet">'.          my $hdr = '<tr class="LC_info_row" style="display:none" id="'.$prefix.'titledet">'.
                   '<td class="LC_left_item">'.$lt{'user'}.'</td>'.                    '<th class="LC_left_item">'.$lt{'user'}.'</th>'.
                   '<td class="LC_left_item">'.$lt{'role'}.'</td>'.                    '<th class="LC_left_item">'.$lt{'role'}.'</th>'.
                   '<td class="LC_left_item">'.$lt{'sec'}.'</td>';                    '<th class="LC_left_item">'.$lt{'sec'}.'</th>';
         if ($context eq 'sessions') {          if ($context eq 'sessions') {
             $hdr .= '<td class="LC_left_item">'.$lt{'active'}.'</td>';              $hdr .= '<th class="LC_left_item">'.$lt{'active'}.'</th>';
         }          }
         $hdr .= '</tr>'."\n".          $hdr .= '</tr>'."\n".
                 '<tr class="LC_info_row" id="'.$prefix.'titlesum">'.                  '<tr class="LC_info_row" id="'.$prefix.'titlesum">'.
                 '<td class="LC_left_item">'.$lt{'number'}.'</td>'.                  '<th class="LC_left_item">'.$lt{'number'}.'</th>'.
                 '<td class="LC_left_item">'.$lt{'role'}.'</td>'.                  '<th class="LC_left_item">'.$lt{'role'}.'</th>'.
                 '<td class="LC_left_item">'.$lt{'sec'};                  '<th class="LC_left_item">'.$lt{'sec'};
         my (%bylastname,%counts);          my (%bylastname,%counts);
         if (ref($details) eq 'HASH') {          if (ref($details) eq 'HASH') {
             my @items = sort { $b <=> $a } (keys(%{$details}));              my @items = sort { $b <=> $a } (keys(%{$details}));
             my $num = 0;              my $num = 0;
             my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME();              my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME();
               my $usediv;
               if ($count > 1) {
                   $usediv = 1;
               }
             foreach my $item (@items) {              foreach my $item (@items) {
                 if (ref($details->{$item}) eq 'ARRAY') {                  if (ref($details->{$item}) eq 'ARRAY') {
                     foreach my $user (@{$details->{$item}}) {                      foreach my $user (@{$details->{$item}}) {
Line 2067  sub display_activity { Line 2226  sub display_activity {
                             }                              }
                             my $link =                              my $link =
                                 &Apache::loncommon::aboutmewrapper($fullname,$uname,$udom);                                  &Apache::loncommon::aboutmewrapper($fullname,$uname,$udom);
                             my $entry = '<td>'.$link.'</td>'.                              my $entry = '<td>';
                                         '<td>'.$role.'</td>'.                              if ($usediv) {
                                         '<td>'.$section.'</td>';                                  $entry .= '<div class="LC_minheight">';
                               }
                               $entry .= $link;
                               if ($usediv) {
                                   $entry .= '</div>';
                               }
                               $entry .= '</td>'.
                                         '<td>'.$role.'</td>'.
                                         '<td>'.$section.'</td>';
                             if ($context eq 'sessions') {                              if ($context eq 'sessions') {
                                 $entry .= '<td>'.&Apache::lonlocal::locallocaltime($item).'</td>';                                  $entry .= '<td>'.&Apache::lonlocal::locallocaltime($item).'</td>';
                             }                              }
Line 2104  sub display_activity { Line 2271  sub display_activity {
             }              }
             $r->print($hdr.'<input type="hidden" name="'.$prefix.'count" value="'.$num.              $r->print($hdr.'<input type="hidden" name="'.$prefix.'count" value="'.$num.
                       '" /><input type="hidden" name="'.$prefix.'row" value="'.$numrow.                        '" /><input type="hidden" name="'.$prefix.'row" value="'.$numrow.
                       '" /></td></tr>'.$table);                        '" /></th></tr>'.$table);
         }          }
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.          $r->print('<tr class="LC_empty_row"><th>'.
                   &mt('There are no '.$interval).                    &mt('There are no '.$interval).
                   '<input type="hidden" name="'.$prefix.'count" value="'.$count.                    '<input type="hidden" name="'.$prefix.'count" value="'.$count.
                   '." /></td></tr>');                    '." /></th></tr>');
     }      }
     return;      return;
 }  }
    
 sub display_coursediscussion {  sub display_coursediscussion {
     my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_;      my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_;
     my $lctype = lc(&Apache::loncommon::course_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',
                 'numn' => 'Number of new posts',                  'numn' => 'New posts',
                 'noun' => 'No unread posts in '.$lctype.' discussions',                  'noun' => 'No unread posts in '.$lctype.' discussions',
                 'tmlp' => 'Time of last post',                   'tmlp' => 'Time of last post', 
     );      );
     if (@{$newdiscussions} > 0) {      if (@{$newdiscussions} > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.          $r->print('<tr class="LC_info_row">'.
                   $lt{'loca'}.'</td><td>'.                    '<th class="LC_left_item LC_nobreak">'.$lt{'loca'}.'</th>'.
                   $lt{'type'}.'</td>');                    '<th class="LC_left_item LC_nobreak">'.$lt{'type'}.'</th>');
         if ($countunread eq 'on') {          if ($countunread eq 'on') {
             $r->print('<td>'.$lt{'tmlp'}.'</td>'.              $r->print('<th class="LC_left_item LC_nobreak">'.$lt{'tmlp'}.'</th>'.
                       '<td class="LC_right_item">'.$lt{'numn'}.'</td>');                        '<th class="LC_left_item LC_nobreak">'.$lt{'numn'}.'</th>');
         } else {          } else {
             $r->print('<td class="LC_right_item">'.$lt{'tmlp'}.'</td>');              $r->print('<th class="LC_left_item">'.$lt{'tmlp'}.'</th>');
         }          }
         $r->print("</tr>\n");          $r->print("</tr>\n");
         @{$newdiscussions} = sort { &cmp_title($a,$b,$res_title) }          @{$newdiscussions} = sort { &cmp_title($a,$b,$res_title) }
                                                             @{$newdiscussions};                                                              @{$newdiscussions};
         my $rowNum = 0;          my $rowNum = 0;
           my $usediv;
           if (@{$newdiscussions} > 1) {
               $usediv = 1;
           }
         foreach my $ressymb (@{$newdiscussions}) {          foreach my $ressymb (@{$newdiscussions}) {
             $rowNum ++;              $rowNum ++;
             my $forum_title = $$unread{$ressymb}{'title'};              my $forum_title = $$unread{$ressymb}{'title'};
             my $type = 'Resource';              my $type = 'Resource';
             my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);              my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);
             my $disclink = $feedurl.'?symb='.&escape($$unread{$ressymb}{symb});              my $disclink = $feedurl.'?symb='. &escape($$unread{$ressymb}{symb});
             if ($feedurl =~ /bulletinboard/) {              if ($feedurl =~ /bulletinboard/) {
                 $type = 'Discussion Board';                  $type = 'Discussion Board';
             }              }
Line 2154  sub display_coursediscussion { Line 2325  sub display_coursediscussion {
             my $css_class = $rowNum%2?' class="LC_odd_row"':'';              my $css_class = $rowNum%2?' class="LC_odd_row"':'';
             my $lastpost = &Apache::lonnavmaps::timeToHumanString(              my $lastpost = &Apache::lonnavmaps::timeToHumanString(
                                                $$unread{$ressymb}{'lastpost'});                                                 $$unread{$ressymb}{'lastpost'});
             $r->print('<tr'.$css_class.'><td><a href="'.$disclink.'">'.$forum_title.'</a>&nbsp;</td><td>'.&mt($type).'&nbsp;</td>');              $r->print('<tr'.$css_class.'><td>');
               if ($usediv) {
                   $r->print('<div class="LC_minheight">');
               }
               $r->print('<a href="'.$disclink.'">'.$forum_title.'</a>&nbsp;');
               if ($usediv) {
                   $r->print('</div>');
               }
               $r->print('</td>'.
                         '<td>'.&mt($type).'&nbsp;</td>');
             if ($countunread eq 'on') {              if ($countunread eq 'on') {
                 my $unreadnum = $$unread{$ressymb}{'unreadcount'};                  my $unreadnum = $$unread{$ressymb}{'unreadcount'};
                 $r->print('<td>'.$lastpost.'</td><td class="LC_right_item">'.                  $r->print('<td>'.$lastpost.'</td><td class="LC_left_item">'.
                           $unreadnum.'&nbsp;</td>');                            $unreadnum.'</td>');
             } else {              } else {
                 $r->print('<td class="LC_right_item">'.$lastpost.'</td>');                  $r->print('<td class="LC_left_item">'.$lastpost.'</td>');
             }              }
             $r->print("</tr>\n");              $r->print("</tr>\n");
         }          }
     } elsif ($itemserror) {      } elsif ($itemserror) {
         $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$itemserror.'</th></tr>');
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.$lt{'noun'}.'</td></tr>');          $r->print('<tr class="LC_empty_row"><th>'.$lt{'noun'}.'</th></tr>');
     }      }
 }  }
   
Line 2175  sub display_coursenormalmail { Line 2355  sub display_coursenormalmail {
     my ($r,$msgcount,$newmsgs) = @_;      my ($r,$msgcount,$newmsgs) = @_;
     my $lctype = lc(&Apache::loncommon::course_type());      my $lctype = lc(&Apache::loncommon::course_type());
     if ($msgcount > 0) {      if ($msgcount > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.          $r->print('<tr class="LC_info_row"><th class="LC_left_item">'.
                   &mt('Number').'</td><td>'.&mt('Subject').'</td><td>'.                    &mt('Number').'&nbsp;</th><th class="LC_left_item">'.
                   &mt('Sender').'</td><td class="LC_right_item">'.                    &mt('Subject').'</th><th class="LC_left_item">'.
                   &mt('Date/Time').'</td></tr>');                    &mt('Sender').'</th><th class="LC_left_item">'.
                     &mt('Date/Time').'</th></tr>');
         my $mailcount = 0;          my $mailcount = 0;
           my $usediv;
           if (@{$newmsgs}) {
               $usediv = 1;
           }
         foreach my $msg (@{$newmsgs}) {          foreach my $msg (@{$newmsgs}) {
             $mailcount ++;              $mailcount ++;
             my $css_class = $mailcount%2?' class="LC_odd_row"':'';              my $css_class = $mailcount%2?' class="LC_odd_row"':'';
             $r->print('<tr'.$css_class.'><td>'.$mailcount              $r->print('<tr'.$css_class.'><td>'.$mailcount
                       .'.&nbsp;</td><td><a href="/adm/email?display='                        .'.&nbsp;</td><td>');
               if ($usediv) {
                   $r->print('<div class="LC_minheight">');
               }
               $r->print('<a href="/adm/email?display='
                       .$msg->{'msgid'}.'">'                        .$msg->{'msgid'}.'">'
                       .$msg->{'shortsub'}.'</a>&nbsp;&nbsp;</td><td>&nbsp;'                        .$msg->{'shortsub'}.'</a>&nbsp;&nbsp;');
                       .$msg->{'from'}.':'.$msg->{'fromdom'}.'&nbsp;</td><td>'              if ($usediv) {
                   $r->print('</div>');
               }
               $r->print('</td><td>'
                         .$msg->{'from'}.':'.$msg->{'fromdom'}.'&nbsp;&nbsp;</td><td>'
                       .$msg->{'sendtime'}.'</td></tr>');                        .$msg->{'sendtime'}.'</td></tr>');
         }          }
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.          $r->print('<tr class="LC_empty_row"><th>'.
                   &mt('No new '.$lctype.' messages').'</td></tr>');                    &mt('No new '.$lctype.' messages').'</th></tr>');
     }      }
 }  }
   
Line 2200  sub display_coursecritmail { Line 2393  sub display_coursecritmail {
     my ($r,$critmsgcount,$critmsgs) = @_;      my ($r,$critmsgcount,$critmsgs) = @_;
     my $lctype = lc(&Apache::loncommon::course_type());      my $lctype = lc(&Apache::loncommon::course_type());
     if ($critmsgcount > 0) {      if ($critmsgcount > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.          $r->print('<tr class="LC_info_row"><th class="LC_left_item">'.
                   &mt('Number').'</td><td>'.&mt('Subject').'</td><td>'.                    &mt('Number').'</th><th>'.&mt('Subject').'</th><th>'.
                   &mt('Sender').'</td><td class="LC_right_item">'.                    &mt('Sender').'</th><th class="LC_right_item">'.
                   &mt('Date/Time').'</td></tr>');                    &mt('Date/Time').'</th></tr>');
         my $mailcount = 0;          my $mailcount = 0;
           my $usediv;
           if (@{$critmsgs} > 1) {
               $usediv = 1;
           }
         foreach my $msg (@{$critmsgs}) {          foreach my $msg (@{$critmsgs}) {
             $mailcount ++;              $mailcount ++;
             my $css_class = $mailcount%2?' class="LC_odd_row"':'';              my $css_class = $mailcount%2?' class="LC_odd_row"':'';
             $r->print('<tr'.$css_class.'><td>'.$mailcount.              $r->print('<tr'.$css_class.'><td>'.$mailcount.
                       '. &nbsp;</td><td><a href="/adm/email?folder=critical">'.                        '. &nbsp;</td>'.
                       $msg->{'shortsub'}.'</a>&nbsp; &nbsp;</td><td>&nbsp;'.                        '<td>');
               if ($usediv) {
                   $r->print('<div class="LC_minheight">');
               }
               $r->print('<a href="/adm/email?folder=critical">'.
                         $msg->{'shortsub'}.'</a>&nbsp; &nbsp;');
               if ($usediv) {
                   $r->print('</div>');
               }
               $r->print('</td><td>&nbsp;'.
                       $msg->{'from'}.':'.$msg->{'fromdom'}.'&nbsp;</td><td>'.                        $msg->{'from'}.':'.$msg->{'fromdom'}.'&nbsp;</td><td>'.
                       $msg->{'sendtime'}.'</td></tr>');                        $msg->{'sendtime'}.'</td></tr>');
         }          }
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.          $r->print('<tr class="LC_empty_row"><th>'.
                   &mt('No unread critical messages in '.$lctype).                    &mt('No unread critical messages in '.$lctype).
                   '</td></tr>');                    '</th></tr>');
     }      }
 }  }
   
Line 2351  sub store_courseinit_setting { Line 2557  sub store_courseinit_setting {
                     $result = &Apache::lonhtmlcommon::confirm_success(&mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'<b>','</b>'));                      $result = &Apache::lonhtmlcommon::confirm_success(&mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'<b>','</b>'));
                 } else {                  } else {
                     $result = &Apache::lonhtmlcommon::confirm_success(&mt('Page displayed after role selection in this '.$lctype.' set to [_1].'                      $result = &Apache::lonhtmlcommon::confirm_success(&mt('Page displayed after role selection in this '.$lctype.' set to [_1].'
                                  ,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>'));                                   ,'<b>'.&mt($initpage->{$env{'form.courseinit_page'}}).'</b>'));
                 }                  }
             } else {              } else {
                 &Apache::lonnet::logthis('Error saving whatsnew courseinit '.                  &Apache::lonnet::logthis('Error saving whatsnew courseinit '.
Line 2364  sub store_courseinit_setting { Line 2570  sub store_courseinit_setting {
                          '<tt>'.$outcome.'</tt>'),1);                           '<tt>'.$outcome.'</tt>'),1);
                 } else {                  } else {
                     $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].'                      $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].'
                                  ,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>'                                   ,'<b>'.&mt($initpage->{$env{'form.courseinit_page'}}).'</b>'
                                  ,'<tt>'.$outcome.'</tt>'),1);                                   ,'<tt>'.$outcome.'</tt>'),1);
                 }                  }
             }              }
Line 2437  sub start_box { Line 2643  sub start_box {
         if ($$show{$caller}) {          if ($$show{$caller}) {
             $r->print('              $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" align="left"><span class="LC_nobreak"><label><input type="radio" name="logindetails" value="0" checked="checked" onclick="javascript:toggledetails('."'login'".');" />&nbsp;'.&mt('Summary').'</label><label><input type="radio" name="logindetails" value="1" onclick="javascript:toggledetails('."'login'".');" />&nbsp;'.&mt('Details').'</label></span></td><td class="LC_subheader"><a href="/adm/whatsnew?command=chgcrslogininterval&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>                  <td class="LC_subheader" align="left"><fieldset class="LC_landmark"><legend><span class="LC_visually_hidden">'.&mt('Go').'</span></legend><span class="LC_nobreak"><label><input type="radio" name="logindetails" value="0" checked="checked" onclick="javascript:toggledetails('."'login'".');" />&nbsp;'.&mt('Summary').'</label><label><input type="radio" name="logindetails" value="1" onclick="javascript:toggledetails('."'login'".');" />&nbsp;'.&mt('Details').'</label></span></fieldset></td><td class="LC_subheader"><a href="/adm/whatsnew?command=chgcrslogininterval&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>
               </tr>');                </tr>');
         }          }
     } elsif (($caller eq 'sessions') && ($$show{$caller})) {      } elsif (($caller eq 'sessions') && ($$show{$caller})) {
         if ($$show{$caller}) {          if ($$show{$caller}) {
             $r->print('              $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" align="left"><span class="LC_nobreak"><label><input type="radio" name="sessiondetails" value="0" checked="checked" onclick="javascript:toggledetails('."'session'".');" />&nbsp;'.&mt('Summary').'</label><label><input type="radio" name="sessiondetails" value="1" onclick="javascript:toggledetails('."'session'".');" />&nbsp;'.&mt('Details').'</label></span></td><td class="LC_subheader"><a href="/adm/whatsnew?command=chgsessionlimit&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>                  <td class="LC_subheader" align="left"><fieldset class="LC_landmark"><legend><span class="LC_visually_hidden">'.&mt('Leave').'</span></legend><span class="LC_nobreak"><label><input type="radio" name="sessiondetails" value="0" checked="checked" onclick="javascript:toggledetails('."'session'".');" />&nbsp;'.&mt('Summary').'</label><label><input type="radio" name="sessiondetails" value="1" onclick="javascript:toggledetails('."'session'".');" />&nbsp;'.&mt('Details').'</label></span></td><td class="LC_subheader"><a href="/adm/whatsnew?command=chgsessionlimit&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>
               </tr>');                </tr>');
         }          }
     }      }

Removed from v.1.105.2.16  
changed lines
  Added in v.1.132


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