--- loncom/auth/lonroles.pm 2004/01/27 22:54:59 1.83 +++ loncom/auth/lonroles.pm 2004/01/29 00:44:06 1.84 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.83 2004/01/27 22:54:59 albertel Exp $ +# $Id: lonroles.pm,v 1.84 2004/01/29 00:44:06 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -306,13 +306,11 @@ ENDHEADER "
\n"); $r->print(&mt( "Author and Co-Author roles may not be available on servers other than your home server.")); - } else { - $r->print("

".&mt('Select a Course to Enter')."

\n"); } if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; } - $r->print('
'); + $r->print(''); $r->print(''); $r->print(''); } @@ -322,14 +320,11 @@ ENDHEADER if ($ENV{'form.showall'}) { $r->print(' checked'); } $r->print('>'); } -# ----------------------------------------------------------------------- Table - $r->print('
'); - unless ($nochoose) { $r->print(''); } - $r->print(''."\n"); my (%roletext,%sortrole,%roleclass); + my $countactive=0; + my $inrole=0; + my $possiblerole=''; foreach $envkey (sort keys %ENV) { my $button = 1; my $switchserver=''; @@ -370,6 +365,8 @@ ENDHEADER if ($tstatus eq 'is') { $tbg='#77FF77'; $tfont='#003300'; + $possiblerole=$trolecode; + $countactive++; } elsif ($tstatus eq 'future') { $tbg='#FFFF77'; $button=0; @@ -386,6 +383,7 @@ ENDHEADER } elsif ($tstatus eq 'selected') { $tbg='#11CC55'; $tfont='#002200'; + $inrole=1; $tremark.=&mt('Currently selected. '); } my $trole; @@ -530,6 +528,35 @@ ENDHEADER } } } +# No active roles + if ($countactive==0) { + if ($inrole) { + $r->print('

'.&mt('Currently no additional roles or courses').'

'); + } else { + $r->print('

'.&mt('Currently no active roles or courses').'

'); + } + $r->print(''); + return OK; +# Is there only one choice? + } elsif ($countactive==1) { + $r->print('

'.&mt('Please stand by.').'

'. + ''); + $r->print("\n"); + $r->rflush(); + $r->print(''); + $r->print(''); + return OK; + } +# More than one possible role +# ----------------------------------------------------------------------- Table + unless (($advanced) || ($nochoose)) { + $r->print("

".&mt('Select a Course to Enter')."

\n"); + } + $r->print('
 '.&mt('User Role').''.&mt('Extent'). - ''.&mt('Start').''.&mt('End').''. - &mt('Remark').'
'); + unless ($nochoose) { $r->print(''); } + $r->print(''."\n"); my $doheaders=-1; foreach my $type ('Construction Space','Course','Domain','System') { my $haverole=0;
 '.&mt('User Role').''.&mt('Extent'). + ''.&mt('Start').''.&mt('End').''. + &mt('Remark').'