--- loncom/interface/loncreateuser.pm 2014/02/12 21:29:03 1.391 +++ loncom/interface/loncreateuser.pm 2014/06/30 14:49:35 1.403 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.391 2014/02/12 21:29:03 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.403 2014/06/30 14:49:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1271,11 +1271,9 @@ ENDTITLE } $r->print('

'.$title.'

'."\n"); $r->print('
'); - my $personal_table = - &personal_data_display($ccuname,$ccdomain,$newuser,$context, - $inst_results{$ccuname.':'.$ccdomain}); - # (Do not offer Disable Safeguard here) - $r->print($personal_table); + $r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context, + $inst_results{$ccuname.':'.$ccdomain})); + # Option to disable student/employee ID conflict checking not offerred for new users. my ($home_server_pick,$numlib) = &Apache::loncommon::home_server_form_item($ccdomain,'hserver', 'default','hide'); @@ -1376,10 +1374,8 @@ ENDAUTH } $r->print('

'.$title.'

'."\n"); $r->print('
'); - my $personal_table = - &personal_data_display($ccuname,$ccdomain,$newuser,$context, - $inst_results{$ccuname.':'.$ccdomain}); - $r->print($personal_table); + $r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context, + $inst_results{$ccuname.':'.$ccdomain})); if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { $r->print('

'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'

'. &Apache::loncommon::start_data_table()); @@ -1475,7 +1471,8 @@ ENDNOTOOLSPRIV } $r->print('
'."\n"); } else { - $r->print('
'.&mt('Add Roles').''); + $r->print('
'. + '
'.&mt('Add Roles').''); my $addrolesdisplay = 0; if ($context eq 'domain' || $context eq 'author') { $addrolesdisplay = &new_coauthor_roles($r,$ccuname,$ccdomain); @@ -1486,27 +1483,32 @@ ENDNOTOOLSPRIV $addrolesdisplay = $add_domainroles; } $r->print(&course_level_dc($env{'request.role.domain'},$showcredits)); - $r->print('

'."\n"); + $r->print('
'. + '
'."\n"); } elsif ($context eq 'author') { if ($addrolesdisplay) { - $r->print('
print('
'. + '
print(' onclick="auth_check()" \>'."\n"); } else { $r->print('onclick="this.form.submit()" \>'."\n"); } } else { - $r->print('
'. + $r->print(''. + ''. + '
'. &mt('Back to previous page').''); } } else { $r->print(&course_level_table(\%inccourses,$showcredits,$defaultcredits)); - $r->print('
'."\n"); + $r->print(''. + '
'."\n"); } } $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain'])); $r->print(''); - $r->print(''); + $r->print('

'); return; } @@ -1811,7 +1813,7 @@ sub display_existing_roles { } } else { $plaintext= - &mt('Customrole [_1][_2]defined by [_3]', + &mt('Custom role [_1][_2]defined by [_3]', '"'.$croletitle.'"', '
', $croleuname.':'.$croleudom); @@ -1861,7 +1863,7 @@ sub display_existing_roles { } else { $contextrole = &mt('Existing Roles in this Domain'); } - $r->print('
'. + $r->print('
'. '
'.$contextrole.''. &Apache::loncommon::start_data_table("LC_createuser"). &Apache::loncommon::start_data_table_header_row(). @@ -2162,7 +2164,7 @@ sub modify_login_block { sub personal_data_display { my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray, - $now,$captchaform,$emailusername) = @_; + $now,$captchaform,$emailusername,$usertype) = @_; my ($output,%userenv,%canmodify,%canmodify_status); my @userinfo = ('firstname','middlename','lastname','generation', 'permanentemail','id'); @@ -2204,19 +2206,24 @@ sub personal_data_display { \@userinfo,$rolesarray); } elsif ($context eq 'selfcreate') { if ($newuser eq 'email') { - if (ref($emailusername) eq 'HASH') { - my ($infofields,$infotitles) = &Apache::loncommon::emailusername_info(); - @userinfo = (); - if ((ref($infofields) eq 'ARRAY') && (ref($infotitles) eq 'HASH')) { - foreach my $field (@{$infofields}) { - if ($emailusername->{$field}) { - push(@userinfo,$field); - $canmodify{$field} = 1; - unless ($textboxsize{$field}) { - $textboxsize{$field} = 25; - } - unless ($lt{$field}) { - $lt{$field} = $infotitles->{$field}; + if (ref($emailusername) eq 'HASH') { + if (ref($emailusername->{$usertype}) eq 'HASH') { + my ($infofields,$infotitles) = &Apache::loncommon::emailusername_info(); + @userinfo = (); + if ((ref($infofields) eq 'ARRAY') && (ref($infotitles) eq 'HASH')) { + foreach my $field (@{$infofields}) { + if ($emailusername->{$usertype}->{$field}) { + push(@userinfo,$field); + $canmodify{$field} = 1; + unless ($textboxsize{$field}) { + $textboxsize{$field} = 25; + } + unless ($lt{$field}) { + $lt{$field} = $infotitles->{$field}; + } + if ($emailusername->{$usertype}->{$field} eq 'required') { + $lt{$field} .= '*'; + } } } } @@ -2232,19 +2239,19 @@ sub personal_data_display { $output = '

'.$lt{'pd'}.'

'. &Apache::lonhtmlcommon::start_pick_box(); if (($context eq 'selfcreate') && ($newuser eq 'email')) { - $output .= &Apache::lonhtmlcommon::row_title($lt{'email'},undef, + $output .= &Apache::lonhtmlcommon::row_title($lt{'email'}.'*',undef, 'LC_oddrow_value')."\n". - ''; + ''; $rowcount ++; $output .= &Apache::lonhtmlcommon::row_closure(1); - my $upassone = ''; - my $upasstwo = ''; - $output .= &Apache::lonhtmlcommon::row_title(&mt('Password'), + my $upassone = ''; + my $upasstwo = ''; + $output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'*', 'LC_pick_box_title', 'LC_oddrow_value')."\n". $upassone."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". - &Apache::lonhtmlcommon::row_title(&mt('Confirm password'), + &Apache::lonhtmlcommon::row_title(&mt('Confirm password').'*', 'LC_pick_box_title', 'LC_oddrow_value')."\n". $upasstwo. @@ -2264,7 +2271,7 @@ sub personal_data_display { } else { if ($context eq 'selfcreate') { if ($canmodify{$item}) { - $row .= ''; + $row .= ''; $editable ++; } else { $hiderow = 1; @@ -2275,19 +2282,15 @@ sub personal_data_display { } } else { if ($context eq 'selfcreate') { - if (($item eq 'permanentemail') && ($newuser eq 'email')) { - $row .= $ccuname; - } else { - if ($canmodify{$item}) { - if ($newuser eq 'email') { - $row .= ''; - } else { - $row .= ''; - } - $editable ++; + if ($canmodify{$item}) { + if ($newuser eq 'email') { + $row .= ''; } else { - $hiderow = 1; + $row .= ''; } + $editable ++; + } else { + $hiderow = 1; } } else { $row .= ''; @@ -2296,12 +2299,12 @@ sub personal_data_display { } else { if ($canmodify{$item}) { $row .= ''; + if (($item eq 'id') && (!$newuser)) { + $row .= '
'.&Apache::lonuserutils::forceid_change($context); + } } else { $row .= $userenv{$item}; } - if (($item eq 'id') && ($canmodify{$item})) { - $row .= '
'.&Apache::lonuserutils::forceid_change($context); - } } $row .= &Apache::lonhtmlcommon::row_closure(1); if (!$hiderow) { @@ -2358,6 +2361,7 @@ sub personal_data_display { $output .= &Apache::lonhtmlcommon::row_title()."\n". '
'. + ''. &Apache::lonhtmlcommon::row_closure(1); } $output .= &Apache::lonhtmlcommon::end_pick_box(); @@ -2713,7 +2717,7 @@ sub update_user_data { $r->print($error.'Invalid login mode or password'.$end.$rtnlink); return; } - # Only allow authentification modification if the person has authority + # Only allow authentication modification if the person has authority if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'})) { $r->print('Modifying authentication: '. &Apache::lonnet::modifyuserauth( @@ -2723,7 +2727,7 @@ sub update_user_data { ($env{'form.ccuname'},$env{'form.ccdomain'})); } else { # Okay, this is a non-fatal error. - $r->print($error.&mt('You do not have the authority to modify this users authentification information').'.'.$end); + $r->print($error.&mt('You do not have the authority to modify this users authentication information.').$end); } } $r->rflush(); # Finish display of header before time consuming actions start @@ -3040,7 +3044,7 @@ sub update_user_data { my %newenvhash; foreach my $key (keys(%changed)) { if (($key eq 'official') || ($key eq 'unofficial') - || ($key eq 'community')) { + || ($key eq 'community') || ($key eq 'textbook')) { $newenvhash{'environment.requestcourses.'.$key} = $changeHash{'requestcourses.'.$key}; if ($changeHash{'requestcourses.'.$key}) { @@ -3148,9 +3152,9 @@ sub update_user_data { $rolestr = &mt('No roles'); } if ($context eq 'course') { - $contextname = &mt('course'); + $contextname = 'course'; } elsif ($context eq 'author') { - $contextname = &mt('co-author'); + $contextname = 'co-author'; } $r->print(&mt('The following fields were not updated: ').'
    '); my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); @@ -3159,9 +3163,9 @@ sub update_user_data { } $r->print('
'); if (@mod_disallowed == 1) { - $r->print(&mt("You do not have the authority to change this field given the user's current set of active/future [_1] roles:",$contextname)); + $r->print(&mt("You do not have the authority to change this field given the user's current set of active/future $contextname roles:")); } else { - $r->print(&mt("You do not have the authority to change these fields given the user's current set of active/future [_1] roles:",$contextname)); + $r->print(&mt("You do not have the authority to change these fields given the user's current set of active/future $contextname roles:")); } my $helplink = 'javascript:helpMenu('."'display'".')'; $r->print(''.$rolestr.'
' @@ -4009,9 +4013,9 @@ sub enroll_single_student { if ($startdate <= $now && !$newuser) { $r->print('

'); if ($crstype eq 'Community') { - $r->print(&mt('If the member is currently logged-in to LON-CAPA, the new role will be available when the member next logs in.')); + $r->print(&mt('If the member is currently logged-in to LON-CAPA, the new role can be displayed by using the "Check for changes" link on the Roles/Courses page.')); } else { - $r->print(&mt('If the student is currently logged-in to LON-CAPA, the new role will be available when the student next logs in.')); + $r->print(&mt('If the student is currently logged-in to LON-CAPA, the new role can be displayed by using the "Check for changes" link on the Roles/Courses page.')); } $r->print('

'); } @@ -4177,6 +4181,7 @@ sub custom_role_editor { my $dompriv=''; my $coursepriv=''; my $body_top; + my $newrole; my ($rdummy,$roledef)= &Apache::lonnet::get('roles',["rolesdef_$rolename"]); # ------------------------------------------------------- Does this role exist? @@ -4189,6 +4194,7 @@ sub custom_role_editor { $syspriv =~ s/bre\&S//; } } else { + $newrole = 1; $body_top .= &mt('New Role').' "'; $roledef=''; } @@ -4458,6 +4464,7 @@ sub set_custom_role { bread_crumbs_component => 'User Management'}; $r->print(&Apache::loncommon::start_page('Save Custom Role',$jscript,$args)); + my $newrole; my ($rdummy,$roledef)= &Apache::lonnet::get('roles',["rolesdef_$rolename"]); @@ -4468,6 +4475,7 @@ sub set_custom_role { } else { $r->print(&mt('New Role').' "'); $roledef=''; + $newrole = 1; } $r->print($rolename.'"'); # ------------------------------------------------------- What can be assigned? @@ -4810,26 +4818,47 @@ sub handler { if (ref($domconfig{'usercreation'}) eq 'HASH') { if (ref($domconfig{'usercreation'}{'cancreate'}) eq 'HASH') { if (ref($domconfig{'usercreation'}{'cancreate'}{'emailusername'}) eq 'HASH') { - my $count = scalar(keys(%{$domconfig{'usercreation'}{'cancreate'}{'emailusername'}})); my %info = &Apache::lonnet::get('nohist_requestedusernames',[$uname],$dom,$domconfiguser); if (ref($info{$uname}) eq 'HASH') { - if ((ref($infofields) eq 'ARRAY') && (ref($infotitles) eq 'HASH')) { - $r->print('
'.&Apache::lonhtmlcommon::start_pick_box()); - my $num; - foreach my $field (@{$infofields}) { - next unless ($domconfig{'usercreation'}{'cancreate'}{'emailusername'}{$field}); - next unless ($infotitles->{$field}); - $r->print(&Apache::lonhtmlcommon::row_title($infotitles->{$field}). - $info{$uname}{$field}); - $num ++; - if ($count == $num) { - $r->print(&Apache::lonhtmlcommon::row_closure(1)); - } else { - $r->print(&Apache::lonhtmlcommon::row_closure()); + my $usertype = $info{$uname}{'inststatus'}; + unless ($usertype) { + $usertype = 'default'; + } + if (ref($domconfig{'usercreation'}{'cancreate'}{'emailusername'}{$usertype}) eq 'HASH') { + if ((ref($infofields) eq 'ARRAY') && (ref($infotitles) eq 'HASH')) { + $r->print('
'.&Apache::lonhtmlcommon::start_pick_box()); + my ($num,$count,$showstatus); + $count = scalar(keys(%{$domconfig{'usercreation'}{'cancreate'}{'emailusername'}{$usertype}})); + unless ($usertype eq 'default') { + my ($othertitle,$usertypes,$types) = + &Apache::loncommon::sorted_inst_types($dom); + if (ref($usertypes) eq 'HASH') { + if ($usertypes->{$usertype}) { + $showstatus = $usertypes->{$usertype}; + $count ++; + } + } + } + foreach my $field (@{$infofields}) { + next unless ($domconfig{'usercreation'}{'cancreate'}{'emailusername'}{$usertype}{$field}); + next unless ($infotitles->{$field}); + $r->print(&Apache::lonhtmlcommon::row_title($infotitles->{$field}). + $info{$uname}{$field}); + $num ++; + if ($count == $num) { + $r->print(&Apache::lonhtmlcommon::row_closure(1)); + } else { + $r->print(&Apache::lonhtmlcommon::row_closure()); + } } + if ($showstatus) { + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Status type (self-reported)')). + $showstatus. + &Apache::lonhtmlcommon::row_closure(1)); + } + $r->print(&Apache::lonhtmlcommon::end_pick_box().'
'); } - $r->print(&Apache::lonhtmlcommon::end_pick_box().'
'); } } } @@ -4942,25 +4971,49 @@ sub handler { ''.&mt('You do not have permission to modify dates or sections for users').''); } } elsif ($env{'form.action'} eq 'selfenroll') { - push(@{$brcrum}, - {href => '/adm/createuser?action=selfenroll', - text => "Configure Self-enrollment", - help => 'Course_Self_Enrollment'}); - if (!exists($env{'form.state'})) { - $args = { bread_crumbs => $brcrum, - bread_crumbs_component => 'Configure Self-enrollment'}; - $r->print(&header(undef,$args)); - $r->print('

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

'."\n"); - &print_selfenroll_menu($r,$context,$permission); - } elsif ($env{'form.state'} eq 'done') { - push (@{$brcrum}, - {href=>'/adm/createuser?action=selfenroll', - text=>"Result"}); - $args = { bread_crumbs => $brcrum, - 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,$context,$permission); + if ($permission->{selfenrolladmin}) { + my $cid = $env{'request.course.id'}; + my $cdom = $env{'course.'.$cid.'.domain'}; + my $cnum = $env{'course.'.$cid.'.num'}; + my %currsettings = ( + selfenroll_types => $env{'course.'.$cid.'.internal.selfenroll_types'}, + selfenroll_registered => $env{'course.'.$cid.'.internal.selfenroll_registered'}, + selfenroll_section => $env{'course.'.$cid.'.internal.selfenroll_section'}, + selfenroll_notifylist => $env{'course.'.$cid.'.internal.selfenroll_notifylist'}, + selfenroll_approval => $env{'course.'.$cid.'.internal.selfenroll_approval'}, + selfenroll_limit => $env{'course.'.$cid.'.internal.selfenroll_limit'}, + selfenroll_cap => $env{'course.'.$cid.'.internal.selfenroll_cap'}, + selfenroll_start_date => $env{'course.'.$cid.'.internal.selfenroll_start_date'}, + selfenroll_end_date => $env{'course.'.$cid.'.internal.selfenroll_end_date'}, + selfenroll_start_access => $env{'course.'.$cid.'.internal.selfenroll_start_access'}, + 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', + text => "Configure Self-enrollment", + help => 'Course_Self_Enrollment'}); + if (!exists($env{'form.state'})) { + $args = { bread_crumbs => $brcrum, + bread_crumbs_component => 'Configure Self-enrollment'}; + $r->print(&header(undef,$args)); + $r->print('

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

'."\n"); + &print_selfenroll_menu($r,'course',$cid,$cdom,$cnum,\%currsettings); + } elsif ($env{'form.state'} eq 'done') { + push (@{$brcrum}, + {href=>'/adm/createuser?action=selfenroll', + text=>"Result"}); + $args = { bread_crumbs => $brcrum, + 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,$context,$crstype,\%currsettings); + } + } else { + $r->print(&header(undef,{'no_nav_bar' => 1}). + ''.&mt('You do not have permission to configure self-enrollment').''); } } elsif ($env{'form.action'} eq 'selfenrollqueue') { push(@{$brcrum}, @@ -5410,12 +5463,12 @@ sub print_main_menu { ); if ($env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_approval'}) { push(@{ $menu[2]->{items} }, - { + { linktext => 'Enrollment Requests', icon => 'selfenrl-queue.png', #help => 'Course_Approve_Selfenroll', url => '/adm/createuser?action=selfenrollqueue', - permission => $permission->{'cusr'}, + permission => $permission->{'selfenrolladmin'}, linktitle =>'Approve or reject enrollment requests.', }, ); @@ -5441,7 +5494,7 @@ sub print_main_menu { icon => 'self_enroll.png', #help => 'Course_Self_Enrollment', url => '/adm/createuser?action=selfenroll', - permission => $permission->{'cusr'}, + permission => $permission->{'selfenrolladmin'}, linktitle => 'Configure user self-enrollment.', }, ); @@ -5478,11 +5531,11 @@ sub restore_prev_selections { } sub print_selfenroll_menu { - my ($r,$context,$permission) = @_; + my ($r,$context,$cid,$cdom,$cnum,$currsettings,$additional) = @_; my $crstype = &Apache::loncommon::course_type(); - my $formname = 'enrollstudent'; + my $formname = 'selfenroll'; my $nolink = 1; - my ($row,$lt) = &get_selfenroll_titles(); + my ($row,$lt) = &Apache::lonuserutils::get_selfenroll_titles(); my $groupslist = &Apache::lonuserutils::get_groupslist(); my $setsec_js = &Apache::lonuserutils::setsections_javascript($formname,$groupslist); @@ -5601,7 +5654,7 @@ function validate_types(form) { } } else { if (document.$formname.selfenroll_activate.checked) { - var num = document.enrollstudent.selfenroll_activate.value; + var num = document.$formname.selfenroll_activate.value; countfail = check_types(num,countfail,needaction) } } @@ -5648,6 +5701,26 @@ function check_types(num,countfail,needa return countfail; } +function toggleNotify() { + var selfenrollApproval = 0; + if (document.$formname.selfenroll_approval.length) { + for (var i=0; i'."\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'}.'

'; + + my $visactions = &cat_visibility(); + my ($cathash,%cattype); + my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); + if (ref($domconfig{'coursecategories'}) eq 'HASH') { + $cathash = $domconfig{'coursecategories'}{'cats'}; + $cattype{'auth'} = $domconfig{'coursecategories'}{'auth'}; + $cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'}; + } else { + $cathash = {}; + $cattype{'auth'} = 'std'; + $cattype{'unauth'} = 'std'; + } + if (($cattype{'auth'} eq 'none') && ($cattype{'unauth'} eq 'none')) { + $r->print('
'.$visactions->{'miss'}.'
'.$visactions->{'yous'}. + '
'. + '
'.$visactions->{'take'}.'
    '. + '
  • '.$visactions->{'dc_chgconf'}.'
  • '. + '
'); + } elsif (($cattype{'auth'} !~ /^(std|domonly)$/) && ($cattype{'unauth'} !~ /^(std|domonly)$/)) { + if ($currsettings->{'uniquecode'}) { + $r->print(''.$visactions->{'vis'}.''); } else { - $output .= '

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

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

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

    '; - foreach my $item (@{$vismsgs}) { - $output .= '
  • '.$visactions->{$item}.'
  • '; + $r->print('
    '.$visactions->{'miss'}.'
    '.$visactions->{'yous'}. + '
    '. + '
    '.$visactions->{'take'}.'
      '. + '
    • '.$visactions->{'dc_setcode'}.'
    • '. + '

    '); + } + } else { + my ($visible,$cansetvis,$vismsgs) = &visible_in_stdcat($cdom,$cnum,\%domconfig); + 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'}.'

      '; + foreach my $item (@{$vismsgs}) { + $output .= '
    • '.$visactions->{$item}.'
    • '; + } + $output .= '
    '; } - $output .= '
'; + $output .= '

'; } - $output .= '

'; } } - $output .= '
'."\n". + 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') { foreach my $item (@{$row}) { @@ -5694,7 +5805,41 @@ ENDSCRIPT } $output .= &Apache::lonhtmlcommon::row_title($title); if ($item eq 'types') { - my $curr_types = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_types'}; + my $curr_types; + 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 .= '
    '; + foreach my $entry (@entries) { + my ($currdom,$typestr) = split(/:/,$entry); + next if ($typestr eq ''); + my $domdesc = &Apache::lonnet::domain($currdom); + my @currinsttypes = split(',',$typestr); + my ($othertitle,$usertypes,$types) = + &Apache::loncommon::sorted_inst_types($currdom); + if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { + $usertypes->{'any'} = &mt('any user'); + if (keys(%{$usertypes}) > 0) { + $usertypes->{'other'} = &mt('other users'); + } + my @longinsttypes = map { $usertypes->{$_}; } @currinsttypes; + $output .= '
  • '.$domdesc.':'.join(', ',@longinsttypes).'
  • '; + } + } + $output .= '
'; + } else { + $output .= &mt('None'); + } + } + $output .= '
'.&mt('(Set by Domain Coordinator)'); + next; + } my $showdomdesc = 1; my $includeempty = 1; my $num = 0; @@ -5759,7 +5904,20 @@ ENDSCRIPT .&Apache::loncommon::end_data_table(); } elsif ($item eq 'registered') { my ($regon,$regoff); - if ($env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_registered'}) { + my $registered; + 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 = ' '; } else { @@ -5772,13 +5930,22 @@ ENDSCRIPT ''. &mt('No').''; } elsif ($item eq 'enroll_dates') { - my $starttime = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_start_date'}; - my $endtime = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_end_date'}; - if ($starttime eq '') { - $starttime = $env{'course.'.$env{'request.course.id'}.'.default_enrollment_start_date'}; - } - if ($endtime eq '') { - $endtime = $env{'course.'.$env{'request.course.id'}.'.default_enrollment_end_date'}; + my ($starttime,$endtime); + if (ref($currsettings) eq 'HASH') { + $starttime = $currsettings->{'selfenroll_start_date'}; + $endtime = $currsettings->{'selfenroll_end_date'}; + if ($starttime eq '') { + $starttime = $currsettings->{'default_enrollment_start_date'}; + } + if ($endtime eq '') { + $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, @@ -5788,13 +5955,22 @@ ENDSCRIPT undef,undef,undef,undef,undef,undef,undef,$nolink); $output .= &selfenroll_date_forms($startform,$endform); } elsif ($item eq 'access_dates') { - my $starttime = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_start_access'}; - my $endtime = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_end_access'}; - if ($starttime eq '') { - $starttime = $env{'course.'.$env{'request.course.id'}.'.default_enrollment_start_date'}; - } - if ($endtime eq '') { - $endtime = $env{'course.'.$env{'request.course.id'}.'.default_enrollment_end_date'}; + my ($starttime,$endtime); + if (ref($currsettings) eq 'HASH') { + $starttime = $currsettings->{'selfenroll_start_access'}; + $endtime = $currsettings->{'selfenroll_end_access'}; + if ($starttime eq '') { + $starttime = $currsettings->{'default_enrollment_start_date'}; + } + if ($endtime eq '') { + $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, @@ -5804,7 +5980,10 @@ ENDSCRIPT undef,undef,undef,undef,undef,undef,undef,$nolink); $output .= &selfenroll_date_forms($startform,$endform); } elsif ($item eq 'section') { - my $currsec = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_section'}; + my $currsec; + if (ref($currsettings) eq 'HASH') { + $currsec = $currsettings->{'selfenroll_section'}; + } my %sections_count = &Apache::loncommon::get_sections($cdom,$cnum); my $newsecval; if ($currsec ne 'none' && $currsec ne '') { @@ -5812,6 +5991,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". @@ -5821,24 +6009,29 @@ ENDSCRIPT &mt('New section').'
'."\n". ''."\n". ''."\n". - ''."\n". '
'."\n"; } elsif ($item eq 'approval') { - my ($appon,$appoff); - my $cid = $env{'request.course.id'}; - my $currnotified = $env{'course.'.$cid.'.internal.selfenroll_notifylist'}; - if ($env{'course.'.$cid.'.internal.selfenroll_approval'}) { - $appon = ' checked="checked" '; - $appoff = ' '; - } else { - $appon = ' '; - $appoff = ' checked="checked" '; + my ($currnotified,$currapproval,%appchecked); + my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs(); + if (ref($currsettings) eq 'HASH') { + $currnotified = $currsettings->{'selfenroll_notifylist'}; + $currapproval = $currsettings->{'selfenroll_approval'}; + } + 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 .= ''.(' 'x2); } - $output .= '  '; my %advhash = &Apache::lonnet::get_course_adv_roles($cid,1); my (@ccs,%notified); my $ccrole = 'cc'; @@ -5857,7 +6050,13 @@ ENDSCRIPT } } if (@ccs) { - $output .= '
'.&mt('Personnel to be notified when an enrollment request needs approval, or has been approved:').' '.&Apache::loncommon::start_data_table(). + my $style; + unless ($currapproval) { + $style = ' style="display: none;"'; + } + $output .= '
'. + &mt('Personnel to be notified when an enrollment request needs approval, or has been approved:').' '. + &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_row(); my $count = 0; my $numcols = 4; @@ -5885,14 +6084,29 @@ ENDSCRIPT } } $output .= &Apache::loncommon::end_data_table_row(). - &Apache::loncommon::end_data_table(); + &Apache::loncommon::end_data_table(). + '
'; } } elsif ($item eq 'limit') { - my ($crslimit,$selflimit,$nolimit); - my $cid = $env{'request.course.id'}; - my $currlim = $env{'course.'.$cid.'.internal.selfenroll_limit'}; - my $currcap = $env{'course.'.$cid.'.internal.selfenroll_cap'}; - $nolimit = ' checked="checked" '; + my ($crslimit,$selflimit,$nolimit,$currlim,$currcap); + if (ref($currsettings) eq 'HASH') { + $currlim = $currsettings->{'selfenroll_limit'}; + $currcap = $currsettings->{'selfenroll_cap'}; + } + if ($noedit{$item}) { + if (($currlim eq 'allstudents') || ($currlim eq 'selfenrolled')) { + if ($currlim eq 'allstudents') { + $output .= &mt('Limit by total students'); + } elsif ($currlim eq 'selfenrolled') { + $output .= &mt('Limit by total self-enrolled students'); + } + $output .= ' '.&mt('Maximum: [_1]',$currcap). + '
'.&mt('(Set by Domain Coordinator)'); + } else { + $output .= &mt('No limit').'
'.&mt('(Set by Domain Coordinator)'); + } + next; + } if ($currlim eq 'allstudents') { $crslimit = ' checked="checked" '; $selflimit = ' '; @@ -5904,6 +6118,7 @@ ENDSCRIPT } else { $crslimit = ' '; $selflimit = ' '; + $nolimit = ' checked="checked" '; } $output .= ''."\n". -''."\n". +''; + } + $result .= ''."\n". ''. &Apache::loncommon::end_data_table_header_row(). @@ -7100,14 +7355,14 @@ $table. sub course_level_row { my ($protectedcourse,$role,$area,$domain,$plrole,$sections_count, - $lt,$defaultcredits,$crstype) = @_; + $lt,$showcredits,$defaultcredits,$crstype) = @_; my $creditem; my $row = &Apache::loncommon::start_data_table_row(). ' '."\n". ' '."\n". ' '."\n"; - if (($role eq 'st') && ($crstype eq 'Course')) { + if (($showcredits) && ($role eq 'st') && ($crstype eq 'Course')) { $row .= ''; @@ -7184,8 +7439,9 @@ sub course_level_dc { &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). ''."\n". - ''."\n". - ''."\n". + ''."\n"; + $header .= ''."\n" if ($showcredits); + $header .= ''."\n". &Apache::loncommon::end_data_table_header_row(); my $otheritems = &Apache::loncommon::start_data_table_row()."\n". '
'.$lt{'act'}.''.$lt{'rol'}.''.$lt{'ext'}.''.$lt{'crd'}.''.$lt{'ext'}.''."\n"; + if ($showcredits) { + $result .= $lt{'crd'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.''.$plrole.''.$area.'
Domain: '.$domain.'
'.$lt{'scc'}.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'crd'}.''.$lt{'sta'}.''.$lt{'end'}.''.$lt{'grs'}.''.$lt{'crd'}.''.$lt{'sta'}.''.$lt{'end'}.'
'. @@ -7215,7 +7471,7 @@ sub course_level_dc { '
'."\n"; if ($showcredits) { $otheritems .= '
'."\n". - ''."\n"; + ''."\n"; } $otheritems .= <
@@ -7231,19 +7487,23 @@ ENDTIMEENTRY } sub update_selfenroll_config { - my ($r,$context,$permission) = @_; - my ($row,$lt) = &get_selfenroll_titles(); - my %curr_groups = &Apache::longroup::coursegroups(); + my ($r,$cid,$cdom,$cnum,$context,$crstype,$currsettings) = @_; + return unless (ref($currsettings) eq 'HASH'); + my ($row,$lt) = &Apache::lonuserutils::get_selfenroll_titles(); + my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); my (%changes,%warning); - my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $curr_types; + my %noedit; + unless ($context eq 'domain') { + %noedit = &get_noedit_fields($cdom,$cnum,$crstype,$row); + } if (ref($row) eq 'ARRAY') { foreach my $item (@{$row}) { + next if ($noedit{$item}); if ($item eq 'enroll_dates') { my (%currenrolldate,%newenrolldate); foreach my $type ('start','end') { - $currenrolldate{$type} = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_'.$type.'_date'}; + $currenrolldate{$type} = $currsettings->{'selfenroll_'.$type.'_date'}; $newenrolldate{$type} = &Apache::lonhtmlcommon::get_date_from_form('selfenroll_'.$type.'_date'); if ($newenrolldate{$type} ne $currenrolldate{$type}) { $changes{'internal.selfenroll_'.$type.'_date'} = $newenrolldate{$type}; @@ -7252,15 +7512,14 @@ sub update_selfenroll_config { } elsif ($item eq 'access_dates') { my (%currdate,%newdate); foreach my $type ('start','end') { - $currdate{$type} = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_'.$type.'_access'}; + $currdate{$type} = $currsettings->{'selfenroll_'.$type.'_access'}; $newdate{$type} = &Apache::lonhtmlcommon::get_date_from_form('selfenroll_'.$type.'_access'); if ($newdate{$type} ne $currdate{$type}) { $changes{'internal.selfenroll_'.$type.'_access'} = $newdate{$type}; } } } elsif ($item eq 'types') { - $curr_types = - $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_'.$item}; + $curr_types = $currsettings->{'selfenroll_'.$item}; if ($env{'form.selfenroll_all'}) { if ($curr_types ne '*') { $changes{'internal.selfenroll_types'} = '*'; @@ -7329,9 +7588,9 @@ sub update_selfenroll_config { my $newlimit = $env{'form.selfenroll_limit'}; my $newcap = $env{'form.selfenroll_cap'}; $newcap =~s/\s+//g; - my $currlimit = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_limit'}; + my $currlimit = $currsettings->{'selfenroll_limit'}; $currlimit = 'none' if ($currlimit eq ''); - my $currcap = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_cap'}; + my $currcap = $currsettings->{'selfenroll_cap'}; if ($newlimit ne $currlimit) { if ($newlimit ne 'none') { if ($newcap =~ /^\d+$/) { @@ -7340,7 +7599,8 @@ sub update_selfenroll_config { } $changes{'internal.selfenroll_limit'} = $newlimit; } else { - $warning{$item} = &mt('Maximum enrollment setting unchanged.').'
'.&mt('The value provided was invalid - it must be a positive integer if enrollment is being limited.'); + $warning{$item} = &mt('Maximum enrollment setting unchanged.').'
'. + &mt('The value provided was invalid - it must be a positive integer if enrollment is being limited.'); } } elsif ($currcap ne '') { $changes{'internal.selfenroll_cap'} = ''; @@ -7352,13 +7612,14 @@ sub update_selfenroll_config { $changes{'internal.selfenroll_cap'} = $newcap; } } else { - $warning{$item} = &mt('Maximum enrollment setting unchanged.').'
'.&mt('The value provided was invalid - it must be a positive integer if enrollment is being limited.'); + $warning{$item} = &mt('Maximum enrollment setting unchanged.').'
'. + &mt('The value provided was invalid - it must be a positive integer if enrollment is being limited.'); } } } elsif ($item eq 'approval') { my (@currnotified,@newnotified); - my $currapproval = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_approval'}; - my $currnotifylist = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_notifylist'}; + my $currapproval = $currsettings->{'selfenroll_approval'}; + my $currnotifylist = $currsettings->{'selfenroll_notifylist'}; if ($currnotifylist ne '') { @currnotified = split(/,/,$currnotifylist); @currnotified = sort(@currnotified); @@ -7394,14 +7655,14 @@ sub update_selfenroll_config { } } } else { - my $curr_val = - $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_'.$item}; + my $curr_val = $currsettings->{'selfenroll_'.$item}; my $newval = $env{'form.selfenroll_'.$item}; if ($item eq 'section') { $newval = $env{'form.sections'}; if (defined($curr_groups{$newval})) { $newval = $curr_val; - $warning{$item} = &mt('Section for self-enrolled users unchanged as the proposed section is a group').'
'.&mt('Group names and section names must be distinct'); + $warning{$item} = &mt('Section for self-enrolled users unchanged as the proposed section is a group').'
'. + &mt('Group names and section names must be distinct'); } elsif ($newval eq 'all') { $newval = $curr_val; $warning{$item} = &mt('Section for self-enrolled users unchanged, as "all" is a reserved section name.'); @@ -7431,11 +7692,10 @@ sub update_selfenroll_config { my %crsinfo = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.', $cnum,undef,undef,'Course'); my $chome = &Apache::lonnet::homeserver($cnum,$cdom); - if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { + if (ref($crsinfo{$cid}) eq 'HASH') { foreach my $item ('selfenroll_types','selfenroll_start_date','selfenroll_end_date') { if (exists($changes{'internal.'.$item})) { - $crsinfo{$env{'request.course.id'}}{$item} = - $changes{'internal.'.$item}; + $crsinfo{$cid}{$item} = $changes{'internal.'.$item}; } } my $crsputresult = @@ -7472,7 +7732,7 @@ sub update_selfenroll_config { if ($changes{'internal.selfenroll_cap'} ne '') { $newcap = $changes{'internal.selfenroll_cap'} } else { - $newcap = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_cap'}; + $newcap = $currsettings->{'selfenroll_cap'}; } if ($changes{'internal.selfenroll_limit'} eq 'none') { $newval = &mt('No limit'); @@ -7482,7 +7742,7 @@ sub update_selfenroll_config { } elsif ($changes{'internal.selfenroll_limit'} eq 'selfenrolled') { $newval = &mt('New self-enrollment no longer allowed when total number of self-enrolled students reaches [_1].',$newcap); } else { - my $currlimit = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_limit'}; + my $currlimit = $currsettings->{'selfenroll_limit'}; if ($currlimit eq 'allstudents') { $newval = &mt('New self-enrollment no longer allowed when total (all students) reaches [_1].',$newcap); } elsif ($changes{'internal.selfenroll_limit'} eq 'selfenrolled') { @@ -7494,24 +7754,24 @@ sub update_selfenroll_config { } elsif ($item eq 'approval') { if ((exists($changes{'internal.selfenroll_approval'})) || (exists($changes{'internal.selfenroll_notifylist'}))) { + my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs(); my ($newval,$newnotify); if (exists($changes{'internal.selfenroll_notifylist'})) { $newnotify = $changes{'internal.selfenroll_notifylist'}; } else { - $newnotify = $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_notifylist'}; + $newnotify = $currsettings->{'selfenroll_notifylist'}; } - if ($changes{'internal.selfenroll_approval'}) { - $newval = &mt('Yes'); - } elsif ($changes{'internal.selfenroll_approval'} eq '0') { - $newval = &mt('No'); + if (exists($changes{'internal.selfenroll_approval'})) { + if ($changes{'internal.selfenroll_approval'} !~ /^[012]$/) { + $changes{'internal.selfenroll_approval'} = '0'; + } + $newval = $selfdescs{'approval'}{$changes{'internal.selfenroll_approval'}}; } else { - my $currapproval = - $env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_approval'}; - if ($currapproval) { - $newval = &mt('Yes'); - } else { - $newval = &mt('No'); + my $currapproval = $currsettings->{'selfenroll_approval'}; + if ($currapproval !~ /^[012]$/) { + $currapproval = 0; } + $newval = $selfdescs{'approval'}{$currapproval}; } $r->print('
  • '.&mt('"[_1]" set to "[_2]".',$title,$newval)); if ($newnotify) { @@ -7542,13 +7802,16 @@ sub update_selfenroll_config { } } $r->print(''); - my %newenvhash; - foreach my $key (keys(%changes)) { - $newenvhash{'course.'.$env{'request.course.id'}.'.'.$key} = $changes{$key}; + if ($env{'course.'.$cid.'.description'} ne '') { + my %newenvhash; + foreach my $key (keys(%changes)) { + $newenvhash{'course.'.$cid.'.'.$key} = $changes{$key}; + } + &Apache::lonnet::appenv(\%newenvhash); } - &Apache::lonnet::appenv(\%newenvhash); } else { - $r->print(&mt('An error occurred when saving changes to self-enrollment settings in this course.').'
    '.&mt('The error was: [_1].',$putresult)); + $r->print(&mt('An error occurred when saving changes to self-enrollment settings in this course.').'
    '. + &mt('The error was: [_1].',$putresult)); } } else { $r->print(&mt('No changes were made to the existing self-enrollment settings in this course.')); @@ -7556,39 +7819,54 @@ sub update_selfenroll_config { } else { $r->print(&mt('No changes were made to the existing self-enrollment settings in this course.')); } - my ($visible,$cansetvis,$vismsgs,$visactions) = &visible_in_cat($cdom,$cnum); - if (ref($visactions) eq 'HASH') { - if (!$visible) { + my $visactions = &cat_visibility(); + my ($cathash,%cattype); + my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); + if (ref($domconfig{'coursecategories'}) eq 'HASH') { + $cathash = $domconfig{'coursecategories'}{'cats'}; + $cattype{'auth'} = $domconfig{'coursecategories'}{'auth'}; + $cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'}; + } else { + $cathash = {}; + $cattype{'auth'} = 'std'; + $cattype{'unauth'} = 'std'; + } + if (($cattype{'auth'} eq 'none') && ($cattype{'unauth'} eq 'none')) { + $r->print('
    '.$visactions->{'miss'}.'
    '.$visactions->{'yous'}. + '
    '. + '
    '.$visactions->{'take'}.'
      '. + '
    • '.$visactions->{'dc_chgconf'}.'
    • '. + '
    '); + } elsif (($cattype{'auth'} !~ /^(std|domonly)$/) && ($cattype{'unauth'} !~ /^(std|domonly)$/)) { + if ($currsettings->{'uniquecode'}) { + $r->print(''.$visactions->{'vis'}.''); + } else { $r->print('
    '.$visactions->{'miss'}.'
    '.$visactions->{'yous'}. - '
    '); - if (ref($vismsgs) eq 'ARRAY') { - $r->print('
    '.$visactions->{'take'}.'
      '); - foreach my $item (@{$vismsgs}) { - $r->print('
    • '.$visactions->{$item}.'
    • '); + '
      '. + '
      '.$visactions->{'take'}.'
        '. + '
      • '.$visactions->{'dc_setcode'}.'
      • '. + '

      '); + } + } else { + my ($visible,$cansetvis,$vismsgs) = &visible_in_stdcat($cdom,$cnum,\%domconfig); + if (ref($visactions) eq 'HASH') { + if (!$visible) { + $r->print('
      '.$visactions->{'miss'}.'
      '.$visactions->{'yous'}. + '
      '); + if (ref($vismsgs) eq 'ARRAY') { + $r->print('
      '.$visactions->{'take'}.'
        '); + foreach my $item (@{$vismsgs}) { + $r->print('
      • '.$visactions->{$item}.'
      • '); + } + $r->print('
      '); } - $r->print('
    '); + $r->print($cansetvis); } - $r->print($cansetvis); } } return; } -sub get_selfenroll_titles { - my @row = ('types','registered','enroll_dates','access_dates','section', - 'approval','limit'); - my %lt = &Apache::lonlocal::texthash ( - types => 'Users allowed to self-enroll in this course', - registered => 'Restrict self-enrollment to students officially registered for the course', - enroll_dates => 'Dates self-enrollment available', - access_dates => 'Course access dates assigned to self-enrolling users', - section => 'Section assigned to self-enrolling users', - approval => 'Self-enrollment requests need approval?', - limit => 'Enrollment limit', - ); - return (\@row,\%lt); -} - #---------------------------------------------- end functions for &phase_two #--------------------------------- functions for &phase_two and &phase_three