--- loncom/interface/lonmodifycourse.pm 2009/11/09 03:50:27 1.48 +++ loncom/interface/lonmodifycourse.pm 2011/01/11 22:09:49 1.58 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.48 2009/11/09 03:50:27 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.58 2011/01/11 22:09:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,20 +49,30 @@ sub get_dc_settable { sub autoenroll_keys { my $internals = ['coursecode','courseowner','authtype','autharg','autoadds','autodrops', - 'autostart','autoend','sectionnums','crosslistings']; + 'autostart','autoend','sectionnums','crosslistings', + 'co-owners']; my $accessdates = ['default_enrollment_start_date','default_enrollment_end_date']; return ($internals,$accessdates); } sub catalog_settable { - my ($confhash) = @_; + my ($confhash,$type) = @_; my @settable; if (ref($confhash) eq 'HASH') { - if ($confhash->{'togglecats'} ne 'crs') { - push(@settable,'togglecats'); - } - if ($confhash->{'categorize'} ne 'crs') { - push(@settable,'categorize'); + if ($type eq 'Community') { + if ($confhash->{'togglecatscomm'} ne 'comm') { + push(@settable,'togglecats'); + } + if ($confhash->{'categorizecomm'} ne 'comm') { + push(@settable,'categorize'); + } + } else { + if ($confhash->{'togglecats'} ne 'crs') { + push(@settable,'togglecats'); + } + if ($confhash->{'categorize'} ne 'crs') { + push(@settable,'categorize'); + } } } else { push(@settable,('togglecats','categorize')); @@ -97,7 +107,7 @@ sub get_enrollment_settings { } else { $enrollvar{$type} = &Apache::lonlocal::locallocaltime($settings{$item}); } - } elsif ($type eq "sectionnums") { + } elsif (($type eq 'sectionnums') || ($type eq 'co-owners')) { $enrollvar{$type} = $settings{$item}; $enrollvar{$type} =~ s/,/, /g; } elsif ($type eq "authtype" @@ -139,7 +149,7 @@ sub print_course_search_page { 'instcodefilter','ownerfilter', 'coursefilter']; my $filter = {}; - my ($numtitles,$cctitle,$dctitle); + my ($numtitles,$cctitle,$dctitle,@codetitles); my $ccrole = 'cc'; if ($type eq 'Community') { $ccrole = 'co'; @@ -153,7 +163,8 @@ sub print_course_search_page { $r->print('

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

'); } $r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, - undef,undef,$filter,$action,\$numtitles,'modifycourse')); + undef,undef,$filter,$action,\$numtitles,'modifycourse', + undef,undef,undef,\@codetitles)); if ($type eq 'Community') { $r->print(&mt('Actions available after searching for a community:').'