--- loncom/interface/lonmodifycourse.pm 2019/08/27 15:34:34 1.79.2.8 +++ loncom/interface/lonmodifycourse.pm 2017/01/05 16:17:11 1.90 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.79.2.8 2019/08/27 15:34:34 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.90 2017/01/05 16:17:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,9 +39,6 @@ use Apache::lonpickcourse; use lib '/home/httpd/lib/perl'; use LONCAPA qw(:DEFAULT :match); -my $registered_cleanup; -my $modified_dom; - sub get_dc_settable { my ($type,$cdom) = @_; if ($type eq 'Community') { @@ -52,10 +49,6 @@ sub get_dc_settable { if (&showcredits($cdom)) { push(@items,'defaultcredits'); } - my %passwdconf = &Apache::lonnet::get_passwdconf($cdom); - if (($passwdconf{'crsownerchg'}) && ($type ne 'Placement')) { - push(@items,'nopasswdchg'); - } return @items; } } @@ -79,6 +72,13 @@ sub catalog_settable { if ($confhash->{'categorizecomm'} ne 'comm') { push(@settable,'categorize'); } + } elsif ($type eq 'Placement') { + if ($confhash->{'togglecatsplace'} ne 'place') { + push(@settable,'togglecats'); + } + if ($confhash->{'categorizeplace'} ne 'place') { + push(@settable,'categorize'); + } } else { if ($confhash->{'togglecats'} ne 'crs') { push(@settable,'togglecats'); @@ -101,7 +101,6 @@ sub get_enrollment_settings { @items = map { 'internal.'.$_; } (@{$internals}); push(@items,@{$accessdates}); } - push(@items,'internal.nopasswdchg'); my %settings = &Apache::lonnet::get('environment',\@items,$cdom,$cnum); my %enrollvar; $enrollvar{'autharg'} = ''; @@ -127,7 +126,7 @@ sub get_enrollment_settings { } elsif ($type eq "authtype" || $type eq "autharg" || $type eq "coursecode" || $type eq "crosslistings" || $type eq "selfenrollmgr" - || $type eq "autodropfailsafe" || $type eq 'nopasswdchg') { + || $type eq "autodropfailsafe") { $enrollvar{$type} = $settings{$item}; } elsif ($type eq 'defaultcredits') { if (&showcredits($cdom)) { @@ -175,6 +174,8 @@ sub print_course_search_page { $r->print(&Apache::loncommon::js_changer()); if ($type eq 'Community') { $r->print('

'.&mt('Search for a community in the [_1] domain',$domdesc).'

'); + } elsif ($type eq 'Placement') { + $r->print('

'.&mt('Search for a placement test in the [_1] domain',$domdesc).'

'); } else { $r->print('

'.&mt('Search for a course in the [_1] domain',$domdesc).'

'); } @@ -185,6 +186,8 @@ sub print_course_search_page { my ($actiontext,$roleoption,$settingsoption); if ($type eq 'Community') { $actiontext = &mt('Actions available after searching for a community:'); + } elsif ($type eq 'Placement') { + $actiontext = &mt('Actions available after searching for a placement test:') } else { $actiontext = &mt('Actions available after searching for a course:'); } @@ -192,6 +195,9 @@ sub print_course_search_page { if ($type eq 'Community') { $roleoption = &mt('Enter the community with the role of [_1]',$cctitle); $settingsoption = &mt('View or modify community settings which only a [_1] may modify.',$dctitle); + } elsif ($type eq 'Placement') { + $roleoption = &mt('Enter the placement test with the role of [_1]',$cctitle); + $settingsoption = &mt('View or modify placement test settings which only a [_1] may modify.',$dctitle); } else { $roleoption = &mt('Enter the course with the role of [_1]',$cctitle); $settingsoption = &mt('View or modify course settings which only a [_1] may modify.',$dctitle); @@ -202,6 +208,8 @@ sub print_course_search_page { if (@{$roles_by_num} > 1) { if ($type eq 'Community') { $roleoption = &mt('Enter the community with one of the available ad hoc roles'); + } elsif ($type eq 'Placement') { + $roleoption = &mt('Enter the placement test with one of the available ad hoc roles.'); } else { $roleoption = &mt('Enter the course with one of the available ad hoc roles.'); } @@ -209,6 +217,8 @@ sub print_course_search_page { my $rolename = $description->{$roles_by_num->[0]}; if ($type eq 'Community') { $roleoption = &mt('Enter the community with the ad hoc role of: [_1]',$rolename); + } elsif ($type eq 'Placement') { + $roleoption = &mt('Enter the placement test with the ad hoc role of: [_1]',$rolename); } else { $roleoption = &mt('Enter the course with the ad hoc role of: [_1]',$rolename); } @@ -216,6 +226,8 @@ sub print_course_search_page { } if ($type eq 'Community') { $settingsoption = &mt('View community settings which only a [_1] may modify.',$dctitle); + } elsif ($type eq 'Placement') { + $settingsoption = &mt('View placement test settings which only a [_1] may modify.',$dctitle); } else { $settingsoption = &mt('View course settings which only a [_1] may modify.',$dctitle); } @@ -277,12 +289,10 @@ function gochoose(cname,cdom,cdesc) { document.courselist.submit(); } else { var str = ''; - \$("#LC_choose_adhoc").empty(); for (var i=0; i"+data.roles[i].desc+"  ") .appendTo("#LC_choose_adhoc"); } - \$( "#LC_adhocrole_chooser" ).toggle( true ); \$( "#LC_get_role_0").prop("checked", true); \$( "#LC_adhocrole_chooser" ).dialog({ autoOpen: false }); \$( "#LC_adhocrole_chooser" ).dialog("open"); @@ -328,7 +338,7 @@ function gochoose(cname,cdom,cdesc) { // ]]> -