--- loncom/auth/lonroles.pm 2006/05/30 19:47:36 1.151
+++ loncom/auth/lonroles.pm 2006/10/20 19:59:57 1.168
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.151 2006/05/30 19:47:36 www Exp $
+# $Id: lonroles.pm,v 1.168 2006/10/20 19:59:57 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,6 +40,7 @@ use Apache::lonhtmlcommon;
use Apache::lonannounce;
use Apache::lonlocal;
use Apache::lonpageflip();
+use Apache::lonnavdisplay();
use GDBM_File;
use LONCAPA;
@@ -53,8 +54,8 @@ sub redirect_user {
my $swinfo=&Apache::lonmenu::rawconfig();
my $navwindow;
if ($launch_nav eq 'on') {
- $navwindow.=&Apache::lonnavmaps::launch_win('now',undef,undef,
- ($url =~ m-^/adm/whatsnew-));
+ $navwindow.=&Apache::lonnavdisplay::launch_win('now',undef,undef,
+ ($url =~ m-^/adm/whatsnew-));
} else {
$navwindow.=&Apache::lonnavmaps::close();
}
@@ -88,7 +89,7 @@ sub error_page {
&Apache::lonmenu::rawconfig().''.
'
'.&mt('The following problems occurred:').
$error.
- '
'.&mt('Continue').''.
&Apache::loncommon::end_page());
}
@@ -149,8 +150,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});
}
@@ -247,9 +250,9 @@ ENDENTERKEY
'request.course.sec' => $csec,
'request.course.groups' => $cgrps);
my $tadv=0;
- my $msg=&mt('Entering course ...');
if (($cnum) && ($role ne 'ca') && ($role ne 'aa')) {
+ my $msg;
my ($furl,$ferr)=
&Apache::lonuserstate::readmap($cdom.'/'.$cnum);
if (($env{'form.orgurl'}) &&
@@ -264,17 +267,19 @@ ENDENTERKEY
}
return OK;
} else {
- unless ($env{'request.course.id'}) {
+ if (!$env{'request.course.id'}) {
&Apache::lonnet::appenv(
"request.course.id" => $cdom.'_'.$cnum);
$furl='/adm/roles?tryagain=1';
$msg=
- ''.
- &mt('Could not initialize course at this time.').
- '
'.&mt('Please try again.').'
'.$ferr;
+ ''.
+ &mt('Could not initialize [_1] at this time.',
+ $env{'course.'.$cdom.'_'.$cnum.'.description'}).
+ '
'.&mt('Please try again.').'
'.$ferr;
}
if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
&Apache::lonnet::appenv('request.role.adv'=>$tadv);
+
if (($ferr) && ($tadv)) {
&error_page($r,$ferr,$furl);
} else {
@@ -298,7 +303,8 @@ ENDENTERKEY
) {
my $startpage = &courseloadpage($courseid);
unless ($startpage eq 'firstres') {
- $msg = &mt('Entering course ....');
+ $msg = &mt('Entering [_1] ....',
+ $env{'course.'.$courseid.'.description'});
&redirect_user($r,&mt('New in course'),
'/adm/whatsnew?refpage=start',$msg,
$env{'environment.remotenavmap'});
@@ -311,7 +317,10 @@ ENDENTERKEY
# Guess not ...
$furl=&Apache::lonpageflip::first_accessible_resource();
}
- &redirect_user($r,&mt('Entering Course'),
+ $msg = &mt('Entering [_1] ...',
+ $env{'course.'.$courseid.'.description'});
+ &redirect_user($r,&mt('Entering [_1]',
+ $env{'course.'.$courseid.'.description'}),
$furl,$msg,
$env{'environment.remotenavmap'});
}
@@ -356,10 +365,10 @@ ENDENTERKEY
my $start_page=&Apache::loncommon::start_page('User Roles');
my $standby=&mt('Role selected. Please stand by.');
$standby=~s/\n/\\n/g;
- my $helptag=''.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).' |
';
+
$r->print(<
+