--- loncom/interface/lonmodifycourse.pm 2017/01/22 19:22:04 1.91 +++ loncom/interface/lonmodifycourse.pm 2023/09/05 03:42:31 1.103 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.91 2017/01/22 19:22:04 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.103 2023/09/05 03:42:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,6 +39,9 @@ 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') { @@ -49,6 +52,10 @@ 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; } } @@ -97,10 +104,11 @@ sub get_enrollment_settings { my ($cdom,$cnum) = @_; my ($internals,$accessdates) = &autoenroll_keys(); my @items; - if ((ref($internals) eq 'ARRAY') && (ref($accessdates) eq 'ARRAY')) { + if ((ref($internals) eq 'ARRAY') && (ref($accessdates) eq 'ARRAY')) { @items = map { 'internal.'.$_; } (@{$internals}); push(@items,@{$accessdates}); } + push(@items,'internal.nopasswdchg'); my %settings = &Apache::lonnet::get('environment',\@items,$cdom,$cnum); my %enrollvar; $enrollvar{'autharg'} = ''; @@ -126,7 +134,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 "autodropfailsafe" || $type eq 'nopasswdchg') { $enrollvar{$type} = $settings{$item}; } elsif ($type eq 'defaultcredits') { if (&showcredits($cdom)) { @@ -289,10 +297,12 @@ 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"); @@ -338,7 +348,7 @@ function gochoose(cname,cdom,cdesc) { // ]]> -
+