'. &mt('Enroll Another Student').'
'); + &enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context); + $r->print(''. + &mt('Enroll Another Student').'
'); } else { - my @rolechanges = &update_roles($r); + my @rolechanges = &update_roles($r,$context); if ($namechanged) { if ($context eq 'course') { if (@userroles > 0) { @@ -2033,14 +2116,21 @@ END } } my $userinfo = &Apache::loncommon::plainname($env{'form.ccuname'}, - $env{'form.ccdomain'}); - $r->print(''.&mt('Modify this user: ([_1])',$userinfo).''.(' 'x5).''.&mt('Create/Modify Another User').'
'); + $env{'form.ccdomain'}); + if ($env{'form.popup'}) { + $r->print(''); + } else { + $r->print('' + .&mt('Modify this user: [_1]',''.$env{'form.ccuname'}.':'.$env{'form.ccdomain'}.' ('.$userinfo.')').'' + .(' 'x5).'' + .&mt('Create/Modify Another User').'
'); + } } $r->print(&Apache::loncommon::end_page()); } sub update_roles { - my ($r) = @_; + my ($r,$context) = @_; my $now=time; my @rolechanges; my %disallowed; @@ -2056,7 +2146,7 @@ sub update_roles { my $result = &Apache::lonnet::revokerole($env{'form.ccdomain'}, $env{'form.ccuname'}, - $scope,$role); + $scope,$role,'','',$context); $r->print(&mt('Revoking [_1] in [_2]: [_3]', $role,$scope,''.$result.'').''.&mt('Create or edit another custom role').'
'); @@ -2731,7 +2823,8 @@ sub handler { $context = 'domain'; } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['action','state','callingform','roletype','showrole','bulkaction']); + ['action','state','callingform','roletype','showrole','bulkaction','popup','phase', + 'username','domain','srchterm','srchdomain','srchin','srchby','srchtype']); &Apache::lonhtmlcommon::clear_breadcrumbs(); if ($env{'form.action'} ne 'dateselect') { &Apache::lonhtmlcommon::add_breadcrumb @@ -2850,7 +2943,7 @@ sub handler { } } elsif ($env{'form.action'} eq 'custom' && $permission->{'custom'}) { if ($env{'form.phase'} eq 'set_custom_roles') { - &set_custom_role($r); + &set_custom_role($r,$context); } else { &custom_role_editor($r); } @@ -2934,6 +3027,35 @@ sub handler { ''.&mt('You do not have permission to modify dates or sections for users').''. &Apache::loncommon::end_page()); } + } elsif ($env{'form.action'} eq 'selfenroll') { + $r->print(&header()); + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/createuser?action=selfenroll', + text=>"Configure Self-enrollment"}); + if (!exists($env{'form.state'})) { + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Configure Self-enrollment', + 'Course_Self_Enrollment')); + $r->print(''; + if (exists($menu_item->{'help'})) { + $menu_html.= + &Apache::loncommon::help_open_topic($menu_item->{'help'}); + } $menu_html.=''; if (exists($menu_item->{'url'})) { $menu_html.=qq{}; @@ -3064,10 +3205,6 @@ sub print_main_menu { qq{}; } $menu_html.= &mt($menu_item->{'text'}).''; - if (exists($menu_item->{'help'})) { - $menu_html.= - &Apache::loncommon::help_open_topic($menu_item->{'help'}); - } $menu_html.='
'; } return $menu_html; @@ -3084,6 +3221,674 @@ sub restore_prev_selections { \%saveable_parameters); } +sub print_selfenroll_menu { + my ($r,$context,$permission) = @_; + my $formname = 'enrollstudent'; + my $nolink = 1; + my ($row,$lt) = &get_selfenroll_titles(); + my $groupslist = &Apache::lonuserutils::get_groupslist(); + my $setsec_js = + &Apache::lonuserutils::setsections_javascript($formname,$groupslist); + my %alerts = &Apache::lonlocal::texthash( + acto => 'Activation of self-enrollment was selected for the following domain(s)', + butn => 'but no user types have been checked.', + wilf => "Please uncheck 'activate' or check at least one type.", + ); + my $selfenroll_js = <<"ENDSCRIPT"; +function update_types(caller,num) { + var delidx = getIndexByName('selfenroll_delete'); + var actidx = getIndexByName('selfenroll_activate'); + if (caller == 'selfenroll_all') { + var selall; + for (var i=0; i'; + } + $count ++; + } + if (($count > 0) && ($count%$numinrow == 0)) { + $output .= ' |
'.
+ ''.&mt('Changes/page:').' '. + &Apache::lonmeta::selectbox('show',$curr->{'show'},undef, + (&mt('all'),5,10,20,50,100,1000,10000)). + ' | '; + my $startform = + &Apache::lonhtmlcommon::date_setter($formname,'rolelog_start_date', + $curr->{'rolelog_start_date'},undef, + undef,undef,undef,undef,undef,undef,$nolink); + my $endform = + &Apache::lonhtmlcommon::date_setter($formname,'rolelog_end_date', + $curr->{'rolelog_end_date'},undef, + undef,undef,undef,undef,undef,undef,$nolink); + my %lt = &rolechg_contexts(); + $output .= ' | '.&mt('Window during which changes occurred:').'
| '. + ' | '.&mt('Role:').' '. + ' | '.
+ &mt('Context:').' |