Diff for /loncom/auth/lonroles.pm between versions 1.83 and 1.84

version 1.83, 2004/01/27 22:54:59 version 1.84, 2004/01/29 00:44:06
Line 306  ENDHEADER Line 306  ENDHEADER
       "<br />\n");        "<br />\n");
     $r->print(&mt(      $r->print(&mt(
       "Author and Co-Author roles may not be available on servers other than your home server."));        "Author and Co-Author roles may not be available on servers other than your home server."));
         } else {  
     $r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");  
         }          }
         if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {          if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {
        $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};         $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};
         }          }
         $r->print('<form method=post action="'.(($fn)?$fn:$r->uri).'">');          $r->print('<form method="post" name="rolechoice" action="'.(($fn)?$fn:$r->uri).'">');
         $r->print('<input type=hidden name=orgurl value="'.$fn.'">');          $r->print('<input type=hidden name=orgurl value="'.$fn.'">');
         $r->print('<input type=hidden name=selectrole value=1>');          $r->print('<input type=hidden name=selectrole value=1>');
     }      }
Line 322  ENDHEADER Line 320  ENDHEADER
  if ($ENV{'form.showall'}) { $r->print(' checked'); }   if ($ENV{'form.showall'}) { $r->print(' checked'); }
  $r->print('><input type=submit value="'.&mt('Display').'">');   $r->print('><input type=submit value="'.&mt('Display').'">');
     }      }
 # ----------------------------------------------------------------------- Table  
     $r->print('<br /><table><tr>');  
     unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }  
     $r->print('<th>'.&mt('User Role').'</th><th colspan=2>'.&mt('Extent').  
          '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th><th>'.  
       &mt('Remark').'</th></tr>'."\n");  
   
     my (%roletext,%sortrole,%roleclass);      my (%roletext,%sortrole,%roleclass);
       my $countactive=0;
       my $inrole=0;
       my $possiblerole='';
     foreach $envkey (sort keys %ENV) {      foreach $envkey (sort keys %ENV) {
         my $button = 1;          my $button = 1;
         my $switchserver='';          my $switchserver='';
Line 370  ENDHEADER Line 365  ENDHEADER
                 if ($tstatus eq 'is') {                  if ($tstatus eq 'is') {
                     $tbg='#77FF77';                      $tbg='#77FF77';
                     $tfont='#003300';                      $tfont='#003300';
       $possiblerole=$trolecode;
       $countactive++;
                 } elsif ($tstatus eq 'future') {                  } elsif ($tstatus eq 'future') {
                     $tbg='#FFFF77';                      $tbg='#FFFF77';
                     $button=0;                      $button=0;
Line 386  ENDHEADER Line 383  ENDHEADER
                 } elsif ($tstatus eq 'selected') {                  } elsif ($tstatus eq 'selected') {
                     $tbg='#11CC55';                      $tbg='#11CC55';
                     $tfont='#002200';                      $tfont='#002200';
       $inrole=1;
                     $tremark.=&mt('Currently selected. ');                      $tremark.=&mt('Currently selected. ');
                 }                  }
                 my $trole;                  my $trole;
Line 530  ENDHEADER Line 528  ENDHEADER
     }      }
         }          }
     }      }
   # No active roles
       if ($countactive==0) {
    if ($inrole) {
       $r->print('<h2>'.&mt('Currently no additional roles or courses').'</h2>');
    } else {
       $r->print('<h2>'.&mt('Currently no active roles or courses').'</h2>');
    }
    $r->print('</form></body></html>');
    return OK;
   # Is there only one choice?
       } elsif ($countactive==1) {
    $r->print('<h3>'.&mt('Please stand by.').'</h3>'.
       '<input type="hidden" name="'.$possiblerole.'" value="1" />');
    $r->print("</form>\n");
    $r->rflush();
    $r->print('<script>document.forms.rolechoice.submit();</script>');
    $r->print('</body></html>');
    return OK;
       }
   # More than one possible role
   # ----------------------------------------------------------------------- Table
       unless (($advanced) || ($nochoose)) {
    $r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");
       }
       $r->print('<br /><table><tr>');
       unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }
       $r->print('<th>'.&mt('User Role').'</th><th colspan=2>'.&mt('Extent').
            '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th><th>'.
         &mt('Remark').'</th></tr>'."\n");
     my $doheaders=-1;      my $doheaders=-1;
     foreach my $type ('Construction Space','Course','Domain','System') {      foreach my $type ('Construction Space','Course','Domain','System') {
  my $haverole=0;   my $haverole=0;

Removed from v.1.83  
changed lines
  Added in v.1.84


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