--- loncom/interface/loncreateuser.pm 2014/04/25 17:56:42 1.399 +++ loncom/interface/loncreateuser.pm 2014/04/28 22:20:13 1.400 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.399 2014/04/25 17:56:42 bisitz Exp $ +# $Id: loncreateuser.pm,v 1.400 2014/04/28 22:20:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4993,6 +4993,7 @@ sub handler { selfenroll_end_access => $env{'course.'.$cid.'.internal.selfenroll_end_access'}, default_enrollment_start_date => $env{'course.'.$cid.'.default_enrollment_start_date'}, default_enrollment_end_date => $env{'course.'.$cid.'.default_enrollment_end_date'}, + uniquecode => $env{'course.'.$cid.'.internal.uniquecode'}, ); push(@{$brcrum}, {href => '/adm/createuser?action=selfenroll', @@ -5012,7 +5013,7 @@ sub handler { bread_crumbs_component => 'Self-enrollment result'}; $r->print(&header(undef,$args)); $r->print('

'.&mt('Self-enrollment with a student role').'

'."\n"); - &update_selfenroll_config($r,$cid,$cdom,$cnum,\%currsettings); + &update_selfenroll_config($r,$cid,$cdom,$cnum,$context,$crstype,\%currsettings); } } else { $r->print(&header(undef,{'no_nav_bar' => 1}). @@ -5740,28 +5741,64 @@ ENDSCRIPT '// ]]>'."\n". ''."\n". '

'.$lt->{'selfenroll'}.'

'."\n"; - my ($visible,$cansetvis,$vismsgs,$visactions) = &visible_in_cat($cdom,$cnum); - if (ref($visactions) eq 'HASH') { - if ($visible) { - $output .= '

'.$visactions->{'vis'}.'

'; - } else { - $output .= '

'.$visactions->{'miss'}.'

' - .$visactions->{'yous'}. - '

'.$visactions->{'gen'}.'
'.$visactions->{'coca'}; - if (ref($vismsgs) eq 'ARRAY') { - $output .= '
'.$visactions->{'make'}.'

'; + $output .= '

'; } - $output .= '

'; } } my $actionhref = '/adm/createuser'; if ($context eq 'domain') { $actionhref = '/adm/modifycourse'; } + + my %noedit; + unless ($context eq 'domain') { + %noedit = &get_noedit_fields($cdom,$cnum,$crstype,$row); + } $output .= '
'."\n". &Apache::lonhtmlcommon::start_pick_box(); if (ref($row) eq 'ARRAY') { @@ -5776,6 +5813,37 @@ ENDSCRIPT if (ref($currsettings) eq 'HASH') { $curr_types = $currsettings->{'selfenroll_types'}; } + if ($noedit{$item}) { + if ($curr_types eq '*') { + $output .= &mt('Any user in any domain'); + } else { + my @entries = split(/;/,$curr_types); + if (@entries > 0) { + $output .= ''; + } else { + $output .= &mt('None'); + } + } + $output .= '
'.&mt('(Set by Domain Coordinator)'); + next; + } my $showdomdesc = 1; my $includeempty = 1; my $num = 0; @@ -5844,6 +5912,15 @@ ENDSCRIPT if (ref($currsettings) eq 'HASH') { $registered = $currsettings->{'selfenroll_registered'}; } + if ($noedit{$item}) { + if ($registered) { + $output .= &mt('Must be registered in course'); + } else { + $output .= &mt('No requirement'); + } + $output .= '
'.&mt('(Set by Domain Coordinator)'); + next; + } if ($registered) { $regon = ' checked="checked" '; $regoff = ' '; @@ -5868,6 +5945,12 @@ ENDSCRIPT $endtime = $currsettings->{'default_enrollment_end_date'}; } } + if ($noedit{$item}) { + $output .= &mt('From: [_1], to: [_2]',&Apache::lonlocal::locallocaltime($starttime), + &Apache::lonlocal::locallocaltime($endtime)); + $output .= '
'.&mt('(Set by Domain Coordinator)'); + next; + } my $startform = &Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_date',$starttime, undef,undef,undef,undef,undef,undef,undef,$nolink); @@ -5887,6 +5970,12 @@ ENDSCRIPT $endtime = $currsettings->{'default_enrollment_end_date'}; } } + if ($noedit{$item}) { + $output .= &mt('From: [_1], to: [_2]',&Apache::lonlocal::locallocaltime($starttime), + &Apache::lonlocal::locallocaltime($endtime)); + $output .= '
'.&mt('(Set by Domain Coordinator)'); + next; + } my $startform = &Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_access',$starttime, undef,undef,undef,undef,undef,undef,undef,$nolink); @@ -5906,6 +5995,15 @@ ENDSCRIPT $newsecval = $currsec; } } + if ($noedit{$item}) { + if ($currsec ne '') { + $output .= $currsec; + } else { + $output .= &mt('No specific section'); + } + $output .= '
'.&mt('(Set by Domain Coordinator)'); + next; + } my $sections_select = &Apache::lonuserutils::course_sections(\%sections_count,'st',$currsec); $output .= ''."\n". @@ -5915,7 +6013,6 @@ ENDSCRIPT &mt('New section').'
'."\n". ''."\n". ''."\n". - ''."\n". '
'."\n"; } elsif ($item eq 'approval') { my ($currnotified,$currapproval,%appchecked); @@ -5927,6 +6024,11 @@ ENDSCRIPT if ($currapproval !~ /^[012]$/) { $currapproval = 0; } + if ($noedit{$item}) { + $output .= $selfdescs{'approval'}{$currapproval}. + '
'.&mt('(Set by Domain Coordinator)'); + next; + } $appchecked{$currapproval} = ' checked="checked"'; for my $i (0..2) { $output .= '