Diff for /loncom/interface/lonwhatsnew.pm between versions 1.67 and 1.68

version 1.67, 2006/12/20 23:02:33 version 1.68, 2007/02/27 22:16:02
Line 243  END Line 243  END
 sub display_actions_box {  sub display_actions_box {
     my ($r,$tabbg,$command,$refpage,$threshold_titles,$interval_titles,      my ($r,$tabbg,$command,$refpage,$threshold_titles,$interval_titles,
                                       $initpage,$cdom,$crs,$checkallowed) = @_;                                        $initpage,$cdom,$crs,$checkallowed) = @_;
     my $rowColor1 = "#ffffff";  
     my $rowColor2 = "#eeeeee";  
   
     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 396  sub display_actions_box { Line 393  sub display_actions_box {
     }      }
   
     if ($needitems) {      if ($needitems) {
         &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,$rowColor1,$rowColor2,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread);          &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread);
     }      }
     if ($show{'coursenormalmail'}) {      if ($show{'coursenormalmail'}) {
         $msgcount = &getnormalmail(\@newmsgs);          $msgcount = &getnormalmail(\@newmsgs);
Line 432  sub display_actions_box { Line 429  sub display_actions_box {
             if ($displayed == $halfway) {              if ($displayed == $halfway) {
                 $r->print('</td><td width="6%">&nbsp;</td><td align="left" valign="top" width="47%">');                  $r->print('</td><td width="6%">&nbsp;</td><td align="left" valign="top" width="47%">');
             }              }
             &display_launcher($r,$actionitem,$refpage,$checkallowed,$tabbg,$rowColor1,$rowColor2,\%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,$tabbg,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread);
             $displayed ++;               $displayed ++; 
         }          }
     }      }
