--- loncom/auth/lonroles.pm 2006/06/07 20:07:09 1.156
+++ loncom/auth/lonroles.pm 2006/06/26 18:56:37 1.159
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.156 2006/06/07 20:07:09 albertel Exp $
+# $Id: lonroles.pm,v 1.159 2006/06/26 18:56:37 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -149,8 +149,10 @@ sub handler {
# store role if recent_role list being kept
if ($env{'environment.recentroles'}) {
+ my %frozen_roles =
+ &Apache::lonhtmlcommon::get_recent_frozen('roles',$env{'environment.recentrolesn'});
&Apache::lonhtmlcommon::store_recent('roles',
- $trolecode,' ');
+ $trolecode,' ',$frozen_roles{$trolecode});
}
@@ -266,18 +268,14 @@ ENDENTERKEY
} else {
my $type = 'Course/Group';
if (!$env{'request.course.id'}) {
- if (defined($env{'course.'.
- $env{'request.course.id'}.'.type'})) {
- $type = $env{'course.'.
- $env{'request.course.id'}.'.type'};
- }
+ $type = &Apache::loncommon::course_type();
&Apache::lonnet::appenv(
"request.course.id" => $cdom.'_'.$cnum);
$furl='/adm/roles?tryagain=1';
$msg=
- '
'.
- &mt('Could not initialize [_1] at this time.',lc($type)).
- '
'.&mt('Please try again.').'
'.$ferr;
+ ''.
+ &mt('Could not initialize '.lc($type).' at this time.').
+ '
'.&mt('Please try again.').'
'.$ferr;
}
if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
&Apache::lonnet::appenv('request.role.adv'=>$tadv);
@@ -305,7 +303,7 @@ ENDENTERKEY
) {
my $startpage = &courseloadpage($courseid);
unless ($startpage eq 'firstres') {
- $msg = &mt('Entering [_1] ....',lc($type));
+ $msg = &mt('Entering '.lc($type).' ....');
&redirect_user($r,&mt('New in course'),
'/adm/whatsnew?refpage=start',$msg,
$env{'environment.remotenavmap'});
@@ -318,8 +316,8 @@ ENDENTERKEY
# Guess not ...
$furl=&Apache::lonpageflip::first_accessible_resource();
}
- $msg = &mt('Entering [_1] ...',lc($type));
- &redirect_user($r,&mt('Entering [_1]',$type),
+ $msg = &mt('Entering '.lc($type).' ...');
+ &redirect_user($r,&mt('Entering '.$type),
$furl,$msg,
$env{'environment.remotenavmap'});
}
@@ -424,8 +422,8 @@ 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').'
');
+ ''.
+ &mt('You need to choose another user role or enter a specific course for this function').'
');
}
}
# -------------------------------------------------------- Choice or no choice?
@@ -518,10 +516,8 @@ ENDHEADER
if ($tremark) { $tremark.='
'; }
$tremark.=&mt('Defined by ').$rauthor.
&mt(' at ').$rdomain.'.';
- $trole=$rrole;
- } else {
- $trole=Apache::lonnet::plaintext($role);
- }
+ }
+ $trole=Apache::lonnet::plaintext($role);
my $ttype;
my $twhere;
my ($tdom,$trest,$tsection)=
@@ -745,10 +741,8 @@ ENDHEADER
$ttype='Construction Space';
$twhere='User: '.$trest.', Domain: '.$tdom;
} else {
- $ttype='Course';
- if (defined($env{'course.'.$tdom.'_'.$trest.'.type'})) {
- $ttype = $env{'course.'.$tdom.'_'.$trest.'.type'};
- }
+ $ttype=
+ &Apache::loncommon::course_type($tdom.'_'.$trest);
$twhere=$env{'course.'.$tdom.'_'.$trest.'.description'};
if ($tsec) {
$twhere.=' (Section: '.$tsec.')';