--- loncom/interface/lonmodifycourse.pm 2016/11/10 21:57:10 1.79.2.4 +++ 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.79.2.4 2016/11/10 21:57:10 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; } } @@ -72,6 +79,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'); @@ -90,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'} = ''; @@ -119,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)) { @@ -167,6 +182,8 @@ sub print_course_search_page { $r->print(&Apache::loncommon::js_changer()); if ($type eq 'Community') { $r->print('
'; - if ($type eq 'Community') { - $menu_html .= &mt('Although almost all community settings can be modified by a Coordinator, the following may only be set or modified by a Domain Coordinator:'); - } else { - $menu_html .= &mt('Although almost all course settings can be modified by a Course Coordinator, the following may only be set or modified by a Domain Coordinator:'); + .&mt($type).': '.$cdesc.'' + .''."\n"); + if ($extendedtype) { + $r->print('
'. + $lt{'cour'}.'
'.$disp_table.''."\n". + &hidden_form_elements().'
'. + ''."\n"); + my @actions = + (''. + $lt{'back'}.''); + $r->print('
$porthelpitem $lt{'gpqu'}: MB
@@ -642,9 +797,12 @@ $uploadhelpitem $lt{'upqu'}:
$hidden_elements
-$lt{'back'}
ENDDOCUMENT
+ my @actions =
+ (''.
+ $lt{'back'}.'');
+ $r->print('
'.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
@@ -659,7 +817,7 @@ sub print_set_anonsurvey_threshold {
my %settings = &Apache::lonnet::get('environment',['internal.anonsurvey_threshold'],$cdom,$cnum);
my $threshold = $settings{'internal.anonsurvey_threshold'};
if ($threshold eq '') {
- my %domconfig =
+ my %domconfig =
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom);
if (ref($domconfig{'coursedefaults'}) eq 'HASH') {
$threshold = $domconfig{'coursedefaults'}{'anonsurvey_threshold'};
@@ -679,17 +837,21 @@ sub print_set_anonsurvey_threshold {
$submit = '';
}
my $helpitem = &Apache::loncommon::help_open_topic('Modify_Anonsurvey_Threshold');
+ my $showtype = &mt($type);
$r->print(<$showtype: $cdesc