--- loncom/interface/courseprefs.pm 2021/12/15 00:48:41 1.49.2.27 +++ loncom/interface/courseprefs.pm 2016/10/11 22:58:55 1.80 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.49.2.27 2021/12/15 00:48:41 raeburn Exp $ +# $Id: courseprefs.pm,v 1.80 2016/10/11 22:58:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -310,7 +310,7 @@ sub handler { idnu => 'Course ID or number', unco => 'Unique code', desc => 'Course Description', - cred => 'Student credits', + cred => 'Student credits', ownr => 'Course Owner', cown => 'Course Co-owners', catg => 'Categorize course', @@ -375,18 +375,18 @@ sub handler { help => 'Course_Prefs_General', ordered => ['owner','co-owners','loncaparev','description', 'clonedfrom','courseid','uniquecode','categories', - 'hidefromcat','syllabus','cloners','url', + 'hidefromcat','externalsyllabus','cloners','url', 'rolenames'], itemtext => { 'owner' => $lt{'ownr'}, 'co-owners' => $lt{'cown'}, 'description' => $lt{'desc'}, 'courseid' => $lt{'idnu'}, - 'uniquecode' => $lt{'unco'}, + 'uniquecode' => $lt{'unco'}, 'categories' => $lt{'catg'}, 'hidefromcat' => $lt{'excc'}, 'cloners' => $lt{'clon'}, - 'syllabus' => 'Syllabus status', + 'externalsyllabus' => 'Syllabus status', 'url' => 'Top Level Map', 'rolenames' => $lt{'rept'}, 'loncaparev' => $lt{'lcrv'}, @@ -419,6 +419,7 @@ sub handler { { text => 'Discussion and Chat', help => 'Course_Prefs_Discussions', ordered => ['pch.roles.denied','pch.users.denied', + 'pac.roles.denied','pac.users.denied', 'plc.roles.denied','plc.users.denied', 'allow_limited_html_in_feedback', 'allow_discussion_post_editing', @@ -428,9 +429,11 @@ sub handler { 'pch.users.denied' => 'No Resource Discussion', 'plc.roles.denied' => 'No Chat room use', 'plc.users.denied' => 'No Chat room use', + 'pac.roles.denied' => 'No Anonymous Resource Discussion', + 'pac.users.denied' => 'No Anonymous Resource Discussion', allow_limited_html_in_feedback => 'Allow limited HTML in discussion', allow_discussion_post_editing => 'Users can edit/delete own discussion posts', - discussion_post_fonts => 'Discussion post fonts based on likes/unlikes', + discussion_post_fonts => 'Discussion post fonts based on likes/unlikes', }, }, 'classlists' => @@ -493,7 +496,7 @@ sub handler { help => 'Course_Prefs_Printouts', ordered => ['problem_stream_switch','suppress_tries', 'default_paper_size','print_header_format', - 'disableexampointprint'], + 'disableexampointprint','canuse_pdfforms'], itemtext => { problem_stream_switch => 'Allow problems to be split over pages', suppress_tries => 'Suppress number of tries in printing', @@ -763,8 +766,7 @@ sub process_changes { (!$can_categorize)); next if (($entry eq 'loncaparev') || ($entry eq 'owner') || - ($entry eq 'clonedfrom') || - ($entry eq 'syllabus')); + ($entry eq 'clonedfrom')); push(@ordered,$entry); } } elsif ($action eq 'classlists') { @@ -967,19 +969,19 @@ sub process_changes { my $udom = $env{'user.domain'}; my $pendingcoowners = $values->{'internal.pendingco-owners'}; my @pendingcoown = split(',',$pendingcoowners); - if ($env{'form.pending_coowner'}) { + if ($env{'form.pending_coowoner'}) { foreach my $item (@pendingcoown) { unless ($item eq $uname.':'.$udom) { push(@newpending,$item); } } @newcoown = @currcoown; - if ($env{'form.pending_coowner'} eq 'accept') { + if ($env{'form.pending_coowoner'} eq 'accept') { unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) { push(@newcoown,$uname.':'.$udom); } } - } elsif ($env{'form.remove_coowner'}) { + } elsif ($env{'form.remove_coowoner'}) { foreach my $item (@currcoown) { unless ($item eq $uname.':'.$udom) { push(@newcoown,$item); @@ -1057,7 +1059,8 @@ sub process_changes { } } } - } elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied')) { + } elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied') || + ($entry eq 'pac.roles.denied')) { my @denied = &Apache::loncommon::get_env_multiple('form.'.$entry); @denied = sort(@denied); my $deniedstr = ''; @@ -1065,7 +1068,8 @@ sub process_changes { $deniedstr = join(',',@denied); } $newvalues{$entry} = $deniedstr; - } elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied')) { + } elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied') || + ($entry eq 'pac.users.denied')) { my $total = $env{'form.'.$entry.'_total'}; my $userstr = ''; my @denied; @@ -1117,14 +1121,14 @@ sub process_changes { my ($classorder,$classtitles) = &discussion_vote_classes(); my $fontchange = 0; foreach my $class (@{$classorder}) { - my $ext_entry = $entry.'_'.$class; + my $ext_entry = $entry.'_'.$class; my $size = $env{'form.'.$ext_entry.'_size'}; my $unit = $env{'form.'.$ext_entry.'_unit'}; my $weight = $env{'form.'.$ext_entry.'_weight'}; my $style = $env{'form.'.$ext_entry.'_style'}; my $other = $env{'form.'.$ext_entry.'_other'}; $size =~ s/,//g; - $unit =~ s/,//g; + $unit =~ s/,//g; $weight =~ s/,//g; $style =~ s/,//g; $other =~ s/[^\w;:\s\-\%.]//g; @@ -1132,7 +1136,7 @@ sub process_changes { $newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); my $current = $values->{$ext_entry}; if ($values->{$ext_entry} eq '') { - $current = ',,,'; + $current = ',,,'; } if ($newvalues{$ext_entry} ne $current) { $changes->{$ext_entry} = $newvalues{$ext_entry}; @@ -1141,7 +1145,7 @@ sub process_changes { } if ($fontchange) { $changes->{$entry} = 1; - } + } } elsif ($entry eq 'nothideprivileged') { my @curr_nothide; my @new_nothide; @@ -1216,7 +1220,7 @@ sub process_changes { my $newtext = $maxnum-1; $newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; $newvalues{$entry} = join('',@newhdr); - } elsif (($entry eq 'languages') || + } elsif (($entry eq 'languages') || ($entry eq 'checkforpriv')) { my $settings; my $total = $env{'form.'.$entry.'_total'}; @@ -1232,7 +1236,7 @@ sub process_changes { } if ($env{'form.'.$entry.'_'.$total} ne '') { my $new = $env{'form.'.$entry.'_'.$total}; - if ($entry eq 'languages') { + if ($entry eq 'languages') { my %langchoices = &get_lang_choices(); if ($langchoices{$new}) { $settings .= $new; @@ -1507,12 +1511,12 @@ sub store_changes { } } unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) { - if ($env{'form.pending_coowner'} eq 'accept') { + if ($env{'form.pending_coowoner'} eq 'accept') { $displayval = &mt('on'); - } elsif ($env{'form.pending_coowner'} eq 'decline') { + } elsif ($env{'form.pending_coowoner'} eq 'decline') { $displayval = ''; $output .= '
  • '.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'
  • '; - } elsif ($env{'form.remove_coowner'}) { + } elsif ($env{'form.remove_coowoner'}) { $displayval = &mt('off'); } if ($displayval) { @@ -1777,7 +1781,7 @@ sub get_jscript { $local_to_standard{$code_order[$i]} = $standardnames[$i]; } foreach my $cloner (@cloners) { - if (($cloner !~ /^\Q*:\E$match_domain$/) && + if (($cloner !~ /^\Q*:\E$match_domain$/) && ($cloner !~ /^$match_username\:$match_domain$/)) { foreach my $item (split(/\&/,$cloner)) { my ($key,$val) = split(/\=/,$item); @@ -1879,7 +1883,7 @@ function syllabusinfo() { } ENDSCRIPT $jscript = '