--- loncom/interface/domainprefs.pm 2024/05/21 02:57:15 1.441 +++ loncom/interface/domainprefs.pm 2024/10/11 23:29:34 1.444 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.441 2024/05/21 02:57:15 raeburn Exp $ +# $Id: domainprefs.pm,v 1.444 2024/10/11 23:29:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -472,6 +472,8 @@ sub handler { header => [{col1 => 'Target user has role', col2 => 'User information updatable in author context'}, {col1 => 'Target user has role', + col2 => 'User information updatable by co-author manager'}, + {col1 => 'Target user has role', col2 => 'User information updatable in course context'}], print => \&print_usermodification, modify => \&modify_usermodification, @@ -1031,7 +1033,7 @@ sub print_config_box { ($action eq 'usersessions') || ($action eq 'coursecategories') || ($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults') || ($action eq 'privacy') || ($action eq 'passwords') || ($action eq 'lti') || - ($action eq 'ltitools')) { + ($action eq 'ltitools') || ($action eq 'usermodification')) { if ($action eq 'coursecategories') { $output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal); $colspan = ' colspan="2"'; @@ -1135,9 +1137,9 @@ sub print_config_box { } } $rowtotal ++; - } elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') || + } elsif (($action eq 'coursedefaults') || ($action eq 'authordefaults') || ($action eq 'directorysrch') || ($action eq 'helpsettings') || - ($action eq 'wafproxy') || ($action eq 'authordefaults')) { + ($action eq 'wafproxy')) { $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); } elsif ($action eq 'scantron') { $output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); @@ -10724,6 +10726,15 @@ sub print_usermodification { $$rowtotal ++; $rowcount ++; } + } elsif ($position eq 'middle') { + $rowcount = 0; + $context = 'coauthor'; + foreach my $role ('ca','aa') { + $datatable .= &modifiable_userdata_row($context,$role,$settings, + $numinrow,$rowcount); + $$rowtotal ++; + $rowcount ++; + } } elsif ($position eq 'bottom') { $context = 'course'; $rowcount = 0; @@ -12229,6 +12240,8 @@ sub modifiable_userdata_row { } else { if ($context eq 'lti') { $prefix = 'lti'; + } elsif ($context eq 'coauthor') { + $prefix = 'cacanmodify'; } elsif ($context eq 'privacy') { $prefix = 'privacy'; } @@ -13719,7 +13732,11 @@ sub modify_colors { @bgs = ('pgbg','tabbg','sidebg'); } my %defaults = &role_defaults($role,\@bgs,\@links,\@images,\@logintext); - unless ($env{'form.'.$role.'_font'} eq $defaults{'font'}) { + $env{'form.'.$role.'_font'} = lc($env{'form.'.$role.'_font'}); + if ($env{'form.'.$role.'_font'} =~ /^\w+/) { + $env{'form.'.$role.'_font'} = '#'.$env{'form.'.$role.'_font'}; + } + unless ($env{'form.'.$role.'_font'} eq lc($defaults{'font'})) { $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'}; } if ($role eq 'login') { @@ -14850,6 +14867,7 @@ sub modify_quotas { $resulttext .= '
  • '.&mt('Validated course requests identified as processed by: [_1]', ''.$changes{'validation'}{'dc'}.'').'
  • '; } + $resulttext .= ''; } } } @@ -19880,21 +19898,27 @@ sub modify_usermodification { } } } - my @contexts = ('author','course'); + my @contexts = ('author','coauthor','course'); my %context_title = ( author => 'In author context', + coauthor => 'As co-author manager', course => 'In course context', ); my @fields = ('lastname','firstname','middlename','generation', 'permanentemail','id'); my %roles = ( author => ['ca','aa'], + coauthor => ['ca','aa'], course => ['st','ep','ta','in','cr'], ); my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); foreach my $context (@contexts) { + my $prefix = 'canmodify'; + if ($context eq 'coauthor') { + $prefix = 'cacanmodify'; + } foreach my $role (@{$roles{$context}}) { - my @modifiable = &Apache::loncommon::get_env_multiple('form.canmodify_'.$role); + my @modifiable = &Apache::loncommon::get_env_multiple('form.'.$prefix.'_'.$role); foreach my $item (@fields) { if (grep(/^\Q$item\E$/,@modifiable)) { $modifyhash{$context}{$role}{$item} = 1;