--- loncom/interface/loncreateuser.pm 2009/02/08 20:01:54 1.279 +++ loncom/interface/loncreateuser.pm 2009/02/18 19:34:08 1.282 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.279 2009/02/08 20:01:54 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.282 2009/02/18 19:34:08 schafran Exp $ # # Copyright Michigan State University Board of Trustees # @@ -337,7 +337,7 @@ sub print_username_entry_form { 'dom' => "Domain", 'ecrp' => "Edit Custom Role Privileges", 'nr' => "Name of Role", - 'cre' => "Custom Role Editor", + 'cre' => "Next", ); $r->print($start_page."\n".$crumbs); if ($env{'form.action'} eq 'custom') { @@ -347,7 +347,7 @@ sub print_username_entry_form {

$lt{'ecrp'}

-$lt{'nr'}: $choice
+$choice $lt{'nr'}:
ENDCUSTOM @@ -1713,8 +1713,8 @@ sub update_user_data { } if ( $env{'form.ccuname'} ne &LONCAPA::clean_username($env{'form.ccuname'}) ) { - $r->print($error.&mt('Invalid login name').'. '. - &mt('Only letters, numbers, periods, dashes, @, and underscores are valid').'.'. + $r->print($error.&mt('Invalid login name.').' '. + &mt('Only letters, numbers, periods, dashes, @, and underscores are valid.'). $end.$rtnlink); return; } @@ -1724,8 +1724,8 @@ sub update_user_data { } if ( $env{'form.ccdomain'} ne &LONCAPA::clean_domain($env{'form.ccdomain'}) ) { - $r->print($error.&mt ('Invalid domain name').'. '. - &mt('Only letters, numbers, periods, dashes, and underscores are valid').'.'. + $r->print($error.&mt('Invalid domain name.').' '. + &mt('Only letters, numbers, periods, dashes, and underscores are valid.'). $end.$rtnlink); return; } @@ -3017,7 +3017,7 @@ ENDCCF ''."\n".''."\n". ''."\n". - ''. + ''. &Apache::loncommon::end_page()); } # -------------------------------------------------------- @@ -4089,7 +4089,7 @@ ENDSCRIPT } $output .= &Apache::lonhtmlcommon::end_pick_box(). '
' + .&mt('Save').'" onclick="validate_types(this.form);" />' .''; $r->print($output); return; @@ -4172,7 +4172,8 @@ sub update_selfenroll_queue { my $hostname = &Apache::lonnet::hostname($chome); my $protocol = $Apache::lonnet::protocol{$chome}; $protocol = 'http' if ($protocol ne 'https'); - my (@existing,@missingreq,@invalidusers,@limitexceeded,@enrolled,@enrollerrors,); + my (@existing,@missingreq,@invalidusers,@limitexceeded,@enrolled, + @enrollerrors,@warn_approves,@warn_rejects); my $now = time; my $sender = $env{'user.name'}.':'.$env{'user.domain'}; my $approvedmsg = [{ @@ -4225,6 +4226,19 @@ sub update_selfenroll_queue { $stucounts->{'selfenrolled'} ++; &Apache::selfenroll::send_notification($uname.':'.$udom,$approvedmsg,$cid, $coursedesc,$now,'enroller',$sender); + my %userrequest = ( + $cdom.'_'.$cnum => { + timestamp => $now, + section => $usec, + adjudicator => $env{'user.name'}.':'.$env{'user.domain'}, + status => 'approved', + } + ); + my $userresult = + &Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); + if ($userresult ne 'ok') { + push(@warn_approves,$uname.':'.$udom); + } } else { push(@enrollerrors,$uname.':'.$udom); } @@ -4238,6 +4252,19 @@ sub update_selfenroll_queue { foreach my $user (@rejections) { &Apache::selfenroll::send_notification($user,$rejectedmsg,$cid, $coursedesc,$now,'enroller',$sender); + my ($uname,$udom) = split(/:/,$user); + my %userrequest = ( + $cdom.'_'.$cnum => { + timestamp => $now, + adjudicator => $env{'user.name'}.':'.$env{'user.domain'}, + status => 'rejected', + } + ); + my $userresult = + &Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); + if ($userresult ne 'ok') { + push(@warn_rejects,$user); + } } } if (@changes) { @@ -4306,6 +4333,20 @@ sub update_selfenroll_queue { } $r->print('

'); } + if (@warn_approves) { + $r->print('

'.&mt("For the following users, an error occurred when updating the user's own self-enroll requests record:").'

'); + } + if (@warn_rejects) { + $r->print('

'.&mt("For the following users, an error occurred when updating the user's own self-enroll requests record:").'

'); + } return; } @@ -4337,7 +4378,7 @@ sub visible_in_cat { miss => 'Your course does not currently appear in the Course Catalog for this domain.', yous => 'You should remedy this if you plan to allow self-enrollment, otherwise students will have difficulty finding your course.', coca => 'Courses can be absent from the Catalog, because they do not have an institutional code, have no assigned category, or have been specifically excluded.', - make => 'Make any changes to self-enrollment settings below, click "Save changes", then take action to include the course in the Catalog:', + make => 'Make any changes to self-enrollment settings below, click "Save", then take action to include the course in the Catalog:', take => 'Take the following action to ensure the course appears in the Catalog:', dc_unhide => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.', dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',