version 1.438, 2024/04/14 17:12:27
|
version 1.444, 2024/10/11 23:29:34
|
Line 472 sub handler {
|
Line 472 sub handler {
|
header => [{col1 => 'Target user has role', |
header => [{col1 => 'Target user has role', |
col2 => 'User information updatable in author context'}, |
col2 => 'User information updatable in author context'}, |
{col1 => 'Target user has role', |
{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'}], |
col2 => 'User information updatable in course context'}], |
print => \&print_usermodification, |
print => \&print_usermodification, |
modify => \&modify_usermodification, |
modify => \&modify_usermodification, |
Line 1031 sub print_config_box {
|
Line 1033 sub print_config_box {
|
($action eq 'usersessions') || ($action eq 'coursecategories') || |
($action eq 'usersessions') || ($action eq 'coursecategories') || |
($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults') || |
($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults') || |
($action eq 'privacy') || ($action eq 'passwords') || ($action eq 'lti') || |
($action eq 'privacy') || ($action eq 'passwords') || ($action eq 'lti') || |
($action eq 'ltitools')) { |
($action eq 'ltitools') || ($action eq 'usermodification')) { |
if ($action eq 'coursecategories') { |
if ($action eq 'coursecategories') { |
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal); |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
Line 1135 sub print_config_box {
|
Line 1137 sub print_config_box {
|
} |
} |
} |
} |
$rowtotal ++; |
$rowtotal ++; |
} elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') || |
} elsif (($action eq 'coursedefaults') || ($action eq 'authordefaults') || |
($action eq 'directorysrch') || ($action eq 'helpsettings') || |
($action eq 'directorysrch') || ($action eq 'helpsettings') || |
($action eq 'wafproxy') || ($action eq 'authordefaults')) { |
($action eq 'wafproxy')) { |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'scantron') { |
} elsif ($action eq 'scantron') { |
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); |
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); |
Line 7523 sub print_authordefaults {
|
Line 7525 sub print_authordefaults {
|
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$itemcount ++; |
$itemcount ++; |
|
my %defchecked = ( |
|
'archive' => 'off', |
|
); |
|
my @toggles = ('archive'); |
|
(my $archive,$itemcount) = &radiobutton_prefs($settings,['archive'], |
|
{'archive' => 'off'}, |
|
\%titles,$itemcount); |
|
$datatable .= $archive."\n"; |
|
$itemcount ++; |
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
Line 7546 sub authordefaults_titles {
|
Line 7557 sub authordefaults_titles {
|
none => 'No override set', |
none => 'No override set', |
overon => 'Override -- webDAV on', |
overon => 'Override -- webDAV on', |
overoff => 'Override -- webDAV off', |
overoff => 'Override -- webDAV off', |
|
archive => 'Authors can download tar.gz file of Authoring Space', |
); |
); |
} |
} |
|
|
Line 10714 sub print_usermodification {
|
Line 10726 sub print_usermodification {
|
$$rowtotal ++; |
$$rowtotal ++; |
$rowcount ++; |
$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') { |
} elsif ($position eq 'bottom') { |
$context = 'course'; |
$context = 'course'; |
$rowcount = 0; |
$rowcount = 0; |
Line 12219 sub modifiable_userdata_row {
|
Line 12240 sub modifiable_userdata_row {
|
} else { |
} else { |
if ($context eq 'lti') { |
if ($context eq 'lti') { |
$prefix = 'lti'; |
$prefix = 'lti'; |
|
} elsif ($context eq 'coauthor') { |
|
$prefix = 'cacanmodify'; |
} elsif ($context eq 'privacy') { |
} elsif ($context eq 'privacy') { |
$prefix = 'privacy'; |
$prefix = 'privacy'; |
} |
} |
Line 13425 sub modify_authordefaults {
|
Line 13448 sub modify_authordefaults {
|
'nocodemirror' => 'off', |
'nocodemirror' => 'off', |
'daxecollapse' => 'off', |
'daxecollapse' => 'off', |
'domcoordacc' => 'on', |
'domcoordacc' => 'on', |
'editors' => ['edit','xml']. |
'editors' => ['edit','xml'], |
'authorquota' => 500, |
'authorquota' => 500, |
'webdav' => 0, |
'webdav' => 0, |
|
'archive' => 'off', |
); |
); |
my %titles = &authordefaults_titles(); |
my %titles = &authordefaults_titles(); |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') { |
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
$confhash{$item} = $env{'form.'.$item}; |
$confhash{$item} = $env{'form.'.$item}; |
} |
} |
Line 13474 sub modify_authordefaults {
|
Line 13498 sub modify_authordefaults {
|
$save_quotas{'webdav'}{'_LC_adv'} = $env{'form.webdav_LC_adv'}; |
$save_quotas{'webdav'}{'_LC_adv'} = $env{'form.webdav_LC_adv'}; |
} |
} |
if (ref($domconfig{'authordefaults'}) eq 'HASH') { |
if (ref($domconfig{'authordefaults'}) eq 'HASH') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail','archive') { |
if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { |
if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
Line 13496 sub modify_authordefaults {
|
Line 13520 sub modify_authordefaults {
|
} |
} |
} else { |
} else { |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') { |
if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { |
if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
Line 13506 sub modify_authordefaults {
|
Line 13530 sub modify_authordefaults {
|
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} |
} |
|
my @diffs = |
|
&Apache::loncommon::compare_arrays($confhash{'editors'}, |
|
$staticdefaults{'editors'}); |
|
unless (@diffs == 0) { |
|
$changes{'editors'} = 1; |
|
} |
} |
} |
foreach my $key ('authorquota','webdav') { |
foreach my $key ('authorquota','webdav') { |
if (ref($curr_quotas{$key}) eq 'HASH') { |
if (ref($curr_quotas{$key}) eq 'HASH') { |
Line 13587 sub modify_authordefaults {
|
Line 13617 sub modify_authordefaults {
|
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
my $domcoordoverride; |
my $domcoordoverride; |
foreach my $key ('editors','authorquota','webdav','webdav_LC_adv') { |
foreach my $key ('editors','authorquota','webdav','webdav_LC_adv','archive') { |
if (exists($changes{$key})) { |
if (exists($changes{$key})) { |
my $shown; |
my $shown; |
unless ($domcoordoverride) { |
unless ($domcoordoverride) { |
Line 13619 sub modify_authordefaults {
|
Line 13649 sub modify_authordefaults {
|
} else { |
} else { |
$shown = $titles{'none'}; |
$shown = $titles{'none'}; |
} |
} |
|
} elsif ($key eq 'archive') { |
|
$domdefaults{$key} = $confhash{$key}; |
|
$shown = ($confhash{$key} ? &mt('Yes') : &mt('No')); |
} |
} |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
} |
} |
Line 13626 sub modify_authordefaults {
|
Line 13659 sub modify_authordefaults {
|
if ($domcoordoverride) { |
if ($domcoordoverride) { |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
$resulttext .= '</ul>'; |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
if (ref($lastactref) eq 'HASH') { |
if (ref($lastactref) eq 'HASH') { |
Line 13698 sub modify_colors {
|
Line 13732 sub modify_colors {
|
@bgs = ('pgbg','tabbg','sidebg'); |
@bgs = ('pgbg','tabbg','sidebg'); |
} |
} |
my %defaults = &role_defaults($role,\@bgs,\@links,\@images,\@logintext); |
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'}; |
$confhash->{$role}{'font'} = $env{'form.'.$role.'_font'}; |
} |
} |
if ($role eq 'login') { |
if ($role eq 'login') { |
Line 14829 sub modify_quotas {
|
Line 14867 sub modify_quotas {
|
$resulttext .= '<li>'.&mt('Validated course requests identified as processed by: [_1]', |
$resulttext .= '<li>'.&mt('Validated course requests identified as processed by: [_1]', |
'<b>'.$changes{'validation'}{'dc'}.'</b>').'</li>'; |
'<b>'.$changes{'validation'}{'dc'}.'</b>').'</li>'; |
} |
} |
|
$resulttext .= '</ul></li>'; |
} |
} |
} |
} |
} |
} |
Line 19859 sub modify_usermodification {
|
Line 19898 sub modify_usermodification {
|
} |
} |
} |
} |
} |
} |
my @contexts = ('author','course'); |
my @contexts = ('author','coauthor','course'); |
my %context_title = ( |
my %context_title = ( |
author => 'In author context', |
author => 'In author context', |
|
coauthor => 'As co-author manager', |
course => 'In course context', |
course => 'In course context', |
); |
); |
my @fields = ('lastname','firstname','middlename','generation', |
my @fields = ('lastname','firstname','middlename','generation', |
'permanentemail','id'); |
'permanentemail','id'); |
my %roles = ( |
my %roles = ( |
author => ['ca','aa'], |
author => ['ca','aa'], |
|
coauthor => ['ca','aa'], |
course => ['st','ep','ta','in','cr'], |
course => ['st','ep','ta','in','cr'], |
); |
); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
foreach my $context (@contexts) { |
foreach my $context (@contexts) { |
|
my $prefix = 'canmodify'; |
|
if ($context eq 'coauthor') { |
|
$prefix = 'cacanmodify'; |
|
} |
foreach my $role (@{$roles{$context}}) { |
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) { |
foreach my $item (@fields) { |
if (grep(/^\Q$item\E$/,@modifiable)) { |
if (grep(/^\Q$item\E$/,@modifiable)) { |
$modifyhash{$context}{$role}{$item} = 1; |
$modifyhash{$context}{$role}{$item} = 1; |