--- loncom/auth/lonroles.pm 2005/11/08 22:08:12 1.133 +++ loncom/auth/lonroles.pm 2005/12/19 21:39:33 1.139 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.133 2005/11/08 22:08:12 albertel Exp $ +# $Id: lonroles.pm,v 1.139 2005/12/19 21:39:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,7 +51,7 @@ sub redirect_user { my $navwindow; if ($launch_nav eq 'on') { $navwindow.=&Apache::lonnavmaps::launch_win('now',undef,undef, - ($url eq '/adm/whatsnew')); + ($url =~ m-/^adm/whatsnew-)); } else { $navwindow.=&Apache::lonnavmaps::close(); } @@ -89,6 +89,9 @@ sub handler { # ================================================================== Roles Init if ($env{'form.selectrole'}) { + if ($env{'form.newrole'}) { + $env{'form.'.$env{'form.newrole'}}=1; + } if ($env{'request.course.id'}) { my %temp=('logout_'.$env{'request.course.id'} => time); &Apache::lonnet::put('email_status',\%temp); @@ -123,6 +126,11 @@ sub handler { if ($tstatus eq 'is') { $where=~s/^\///; my ($cdom,$cnum,$csec)=split(/\//,$where); +# check for course groups + my %coursegroups = &Apache::lonnet::get_active_groups( + $env{'user.domain'},$env{'user.name'},$cdom, $cnum); + my $cgrps = join(':',keys(%coursegroups)); + # store role if recent_role list being kept if ($env{'environment.recentroles'}) { &Apache::lonhtmlcommon::store_recent('roles', @@ -224,7 +232,8 @@ ENDENTERKEY &Apache::lonnet::appenv( 'request.role' => $trolecode, 'request.role.domain' => $cdom, - 'request.course.sec' => $csec); + 'request.course.sec' => $csec, + 'request.course.groups' => $cgrps); my $tadv=0; my $msg=&mt('Entering course ...'); @@ -262,13 +271,17 @@ ENDENTERKEY '.course.helper.not.run'}) { $furl = "/adm/helper/course.initialization.helper"; # Send the user to the course they selected - } elsif (($env{'request.course.fn'}) - && ($role eq 'cc' && ($env{'environment.course_init_display'} ne 'firstres'))) { - $msg = &mt('Entering course ....'); - &redirect_user($r,&mt('New in course'), - '/adm/whatsnew',$msg, - $env{'environment.remotenavmap'}); - return OK; + } elsif ($env{'request.course.fn'}) { + if ($env{'user.adv'}) { + my $startpage = &courseloadpage($courseid); + unless ($startpage eq 'firstres') { + $msg = &mt('Entering course ....'); + &redirect_user($r,&mt('New in course'), + '/adm/whatsnew?refpage=start',$msg, + $env{'environment.remotenavmap'}); + return OK; + } + } } &redirect_user($r,&mt('Entering Course'), $furl,$msg, @@ -312,6 +325,8 @@ ENDENTERKEY my $swinfo=&Apache::lonmenu::rawconfig(); my $bodytag=&Apache::loncommon::bodytag('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")).' |