--- loncom/auth/lonroles.pm 2010/01/05 15:30:25 1.240.2.7 +++ loncom/auth/lonroles.pm 2010/10/04 17:43:24 1.240.2.17 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.240.2.7 2010/01/05 15:30:25 raeburn Exp $ +# $Id: lonroles.pm,v 1.240.2.17 2010/10/04 17:43:24 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; @@ -454,6 +454,12 @@ ENDENTERKEY &Apache::lonnet::appenv({'request.role.adv'=>$tadv}); my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum); + if ($custommenu) { + unless (($ferr) || ($env{'form.switchrole'})) { + &Apache::lonnet::put('nohist_crslastlogin',{$env{'user.name'}.':'.$env{'user.domain'}.':'.$csec.':'.$role => $now}, + $cdom,$cnum); + } + } if (($env{'form.orgurl'}) && ($env{'form.orgurl'}!~/^\/adm\/flip/)) { my $dest=$env{'form.orgurl'}; @@ -588,8 +594,11 @@ ENDENTERKEY 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.').'

'; if ($custommenu) { - my $start_page = &Apache::loncommon::start_page('Main Menu',undef, - {'bread_crumbs' => 1}); + my $brcrum = {'bread_crumbs' => 1}; + if ($env{'form.destinationurl'} eq '/adm/gci_info') { + undef($brcrum); + } + my $start_page = &Apache::loncommon::start_page('Main Menu',undef,$brcrum); $r->print(<<"ENDCUSTOM"); $start_page
@@ -722,25 +731,32 @@ ENDHEADER $refresh = $now; &Apache::lonnet::appenv({'user.refresh.time' => $refresh}); + if (!$countactive && !$countfuture) { + if (&Apache::loncommon::new_roles_update()) { + ($countactive,$countfuture,$inrole,$possiblerole) = + &gather_roles($then,$refresh,$now,$reinit,$nochoose,\%roletext,\%sortrole, + \%roleclass,\%futureroles,\%timezones); + } + } if ($custommenu) { if ($env{'form.destinationurl'} eq '/adm/gci_info') { $r->print(&gci_info_page()). &Apache::loncommon::end_page(); return OK; } - my %courses = &Apache::loncommon::existing_gcitest_courses(); + my %courses = &Apache::loncommon::existing_gcitest_courses('cc'); $env{'browser.interface'}='faketextual'; $env{'environment.remote'}='off'; my $numcourses = keys(%courses); my $switcher; if ($numcourses > 0) { - $switcher = &Apache::lonmainmenu::gcitest_switcher(%courses); + $switcher = &Apache::loncommon::gcitest_switcher('cc',%courses); my $current; if ($env{'request.course.id'}) { $current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}. '/'.$env{'course.'.$env{'request.course.id'}.'.num'}; } - my $switcher_js = &Apache::lonmainmenu::gcitest_switcher_js($current,$numcourses); + my $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses); $r->print(<<"ENDSCRIPT");