--- loncom/auth/lonroles.pm 2009/10/25 14:48:43 1.234 +++ loncom/auth/lonroles.pm 2009/11/03 03:01:47 1.240 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.234 2009/10/25 14:48:43 raeburn Exp $ +# $Id: lonroles.pm,v 1.240 2009/11/03 03:01:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -255,12 +255,12 @@ sub handler { # Check if user is a DC trying to enter a course or author space and needs privs to be created if ($numdc > 0) { foreach my $envkey (keys %env) { -# Is this an ad-hoc CC-role? - if (my ($domain,$coursenum) = - ($envkey =~ m-^form\.cc\./($match_domain)/($match_courseid)$-)) { +# Is this an ad-hoc Coordinator role? + if (my ($ccrole,$domain,$coursenum) = + ($envkey =~ m-^form\.(cc|co)\./($match_domain)/($match_courseid)$-)) { if ($dcroles{$domain}) { &Apache::lonnet::check_adhoc_privs($domain,$coursenum, - $then,$refresh,$now,'cc'); + $then,$refresh,$now,$ccrole); } last; } @@ -491,8 +491,8 @@ ENDENTERKEY $courseid = substr($courseid, 1); } $courseid =~ s/\//_/; - if ($role eq 'cc' && $env{'course.' . $courseid . - '.course.helper.not.run'}) { + 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 } elsif ($env{'request.course.id'}) { @@ -675,7 +675,8 @@ ENDHEADER } else { $r->print( '

'. - &mt('You need to choose another user role or enter a specific course or community for this function').'

'); + &mt('You need to choose another user role or enter a specific course or community for this function.'). + ''); } } } @@ -703,10 +704,11 @@ ENDHEADER $refresh = $now; &Apache::lonnet::appenv({'user.refresh.time' => $refresh}); if ($env{'user.adv'}) { - $r->print( - '

'); + $r->print(' />'.&mt('Show all roles').'' + .' ' + .'

'); } else { if ($countactive > 0) { &queued_selfenrollment($r); @@ -720,7 +722,7 @@ ENDHEADER ,'' ,'',$domdesc) .'
' - .&mt('If a course or community is [_1]not[_2] in your list of current courses below,' + .&mt('If a course or community is [_1]not[_2] in your list of current courses and communities below,' .' you may be able to enroll if self-enrollment is permitted.' ,'','') .'

' @@ -1108,7 +1110,7 @@ sub roletable_headers { } sub roletypes { - my @types = ('Domain','Construction Space','Course','Unavailable','System'); + my @types = ('Domain','Construction Space','Course','Community','Unavailable','System'); return @types; } @@ -1170,9 +1172,9 @@ 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').'

'. + $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 the course catalog for courses and communities which permit self-enrollment, if you would like to enroll in one.').'

'); + $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'

'); &queued_selfenrollment($r); return; } @@ -1187,14 +1189,20 @@ sub requestcourse_advice { my ($types,$typename) = &Apache::loncommon::course_types(); if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) { $r->print('

'.&mt('Request creation of a course or community').'

'. - '

'.&mt('You have rights to create courses and/or communities in the following domain(s):').'