Line 471  sub display_threshold_config { Line 468  sub display_threshold_config {
                          );                           );
     &get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs);      &get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs);
   
     $r->print('<br /><form name="thresholdform" method="post" action="/adm/whatsnew">      $r->print('<br /><form name="thresholdform" method="post" action="/adm/whatsnew">'.
         <table border="0" cellpadding="2" cellspacing="4">                &Apache::loncommon::start_data_table().
          <tr>                &Apache::loncommon::start_data_table_header_row().
           <td align="left" valign="top" width="45%">               '<th>Threshold Name</th>'."\n".
            <table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">               '<th>Current value</th>'."\n".
             <tr>               '<th>Change?</th>'."\n".
              <td>                &Apache::loncommon::end_data_table_header_row());
                <table border="0" cellpadding="1" cellspacing="1" bgcolor="#000000">  
                 <tr>  
                 <td bgcolor="#ffffff">  
                  <table cellspacing="0" cellpadding="4" border="0">  
      <tr bgcolor="'.$tabbg.'">  
       <th>Threshold Name</th>  
       <th>Current value</th>  
       <th>Change?</th>  
      </tr>');  
     my $rowNum =0;  
     foreach my $type (@thresholditems) {      foreach my $type (@thresholditems) {
         my $parameter = $env{'request.course.id'}.':threshold_'.$type;          my $parameter = $env{'request.course.id'}.':threshold_'.$type;
 # onchange is javascript to automatically check the 'Set' button.  # onchange is javascript to automatically check the 'Set' button.
         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;"';
         if ($rowNum %2 == 1) {          $r->print(&Apache::loncommon::start_data_table_row()."\n".
             $rowColor = $rowColor1;                   '<td>'.$threshold_titles{$type}.'</td>'."\n".
         } else {                   '<td>'.&Apache::lonhtmlcommon::textbox($parameter.'_value',
             $rowColor = $rowColor2;  
         }  
         $r->print('  
      <tr bgcolor="'.$rowColor.'">  
       <td>'.$threshold_titles{$type}.'</td>  
       <td>'.&Apache::lonhtmlcommon::textbox($parameter.'_value',  
                                             $threshold{$type},                                              $threshold{$type},
                                             10,$onchange).'</td>                                              10,$onchange).'</td>'."\n".
       <td>'                   '<td>'.
            .&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval').                   &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval').
       '</td>                   '</td>'."\n".
      </tr>');                   &Apache::loncommon::end_data_table_row());
         $rowNum ++;  
     }      }
     $r->print('</table></td></tr></table></td></tr></table>      $r->print(&Apache::loncommon::end_data_table()."\n".
            <br /><input type="submit" name="threshold" value="Make changes" />            '<br /><input type="submit" name="threshold" value="Make changes" />
                  <input type="hidden" name="command" value="update" />                   <input type="hidden" name="command" value="update" />
                  <input type="hidden" name="refpage" value="'.$refpage.'" />                   <input type="hidden" name="refpage" value="'.$refpage.'" />
                </form>');                 </form>');
Line 674  sub curr_courseinit { Line 654  sub curr_courseinit {
 }  }
   
 sub display_launcher {  sub display_launcher {
     my ($r,$action,$refpage,$checkallowed,$tabbg,$rowColor1,$rowColor2,$show,      my ($r,$action,$refpage,$checkallowed,$tabbg,$show,$headings,$res_title,
         $headings,$res_title,$tograde,$ungraded,$bombs,$bombed,$changed,          $tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered,
         $warnings,$triggered,$newdiscussions,$unread,$msgcount,$newmsgs,          $newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs,
                           $critmsgcount,$critmsgs,$interval,$countunread) = @_;          $interval,$countunread) = @_;
   
     if ($$checkallowed{$action}) {      if ($$checkallowed{$action}) {
         &start_box($r,$tabbg,$show,$headings,$action,$refpage,$action);          &start_box($r,$tabbg,$show,$headings,$action,$refpage,$action);
         if ($$show{$action}) {          if ($$show{$action}) {
             if ($action eq 'handgrading') {    # UNGRADED ITEMS              if ($action eq 'handgrading') {    # UNGRADED ITEMS
                 &display_handgrade($r,$tograde,$rowColor1,$rowColor2,                  &display_handgrade($r,$tograde,$ungraded);
                                                                     $ungraded);  
             } elsif ($action eq 'haserrors') { # BOMBS              } elsif ($action eq 'haserrors') { # BOMBS
                 &display_haserrors($r,$bombs,$rowColor1,$rowColor2,$bombed,                  &display_haserrors($r,$bombs,$bombed,$res_title);
                                                                    $res_title);  
             } elsif ($action eq 'versionchanges') { # VERSION CHANGES              } elsif ($action eq 'versionchanges') { # VERSION CHANGES
                 &display_versionchanges($r,$changed,$res_title,$rowColor1,                  &display_versionchanges($r,$changed,$res_title,$interval);
                                                          $rowColor2,$interval);  
   
             } elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS              } elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS
                 &display_abovethreshold($r,$refpage,$warnings,$triggered,                  &display_abovethreshold($r,$refpage,$warnings,$triggered,
  $res_title);   $res_title);
             } elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION              } elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION
                 &display_coursediscussion($r,$newdiscussions,$unread,                  &display_coursediscussion($r,$newdiscussions,$unread,
                                 $countunread,$res_title,$rowColor1,$rowColor2);                                  $countunread,$res_title);
             } elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES              } elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES
                 &display_coursenormalmail($r,$msgcount,$newmsgs,$rowColor1,                  &display_coursenormalmail($r,$msgcount,$newmsgs);
                                                                    $rowColor2);  
             } elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES              } elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES
                 &display_coursecritmail($r,$critmsgcount,$critmsgs,$rowColor1,                  &display_coursecritmail($r,$critmsgcount,$critmsgs);
                                                                    $rowColor2);  
             }              }
         }          }
         &end_box($r);          &end_box($r);
