--- loncom/auth/lonroles.pm 2003/03/19 22:22:18 1.46.2.2
+++ 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.46.2.2 2003/03/19 22:22:18 albertel Exp $
+# $Id: lonroles.pm,v 1.49 2003/01/29 15:22:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -150,7 +150,8 @@ ENDREDIR
my $swinfo=&Apache::lonmenu::rawconfig($r);
my $bodytag=&Apache::loncommon::bodytag('User Roles');
- my $helptag=&Apache::loncommon::help_open_topic("General_Intro","HELP");
+ my $helptag=&Apache::loncommon::help_open_topic
+ ("General_Intro","CLICK HERE FOR HELP");
$r->print(<
@@ -240,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 '');
@@ -250,6 +252,7 @@ ENDHEADER
my $tstatus='is';
my $tpstart=' ';
my $tpend=' ';
+ my $tfont='#000000';
if ($tstart) {
if ($tstart>$then) {
$tstatus='future';
@@ -273,18 +276,23 @@ ENDHEADER
($ENV{'form.showall'})) {
if ($tstatus eq 'is') {
$tbg='#77FF77';
+ $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. ';
} elsif ($tstatus eq 'selected') {
$tbg='#11CC55';
+ $tfont='#002200';
$tremark.='Currently selected. ';
}
my $trole;
@@ -302,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';
@@ -313,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';
@@ -329,7 +346,7 @@ ENDHEADER
$twhere=$ENV{'course.'.$tcourseid.'.description'};
unless ($twhere eq 'Currently not available') {
$twhere.=' '.
- &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom).
+ &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont).
'';
}
} else {
@@ -338,7 +355,7 @@ ENDHEADER
if (%newhash) {
$twhere=$newhash{'description'}.
' '.
- &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom).
+ &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont).
'';
} else {
$twhere='Currently not available';
@@ -358,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(' | ');
@@ -370,17 +392,22 @@ ENDHEADER
$r->print(' | ');
}
}
- $r->print(''.$trole.' | '.
- $ttype.' | '.$twhere.' | '.$tpstart.
- ' | '.$tpend.
- ' | '.$tremark.' |
'."\n");
+ $r->print(''.$trole.
+ ' | '.$ttype.
+ ' | '.$twhere.
+ ' | '.$tpstart.
+ ' | '.$tpend.
+ ' | '.$tremark.
+ ' | '."\n");
}
}
}
my $tremark='';
+ my $tfont='#003300';
if ($ENV{'request.role'} eq 'cm') {
$r->print('');
$tremark='Currently selected.';
+ $tfont='#002200';
} else {
$r->print('
');
}
@@ -391,8 +418,9 @@ ENDHEADER
$r->print(' | ');
}
}
- $r->print('No role specified'.
- ' | '.$tremark.' |
'."\n");
+ $r->print('No role specified'.
+ ' | '.$tremark.
+ ' | '."\n");
$r->print('');
unless ($nochoose) {