--- loncom/auth/lonroles.pm 2004/02/10 19:23:11 1.80.4.1 +++ loncom/auth/lonroles.pm 2004/02/19 21:45:22 1.86 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.80.4.1 2004/02/10 19:23:11 albertel Exp $ +# $Id: lonroles.pm,v 1.86 2004/02/19 21:45:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,20 +25,6 @@ # # http://www.lon-capa.org/ # -# (Directory Indexer -# (Login Screen -# YEAR=1999 -# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer) -# 11/23 Gerd Kortemeyer) -# YEAR=2000 -# 1/14,03/06,06/01,07/22,07/24,07/25, -# 09/04,09/06,09/28,09/29,09/30,10/2,10/5,10/26,10/28, -# 12/08,12/28, -# YEAR=2001 -# 01/15/01 Gerd Kortemeyer -# 03/02,05/03,05/25,05/30,06/01,07/06,08/06 Gerd Kortemeyer -# 12/29 Gerd Kortemeyer -# ### package Apache::lonroles; @@ -237,8 +223,10 @@ ENDENTERKEY my $swinfo=&Apache::lonmenu::rawconfig(); my $bodytag=&Apache::loncommon::bodytag('User Roles'); - my $helptag=&Apache::loncommon::help_open_topic - ("General_Intro",&mt("Click here for help")); + my $helptag='
'.&Apache::loncommon::help_open_topic + ("General_Intro",&mt("Click here for help")).''. + &Apache::loncommon::help_open_faq(1,&mt('Click here for FAQ')).''. + &Apache::loncommon::help_open_bug('',&mt('Click here to report bugs')).'
'; $r->print(< @@ -304,13 +292,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(''); } @@ -320,14 +306,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=''; @@ -368,6 +351,8 @@ ENDHEADER if ($tstatus eq 'is') { $tbg='#77FF77'; $tfont='#003300'; + $possiblerole=$trolecode; + $countactive++; } elsif ($tstatus eq 'future') { $tbg='#FFFF77'; $button=0; @@ -384,6 +369,8 @@ ENDHEADER } elsif ($tstatus eq 'selected') { $tbg='#11CC55'; $tfont='#002200'; + $inrole=1; + $countactive++; $tremark.=&mt('Currently selected. '); } my $trole; @@ -420,6 +407,7 @@ ENDHEADER ': '.$tdom.'
'. ' '.&mt('Server').': '.$home; $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca'; + $tremark.=&Apache::lonhtmlcommon::authorbombs('/res/'.$tdom.'/'.$trest.'/'); $sortkey=$role."$trest:$tdom"; } elsif ($role eq 'au') { # Authors @@ -442,6 +430,7 @@ ENDHEADER $twhere=&mt('Domain').': '.$tdom.'
'.&mt('Server'). ': '.$home; $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca'; + $tremark.=&Apache::lonhtmlcommon::authorbombs('/res/'.$tdom.'/'.$ENV{'user.name'}.'/'); $sortkey=$role; } elsif ($trest) { $ttype='Course'; @@ -526,6 +515,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; @@ -633,7 +651,8 @@ ENDHEADER $r->print(&Apache::lonnet::getannounce()); if ($advanced) { $r->print('

This is LON-CAPA '. - $r->dir_config('lonVersion').'

'); + $r->dir_config('lonVersion').'
'. + ''.&mt('Logout').'

'); } $r->print("\n"); return OK;
 '.&mt('User Role').''.&mt('Extent'). + ''.&mt('Start').''.&mt('End').''. + &mt('Remark').'