--- loncom/auth/lonroles.pm 2010/10/04 17:43:24 1.240.2.17 +++ loncom/auth/lonroles.pm 2010/12/05 16:15:02 1.240.2.19 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.240.2.17 2010/10/04 17:43:24 raeburn Exp $ +# $Id: lonroles.pm,v 1.240.2.19 2010/12/05 16:15:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -592,16 +592,12 @@ ENDENTERKEY return OK if $r->header_only; 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.').'

'; + $show_course=&Apache::loncommon::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 $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); + my $start_page = &Apache::loncommon::start_page('Main Menu'); $r->print(<<"ENDCUSTOM"); $start_page -
@@ -610,20 +606,28 @@ ENDCUSTOM $crumbtext = 'User Roles'; $pagetitle = 'My Roles'; $recent = &mt('Recent Roles'); - $show_course=&Apache::loncommon::show_course(); + my $standby=&mt('Role selected. Please stand by.'); if ($show_course) { $crumbtext = 'Courses'; $pagetitle = 'My Courses'; $recent = &mt('Recent Courses'); + $standby = &mt('Course selected. Please stand by.'); + } + my $brcrum = [{ href => '/adm/roles', + text => $crumbtext,}, + ]; + my $args; + if ($numdc) { + $args = {bread_crumbs => $brcrum}; + } else { + $args = {bread_crumbs => $brcrum, + bread_crumbs_menulink => '_nomenu'}; } - my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; + my $start_page=&Apache::loncommon::start_page($pagetitle,undef,$args); 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(< @@ -756,14 +760,6 @@ ENDHEADER $current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}. '/'.$env{'course.'.$env{'request.course.id'}.'.num'}; } - my $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses); - $r->print(<<"ENDSCRIPT"); - -ENDSCRIPT } $r->print(&Apache::lonmenu::inlinemenu('gcicustom',$switcher). &Apache::loncommon::end_page()); @@ -807,7 +803,15 @@ ENDSCRIPT if ($inrole) { $r->print('

'.&mt('Currently no additional roles, courses or communities').'

'); } else { - $r->print('

'.&mt('Currently no active roles, courses or communities').'

'); + if ($show_course) { + if ($env{'user.domain'} eq 'gcitest') { + $r->print('

'.&mt('Currently no active Concept Tests').'

'); + } elsif ($env{'user.domain'} eq 'gci') { + $r->print('

'.&mt('Currently not assigned as a GCI contributor').'

'); + } + } else { + $r->print('

'.&mt('Currently no active roles, courses or communities').'

'); + } } unless ($env{'user.domain'} eq 'gcitest') { &findcourse_advice($r); @@ -815,7 +819,15 @@ ENDSCRIPT } $r->print(''); if ($countfuture) { - $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture)); + if ($show_course) { + if ($env{'user.domain'} eq 'gcitest') { + $r->print(&mt('The following [quant,_1,Concept Test] will be available in the future:',$countfuture)); + } else { + $r->print(&mt('The following [quant,_1,course] will become active in the future:',$countfuture)); + } + } else { + $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture)); + } my $doheaders = &roletable_headers($r,\%roleclass,\%sortrole, $nochoose); &print_rolerows($r,$doheaders,\%roleclass,\%sortrole,\%dcroles, @@ -864,7 +876,7 @@ ENDSCRIPT } } # ----------------------------------------------------------------------- Table - unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) { + unless ((!$show_course) || ($nochoose) || ($countactive==1)) { $r->print("

".&mt('Select a Course to Enter')."

\n"); } if ($env{'form.destinationurl'}) { @@ -967,6 +979,8 @@ ENDSCRIPT sub gci_info_page { return <<"END"; +
+

Welcome to the Geoscience Concept Inventory WebCenter

Use the tabs to navigate the WebCenter and... @@ -979,7 +993,7 @@ Use the tabs to navigate the WebCenter a

For more information about writing and reviewing Concept Inventory questions please refer to the GCI Workbook. - +

END } @@ -1285,10 +1299,15 @@ sub findcourse_advice { } else { $r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'
'); } - $r->print('

'.&mt('Self-Enrollment').'

'. - '

'.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','','',$domdesc).'
'); - $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'

'. - &Apache::loncoursequeueadmin::queued_selfenrollment()); + my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment(); + if ($queued) { + $r->print($queued); + } else { + $r->print(&mt('You have no request for contributor access pending approval by the GCI WebCenter team.').''); + } return; }