Line 713  sub display_launcher { Line 687  sub display_launcher {
   
 sub getitems {  sub getitems {
     my ($unread,$ungraded,$bombed,$triggered,$changed,$newdiscussions,      my ($unread,$ungraded,$bombed,$triggered,$changed,$newdiscussions,
         $tograde,$bombs,$warnings,$rowColor1,$rowColor2,$threshold,$cdom,$crs,          $tograde,$bombs,$warnings,$threshold,$cdom,$crs,$res_title,$show,
                                  $res_title,$show,$starttime,$countunread) = @_;          $starttime,$countunread) = @_;
     my $navmap = Apache::lonnavmaps::navmap->new();      my $navmap = Apache::lonnavmaps::navmap->new();
     # force retrieve Resource to seed the part id cache we'll need it later      # force retrieve Resource to seed the part id cache we'll need it later
     my @allres=$navmap->retrieveResources(undef,      my @allres=$navmap->retrieveResources(undef,
Line 849  sub check_thresholds { Line 823  sub check_thresholds {
     my %stats;      my %stats;
     my %lastreset = ();      my %lastreset = ();
     my $warning = 0;      my $warning = 0;
     my $rowColor;  
     foreach my $part (@parts) {      foreach my $part (@parts) {
         if ($resource->handgrade($part) eq 'yes') {          if ($resource->handgrade($part) eq 'yes') {
             next;              next;
Line 1139  sub checkversions { Line 1112  sub checkversions {
 }  }
   
 sub display_handgrade {  sub display_handgrade {
     my ($r,$tograde,$rowColor1,$rowColor2,$ungraded) = @_;      my ($r,$tograde,$ungraded) = @_;
     my $rowColor;  
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                         'prna' => 'Problem Name',                          'prna' => 'Problem Name',
                         'nmun' => 'Number ungraded',                          'nmun' => 'Number ungraded',
                         'nopr' => 'No problems require handgrading',                          'nopr' => 'No problems require handgrading',
     );      );
     if (@{$tograde} > 0) {      if (@{$tograde} > 0) {
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'prna'}.'</small></b></td><td align="right"><b><small>'.$lt{'nmun'}.'</small></b></td></tr>');          $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.
                     $lt{'prna'}.'</td><td class="LC_right_item">'.
                     $lt{'nmun'}.'</td></tr>');
         my $rowNum = 0;          my $rowNum = 0;
         foreach my $res (@{$tograde}) {          foreach my $res (@{$tograde}) {
             if ($rowNum %2 == 1) {              $rowNum ++;
                 $rowColor = $rowColor1;              my $css_class = $rowNum%2?' class="LC_odd_row"':'';
             } else {  
                 $rowColor = $rowColor2;  
             }  
             my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);              my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
             my $linkurl=&Apache::lonnet::clutter($url);              my $linkurl=&Apache::lonnet::clutter($url);
             $linkurl .= '?symb='.&escape($res);              $linkurl .= '?symb='.&escape($res);
Line 1162  sub display_handgrade { Line 1133  sub display_handgrade {
                 $linkurl =                   $linkurl = 
                     $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};                      $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};
             }               } 
             $r->print('<tr bgcolor="'.$rowColor.'"><td><a href="'.$linkurl.'"><small>'.$$ungraded{$res}{title}.'</small></a></td><td align="right"><small>'.$$ungraded{$res}{count}.'</small></td></tr>');              $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');
             $rowNum ++;  
         }          }
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff"><br><center><i><b><small>&nbsp;&nbsp;'.$lt{'nopr'}.'&nbsp;&nbsp;</small><br><br></b></i></td></tr>');          $r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>');
     }      }
 }  }
   
 sub display_haserrors {  sub display_haserrors {
     my ($r,$bombs,$rowColor1,$rowColor2,$bombed,$res_title) = @_;      my ($r,$bombs,$bombed,$res_title) = @_;
     my $bombnum = 0;      my $bombnum = 0;
     my $rowColor;  
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                                    reso => 'Resource',                                     reso => 'Resource',
                                    nmer => 'Number of errors',                                     nmer => 'Number of errors',
                                    noer => 'No problems with errors',                                     noer => 'No problems with errors',
     );      );
     if (@{$bombs} > 0) {      if (@{$bombs} > 0) {
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'reso'}.'</small></b></td><td align="right"><b><small>'.$lt{'nmer'}.'</small></b></td></tr>');          $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.
                     $lt{'reso'}.'</td><td class="LC_right_item">'.
                     $lt{'nmer'}.'</td></tr>');
         @{$bombs} = sort { &cmp_title($a,$b,$res_title) } @{$bombs};          @{$bombs} = sort { &cmp_title($a,$b,$res_title) } @{$bombs};
         foreach my $bomb (@{$bombs}) {          foreach my $bomb (@{$bombs}) {
             if ($bombnum %2 == 1) {  
                 $rowColor = $rowColor1;  
             } else {  
                 $rowColor = $rowColor2;  
             }  
             $r->print('<tr bgcolor="'.$rowColor.'"><td><small>'.$$bombed{$bomb}{errorlink}.'</small></td><td align="right"><small>'.$$bombed{$bomb}{errorcount}.'</small></td></tr>');  
             $bombnum ++;              $bombnum ++;
               my $css_class = $bombnum%2?' class="LC_odd_row"':'';
               $r->print('<tr'.$css_class.'><td>'.$$bombed{$bomb}{errorlink}.
                         '</td><td class="LC_right_item">'.
                         $$bombed{$bomb}{errorcount}.'</td></tr>');
         }          }
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'noer'}.'</small></i></b></center><br /></td></tr>');          $r->print('<tr class="LC_empty_row"><td>'.$lt{'noer'}.'</td></tr>');
     }      }
     return;      return;
 }  }
