--- loncom/auth/lonroles.pm 2008/07/04 14:19:16 1.196
+++ loncom/auth/lonroles.pm 2008/11/12 20:01:09 1.210
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.196 2008/07/04 14:19:16 raeburn Exp $
+# $Id: lonroles.pm,v 1.210 2008/11/12 20:01:09 jms Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,6 +27,103 @@
#
###
+=pod
+
+=head1 NAME
+
+Apache::lonroles - User Roles Screen
+
+=head1 SYNOPSIS
+
+Invoked by /etc/httpd/conf/srm.conf:
+
+ '.&mt('[_1]Visit the [_2]Course Catalog[_3] to view all [_4] LON-CAPA courses.','','','',$domdesc).' '.&mt('[_1]Visit the [_2]Course Catalog[_3] to view all [_4] LON-CAPA courses.','','','',$domdesc).' '
.&mt('This is LON-CAPA [_1]',$r->dir_config('lonVersion'))
.''.
+ &mt('As your session file for the course has expired, you will need to re-select the course.').'
');
+ } else {
+ $r->print(
''.
&mt('You need to choose another user role or enter a specific course for this function').'
');
- }
+ }
+ }
}
# -------------------------------------------------------- Choice or no choice?
if ($nochoose) {
@@ -549,7 +685,7 @@ ENDHEADER
$countfuture ++;
} elsif ($tstatus eq 'will') {
$tbg='#FFAA77';
- $tremark.=&mt('Active at next login. ');
+ $tremark.=&mt('Active at next login.').' ';
$roles_nextlogin{$trolecode} = $tstart.':'.$tend;
$countwill ++;
} elsif ($tstatus eq 'expired') {
@@ -558,20 +694,19 @@ ENDHEADER
$button=0;
} elsif ($tstatus eq 'will_not') {
$tbg='#AAFF77';
- $tremark.=&mt('Expired after logout. ');
+ $tremark.=&mt('Expired after logout.').' ';
} elsif ($tstatus eq 'selected') {
$tbg='#11CC55';
$tfont='#002200';
$inrole=1;
$countactive++;
- $tremark.=&mt('Currently selected. ');
+ $tremark.=&mt('Currently selected.').' ';
}
my $trole;
if ($role =~ /^cr\//) {
my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role);
if ($tremark) { $tremark.='
'; }
- $tremark.=&mt('Defined by ').$rauthor.
- &mt(' at ').$rdomain.'.';
+ $tremark.=&mt('Defined by [_1] at [_2].',$rauthor,$rdomain);
}
$trole=Apache::lonnet::plaintext($role);
my $ttype;
@@ -659,7 +794,7 @@ ENDHEADER
$twhere=&mt('system wide');
$sortkey=$role.$twhere;
}
- $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver);
+ $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver,$reinit);
$roletext{$envkey}=$roletext;
if (!$sortkey) {$sortkey=$twhere."\0".$envkey;}
$sortrole{$sortkey}=$envkey;
@@ -675,7 +810,8 @@ ENDHEADER
} else {
if ($countactive > 0) {
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
- $r->print('
'.&mt('If a course is [_1]not[_2] in your list of current courses below, you may be able to enroll if self-enrollment is permitted.','','').'
'.&mt('If a course is [_1]not[_2] in your list of current courses below, you may be able to enroll if self-enrollment is permitted.','','').'');
- $tremark=&mt('Currently selected. ');
+ $tremark=&mt('Currently selected.').' ';
$tfont='#002200';
} else {
$r->print(' ');
@@ -711,20 +847,9 @@ ENDHEADER
}
$r->print(&Apache::loncommon::end_page());
return OK;
-# Is there only one choice?
- } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {
- $r->print(' '.&mt('Please stand by.').'
'.
- ''.
- '');
- $r->print("\n");
- $r->rflush();
- $r->print('');
- $r->print(&Apache::loncommon::end_page());
- return OK;
}
-# More than one possible role
# ----------------------------------------------------------------------- Table
- unless ((!&Apache::lonmenu::show_course()) || ($nochoose)) {
+ unless ((!&Apache::lonmenu::show_course()) || ($nochoose) || ($countactive==1)) {
$r->print("".&mt('Select a Course to Enter')."
\n");
}
my $doheaders = &roletable_headers($r,\%roleclass,\%sortrole,$nochoose);
@@ -759,27 +884,28 @@ ENDHEADER
&Apache::loncommon::authorbrowser_javascript());
}
&print_rolerows($r,$doheaders,\%roleclass,\%sortrole,\%dcroles,\%roletext);
- my $tremark='';
- my $tfont='#003300';
- if ($env{'request.role'} eq 'cm') {
- $r->print('');
- $tremark=&mt('Currently selected. ');
- $tfont='#002200';
- } else {
- $r->print(' ');
- }
- unless ($nochoose) {
- if ($env{'request.role'} ne 'cm') {
- $r->print(' '."\n");
-
+ if ($countactive > 1) {
+ my $tremark='';
+ my $tfont='#003300';
+ if ($env{'request.role'} eq 'cm') {
+ $r->print('');
- } else {
- $r->print(' ');
- }
- }
- $r->print(''.&mt('No role specified').
- ' '.$tremark.
- ' ');
+ $tremark=&mt('Currently selected.').' ';
+ $tfont='#002200';
+ } else {
+ $r->print(' ');
+ }
+ unless ($nochoose) {
+ if ($env{'request.role'} ne 'cm') {
+ $r->print(' '."\n");
+ }
$r->print('');
unless ($nochoose) {
$r->print("\n");
@@ -791,10 +917,14 @@ ENDHEADER
}
$r->print(&Apache::lonnet::getannounce());
if ($advanced) {
+ my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
$r->print('');
+ } else {
+ $r->print(' ');
+ }
+ }
+ $r->print(''.&mt('No role specified').
+ ' '.$tremark.
+ '
'
- .''.&mt('Logout').'
'.&mt('The [_1]Course Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created.','','',$domdesc).'
');
+ $r->print('
'.&mt('The [_1]Course Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created.','','',$domdesc).'
');
$r->print(&mt('You can search the course catalog for courses which permit self-enrollment, if you would like to enroll in a course.').'