--- loncom/auth/lonroles.pm 2009/12/15 05:04:17 1.240.2.3 +++ loncom/auth/lonroles.pm 2010/01/18 17:15:47 1.244 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.240.2.3 2009/12/15 05:04:17 raeburn Exp $ +# $Id: lonroles.pm,v 1.244 2010/01/18 17:15:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -138,7 +138,7 @@ use Apache::lonannounce; use Apache::lonlocal; use Apache::lonpageflip(); use Apache::lonnavdisplay(); -use Apache::lonmainmenu(); +use Apache::loncoursequeueadmin; use GDBM_File; use LONCAPA qw(:DEFAULT :match); use HTML::Entities; @@ -225,7 +225,6 @@ 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'}) { @@ -320,9 +319,7 @@ sub handler { } } } - 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); @@ -495,7 +492,7 @@ ENDENTERKEY $courseid = substr($courseid, 1); } $courseid =~ s/\//_/; - if (($cdom ne 'gcitest') && (($role eq 'cc') || ($role eq 'co')) + if ((($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 @@ -519,7 +516,7 @@ ENDENTERKEY .$env{'request.course.sec'}) ) { my $startpage = &courseloadpage($courseid); - unless (($startpage eq 'firstres') || ($cdom eq 'gcitest')) { + unless ($startpage eq 'firstres') { $msg = &mt('Entering [_1] ...', $env{'course.'.$courseid.'.description'}); &redirect_user($r,&mt('New in course'), @@ -534,9 +531,6 @@ 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]', @@ -579,6 +573,7 @@ ENDENTERKEY } } + # =============================================================== No Roles Init &Apache::loncommon::content_type($r,'text/html'); @@ -586,34 +581,23 @@ ENDENTERKEY $r->send_http_header; return OK if $r->header_only; - my ($crumbtext,$pagetitle,$recent,$show_course); + 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 $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.').'

'; - if ($custommenu) { - my $start_page = &Apache::loncommon::start_page('Main Menu',undef, - {'bread_crumbs' => 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(<print(<