Line 1217  sub display_abovethreshold { Line 1186  sub display_abovethreshold {
                 ' <input type="hidden" name="refpage" value="'.$refpage.'" />'.                  ' <input type="hidden" name="refpage" value="'.$refpage.'" />'.
                 "\n");                  "\n");
         $r->print('<tr class="LC_info_row">'.          $r->print('<tr class="LC_info_row">'.
   '<td class="LC_first_item">'.$lt{'reso'}.'</td>'.    '<td class="LC_left_item">'.$lt{'reso'}.'</td>'.
   '<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'.    '<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'.
   '<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'.    '<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'.
   '<td>'.$lt{'lare'}.'</td><td>'.$lt{'reco'}.'</td></tr>');    '<td>'.$lt{'lare'}.'</td><td  class="LC_right_item">'.
                     $lt{'reco'}.'</td></tr>');
  my $row;   my $row;
         foreach my $res (@{$warnings}) {          foreach my $res (@{$warnings}) {
     $row++;      $row++;
Line 1235  sub display_abovethreshold { Line 1205  sub display_abovethreshold {
                 $linkurl =                   $linkurl = 
                   $$triggered{$res}{'enclink'}.'?symb='.$$triggered{$res}{'encsymb'};                    $$triggered{$res}{'enclink'}.'?symb='.$$triggered{$res}{'encsymb'};
             }              }
             my $css_class = $row%2?'LC_odd_row':'';              my $css_class = $row%2?' class="LC_odd_row"':'';
             $r->print('<tr class="'.$css_class.'">'.              $r->print('<tr'.$css_class.'>'.
       '<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'.        '<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'.
       $$triggered{$res}{title}.'</a></td>');        $$triggered{$res}{title}.'</a></td>');
                       if (ref($$triggered{$res}{text}) eq 'ARRAY') {                        if (ref($$triggered{$res}{text}) eq 'ARRAY') {
Line 1252  sub display_abovethreshold { Line 1222  sub display_abovethreshold {
                 }                  }
             }              }
         }          }
         $r->print('<tr class="LC_info_row"><td colspan="7"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>');          $r->print('<tr class="LC_info_row"><td colspan="7" class="LC_right_item"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>');
     } else {      } else {
         $r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>');          $r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>');
     }      }
 }  }
   
 sub display_versionchanges {  sub display_versionchanges {
     my ($r,$changed,$res_title,$rowColor1,$rowColor2,$interval) = @_;      my ($r,$changed,$res_title,$interval) = @_;
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
         'reso' => 'Resource',          'reso' => 'Resource',
         'revd' => 'Last revised',          'revd' => 'Last revised',
Line 1267  sub display_versionchanges { Line 1237  sub display_versionchanges {
         'veru' => 'Version used',          'veru' => 'Version used',
         'noup' => 'No updated versions',           'noup' => 'No updated versions', 
     );      );
     my $rowColor;  
     if (keys(%{$changed}) > 0) {      if (keys(%{$changed}) > 0) {
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'reso'}.'</small></b></td><td><b><small>'.$lt{'revd'}.'</small></b></td><td><b><small>'.$lt{'newv'}.'</small></b></td><td><b><small>'.$lt{'veru'}.'</small></b></td></tr>');          $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.
                             $lt{'reso'}.'</td><td>'.$lt{'revd'}.'</td><td>'.
                             $lt{'newv'}.'</td><td class="LC_right_item">'.
                     $lt{'veru'}.'</td></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;
         foreach my $item (@changes) {          foreach my $item (@changes) {
             if ($changenum %2 == 1) {              $changenum ++;
                 $rowColor = $rowColor1;              my $css_class = $changenum%2?' class="LC_odd_row"':'';
             } else {  
                 $rowColor = $rowColor2;  
             }  
             my ($map,$id,$url)=&Apache::lonnet::decode_symb($item);              my ($map,$id,$url)=&Apache::lonnet::decode_symb($item);
             my $linkurl=&Apache::lonnet::clutter($url);              my $linkurl=&Apache::lonnet::clutter($url);
             $linkurl .= '?symb='.&escape($item);              $linkurl .= '?symb='.&escape($item);
   
             $r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$linkurl.'">'.$$res_title{$item}.'</a></small></td><td><small>'.$$changed{$item}{'revdate'}.'</small></td><td><small>'.$$changed{$item}{'current'}.'</small></td><td><small>'.$$changed{$item}{'version'}.'</small></td></tr>');              $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.
             $changenum ++;                        $$res_title{$item}.'</a></td><td>'.
                         $$changed{$item}{'revdate'}.'</td><td>'.
                         $$changed{$item}{'current'}.'</td><td>'.
                         $$changed{$item}{'version'}.'</td></tr>');
         }          }
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'noup'}.' '.$interval.'</small></i></b></center><br /></td></tr>');          $r->print('<tr class="LC_empty_row"><td>'.$lt{'noup'}.
                     ' '.$interval.'</td></tr>');
     }      }
     return;      return;
 }  }
     
 sub display_coursediscussion {  sub display_coursediscussion {
     my ($r,$newdiscussions,$unread,$countunread,$res_title,$rowColor1,      my ($r,$newdiscussions,$unread,$countunread,$res_title) = @_;
                                                               $rowColor2) = @_;  
     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',
Line 1304  sub display_coursediscussion { Line 1274  sub display_coursediscussion {
                 'noun' => 'No unread posts in '.$lctype.' discussions',                  'noun' => 'No unread posts in '.$lctype.' discussions',
                 'tmlp' => 'Time of last post',                   'tmlp' => 'Time of last post', 
     );      );
     my $rowColor;  
     if (@{$newdiscussions} > 0) {      if (@{$newdiscussions} > 0) {
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'loca'}.          $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.
                   '</small></b></td><td><b><small>'.$lt{'type'}.                    $lt{'loca'}.'</td><td>'.
                   '</small></b>');                    $lt{'type'}.'</td>');
         if ($countunread eq 'on') {          if ($countunread eq 'on') {
             $r->print('<td><b><small>'.$lt{'tmlp'}.'</small></b></td>'.              $r->print('<td>'.$lt{'tmlp'}.'</td>'.
                       '<td align="right"><b><small>'.$lt{'numn'}.                        '<td class="LC_right_item">'.$lt{'numn'}.'</td>');
                       '</small></b></td>');  
         } else {          } else {
             $r->print('<td align="right"><b><small>'.$lt{'tmlp'}.              $r->print('<td class="LC_right_item">'.$lt{'tmlp'}.'</td>');
                          '</small></b></td>');  
         }          }
         $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;
         foreach my $ressymb (@{$newdiscussions}) {          foreach my $ressymb (@{$newdiscussions}) {
               $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);
Line 1332  sub display_coursediscussion { Line 1300  sub display_coursediscussion {
             if ($$unread{$ressymb}{'enclink'}) {              if ($$unread{$ressymb}{'enclink'}) {
                 $disclink = $$unread{$ressymb}{'enclink'}.'?symb='.$$unread{$ressymb}{'encsymb'};                  $disclink = $$unread{$ressymb}{'enclink'}.'?symb='.$$unread{$ressymb}{'encsymb'};
             }              }
             if ($rowNum %2 == 1) {              my $css_class = $rowNum%2?' class="LC_odd_row"':'';
                 $rowColor = $rowColor1;  
             } else {  
                 $rowColor = $rowColor2;  
             }  
             my $lastpost = &Apache::lonnavmaps::timeToHumanString(              my $lastpost = &Apache::lonnavmaps::timeToHumanString(
                                                $$unread{$ressymb}{'lastpost'});                                                 $$unread{$ressymb}{'lastpost'});
             $r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$disclink.'">'.$forum_title.'</a>&nbsp;</td><td><small>'.$type.'&nbsp;</small></td>');              $r->print('<tr'.$css_class.'><td><a href="'.$disclink.'">'.$forum_title.'</a>&nbsp;</td><td>'.$type.'&nbsp;</td>');
             if ($countunread eq 'on') {              if ($countunread eq 'on') {
                 my $unreadnum = $$unread{$ressymb}{'unreadcount'};                  my $unreadnum = $$unread{$ressymb}{'unreadcount'};
                 $r->print('<td><small>'.$lastpost.'<small></td><td align="right">'.                  $r->print('<td>'.$lastpost.'</td><td class="LC_right_item">'.
                           '<small>',$unreadnum.'&nbsp;</small></td>');                            $unreadnum.'&nbsp;</td>');
             } else {              } else {
                 $r->print('<td align="right"><small>'.$lastpost.'</small></td>');                  $r->print('<td class="LC_right_item">'.$lastpost.'</td>');
             }              }
             $r->print("</tr>\n");              $r->print("</tr>\n");
             $rowNum ++;  
         }          }
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff"><br><center>&nbsp;<i><b><small>'.          $r->print('<tr class="LC_empty_row"><td>'.$lt{'noun'}.'</td></tr>');
                   $lt{'noun'}.'</small></b></i><br><br></td></tr>');  
     }      }
 }  }
   
 sub display_coursenormalmail {  sub display_coursenormalmail {
     my ($r,$msgcount,$newmsgs,$rowColor1,$rowColor2) = @_;      my ($r,$msgcount,$newmsgs) = @_;
     my $rowColor;  
     my $lctype = lc(&Apache::loncommon::course_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 class="LC_info_row"><td class="LC_left_item">'.
         my $rowNum = 0;                    &mt('Number').'</td><td>'.&mt('Subject').'</td><td>'.
         my $mailcount = 1;                    &mt('Sender').'</td><td class="LC_right_item">'.
                     &mt('Date/Time').'</td></tr>');
           my $mailcount = 0;
         foreach my $msg (@{$newmsgs}) {          foreach my $msg (@{$newmsgs}) {
             if ($rowNum %2 == 1) {  
                 $rowColor = $rowColor1;  
             } else {  
                 $rowColor = $rowColor2;  
             }  
             $r->print('<tr bgcolor="'.$rowColor.'"><td valign="top"><small>'.$mailcount.'. &nbsp;</small></td><td valign="top"><small><a href="/adm/communicate">'.$msg->{'shortsub'}.'</a>&nbsp; &nbsp;</small></td><td valign="top"><small>&nbsp;'.$msg->{'from'}.'@'.$msg->{'fromdom'}.'&nbsp;</small></td><td valign="top"><small>'.$msg->{'sendtime'}.'</small></td></tr>');  
             $rowNum ++;  
             $mailcount ++;              $mailcount ++;
               my $css_class = $mailcount%2?' class="LC_odd_row"':'';
               $r->print('<tr'.$css_class.'><td>'.$mailcount.
                         '. &nbsp;</td><td><a href="/adm/communicate">'.
                         $msg->{'shortsub'}.'</a>&nbsp; &nbsp;</td><td>&nbsp;'.
                         $msg->{'from'}.'@'.$msg->{'fromdom'}.'&nbsp;</td><td>'.
                         $msg->{'sendtime'}.'</td></tr>');
         }          }
     } else {      } else {
         $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>');          $r->print('<tr class="LC_empty_row"><td>'.
                     &mt('No new '.$lctype.' messages').'</td></tr>');
     }      }
 }  }
   
 sub display_coursecritmail {  sub display_coursecritmail {
     my ($r,$critmsgcount,$critmsgs,$rowColor1,$rowColor2) = @_;      my ($r,$critmsgcount,$critmsgs) = @_;
     my $rowColor;  
     my $lctype = lc(&Apache::loncommon::course_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 class="LC_info_row"><td class="LC_left_item">'.
         my $rowNum = 0;                    &mt('Number').'</td><td>'.&mt('Subject').'</td><td>'.
         my $mailcount = 1;                    &mt('Sender').'</td><td class="LC_right_item">'.
                     &mt('Date/Time').'</td></tr>');
           my $mailcount = 0;
         foreach my $msg (@{$critmsgs}) {          foreach my $msg (@{$critmsgs}) {
             if ($rowNum %2 == 1) {  
                 $rowColor = $rowColor1;  
             } else {  
                 $rowColor = $rowColor2;  
             }  
             $r->print('<tr bgcolor="'.$rowColor.'"><td valign="top"><small>'.$mailcount.'. &nbsp;<small></td><td valign="top"><small><a href="/adm/email?folder=critical">'.$msg->{'shortsub'}.'</a>&nbsp; &nbsp;</small></td><td valign="top"><small>&nbsp;'.$msg->{'from'}.'@'.$msg->{'fromdom'}.'&nbsp;</small></td><td valign="top"><small>'.$msg->{'sendtime'}.'</small></td></tr>');  
             $rowNum ++;  
             $mailcount ++;              $mailcount ++;
               my $css_class = $mailcount%2?' class="LC_odd_row"':'';
               $r->print('<tr'.$css_class.'><td>'.$mailcount.
                         '. &nbsp;</td><td><a href="/adm/email?folder=critical">'.
                         $msg->{'shortsub'}.'</a>&nbsp; &nbsp;</td><td>&nbsp;'.
                         $msg->{'from'}.'@'.$msg->{'fromdom'}.'&nbsp;</td><td>'.
                         $msg->{'sendtime'}.'</td></tr>');
         }          }
     } else {      } else {
         $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>');          $r->print('<tr class="LC_empty_row"><td>'.
                     &mt('No unread critical messages in '.$lctype).
                     '</td></tr>');
     }      }
 }  }
   
