--- loncom/auth/lonroles.pm 2010/01/18 16:41:57 1.242 +++ loncom/auth/lonroles.pm 2010/03/22 20:11:08 1.246 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.242 2010/01/18 16:41:57 raeburn Exp $ +# $Id: lonroles.pm,v 1.246 2010/03/22 20:11:08 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -57,8 +57,7 @@ course they should act on, etc. Both in handler determines via C's C<&allowed> function that a certain action is not allowed, C is used as error handler. This allows the user to select another role which may have permission to do -what they were trying to do. C can also be accessed via the -B button in the Remote Control. +what they were trying to do. =begin latex @@ -145,19 +144,11 @@ use HTML::Entities; sub redirect_user { - my ($r,$title,$url,$msg,$launch_nav) = @_; + my ($r,$title,$url,$msg) = @_; $msg = $title if (! defined($msg)); &Apache::loncommon::content_type($r,'text/html'); &Apache::loncommon::no_cache($r); $r->send_http_header; - my $swinfo=&Apache::lonmenu::rawconfig(); - my $navwindow; - if ($launch_nav eq 'on') { - $navwindow.=&Apache::lonnavdisplay::launch_win('now',undef,undef, - ($url =~ m-^/adm/whatsnew-)); - } else { - $navwindow.=&Apache::lonnavmaps::close(); - } # Breadcrumbs my $brcrum = [{'href' => $url, @@ -172,12 +163,6 @@ sub redirect_user { $url=~s/ /\%20/g; $r->print(< -// - -$navwindow

$msg

$end_page ENDREDIR @@ -503,10 +488,9 @@ ENDENTERKEY my $esc_symb = &HTML::Entities::encode($env{'form.destsymb'},'"<>&'); $dest .= '?symb='.$esc_symb; } - &redirect_user($r,&mt('Entering [_1]', - $env{'course.'.$courseid.'.description'}), - $dest,$msg, - $env{'environment.remotenavmap'}); + &redirect_user($r, &mt('Entering [_1]', + $env{'course.'.$courseid.'.description'}), + $dest, $msg); return OK; } if (&Apache::lonnet::allowed('whn', @@ -519,9 +503,8 @@ ENDENTERKEY unless ($startpage eq 'firstres') { $msg = &mt('Entering [_1] ...', $env{'course.'.$courseid.'.description'}); - &redirect_user($r,&mt('New in course'), - '/adm/whatsnew?refpage=start',$msg, - $env{'environment.remotenavmap'}); + &redirect_user($r, &mt('New in course'), + '/adm/whatsnew?refpage=start', $msg); return OK; } } @@ -533,10 +516,9 @@ ENDENTERKEY } $msg = &mt('Entering [_1] ...', $env{'course.'.$courseid.'.description'}); - &redirect_user($r,&mt('Entering [_1]', - $env{'course.'.$courseid.'.description'}), - $furl,$msg, - $env{'environment.remotenavmap'}); + &redirect_user($r, &mt('Entering [_1]', + $env{'course.'.$courseid.'.description'}), + $furl, $msg); } return OK; } @@ -995,7 +977,7 @@ sub gather_roles { &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom). ''; $ttype = $newhash{'type'}; - $trole = &Apache::lonnet::plaintext($role,$ttype); + $trole = &Apache::lonnet::plaintext($role,$ttype,$tcourseid); } else { $twhere=&mt('Currently not available'); $env{'course.'.$tcourseid.'.description'}=$twhere; @@ -1233,49 +1215,6 @@ sub requestcourse_advice { return; } -sub queued_selfenrollment { - my ($r) = @_; - my %selfenrollrequests = &Apache::lonnet::dump('selfenrollrequests'); - my %reqs_by_date; - foreach my $item (keys(%selfenrollrequests)) { - if (ref($selfenrollrequests{$item}) eq 'HASH') { - if ($selfenrollrequests{$item}{'status'} eq 'request') { - if ($selfenrollrequests{$item}{'timestamp'}) { - push(@{$reqs_by_date{$selfenrollrequests{$item}{'timestamp'}}},$item); - } - } - } - } - if (keys(%reqs_by_date)) { - my $rolename = &Apache::lonnet::plaintext('st'); - $r->print(''.&mt('Enrollment requests pending Course Coordinator approval').'
'. - &Apache::loncommon::start_data_table(). - &Apache::loncommon::start_data_table_header_row(). - ''.&mt('Date requested').''.&mt('Course title').''. - ''.&mt('User role').''.&mt('Section').''. - &Apache::loncommon::end_data_table_header_row()); - my @sorted = sort { $a <=> $b } (keys(%reqs_by_date)); - foreach my $item (@sorted) { - if (ref($reqs_by_date{$item}) eq 'ARRAY') { - foreach my $crs (@{$reqs_by_date{$item}}) { - my %courseinfo = &Apache::lonnet::coursedescription($crs); - my $usec = $selfenrollrequests{$crs}{'section'}; - if ($usec eq '') { - $usec = &mt('No section'); - } - $r->print(&Apache::loncommon::start_data_table_row(). - ''.&Apache::lonlocal::locallocaltime($item).''. - ''.$courseinfo{'description'}.''. - ''.$rolename.''.$usec.''. - &Apache::loncommon::end_data_table_row()); - } - } - } - $r->print(&Apache::loncommon::end_data_table()); - } - return; -} - sub privileges_info { my ($which) = @_; my $output; @@ -1694,8 +1633,7 @@ course they should act on, etc. Both in handler determines via C's C<&allowed> function that a certain action is not allowed, C is used as error handler. This allows the user to select another role which may have permission to do -what they were trying to do. C can also be accessed via the -B button in the Remote Control. +what they were trying to do. =begin latex