Diff for /loncom/interface/lonnavmaps.pm between versions 1.46 and 1.47

version 1.46, 2002/09/02 19:35:31 version 1.47, 2002/09/03 20:46:30
Line 67  my %courseopt; Line 67  my %courseopt;
 my %useropt;  my %useropt;
 my %parmhash;  my %parmhash;
   
   # This parameter keeps track of whether obtaining the user's information
   # failed, which the colorizer in astatus can use
   my $networkFailedFlag = 0;
   
 # ------------------------------------------------------------------ Euclid gcd  # ------------------------------------------------------------------ Euclid gcd
   
 sub euclid {  sub euclid {
Line 458  sub handler { Line 462  sub handler {
  my ($cdom,$cnum)=split(/\_/,$cid);   my ($cdom,$cnum)=split(/\_/,$cid);
   
  my $userprefix=$uname.'_'.$udom.'_';   my $userprefix=$uname.'_'.$udom.'_';
   
  unless ($uhome eq 'no_host') {    unless ($uhome eq 'no_host') { 
 # -------------------------------------------------------------- Get coursedata  # -------------------------------------------------------------- Get coursedata
     unless ((time-$courserdatas{$cid.'.last_cache'})<240) {      unless ((time-$courserdatas{$cid.'.last_cache'})<240) {
Line 468  sub handler { Line 472  sub handler {
     $courserdatas{$cid}=$reply;      $courserdatas{$cid}=$reply;
     $courserdatas{$cid.'.last_cache'}=time;      $courserdatas{$cid.'.last_cache'}=time;
  }   }
    else
    {
       $networkFailedFlag = 1;
    }
     }      }
     foreach (split(/\&/,$courserdatas{$cid})) {      foreach (split(/\&/,$courserdatas{$cid})) {
  my ($name,$value)=split(/\=/,$_);   my ($name,$value)=split(/\=/,$_);
Line 584  sub handler { Line 592  sub handler {
  ($currenturl!~/^\/res\/adm/)) {   ($currenturl!~/^\/res\/adm/)) {
  $r->print('<a href="#curloc">Current Location</a><p>');   $r->print('<a href="#curloc">Current Location</a><p>');
     }      }
   
       # Handle a network error
   
       if ($networkFailedFlag)
       {
    $r->print('<H2>LON-CAPA network failure.</H2>'."\n");
    $r->print("<p>LON-CAPA's network is having difficulties, some problem" .
     " information, such as due dates, will not be available.");
       }
 # ----------------------------------------------------- The little content list  # ----------------------------------------------------- The little content list
     for ($i=0;$i<=$#rows;$i++) {      for ($i=0;$i<=$#rows;$i++) {
  if ($rows[$i]) {   if ($rows[$i]) {
Line 642  sub handler { Line 659  sub handler {
     my $tcode=$2;      my $tcode=$2;
     my $ctext=$3;      my $ctext=$3;
     $rid=$4;      $rid=$4;
     if ($tcode eq '1') {      
       # will open later
       if ($tcode eq '1') { 
  $add='<td bgcolor="#AAAAAA">';   $add='<td bgcolor="#AAAAAA">';
     }      }
   
       # solved/correct
     if ($code eq '3') {      if ($code eq '3') {
  $add='<td bgcolor="#AAFFAA">';   $add='<td bgcolor="#AAFFAA">';
     } elsif ($code eq '4') {      } elsif ($code eq '4') { # partially correct
  $add='<td bgcolor="#E0FFAA">';   $add='<td bgcolor="#E0FFAA">';
     } else {      } else {
  $add='<td bgcolor="#CCCCFF">';   # not attempted
  if ($tcode eq '2') {  
    # we end up here on network failure, so pick a neutral
    # color if the network failed instead of bright red.
    if ( $networkFailedFlag )
    {
       $add = '<td bgcolor="#AAAAAA">';
    }
    else
    {
       $add='<td bgcolor="#FFAAAA">';
    }
   
    if ($tcode eq '2') { # open, not past due
     $add='<td bgcolor="#FFFFAA">';      $add='<td bgcolor="#FFFFAA">';
  }   }
  if ($tcode eq '4') {  
    if ($tcode eq '4') { # due in next 24 hours
     $add='<td bgcolor="#FFFF33">';      $add='<td bgcolor="#FFFF33">';
     $adde='</td>';      $adde='</td>';
  }   }
Line 672  sub handler { Line 706  sub handler {
  $hwk='<font color="#229922"><b>';   $hwk='<font color="#229922"><b>';
  $hwke='</b> ('.$ctext.')</font>';   $hwke='</b> ('.$ctext.')</font>';
     }      }
       if ($networkFailedFlag) 
       {
    $hwke='</b> (status unavailable)</font>';
       }
  }   }
  if ($rid && $hash{'src_'.$rid} eq $currenturl) {   if ($rid && $hash{'src_'.$rid} eq $currenturl) {
     $add=$add.'<a name="curloc"></a>'.      $add=$add.'<a name="curloc"></a>'.

Removed from v.1.46  
changed lines
  Added in v.1.47


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