Line 1547  sub start_box { Line 1512  sub start_box {
                        chin => 'Change interval?',                         chin => 'Change interval?',
                        chop => 'Change options?',                         chop => 'Change options?',
     );      );
     my ($showhide,$class);      my $showhide;
     if ($$show{$caller}) {      if ($$show{$caller}) {
         $showhide = '<b><a href="javascript:change_display(document.visible.'.          $showhide = '<b><a href="javascript:change_display(document.visible.'.
                                'display_'.$caller.",'hide'".');">Hide</a></b>';                                 'display_'.$caller.",'hide'".');">Hide</a></b>';
Line 1558  sub start_box { Line 1523  sub start_box {
     }      }
           
     $r->print('      $r->print('
          <table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000" width="100%">           <table class="LC_nested_outer">
           <tr>            <tr>
            <td>             <th>'.$$heading{$caller}.'</th>
             <table border="0" cellpadding="1" cellspacing="1" bgcolor="#000000" width="100%">             <th class="LC_right_item">'.$showhide.'</th>
               <tr>            </tr>');
                <td bgcolor="'.$tabbg.'">  
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">  
                  <tr>  
                   <td><b>'.$$heading{$caller}.'</b></td>  
                   <td valign="top" align="right">'.$showhide.'</td>  
                  </tr>  
                 </table>  
                </td>  
               </tr>');  
      if (($caller eq 'abovethreshold') && ($$show{$caller})) {       if (($caller eq 'abovethreshold') && ($$show{$caller})) {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'"><b><small>'.$lt{'chth'}.'</small></b></a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'">'.$lt{'chth'}.'</a></td>
               </tr>');                </tr>');
          }           }
  $class='class="LC_whatsnew"';  
      } elsif (($caller eq 'versionchanges') && ($$show{$caller})) {       } elsif (($caller eq 'versionchanges') && ($$show{$caller})) {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'"><b><small>'.$lt{'chin'}.'</small></b></a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>
               </tr>');                </tr>');
          }           }
      } elsif ($caller eq 'coursediscussion') {       } elsif ($caller eq 'coursediscussion') {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'"><b><small>'.$lt{'chop'}.'</small></b></a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td>
               </tr>');                </tr>');
          }           }
      }       }
     $r->print('      $r->print('
               <tr>                <tr>
                <td bgcolor="#ffffff">                 <td colspan="2">
                 <table cellpadding="2" cellspacing="0" border="0" width="100%" '.$class.'>                  <table class="LC_nested">
 ');  ');
     return;      return;
 }  }
Line 1606  sub start_box { Line 1561  sub start_box {
 sub end_box {  sub end_box {
     my ($r) = shift;      my ($r) = shift;
     $r->print('      $r->print('
       </table>  
      </td>  
     </tr>  
    </table>     </table>
   </td>    </td>
  </tr>   </tr>

Removed from v.1.67  
changed lines
  Added in v.1.68


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