--- loncom/auth/lonroles.pm 2005/07/08 10:39:49 1.126
+++ loncom/auth/lonroles.pm 2005/11/01 21:59:24 1.131
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.126 2005/07/08 10:39:49 www Exp $
+# $Id: lonroles.pm,v 1.131 2005/11/01 21:59:24 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -50,7 +50,8 @@ sub redirect_user {
my $swinfo=&Apache::lonmenu::rawconfig();
my $navwindow;
if ($launch_nav eq 'on') {
- $navwindow.=&Apache::lonnavmaps::launch_win('now');
+ $navwindow.=&Apache::lonnavmaps::launch_win('now',undef,undef,
+ ($url eq '/adm/whatsnew'));
} else {
$navwindow.=&Apache::lonnavmaps::close();
}
@@ -243,7 +244,7 @@ ENDENTERKEY
"request.course.id" => $cdom.'_'.$cnum);
$furl='/adm/roles?tryagain=1';
$msg=
- '
'.
+ ''.
&mt('Could not initialize course at this time.').
' '.&mt('Please try again.').' '.$ferr;
}
@@ -361,7 +362,7 @@ ENDHEADER
} else {
if ($env{'user.error.msg'}) {
$r->print(
- ''.
+ ''.
&mt('You need to choose another user role or enter a specific course for this function').' ');
}
}
@@ -430,34 +431,28 @@ ENDHEADER
$tstatus='selected';
}
my $tbg;
- my $tbghigh;
if (($tstatus eq 'is') || ($tstatus eq 'selected') ||
($env{'form.showall'})) {
if ($tstatus eq 'is') {
$tbg='#77FF77';
- $tbghigh='#99CC77';
$tfont='#003300';
$possiblerole=$trolecode;
$countactive++;
} elsif ($tstatus eq 'future') {
$tbg='#FFFF77';
- $tbghigh='#DDDD55';
$button=0;
} elsif ($tstatus eq 'will') {
$tbg='#FFAA77';
$tremark.=&mt('Active at next login. ');
} elsif ($tstatus eq 'expired') {
$tbg='#FF7777';
- $tbghigh='#EE9955';
$tfont='#330000';
$button=0;
} elsif ($tstatus eq 'will_not') {
$tbg='#AAFF77';
- $tbghigh='#BBDD55';
$tremark.=&mt('Expired after logout. ');
} elsif ($tstatus eq 'selected') {
$tbg='#11CC55';
- $tbghigh='339944';
$tfont='#002200';
$inrole=1;
$countactive++;
@@ -484,11 +479,7 @@ ENDHEADER
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
if (!$allowed) {
$button=0;
- $switchserver=&Apache::lonnet::escape('http://'.
- $Apache::lonnet::hostname{$home}.
- '/adm/login?domain='.$env{'user.domain'}.
- '&username='.$env{'user.name'}.
- '&firsturl=/priv/'.$trest.'/');
+ $switchserver='otherserver='.$home.'&role='.$trolecode;
}
#next if ($home eq 'no_host');
$home = $Apache::lonnet::hostname{$home};
@@ -563,7 +554,7 @@ ENDHEADER
$sortkey=$role.$twhere;
}
- $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tbghigh,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver);
+ $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver);
$roletext{$envkey}=$roletext;
if (!$sortkey) {$sortkey=$twhere."\0".$envkey;}
$sortrole{$sortkey}=$envkey;
@@ -601,7 +592,7 @@ ENDHEADER
' '.&mt('Start').' '.&mt('End').' '.
&mt('Remarks and Calendar Announcements').' '."\n");
my $doheaders=-1;
- foreach my $type ('Construction Space','Course','Domain','System') {
+ foreach my $type ('Domain','Construction Space','Course','System') {
my $haverole=0;
foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) {
if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) {
@@ -625,7 +616,7 @@ ENDHEADER
}
}
if ($output) {
- $r->print("".
+ $r->print("".
&mt('Recent Roles')." ");
$r->print($output);
$r->print(" ");
@@ -652,7 +643,7 @@ ENDHEADER
if ($output) {
if ($doheaders > 0) {
$r->print("".
- "".&mt($type)." ");
+ " ".&mt($type)." ");
}
$r->print($output);
}
@@ -684,7 +675,7 @@ ENDHEADER
}
# ------------------------------------------------------------ Privileges Info
if (($advanced) && (($env{'user.error.msg'}) || ($error))) {
- $r->print('Current Privileges ');
+ $r->print('Current Privileges ');
foreach $envkey (sort keys %env) {
if ($envkey=~/^user\.priv\.$env{'request.role'}\./) {
@@ -772,12 +763,12 @@ sub role_status {
}
sub build_roletext {
- my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tbghigh,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;
- my $roletext='';
+ my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;
+ my $roletext=' ';
unless ($nochoose) {
if (!$button) {
if ($switchserver) {
- $roletext.=''.&mt('Switch Server').' ';
} else {
$roletext.=(' ');
@@ -938,7 +929,6 @@ sub display_cc_role {
my $trole = Apache::lonnet::plaintext('cc');
my $twhere;
my $tbg='#77FF77';
- my $tbghigh='#99CC77';
my $tfont='#003300';
my %newhash=&Apache::lonnet::coursedescription($tcourseid);
if (%newhash) {
@@ -951,7 +941,7 @@ sub display_cc_role {
$env{'course.'.$tcourseid.'.description'}=$twhere;
}
$twhere.=" ".&mt('Domain').":".$1;
- $roletext = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$tbghigh,$tfont,$trole,&mt('Course'),$twhere,'','','',1,'');
+ $roletext = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$tfont,$trole,&mt('Course'),$twhere,'','','',1,'');
}
}
return $roletext;
@@ -961,7 +951,7 @@ sub allcourses_row {
my $dcdom = shift;
my $ccrole = Apache::lonnet::plaintext('cc');
my $selectlink = &courselink($dcdom);
- my $output = ' '.
+ my $output = ' '.
' '.