--- loncom/auth/lonroles.pm 2003/01/16 01:37:26 1.48 +++ loncom/auth/lonroles.pm 2003/01/29 15:22:06 1.49 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.48 2003/01/16 01:37:26 www Exp $ +# $Id: lonroles.pm,v 1.49 2003/01/29 15:22:06 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -241,6 +241,7 @@ ENDHEADER foreach $envkey (sort keys %ENV) { my $button = 1; + my $switchserver=''; if ($envkey=~/^user\.role\./) { my (undef,undef,$role,@pwhere)=split(/\./,$envkey); next if (!defined($role) || $role eq ''); @@ -278,12 +279,14 @@ ENDHEADER $tfont='#003300'; } elsif ($tstatus eq 'future') { $tbg='#FFFF77'; + $button=0; } elsif ($tstatus eq 'will') { $tbg='#FFAA77'; $tremark.='Active at next login. '; } elsif ($tstatus eq 'expired') { $tbg='#FF7777'; $tfont='#330000'; + $button=0; } elsif ($tstatus eq 'will_not') { $tbg='#AAFF77'; $tremark.='Expired after logout. '; @@ -307,7 +310,11 @@ ENDHEADER # First, Co-Authorship roles if ($role eq 'ca') { my $home = &Apache::lonnet::homeserver($trest,$tdom); - $button = 0 if ($home ne $r->dir_config('lonHostID')); + if ($home ne $r->dir_config('lonHostID')) { + $button=0; + $switchserver='http://'. + $Apache::lonnet::hostname{$home}.'/priv/'.$trest; + } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; $ttype='Construction Space'; @@ -318,7 +325,12 @@ ENDHEADER # Authors my $home = &Apache::lonnet::homeserver ($ENV{'user.name'},$ENV{'user.domain'}); - $button = 0 if ($home ne $r->dir_config('lonHostID')); + if ($home ne $r->dir_config('lonHostID')) { + $button=0; + $switchserver='http://'. + $Apache::lonnet::hostname{$home}.'/priv/'. + $ENV{'user.name'}; + } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; $ttype='Construction Space'; @@ -333,16 +345,18 @@ ENDHEADER if ($ENV{'course.'.$tcourseid.'.description'}) { $twhere=$ENV{'course.'.$tcourseid.'.description'}; unless ($twhere eq 'Currently not available') { - $twhere= - &Apache::loncommon::syllabuswrapper($twhere,$trest,$tdom,$tfont); + $twhere.=' '. + &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont). + ''; } } else { my %newhash=Apache::lonnet::coursedescription ($tcourseid); if (%newhash) { - $twhere= -&Apache::loncommon::syllabuswrapper($newhash{'description'},$trest,$tdom, - $tfont); + $twhere=$newhash{'description'}. + ' '. + &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont). + ''; } else { $twhere='Currently not available'; $ENV{'course.'.$tcourseid.'.description'}=$twhere; @@ -361,7 +375,12 @@ ENDHEADER $r->print(''); unless ($nochoose) { if (!$button) { - $r->print(' '); + if ($switchserver) { + $r->print('Switch Server'); + } else { + $r->print(' '); + } } elsif ($tstatus eq 'is') { $r->print('');