--- loncom/auth/lonroles.pm 2009/12/07 04:38:22 1.240.2.2 +++ loncom/auth/lonroles.pm 2009/12/15 05:04:17 1.240.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.240.2.2 2009/12/07 04:38:22 raeburn Exp $ +# $Id: lonroles.pm,v 1.240.2.3 2009/12/15 05:04:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -138,6 +138,7 @@ use Apache::lonannounce; use Apache::lonlocal; use Apache::lonpageflip(); use Apache::lonnavdisplay(); +use Apache::lonmainmenu(); use GDBM_File; use LONCAPA qw(:DEFAULT :match); use HTML::Entities; @@ -224,6 +225,7 @@ sub handler { my %dcroles = (); my $numdc = &check_fordc(\%dcroles,$then); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); + my $custommenu = &Apache::loncommon::needs_gci_custom(); # ================================================================== Roles Init if ($env{'form.selectrole'}) { @@ -318,10 +320,9 @@ sub handler { } } } - if (($env{'form.cm'}) && ($env{'form.orgurl'})) { + if (($env{'form.cm'}) && ($env{'form.orgurl'})) { $r->internal_redirect($env{'form.orgurl'}); } - foreach $envkey (keys %env) { next if ($envkey!~/^user\.role\./); my ($where,$trolecode,$role,$tstatus,$tend,$tstart); @@ -494,7 +495,7 @@ ENDENTERKEY $courseid = substr($courseid, 1); } $courseid =~ s/\//_/; - if ((($role eq 'cc') || ($role eq 'co')) + if (($cdom ne 'gcitest') && (($role eq 'cc') || ($role eq 'co')) && ($env{'course.' . $courseid .'.course.helper.not.run'})) { $furl = "/adm/helper/course.initialization.helper"; # Send the user to the course they selected @@ -518,7 +519,7 @@ ENDENTERKEY .$env{'request.course.sec'}) ) { my $startpage = &courseloadpage($courseid); - unless ($startpage eq 'firstres') { + unless (($startpage eq 'firstres') || ($cdom eq 'gcitest')) { $msg = &mt('Entering [_1] ...', $env{'course.'.$courseid.'.description'}); &redirect_user($r,&mt('New in course'), @@ -533,6 +534,9 @@ ENDENTERKEY # Guess not ... $furl=&Apache::lonpageflip::first_accessible_resource(); } + if (($cdom eq 'gcitest') && ($custommenu)) { + $furl = '/adm/navmaps'; + } $msg = &mt('Entering [_1] ...', $env{'course.'.$courseid.'.description'}); &redirect_user($r,&mt('Entering [_1]', @@ -575,7 +579,6 @@ ENDENTERKEY } } - # =============================================================== No Roles Init &Apache::loncommon::content_type($r,'text/html'); @@ -583,23 +586,34 @@ ENDENTERKEY $r->send_http_header; return OK if $r->header_only; - my $crumbtext = 'User Roles'; - my $pagetitle = 'My Roles'; - my $recent = &mt('Recent Roles'); - my $show_course=&Apache::loncommon::show_course(); - if ($show_course) { - $crumbtext = 'Courses'; - $pagetitle = 'My Courses'; - $recent = &mt('Recent Courses'); - } - my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; - my $swinfo=&Apache::lonmenu::rawconfig(); - my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum}); - my $standby=&mt('Role selected. Please stand by.'); - $standby=~s/\n/\\n/g; + my ($crumbtext,$pagetitle,$recent,$show_course); my $noscript=''.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will be unavailable.').'

'; - - $r->print(< 1}); + $r->print(<<"ENDCUSTOM"); +$start_page +
+ +ENDCUSTOM + } else { + $crumbtext = 'User Roles'; + $pagetitle = 'My Roles'; + $recent = &mt('Recent Roles'); + $show_course=&Apache::loncommon::show_course(); + if ($show_course) { + $crumbtext = 'Courses'; + $pagetitle = 'My Courses'; + $recent = &mt('Recent Courses'); + } + my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; + my $swinfo=&Apache::lonmenu::rawconfig(); + my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum}); + my $standby=&mt('Role selected. Please stand by.'); + $standby=~s/\n/\\n/g; + $r->print(<